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
change the top carousel items to fit the small window size
function changeFlowItemToFitLargeWindow(i) { deckTitle[i].style.left = "60px"; imageFlowCard[i].style.width = "144px"; imageFlowCard[i].style.height = "166px"; imageFlowCard[i].style.right = "60px"; imageFlowCard[i].style.top = "30px"; deckTitle[i].style.maxWidth = "50%"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setHeightCarousel3() {\n $carousel3.each(function () {\n var $allImages = $(this).find('img');\n var size = $(this).attr('data-size') || 0.8;\n var resultH = wndH * size;\n var maxItemW = Math.min($(this).parent().width(), wndW) * size;\n $allImages.each(function () {\n if (this.naturalWidth && this.naturalHeight && resultH * this.naturalWidth / this.naturalHeight > maxItemW) {\n resultH = maxItemW * this.naturalHeight / this.naturalWidth;\n }\n });\n $allImages.css('height', resultH);\n $(this).children('.nk-carousel-inner').flickity('reposition');\n });\n }", "function adjustSize() {\n const childWidth = carousel.offsetWidth;\n carousel.style.height = childWidth + \"px\";\n carouselInner.style.height = childWidth + \"px\";\n const children = document.querySelectorAll(\".page-item\");\n children.forEach(child => {\n child.style.width = (childWidth / 2) * 0.96 + \"px\";\n });\n circle1.click();\n}", "function ResCarouselSize() {\n \n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function () {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n }\n else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * itemNumbers });\n $(this).find(itemClass).each(function () {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function changeSize() {\n carouselWrapWidth = carouselWrap.offsetWidth;\n isResizing = true;\n carouselList.style.transition = \"\";\n moveCarousel();\n}", "function ResCarouselSize() {\n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function() {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n } else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n } else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n } else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({\n 'transform': 'translateX(0px)',\n 'width': itemWidth * itemNumbers\n });\n $(this).find(itemClass).each(function() {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function ResCarouselSize() {\n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function () {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n }\n else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * itemNumbers });\n $(this).find(itemClass).each(function () {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function ResCarouselSize() {\n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function () {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n }\n else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * itemNumbers });\n $(this).find(itemClass).each(function () {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function ResCarouselSize() {\n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function () {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n }\n else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * itemNumbers });\n $(this).find(itemClass).each(function () {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function ResCarouselSize() {\r\n var incno = 0;\r\n var dataItems = (\"data-items\");\r\n var itemClass = ('.item');\r\n var id = 0;\r\n var btnParentSb = '';\r\n var itemsSplit = '';\r\n var sampwidth = $(itemsMainDiv).width();\r\n var bodyWidth = $('body').width();\r\n $(itemsDiv).each(function () {\r\n id = id + 1;\r\n var itemNumbers = $(this).find(itemClass).length;\r\n btnParentSb = $(this).parent().attr(dataItems);\r\n itemsSplit = btnParentSb.split(',');\r\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\r\n\r\n\r\n if (bodyWidth >= 1200) {\r\n incno = itemsSplit[7];\r\n itemWidth = sampwidth / 5;\r\n }\r\n else if (bodyWidth >= 992) {\r\n incno = itemsSplit[1];\r\n itemWidth = sampwidth / incno;\r\n }\r\n else if (bodyWidth >= 768) {\r\n incno = itemsSplit[1];\r\n itemWidth = sampwidth / incno;\r\n }\r\n else {\r\n incno = itemsSplit[0];\r\n itemWidth = sampwidth / incno;\r\n }\r\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * 8 });\r\n $(this).find(itemClass).each(function () {\r\n $(this).outerWidth(itemWidth);\r\n });\r\n\r\n $(\".leftLst\").addClass(\"over\");\r\n $(\".rightLst\").removeClass(\"over\");\r\n\r\n });\r\n }", "function setHeightCarousel3() {\n $carousel3.each(function eachCarousel3() {\n var $allImages = (0, _utility.$)(this).find('img');\n var size = (0, _utility.$)(this).attr('data-size') || 0.8;\n var resultH = _utility.wndH * size;\n var maxItemW = Math.min((0, _utility.$)(this).parent().width(), _utility.wndW) * size;\n $allImages.each(function eachCarousel3Images() {\n if (this.naturalWidth && this.naturalHeight && resultH * this.naturalWidth / this.naturalHeight > maxItemW) {\n resultH = maxItemW * this.naturalHeight / this.naturalWidth;\n }\n });\n $allImages.css('height', resultH);\n (0, _utility.$)(this).children('.nk-carousel-inner').flickity('reposition');\n });\n }", "function onSizeChange(){\n\t\t\n\t\tvar galleryWidth = getGalleryWidth();\n\t\tg_carousel.setMaxWidth(galleryWidth);\n\t\tg_carousel.run();\n\t\t\t\n\t\tpositionElements();\n\t}", "function changeToFit() { //fix\n if (($(window).width() < 559)) {\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"134px\";\n }\n for (i = 0; i < authorDeck.length; i++) {\n // the carousel elements\n authorDeck[i].style.fontSize = \"13px\";\n deckTitle[i].children[0].classList.add(\"h5\");\n deckTitle[i].style.maxWidth = \"50%\";\n changeFlowItemToFitSmallWindow(i)\n }\n // nav bar\n removeAbsolutePosition();\n userBar.style.width = \"100%\";\n for (i = 0; i < userBar.children.length; i++) {\n userBar.children[i].style.width = String($(window).width() / 4) + \"px\";\n }\n } else if (($(window).width() < 700)) {\n // nav bar\n spreadNavBar();\n removeAbsolutePosition();\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"134px\";\n }\n for (i = 0; i < userBar.children.length; i++) {\n userBar.children[i].style.width = \"\";\n }\n // carousel\n for (i = 0; i < authorDeck.length; i++) {\n spreadCarousel(i);\n changeFlowItemToFitSmallWindow(i)\n }\n } else if ($(window).width() < 977) {\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"134px\";\n }\n // nav bar\n spreadNavBar();\n userBar.classList.add(\"position-absolute\");\n userBar.style.right = \"-80px\";\n // carousel\n for (i = 0; i < imageFlowCard.length; i++) {\n spreadCarousel(i);\n changeFlowItemToFitSmallWindow(i);\n }\n } else if ($(window).width() < 1200) {\n // trending decks\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"134px\";\n }\n // navbar\n spreadNavBar();\n removeAbsolutePosition();\n for (var i = 0; i < imageFlowCard.length; i++) {\n // carousel\n spreadCarousel(i);\n changeFlowItemToFitLargeWindow(i);\n }\n } else {\n // navbar\n spreadNavBar();\n removeAbsolutePosition();\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"166px\";\n }\n for (i = 0; i < imageFlowCard.length; i++) {\n // carousel\n spreadCarousel(i);\n changeFlowItemToFitLargeWindow(i);\n }\n }\n}", "function resizeslider(){\n\t$(\".slider .items\").css({\"height\":$(window).height()});\n\t$(\".slider\").css({\"height\":$(window).height()});\n}", "function resizeCarousel(carousel) {\n const parentWidth = $(carousel).width();\n const Btns = $(carousel).find(\".btn-prev , .btn-next\");\n Btns.hide();\n let inner = $(carousel).find(\".CustomCarousel-inner\");\n const items = $(inner).find(\".item\");\n let pad = $(carousel).attr(\"data-padding\");\n if (pad == NaN) pad = 0;\n\n $(items).hide();\n let widthCount = 0;\n let visibleItems = 0;\n if ($(carousel).hasClass(\"spaced\")) {\n spaced(carousel, parentWidth, items, pad);\n }\n let last;\n let i = 0;\n let maxHeight = 200;\n $(items).each(function () {\n if ($(this).height() > maxHeight) maxHeight = $(this).height();\n if (i++ > 0) $(this).css(\"padding-left\", pad + \"px\");\n else $(this).css(\"padding-left\", 0);\n $(this).removeClass(\"Last\");\n widthCount += $(this).outerWidth();\n if (widthCount < parentWidth) {\n visibleItems++;\n $(this).show();\n $(this).addClass(\"Visib\");\n last = $(this);\n } else $(this).removeClass(\"Visib\");\n });\n $(carousel).height(maxHeight + \"px\");\n if (last) last.addClass(\"Last\");\n if (items.length > visibleItems) {\n Btns.height($(carousel).height());\n Btns.show();\n }\n}", "function changeSliderSize() {\n\t\t\twrapperA.css({\n\t\t\t\twidth: itemsA.length * (sliderWidth + 2 * sliderMargin) + \"vw\",\n\t\t\t\tmarginLeft: getWrapperMargin() + \"vw\"\n\t\t\t});\n\t\t\t\n\t\t\titemsA.css({\n\t\t\t\twidth: sliderWidth + \"vw\",\n\t\t\t\theight: sliderHeight + \"em\",\n\t\t\t\tmargin: \"0 \" + sliderMargin + \"vw\"\n\t\t\t});\n\t\t}", "function qodeNumberOfTestimonialsItemsResize(){\n\n\n var testimonialsSlider = $j('.testimonials_carousel, .testimonials_c_carousel');\n\n if(testimonialsSlider.length){\n testimonialsSlider.each(function(){\n var thisSliderHolder = $j(this);\n\n var items = qodeNumberOfTestimonialsItems(thisSliderHolder);\n\n thisSliderHolder.data('flexslider').vars.minItems = items;\n thisSliderHolder.data('flexslider').vars.maxItems = items;\n });\n }\n}", "function setCarouselHeight() {\n setSingleCarouselHeight('testimonialCarousel');\n setSingleCarouselHeight('textCarousel');\n setSingleCarouselHeight('panelCarousel');\n}", "function resizeElements() {\n\t// Compute the max height so that the settings fit on the screen\n\t$('#song-list').height($(window).height() - $('#settings-container-inner').height() - 200);\n}", "function simpleLayoutChanges() {\n \"use strict\";\n var container = $('.container').width();\n $('.testimonial_carousel .item').each(function() {\n\n var self = $(this);\n var wpb_column = self.parents('.wpb_column').first().width();\n self.innerWidth(wpb_column + 'px');\n self.height(self.height() + 'px');\n self.parents('.caroufredsel_wrapper').first().height(self.height() + 'px');\n self.parents('.testimonial_carousel').first().height(self.height() + 'px');\n\n });\n\n $('.clients_caro .item').each(function() {\n var self = $(this);\n var wpb_column = self.parents('.vc_column-inner').width();\n\n if (container > 420 && container <= 724) {\n self.innerWidth((wpb_column / 3) + 'px');\n }\n if (container > 724 && container < 940) {\n self.innerWidth((wpb_column / 4) + 'px');\n }\n if (container > 940) {\n self.innerWidth((wpb_column / 6) + 'px');\n }\n });\n\n clientsCarousel();\n }", "function setSliderElementsSize($item,i){\n if($window_width > responsive_breakpoint_set[0]) {\n slider_graphic_coefficient = coefficients_graphic_array[0];\n slider_title_coefficient = coefficients_title_array[0];\n slider_subtitle_coefficient = coefficients_subtitle_array[0];\n slider_text_coefficient = coefficients_text_array[0];\n slider_button_coefficient = coefficients_button_array[0];\n }else if($window_width > responsive_breakpoint_set[1]){\n slider_graphic_coefficient = coefficients_graphic_array[1];\n slider_title_coefficient = coefficients_title_array[1];\n slider_subtitle_coefficient = coefficients_subtitle_array[1];\n slider_text_coefficient = coefficients_text_array[1];\n slider_button_coefficient = coefficients_button_array[1];\n }else if($window_width > responsive_breakpoint_set[2]){\n slider_graphic_coefficient = coefficients_graphic_array[2];\n slider_title_coefficient = coefficients_title_array[2];\n slider_subtitle_coefficient = coefficients_subtitle_array[2];\n slider_text_coefficient = coefficients_text_array[2];\n slider_button_coefficient = coefficients_button_array[2];\n }else if($window_width > responsive_breakpoint_set[3]){\n slider_graphic_coefficient = coefficients_graphic_array[3];\n slider_title_coefficient = coefficients_title_array[3];\n slider_subtitle_coefficient = coefficients_subtitle_array[3];\n slider_text_coefficient = coefficients_text_array[3];\n slider_button_coefficient = coefficients_button_array[3];\n }else if ($window_width > responsive_breakpoint_set[4]) {\n slider_graphic_coefficient = coefficients_graphic_array[4];\n slider_title_coefficient = coefficients_title_array[4];\n slider_subtitle_coefficient = coefficients_subtitle_array[4];\n slider_text_coefficient = coefficients_text_array[4];\n slider_button_coefficient = coefficients_button_array[4];\n }else if ($window_width > responsive_breakpoint_set[5]){\n slider_graphic_coefficient = coefficients_graphic_array[5];\n slider_title_coefficient = coefficients_title_array[5];\n slider_subtitle_coefficient = coefficients_subtitle_array[5];\n slider_text_coefficient = coefficients_text_array[5];\n slider_button_coefficient = coefficients_button_array[5];\n }\n else{\n slider_graphic_coefficient = coefficients_graphic_array[6];\n slider_title_coefficient = coefficients_title_array[6];\n slider_subtitle_coefficient = coefficients_subtitle_array[6];\n slider_text_coefficient = coefficients_text_array[6];\n slider_button_coefficient = coefficients_button_array[6];\n }\n\n // letter-spacing decrease quicker\n var slider_title_coefficient_letter_spacing = slider_title_coefficient;\n var slider_subtitle_coefficient_letter_spacing = slider_subtitle_coefficient;\n var slider_text_coefficient_letter_spacing = slider_text_coefficient;\n if($window_width <= responsive_breakpoint_set[0]) {\n slider_title_coefficient_letter_spacing = slider_title_coefficient/2;\n slider_subtitle_coefficient_letter_spacing = slider_subtitle_coefficient/2;\n slider_text_coefficient_letter_spacing = slider_text_coefficient/2;\n }\n\n $item.find('.thumb').css({\"width\": Math.round(window[\"slider_graphic_width_\" + i][0]*slider_graphic_coefficient) + 'px'}).css({\"height\": Math.round(window[\"slider_graphic_height_\" + i][0]*slider_graphic_coefficient) + 'px'});\n $item.find('.qode_slide-svg-holder svg').css({\"width\": Math.round(window[\"slider_svg_width_\" + i][0]*slider_graphic_coefficient) + 'px'}).css({\"height\": Math.round(window[\"slider_svg_height_\" + i][0]*slider_graphic_coefficient) + 'px'});\n\n $item.find('.q_slide_title').css({\"font-size\": Math.round(window[\"slider_title_\" + i][0]*slider_title_coefficient) + 'px'});\n $item.find('.q_slide_title').css({\"line-height\": Math.round(window[\"slider_title_\" + i][1]*slider_title_coefficient) + 'px'});\n $item.find('.q_slide_title').css({\"letter-spacing\": Math.round(window[\"slider_title_\" + i][2]*slider_title_coefficient_letter_spacing) + 'px'});\n $item.find('.q_slide_title').css({\"margin-bottom\": Math.round(window[\"slider_title_\" + i][3]*slider_title_coefficient) + 'px'});\n\n $item.find('.q_slide_subtitle').css({\"font-size\": Math.round(window[\"slider_subtitle_\" + i][0]*slider_subtitle_coefficient) + 'px'});\n $item.find('.q_slide_subtitle').css({\"line-height\": Math.round(window[\"slider_subtitle_\" + i][1]*slider_subtitle_coefficient) + 'px'});\n $item.find('.q_slide_subtitle').css({\"letter-spacing\": Math.round(window[\"slider_subtitle_\" + i][2]*slider_subtitle_coefficient_letter_spacing) + 'px'});\n $item.find('.q_slide_subtitle').css({\"margin-bottom\": Math.round(window[\"slider_subtitle_\" + i][3]*slider_subtitle_coefficient) + 'px'});\n\n $item.find('.q_slide_text').css({\"font-size\": Math.round(window[\"slider_text_\" + i][0]*slider_text_coefficient) + 'px'});\n $item.find('.q_slide_text').css({\"line-height\": Math.round(window[\"slider_text_\" + i][1]*slider_text_coefficient) + 'px'});\n $item.find('.q_slide_text').css({\"letter-spacing\": Math.round(window[\"slider_text_\" + i][2]*slider_text_coefficient_letter_spacing) + 'px'});\n\n $item.find('.qbutton:eq(0)').css({\"font-size\": Math.round(window[\"slider_button1_\" + i][0]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"font-size\": Math.round(window[\"slider_button2_\" + i][0]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(0)').css({\"line-height\": Math.round(window[\"slider_button1_\" + i][1]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"line-height\": Math.round(window[\"slider_button2_\" + i][1]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(0)').css({\"letter-spacing\": Math.round(window[\"slider_button1_\" + i][2]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"letter-spacing\": Math.round(window[\"slider_button2_\" + i][2]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(0)').css({\"height\": Math.round(window[\"slider_button1_\" + i][3]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"height\": Math.round(window[\"slider_button2_\" + i][3]*slider_button_coefficient) + 'px'});\n if(window[\"slider_button1_\" + i][4] != 0) {\n $item.find('.qbutton:eq(0)').css({\"width\": Math.round(window[\"slider_button1_\" + i][4]*slider_button_coefficient) + 'px'});\n }else{\n $item.find('.qbutton:eq(0)').css({\"width\": 'auto'});\n }\n if(window[\"slider_button2_\" + i][4] != 0) {\n $item.find('.qbutton:eq(1)').css({\"width\": Math.round(window[\"slider_button2_\" + i][4]*slider_button_coefficient) + 'px'});\n }else{\n $item.find('.qbutton:eq(1)').css({\"width\": 'auto'});\n }\n $item.find('.qbutton:eq(0)').css({\"padding-left\": Math.round(window[\"slider_button1_\" + i][5]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"padding-left\": Math.round(window[\"slider_button2_\" + i][5]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(0)').css({\"padding-right\": Math.round(window[\"slider_button1_\" + i][6]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"padding-right\": Math.round(window[\"slider_button2_\" + i][6]*slider_button_coefficient) + 'px'});\n\n $item.find('.separator').css({\"margin-top\": Math.round(window[\"slider_separator_\" + i][0]*slider_title_coefficient) + 'px'});\n $item.find('.separator').css({\"margin-bottom\": Math.round(window[\"slider_separator_\" + i][1]*slider_title_coefficient) + 'px'});\n\n }", "function topResizeOnresize() {\n\n var alldivs = document.getElementsByClassName('a1');\n var viewportwidth = window.innerWidth;\n var x;\n\n if (document.cookie.indexOf(\"r=1\") > 0) {\n if ( viewportwidth > 1200 ) {\n for (x = 0; x < alldivs.length; x++) {\n alldivs[x].style.height = \"auto\";\n }\n // repeat init resize:\n topResize();\n }\n }\n\n\n\n}// f a1resize onresize", "function resize() {\n // $pages.find('.sc-slides').find('.infos').height(window.innerHeight);\n // _controller.update(true);\n}", "function resizeBasketItems(){\n var winHeight = $(window).height(),\n heightTop = (winHeight - 350) > 160 ? winHeight - 350 : 160,\n heightBasket = (winHeight - 320) > 160 ? winHeight - 320 : 160;\n\n $('.compared .basket-items, .watched .basket-items').css({\n 'max-height': heightTop + 'px'\n });\n $('.header-basket .basket-items').css({\n 'max-height': heightBasket + 'px'\n });\n}", "function ResizeTop50() {\n AlterRatingHeights(top50ArcadeRatings, \"\", \"rating\");\n AlterRatingHeights(top50PinballRatings, \"\", \"rating\");\n}", "function changeFlowItemToFitSmallWindow(i) {\n deckTitle[i].style.left = \"40px\";\n deckTitle[i].style.maxWidth = \"50%\";\n imageFlowCard[i].style.width = \"116px\";\n imageFlowCard[i].style.height = \"140px\";\n imageFlowCard[i].style.right = \"25px\";\n imageFlowCard[i].style.top = \"40px\";\n}", "function resizeImgs() {\n window.galleryItemsWidth = $(galleryItemList[0]).innerWidth();\n for (var i = galleryItemsLength - 1; i >= 0; i--) {\n\n $item = $(galleryItemList[i]);\n\n var itemAttrWidth = $item.attr('width'),\n itemAttrHeight = $item.attr('height')\n itemCurrentHeight = Math.floor(galleryItemsWidth * itemAttrHeight / itemAttrWidth);\n $item.height(itemCurrentHeight);\n };\n }", "_expandSlider() {\n for (const item of this._items) {\n const li = this._createItemWrap();\n this._itemsHolder.append(li);\n li.append(item);\n }\n this._addItemsSpacing();\n this._setDisplayedItemsClasses();\n this._viewLimiter.append(this._itemsHolder);\n this._container.append(this._viewLimiter);\n }", "function initCarousel($c, $w){\n $c.show().carouFredSel({\n align: false,\n items: Math.min($c.children().length - 1, 12),\n scroll: {\n items: 1,\n duration: 7500,\n timeoutDuration: 0,\n easing: 'linear',\n pauseOnHover: 'immediate'\n }\n });\n\n \n $w.bind('resize.affiliations', function() {\n var nw = $w.width();\n if (nw < 990) {\n nw = 990;\n }\n\n $c.width(nw * 3);\n $c.parent().width(nw);\n\n }).trigger('resize.affiliations');\n}", "setStyle (){\n // console.log(\"style\")\n let ratio = this.items.length / this.slidesVisible\n this.container.style.width = (ratio * 100)+ \"%\"\n this.items.forEach(item => item.style.width= ((100 / this.slidesVisible )/ ratio) + \"%\")\n }", "function autoAlign(){\r\n var windowWidth = $(window).width();\r\n var windowHeight= $(window).height();\r\n var logoWidth = $(\".logo\").innerWidth();\r\n var topBarHeight = $(\".topBar\").height();\r\n var navHeight = $(\"header nav\").outerHeight();\r\n $(\".logo\").css(\"margin-left\", (windowWidth - logoWidth)/2 + \"px\");\r\n $(\".carousel\").css(\"padding-top\", topBarHeight + navHeight + \"px\");\r\n if(windowWidth > windowHeight){\r\n $(\".carousel-item img\").css(\"height\", windowHeight-topBarHeight-navHeight + \"px\");\r\n }\r\n else{ \r\n $(\".carousel-item img\").css(\"height\", \"auto\");\r\n }\r\n }", "function initDesktopCarusel()\n {\n var $carousel = $('.desktop-carousel');\n var $carouselItems;\n var startPosition = Math.floor($carousel.children().length / 2);\n var inaccuracy;\n \n //initializes carousel\n $carousel.owlCarousel ({\n items: 1,\n startPosition: startPosition,\n loop: true,\n center: true,\n mouseDrag: false,\n smartSpeed: 500,\n dotsSpeed: 500,\n responsive: {\n 1800: {\n items: 2\n },\n 3000: {\n items: 3\n },\n 4000: {\n items: 5\n }\n }\n });\n \n $carouselItems = $carousel.find('.owl-item');\n inaccuracy = $carouselItems.filter('.cloned').length / 2;\n \n //moving carousel when clicked on an item\n $carouselItems.on('click', function(){\n var itemIndex = $carouselItems.index(this) - inaccuracy;\n $carousel.trigger('to', itemIndex);\n });\n }", "function spreadCarousel(i) {\n authorDeck[i].style.fontSize = \"15px\";\n deckTitle[i].children[0].classList.remove(\"h5\");\n deckTitle[i].style.maxWidth = \"50%\";\n}", "function newSize() {\n offsets = [];\n ih = window.innerHeight;\n TweenMax.set(\"#panelWrap\", { height: slides.length * ih });\n TweenMax.set(slides, { height: ih });\n for (let i = 0; i < slides.length; i++) {\n offsets.push(-slides[i].offsetTop);\n }\n TweenMax.set(container, { y: offsets[activeSlide] });\n dragMe[0].vars.snap = offsets;\n}", "function initializeFreshBaskets(){\n var containerWidth = $(window).width();\n var centerFreshBasketsFlag = false;\n if(containerWidth <= 767) {\n centerFreshBasketsFlag = true;\n } else {\n centerFreshBasketsFlag = false;\n }\n $('#carouselFreshBaskets').owlCarousel({\n center: centerFreshBasketsFlag,\n autoplay: true,\n dots: false,\n nav:true,\n navText: ['<i class=\"fa fa-angle-left\"></i>', '<i class=\"fa fa-angle-right\"></i>'],\n responsive:{\n 480:{\n items:3\n },\n 992:{\n items:4\n }\n }\n });\n }", "function equalHeightNewsCarousel() {\r\n\r\n $(\".rp-carousel-news\").each(function () {\r\n var maxHeight = 0;\r\n $(this).find(\".item-carousel\").each(function () {\r\n if (maxHeight < $(this).height()) {\r\n maxHeight = $(this).height();\r\n }\r\n });\r\n if (maxHeight > 0) {\r\n $(this).find(\".item-carousel\").each(function () {\r\n if ($(this).height() < maxHeight) {\r\n var difHeight = maxHeight - $(this).height();\r\n $(this).find(\".learn-more\").css(\"padding-top\", difHeight + \"px\");\r\n }\r\n });\r\n }\r\n\r\n });\r\n }", "function setSize(img,opt) {\n\n\t\t\t\t\n\t\t\t\tjQuery('.tp-fullwidth-forcer').css({'height':opt.container.height()});\n\n\n\t\t\t\t\t\t\n\t\t\t\topt.width=parseInt(opt.container.width(),0);\n\t\t\t\topt.height=parseInt(opt.container.height(),0);\n\n\n\t\t\t\t\n\t\t\t\topt.bw= (opt.width / opt.startwidth);\n\t\t\t\topt.bh = (opt.height / opt.startheight);\n\n\t\t\t\tif (opt.bh>opt.bw) opt.bh=opt.bw;\n\t\t\t\tif (opt.bh<opt.bw) opt.bw = opt.bh;\n\t\t\t\tif (opt.bw<opt.bh) opt.bh = opt.bw;\n\t\t\t\tif (opt.bh>1) { opt.bw=1; opt.bh=1; }\n\t\t\t\tif (opt.bw>1) {opt.bw=1; opt.bh=1; }\n\n\t\t\t\t\n\t\t\t\t//opt.height= opt.startheight * opt.bh;\n\t\t\t\topt.height = Math.round(opt.startheight * (opt.width/opt.startwidth));\n\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (opt.height>opt.startheight && opt.autoHeight!=\"on\") opt.height=opt.startheight;\n\n\t\t\t\tif (opt.fullScreen==\"on\") {\n\t\t\t\t\t\topt.height = opt.bw * opt.startheight;\n\t\t\t\t\t\tvar cow = opt.container.parent().width();\n\t\t\t\t\t\tvar coh = jQuery(window).height();\n\t\t\t\t\n\t\t\t\t\t\tif (opt.fullScreenOffsetContainer!=undefined) {\n\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\tcoh = coh - jQuery(opt.fullScreenOffsetContainer).outerHeight(true);\n\t\t\t\t\t\t\t} catch(e) {}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// IF THE DEFAULT GRID IS HIGHER THEN THE CALCULATED SLIDER HEIGHT, WE NEED TO RESIZE THE SLIDER HEIGHT\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tvar offsety = coh/2 - (opt.startheight*opt.bh)/2;\n\t\t\t\t\t\tif (offsety<0) coh=opt.startheight*opt.bh;\n\t\t\t\t\t\t*/\n\n\t\t\t\t\t\topt.container.parent().height(coh);\n\t\t\t\t\t\topt.container.css({'height':'100%'});\n\n\t\t\t\t\t\topt.height=coh;\n\n\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\topt.container.height(opt.height);\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\topt.slotw=Math.ceil(opt.width/opt.slots);\n\n\t\t\t\tif (opt.fullSreen==\"on\")\n\t\t\t\t\topt.sloth=Math.ceil(jQuery(window).height()/opt.slots);\n\t\t\t\telse\n\t\t\t\t\topt.sloth=Math.ceil(opt.height/opt.slots);\n\t\t\t\t\t\n\t\t\t\tif (opt.autoHeight==\"on\")\n\t\t\t\t \topt.sloth=Math.ceil(img.height()/opt.slots);\n\t\n\n\n\n\t\t}", "function spaced(carousel, parentWidth, items, pad) {\n const itemsSplit = $(carousel).attr(\"data-items\").split(\",\");\n let visibleItems = itemsSplit[0];\n if (parentWidth >= 1200) visibleItems = itemsSplit[4];\n else if (parentWidth >= 992) visibleItems = itemsSplit[3];\n else if (parentWidth >= 768) visibleItems = itemsSplit[2];\n else if (parentWidth >= 576) visibleItems = itemsSplit[1];\n const itemWidth = (parentWidth - pad) / visibleItems;\n $(items).each(function () {\n $(this).outerWidth(itemWidth);\n });\n}", "function handleIsotopeStretch() {\n\t\tvar width = $(window).width();\n\t\tif ( width < 768 ) {\n\t\t\t$('#filter-items .item').addClass('width-100');\n\t\t}\n\t\telse {\n\t\t\t$('#filter-items .item').removeClass('width-100');\n\t\t}\n\t}", "function changeInsightsSliderSize() {\n\t\t\twrapperI.css({\n\t\t\t\twidth: itemsI.length * sliderInsightsWidth + \"vw\"\n\t\t\t});\n\t\t\t\n\t\t\tpaddingI.css({\n\t\t\t\tpadding: \"0 \" + sliderInsightsPadding + \"vw\"\n\t\t\t});\n\t\t\t\n\t\t\titemsI.each(function() {\n\t\t\t\tif(parseFloat($(this).css(\"width\")) != 0) {\n\t\t\t\t\t$(this).css({\n\t\t\t\t\t\twidth: sliderInsightsWidth + \"vw\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t$(this).css({\n\t\t\t\t\theight: sliderInsightsHeight + \"em\"\n\t\t\t\t});\n\t\t\t});\n\t\t\t\n\t\t\tcontrolI.css({\n\t\t\t\tmarginLeft: sliderInsightsPadding + \"vw\",\n\t\t\t\twidth: (Math.floor(100/sliderInsightsWidth) * sliderInsightsWidth - 2 * sliderInsightsPadding) + \"vw\"\n\t\t\t});\n\t\t}", "function GallerySize(){jQuery(\".codegallery\").css({\"height\":jQuery(\".codeimage:first img\").height(),\"width\":jQuery(\".codeimage:first img\").width()});jQuery(\".codeimage\").width(jQuery(\".codegallery\").width());jQuery(\".carousel\").css(\"width\",jQuery(\".codeimage\").width()*jQuery(\".codeimage\").length)}", "function resizeSliderWrap(){\n\n // get the height of a porfolio image\n var listHeight = $j('li.active img').height();\n\n if (listHeight <= 200){\n listHeight = 736;\n }\n\n //update it\n $j('.slider').height(listHeight);\n}", "function sizeToFit() {\n gridManager.sizeToFit();\n}", "function fitToContainer() {\n\tresizeButtons();\n\treconfigureArrows();\n}", "function resizeItems(parent) {\n var elements = parent.find('.grid.item');\n var size = 100 / elements.length;\n elements.css('width', (size - 1) + '%');\n elements.css('height', $(elements[0]).width());\n}", "function onLoad() {\n carousel = new Carousel();\n carousel.centerSelected();\n}", "function setCarouselHeight() {\n \"use strict\";\n try {\n var selectedHeight,\n i;\n for (i = 0; i < carousels.length; i += 1) {\n selectedHeight = carousels[i].querySelector('.selected').offsetHeight;\n carousels[i].querySelector('.carouselLeft').style.height = selectedHeight + \"px\";\n carousels[i].querySelector('.carouselRight').style.height = selectedHeight + \"px\";\n carousels[i].style.height = selectedHeight + carousels[i].querySelector('.navDots').offsetHeight + \"px\";\n }\n } catch (ex) {\n console.log(ex.name + \": \" + ex.message);\n }\n }", "function update_containersize() {\n $('ul.filterable-grid').css(\"width\", $('.showcase-container').width() + \"px\");\n }", "function setWidth(){\n\n document.body.style.minWidth = window.innerWidth + 'px'; \n document.body.style.minHeight = window.innerHeight + 'px';\n largeImageCont.style.minWidth = window.innerWidth + 'px';\n largeImageCont.style.minHeight = window.innerHeight + 'px';\n smallImageCont.style.height = Math.floor(window.innerHeight / 5) + 'px';\n smallImageCont.style.width = window.innerWidth + 'px';\n headTop.style.width = window.innerWidth + 'px';\n\n }", "onLayoutReposition() {\n this.slider.find('.slick-slide').css('max-width', this.getSliderWidth());\n this.slider.find('.images-list__item').css('max-height', this.getSliderHeight());\n }", "function throttleCarousel() {\n\t\t\t$('.ss-carousel .pag li a').fastTabFix();\n\t\t}", "_updateCarouselLayout() {\n if (!this.getContainerElement()) {\n return;\n }\n var carouselSize = qx.bom.element.Dimension.getSize(\n this.getContainerElement()\n );\n\n this.__carouselWidth = carouselSize.width;\n\n if (this.getHeight() !== null) {\n this._setStyle(\"height\", this.getHeight() / 16 + \"rem\");\n } else {\n this._setStyle(\"height\", \"100%\");\n }\n\n qx.bom.element.Style.set(\n this.__carouselScroller.getContentElement(),\n \"width\",\n this.__pages.length * carouselSize.width + \"px\"\n );\n\n for (var i = 0; i < this.__pages.length; i++) {\n var pageContentElement = this.__pages[i].getContentElement();\n qx.bom.element.Style.set(\n pageContentElement,\n \"width\",\n carouselSize.width + \"px\"\n );\n\n qx.bom.element.Style.set(\n pageContentElement,\n \"height\",\n carouselSize.height + \"px\"\n );\n }\n\n if (this.__pages.length == 1) {\n this.__pagination.exclude();\n } else {\n if (this.isShowPagination()) {\n this.__pagination.show();\n }\n }\n\n this._refreshScrollerPosition();\n }", "function sliderResizeToTallest() {\n var max = 0;\n\n $('.sp-slide').each(function(){\n var slideHeight = $(this).height();\n if( slideHeight > max )\n max = slideHeight;\n });\n\n $('#slider').css({'height' : max});\n }", "function sizeAll() {\n\tvar h = window.innerHeight;\n\tvar\tw = window.innerWidth;\n\t\n\tif ( w > (h-250)*2) {\n\t\tTweenMax.set(demo, {height:h-240, width:(h-250)*2});\n\t\tTweenMax.set($controls, {y:h-240});\t\n\t}\telse {\n\t\tTweenMax.set(demo, {y:0, width:w-10, height:w/2});\n\t\tTweenMax.set($controls, {y:w/2+10});\t\n\t}\n}", "function resizeZoom(event)\n{\n var jqDiv = $('#meeting > #zoom > .cloudcarousel'),\n wbCanvas = $(\"#wbCanvas\", jqDiv), // todo better wb access\n wb = wbCanvas.data('wb'),\n edit = jqDiv.data('gcEdit'),\n width, height, item, newWidth, newHeight,\n widthScale, heightScale, scale, left, top;\n if (jqDiv.length > 0)\n {\n width = $('#meeting > #zoom').width();\n height = $('#meeting > #zoom').height();\n item = $(jqDiv).data('item');\n newWidth = width; // * 1.0; //app.carousel.options.xSpotRatio;\n newHeight = height; // * 1.0; //app.carousel.options.ySpotRatio;\n widthScale = newWidth / item.orgWidth;\n heightScale = newHeight / item.orgHeight;\n scale = (widthScale < heightScale) ? widthScale : heightScale;\n item.orgWidth *= scale;\n item.orgHeight *= scale;\n item.plgOrgWidth *= scale;\n item.plgOrgHeight *= scale;\n if (wb) // todo better wb access\n {\n wb.setScale(item.plgOrgWidth, item.plgOrgHeight);\n } else if (edit) {\n edit.setScale(item.plgOrgWidth, item.plgOrgHeight);\n }\n\n // center div in zoom div\n left = (width - item.orgWidth) / 2;\n top = (height - item.orgHeight) / 2;\n\n $(jqDiv).css('width', item.orgWidth + 'px');\n $(jqDiv).css('height', item.orgHeight + 'px');\n $(jqDiv).css('left', left + 'px');\n $(jqDiv).css('top', top + 'px');\n\n $('#zoom > .close').css({\n 'left': (left + 10.0) + 'px'\n });\n\n if ($(jqDiv).hasClass('editor')) {\n $('#zoom > .close').css({'bottom': '10px'});\n } else {\n $('#zoom > .close').css({'top': (top + 10.0) + 'px'});\n }\n }\n}", "function setMainSliderHeight(){\n if (!isMobile) {\n var width = $('.b-main-slider-cont').width();\n $('.b-main-slider-cont').css('max-height', width/2);\n }\n }", "function initHomeCarouselSmall() {\n $tabbedCarousel.show().owlCarousel({\n autoPlay: 4000,\n slideSpeed: 300,\n paginationSpeed: 400,\n singleItem: true,\n pagination: true,\n stopOnHover: true,\n beforeMove: function(el) {\n //el.find('img.lazy').show().lazyload();\n }\n });\n }", "fitScreenSize() {\n const isDiplayNone = $('#side').css('display') === 'none';\n if (isDiplayNone) this.canvas.setWidth($('body').width());\n else this.canvas.setWidth($('body').width() - $('#side').width());\n this.canvas.setHeight(\n $('body').height() - $('#nav').height() - 50 - 70 - 30,\n );\n }", "function initHomeCarouselWide() {\n var interval = 4000,\n carouselTimer = setInterval(animateCarousel, interval);\n\n $tabbedCarousel.find('.c-item:first').addClass('this-is-active');\n function animateCarousel(){\n $tabbedCarousel.find('.c-item').removeClass('this-is-active');\n $tabbedCarousel.find('.c-item:first').removeClass('this-is-active').next('.c-item').addClass('this-is-active').end().appendTo('.js-carousel--tabbed');\n //$tabbedCarousel.find('img.lazy').lazyload();\n }\n // Disable animation when tabs are interacted with.\n $tabbedCarousel.find('.c-tab').hover(function(e){\n clearInterval(carouselTimer);\n $tabbedCarousel.find('.c-item').removeClass('this-is-active');\n $(this).parents('.c-item').addClass('this-is-active');\n });\n // On resize, if the viewport is below 500px, clear the interval and\n // remove active classes.\n $(window).resize(function(){\n if (getWidth() < 500 || (getWidth() > 800 && getWidth() < 1024)) {\n clearInterval(carouselTimer);\n $tabbedCarousel.find('.c-item').removeClass('this-is-active');\n }\n });\n }", "function ScaleSlider() {\n var bodyWidth = document.body.clientWidth;\n if (bodyWidth)\n jssor_slider1.$ScaleWidth(Math.min(bodyWidth, 1920));\n else\n $Jssor$.$Delay(ScaleSlider, 30);\n }", "function setupScrollVideoTray() {\n var itemWidth = parseInt($('.video-thumb').css('width'), 10);\n var trayWidth = tray.width();\n var itemsPerSection = Math.round(trayWidth/itemWidth)-1;\n\n $('#ca-container').contentcarousel({scroll:itemsPerSection});\n }", "function initQuickLinks() {\r\n\r\n quickLinksAnimation();\r\n\r\n jQuery(window).on(\"resize\", function () {\r\n\r\n quickLinksAnimation();\r\n\r\n });\r\n\r\n function quickLinksAnimation() {\r\n\r\n jQuery(\".quick-links\").each(function () {\r\n\r\n var thisObj = jQuery(this),\r\n thisQuickLinkItem = thisObj.find(\".quick-links_item\");\r\n\r\n if (jQuery(window).width() < 800) {\r\n\r\n thisQuickLinkItem.removeClass(\"is-active\");\r\n thisQuickLinkItem.eq(0).addClass(\"is-active\");\r\n\r\n if (!thisObj.hasClass(\"is-carousel\")) {\r\n thisObj.addClass(\"is-carousel\");\r\n }\r\n\r\n var index = 1;\r\n\r\n setInterval(function () {\r\n\r\n var thisPreviousItem = thisQuickLinkItem.eq(index - 1);\r\n\r\n if (thisPreviousItem.length) {\r\n thisPreviousItem.removeClass(\"is-active\");\r\n }\r\n\r\n if (!thisQuickLinkItem.hasClass(\"is-active\")) {\r\n thisQuickLinkItem.eq(index).addClass(\"is-active\");\r\n }\r\n\r\n if (index == (thisQuickLinkItem.length - 1)) {\r\n index = 0;\r\n } else {\r\n index++;\r\n }\r\n\r\n }, 6000);\r\n\r\n }\r\n\r\n });\r\n }\r\n}", "function setSkinListHeightAndScroll() {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.demo-choose-skin');\n\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '4px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "function setSkinListHeightAndScroll() {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.demo-choose-skin');\n\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '4px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "function adjustWindow() {\n // get window size\n winW = $(window).width();\n winH = $(window).height();\n\n // app img animation\n topOffs();\n \n handleScroll();\n}", "function InitWorksContHeight() {\n if ($(window).width() > 768) {\n var works_height = $(window).height() - 185;\n var item_margin = ($(window).height() - works_height) * 0.9;\n\n $('.works-container').height(works_height);\n $('.works-container .work').css({\n 'margin-top': item_margin,\n 'margin-bottom': item_margin\n });\n }\n }", "function setSizeForPages(){\n var screen_height=$(window).height();\n $(\".fullPage\").css({\n \"position\":\"relative\",\n \"height\":screen_height+\"px\",\n \"width\":\"100%\",\n });\n $(\".fullPage-Container\").css({\n \"width\":\"100%\",\n \"position\":\"relative\",\n \"height\":_num*screen_height+\"px\",\n \"top\":-_index*screen_height+\"px\"\n });\n }", "function ScaleSlider() {\n var bodyWidth = $(window).width();\n if (bodyWidth)\n jssor_slider1.$ScaleWidth(Math.min(bodyWidth, 1920));\n else\n window.setTimeout(ScaleSlider, 30);\n }", "setTopColapsedMenuSize() {\n\t\t// When counting position we need compensate a pixel\n\t\tconst fixOffsetPosition = 1;\n\t\tif (this.isWindowFixed && this._window) {\n\t\t\tconst bodyHeight = this._window.bodyEl.offsetHeight;\n\t\t\tconst diff = this.element.offsetTop - this._window._dialog.offsetTop - this._window.defaultBorderSize - this._window.bodyEl.offsetTop + fixOffsetPosition;\n\t\t\tlet height = bodyHeight + diff + this._window.titleBarEl.offsetHeight + this.element.offsetHeight;\n\t\t\tif (this._window.isMaximized || this.$powerUi.componentsManager.smallWindowMode) {\n\t\t\t\theight = height - this._window.defaultBorderSize;\n\t\t\t}\n\t\t\tthis.element.style['max-height'] = height + 'px';\n\t\t\tthis.element.style['min-width'] = this._currentWidth + 'px';\n\t\t}\n\t}", "function initCarouselControls() {\n\tvar imgWidth = 0;\t\t\n\t$('.jcarousel-img-container > img').load( function() {\t\t\n\t\t$(this).each( function(){\n\t\t\timgWidth += $(this).width();\n\t\t\tif ( imgWidth < (windowObj.width() * 0.6 )) {\n\t\t\t\t$('.jcarousel-next').fadeOut( 800 );\n\t\t\t} else {\n\t\t\t\t$('.jcarousel-next').fadeIn( 800 );\n\t\t\t}\n\t\t});\t\t\n\t});\n}", "function carouselHeight() {\n\t\tlet $highest_name = 0;\n\t\tlet $highest_opinion = 0;\n\t\tlet $opinion_carousel_item = $('.opinion-carousel-item');\n\t\t// let $check = $opinion_carousel_item.first().height();\n\t\t$opinion_carousel_item.each(function() {\n\n\t\t\tlet $name = $(this).find('h2').outerHeight();\n\t\t\tlet $opinion = $(this).find('blockquote').outerHeight();\n\n\t\t\tif ( $name > $highest_name ) {\n\t\t\t\t$highest_name = $name;\n\t\t\t}\n\t\t\tif ( $opinion > $highest_opinion ) {\n\t\t\t\t$highest_opinion = $opinion;\n\t\t\t}\n\t\t});\n\n\t\tlet $new_height = 300 + $highest_name + $highest_opinion;\n\t\t$('.opinion.carousel').attr('style', 'min-height: ' + $new_height + 'px !important');\n\t}", "function ScaleSlider() {\n var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;\n if (parentWidth) jssor_slider1.$ScaleWidth(Math.min(parentWidth, 720));\n else $Jssor$.$Delay(ScaleSlider, 30);\n }", "function view_partners_resize() {\n\t\t\n\t}", "function setMaxXSWidth(width){\n xs = width;\n }", "function carouselHeightCalcs() {\r\n\t\t\t\r\n\t\t\t// Standard carousels\r\n\t\t\t$('.carousel.finished-loading:not(\".portfolio-items, .clients\"), .caroufredsel_wrapper .products.finished-loading').each(function () {\r\n\t\t\t\t\r\n\t\t\t\tvar tallestColumn = 0;\r\n\t\t\t\t\r\n\t\t\t\t$(this).find('> li').each(function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( $(this).height() > tallestColumn ) {\r\n\t\t\t\t\t\ttallestColumn = $(this).height();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t$(this).css('height', tallestColumn + 5);\r\n\t\t\t\t$(this).parents('.caroufredsel_wrapper').css('height', tallestColumn + 5);\r\n\t\t\t\t\r\n\t\t\t\tif ($('body.ascend').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true' || \r\n\t\t\t\t$('body.material').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true') {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler(\"currentPosition\") + 1) / $(this).triggerHandler(\"currentVisible\").length));\r\n\t\t\t\t\t$(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('> li').length / $(this).triggerHandler(\"currentVisible\").length));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t}", "function euGalleryAdjust() {\n\t\t\timg_height = $( 'ul.eu_gallery li figure .img_container' ).height();\n\n\t\t\t/**\n\t\t\t * Resize img_container\n\t\t\t */\n\t\t\timg_cont_w = $( '.img_container' ).width();\n\t\t\timg_cont_h = ( 387*img_cont_w ) / 582;\n\t\t\t$( '.img_container' ).height( img_cont_h );\n\t\t\t$( '.eu_gallery' ).height( $( '.eu_gallery li' ).height() );\n\n\t\t\t/**\n\t\t\t * Reposition the gallery controls\n\t\t\t */\n\t\t\ty_pos = img_height - 45;\n\t\t\t$( '.eu_expand_gallery' ).css( 'top', y_pos );\n\t\t\t$( '.eu_slide_number' ).css( 'top', y_pos - 45 );\n\t\t\t$( '.eu_prev, .eu_next' ).css('top', y_pos/2 );\n\t\t\tif( 720 >= $(window).width() ) {\n\t\t\t\t$( '.eu_slide_number' ).css( 'top', y_pos );\n\t\t\t}\n\t\t}", "function ScaleSlider() {\n var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth;\n if (parentWidth)\n jssor_slider2.$ScaleWidth(Math.min(parentWidth, 600));\n else\n window.setTimeout(ScaleSlider, 30);\n }", "function ScaleSlider() {\n var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth;\n if (parentWidth)\n jssor_slider2.$ScaleWidth(Math.min(parentWidth, 750));\n else\n window.setTimeout(ScaleSlider, 30);\n }", "function resizeCards() {\n $('.card').css('width', window.innerHeight * 0.8 / 3.1);\n $('.card').css('height', window.innerHeight * 0.8 / 3.1);\n }", "function ScaleSlider() {\n var width = $galleryWide.parent().width();\n galleryWide.width = width;\n //if (bodyWidth)\n // galleryWide.$ScaleWidth(bodyWidth);\n //else\n // window.setTimeout(ScaleSlider, 30);\n }", "function onWindowResize() {\n updateSizes();\n }", "function resizeFullWidthSlider() {\n\n\n\n\t\tjQuery('.fullwidth_slider').each(function() {\n\t\t\tvar l=0;\n\t\t\tvar t=0;\n\t\t\tvar fwslider=jQuery(this);\n\n\t\t\t// WIDTH OF THE SCREEN\n\t\t\tvar sw=jQuery(window).width();\n\n\t\t\tvar spaces=20;\n\n\t\t\tif (sw<720) spaces=10;\n\n\t\t\t// THE DIMENSION OF THE CURRENT ITEM\n\t\t\tvar ww=0;\n\t\t\tvar hh=0;\n\n\t\t\t// THE HEIGHT OF THE FULLWIDTH SLIDER\n\t\t\tvar fwheight = 450;\n\t\t\tvar fwwidth = 450;\n\n\t\t\tif (sw<1200 && sw>420) {\n\t\t\t\tvar prop = (sw/1200)*1.4;\n\t\t\t\tif (prop>1) prop=1;\n\t\t\t\tfwheight=Math.round(fwheight*prop);\n\t\t\t\tfwwidth=Math.round(fwwidth*prop);\n\t\t\t}\n\n\t\t\tif (sw<421) {\n\t\t\t\tvar prop = (sw/1200)*1.9;\n\t\t\t\tif (prop>1) prop=1;\n\t\t\t\tfwheight=Math.round(fwheight*prop);\n\t\t\t\tfwwidth=Math.round(fwwidth*prop);\n\t\t\t}\n\n\t\t\t// SET THE RIGHT HEIGHT OF THE ELEMENT\n\t\t\tfwslider.height(fwheight);\n\n\t\t\tjQuery(this).find('.fs-entry').each(function() {\n\t\t\t\t\tvar ent=jQuery(this);\n\n\t\t\t\t\t// SIZING THE BOXES\n\t\t\t\t\tif (ent.hasClass(\"fs-maxw\")) ww=fwwidth;\n\t\t\t\t\tif (ent.hasClass(\"fs-twothirdw\")) ww=fwwidth/3*2;\n\t\t\t\t\tif (ent.hasClass(\"fs-onethirdw\")) ww=fwwidth/3;\n\t\t\t\t\tif (ent.hasClass(\"fs-halfw\")) ww=fwwidth/2;\n\n\t\t\t\t\tif (ent.hasClass(\"fs-maxh\")) hh=fwheight;\n\t\t\t\t\tif (ent.hasClass(\"fs-twothirdh\")) hh=(fwheight/3*2)-(spaces/2);\n\t\t\t\t\tif (ent.hasClass(\"fs-onethirdh\")) hh=(fwheight/3)-(spaces*2/3);\n\t\t\t\t\tif (ent.hasClass(\"fs-halfh\")) hh=(fwheight/2)-(spaces/2);\n\n\t\t\t\t\t// POSITION OF THE ITEMS\n\t\t\t\t\tent.css({'width':ww+\"px\", 'height':hh+\"px\",'left':l+\"px\", 'top':t+\"px\"});\n\n\t\t\t\t\t// REPOSITION THE NEXT ITEM\n\n\t\t\t\t\tif (t+ent.height()<fwheight-4)\n\t\t\t\t\t\tt=t+ent.height()+spaces;\n\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tt=0;\n\t\t\t\t\t\t\tl=l+ent.width()+spaces;\n\t\t\t\t\t\t}\n\t\t\t\t\tfwslider.width(l);\n\t\t\t})\n\t\t})\n\t }", "function update_containersize() {\n $container.css(\"width\", $('.showcase-container').width() + \"px\");\n $container.css(\"height\", \"auto\");\n }", "function setSize(img,opt) {\n\n\n\t\t\t\topt.container.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').css({'height':opt.container.height()});\n\t\t\t\topt.container.closest('.rev_slider_wrapper').css({'height':opt.container.height()});\n\n\n\t\t\t\topt.width=parseInt(opt.container.width(),0);\n\t\t\t\topt.height=parseInt(opt.container.height(),0);\n\n\n\n\t\t\t\topt.bw= (opt.width / opt.startwidth);\n\t\t\t\topt.bh = (opt.height / opt.startheight);\n\n\t\t\t\tif (opt.bh>opt.bw) opt.bh=opt.bw;\n\t\t\t\tif (opt.bh<opt.bw) opt.bw = opt.bh;\n\t\t\t\tif (opt.bw<opt.bh) opt.bh = opt.bw;\n\t\t\t\tif (opt.bh>1) { opt.bw=1; opt.bh=1; }\n\t\t\t\tif (opt.bw>1) {opt.bw=1; opt.bh=1; }\n\n\n\t\t\t\t//opt.height= opt.startheight * opt.bh;\n\t\t\t\topt.height = Math.round(opt.startheight * (opt.width/opt.startwidth));\n\n\n\n\n\n\t\t\t\tif (opt.height>opt.startheight && opt.autoHeight!=\"on\") opt.height=opt.startheight;\n\n\n\n\t\t\t\tif (opt.fullScreen==\"on\") {\n\t\t\t\t\t\topt.height = opt.bw * opt.startheight;\n\t\t\t\t\t\tvar cow = opt.container.parent().width();\n\t\t\t\t\t\tvar coh = jQuery(window).height();\n\t\t\t\t\t\tif (opt.fullScreenOffsetContainer!=undefined) {\n\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\tvar offcontainers = opt.fullScreenOffsetContainer.split(\",\");\n\t\t\t\t\t\t\t\tjQuery.each(offcontainers,function(index,searchedcont) {\n\t\t\t\t\t\t\t\t\tcoh = coh - jQuery(searchedcont).outerHeight(true);\n\t\t\t\t\t\t\t\t\tif (coh<opt.minFullScreenHeight) coh=opt.minFullScreenHeight;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} catch(e) {}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\topt.container.parent().height(coh);\n\t\t\t\t\t\topt.container.css({'height':'100%'});\n\n\t\t\t\t\t\topt.height=coh;\n\n\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\topt.container.height(opt.height);\n\t\t\t\t}\n\n\n\t\t\t\topt.slotw=Math.ceil(opt.width/opt.slots);\n\n\t\t\t\tif (opt.fullSreen==\"on\")\n\t\t\t\t\topt.sloth=Math.ceil(jQuery(window).height()/opt.slots);\n\t\t\t\telse\n\t\t\t\t\topt.sloth=Math.ceil(opt.height/opt.slots);\n\n\t\t\t\tif (opt.autoHeight==\"on\")\n\t\t\t\t \topt.sloth=Math.ceil(img.height()/opt.slots);\n\n\n\n\n\t\t}", "function setSize(img,opt) {\n\n\n\t\t\t\topt.container.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').css({'height':opt.container.height()});\n\t\t\t\topt.container.closest('.rev_slider_wrapper').css({'height':opt.container.height()});\n\n\n\t\t\t\topt.width=parseInt(opt.container.width(),0);\n\t\t\t\topt.height=parseInt(opt.container.height(),0);\n\n\n\n\t\t\t\topt.bw= (opt.width / opt.startwidth);\n\t\t\t\topt.bh = (opt.height / opt.startheight);\n\n\t\t\t\tif (opt.bh>opt.bw) opt.bh=opt.bw;\n\t\t\t\tif (opt.bh<opt.bw) opt.bw = opt.bh;\n\t\t\t\tif (opt.bw<opt.bh) opt.bh = opt.bw;\n\t\t\t\tif (opt.bh>1) { opt.bw=1; opt.bh=1; }\n\t\t\t\tif (opt.bw>1) {opt.bw=1; opt.bh=1; }\n\n\n\t\t\t\t//opt.height= opt.startheight * opt.bh;\n\t\t\t\topt.height = Math.round(opt.startheight * (opt.width/opt.startwidth));\n\n\n\n\n\n\t\t\t\tif (opt.height>opt.startheight && opt.autoHeight!=\"on\") opt.height=opt.startheight;\n\n\n\n\t\t\t\tif (opt.fullScreen==\"on\") {\n\t\t\t\t\t\topt.height = opt.bw * opt.startheight;\n\t\t\t\t\t\tvar cow = opt.container.parent().width();\n\t\t\t\t\t\tvar coh = jQuery(window).height();\n\t\t\t\t\t\tif (opt.fullScreenOffsetContainer!=undefined) {\n\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\tvar offcontainers = opt.fullScreenOffsetContainer.split(\",\");\n\t\t\t\t\t\t\t\tjQuery.each(offcontainers,function(index,searchedcont) {\n\t\t\t\t\t\t\t\t\tcoh = coh - jQuery(searchedcont).outerHeight(true);\n\t\t\t\t\t\t\t\t\tif (coh<opt.minFullScreenHeight) coh=opt.minFullScreenHeight;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} catch(e) {}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\topt.container.parent().height(coh);\n\t\t\t\t\t\topt.container.css({'height':'100%'});\n\n\t\t\t\t\t\topt.height=coh;\n\n\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\topt.container.height(opt.height);\n\t\t\t\t}\n\n\n\t\t\t\topt.slotw=Math.ceil(opt.width/opt.slots);\n\n\t\t\t\tif (opt.fullSreen==\"on\")\n\t\t\t\t\topt.sloth=Math.ceil(jQuery(window).height()/opt.slots);\n\t\t\t\telse\n\t\t\t\t\topt.sloth=Math.ceil(opt.height/opt.slots);\n\n\t\t\t\tif (opt.autoHeight==\"on\")\n\t\t\t\t \topt.sloth=Math.ceil(img.height()/opt.slots);\n\n\n\n\n\t\t}", "function setSize(img,opt) {\n\n\n\t\t\t\topt.container.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').css({'height':opt.container.height()});\n\t\t\t\topt.container.closest('.rev_slider_wrapper').css({'height':opt.container.height()});\n\n\n\t\t\t\topt.width=parseInt(opt.container.width(),0);\n\t\t\t\topt.height=parseInt(opt.container.height(),0);\n\n\n\n\t\t\t\topt.bw= (opt.width / opt.startwidth);\n\t\t\t\topt.bh = (opt.height / opt.startheight);\n\n\t\t\t\tif (opt.bh>opt.bw) opt.bh=opt.bw;\n\t\t\t\tif (opt.bh<opt.bw) opt.bw = opt.bh;\n\t\t\t\tif (opt.bw<opt.bh) opt.bh = opt.bw;\n\t\t\t\tif (opt.bh>1) { opt.bw=1; opt.bh=1; }\n\t\t\t\tif (opt.bw>1) {opt.bw=1; opt.bh=1; }\n\n\n\t\t\t\t//opt.height= opt.startheight * opt.bh;\n\t\t\t\topt.height = Math.round(opt.startheight * (opt.width/opt.startwidth));\n\n\n\n\n\n\t\t\t\tif (opt.height>opt.startheight && opt.autoHeight!=\"on\") opt.height=opt.startheight;\n\n\n\n\t\t\t\tif (opt.fullScreen==\"on\") {\n\t\t\t\t\t\topt.height = opt.bw * opt.startheight;\n\t\t\t\t\t\tvar cow = opt.container.parent().width();\n\t\t\t\t\t\tvar coh = jQuery(window).height();\n\t\t\t\t\t\tif (opt.fullScreenOffsetContainer!=undefined) {\n\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\tvar offcontainers = opt.fullScreenOffsetContainer.split(\",\");\n\t\t\t\t\t\t\t\tjQuery.each(offcontainers,function(index,searchedcont) {\n\t\t\t\t\t\t\t\t\tcoh = coh - jQuery(searchedcont).outerHeight(true);\n\t\t\t\t\t\t\t\t\tif (coh<opt.minFullScreenHeight) coh=opt.minFullScreenHeight;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} catch(e) {}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\topt.container.parent().height(coh);\n\t\t\t\t\t\topt.container.css({'height':'100%'});\n\n\t\t\t\t\t\topt.height=coh;\n\n\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\topt.container.height(opt.height);\n\t\t\t\t}\n\n\n\t\t\t\topt.slotw=Math.ceil(opt.width/opt.slots);\n\n\t\t\t\tif (opt.fullSreen==\"on\")\n\t\t\t\t\topt.sloth=Math.ceil(jQuery(window).height()/opt.slots);\n\t\t\t\telse\n\t\t\t\t\topt.sloth=Math.ceil(opt.height/opt.slots);\n\n\t\t\t\tif (opt.autoHeight==\"on\")\n\t\t\t\t \topt.sloth=Math.ceil(img.height()/opt.slots);\n\n\n\n\n\t\t}", "function setSkinListHeightAndScroll(isFirstTime) {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.demo-choose-skin');\n\n if (!isFirstTime){\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n }\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '6px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "function setSkinListHeightAndScroll(isFirstTime) {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.demo-choose-skin');\n\n if (!isFirstTime){\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n }\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '6px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "function setSkinListHeightAndScroll(isFirstTime) {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.demo-choose-skin');\n\n if (!isFirstTime){\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n }\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '6px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "function _fit() {\n\t\t\t// size panels to fit window height\n\t\t\t$( \".panel\", _context ).each( function ( i ) {\n\t\t\t\tvar h = $( window ).height() - 76;\n\t\t\t\t$( this ).height( h );\n\t\t\t});\n\t\t\t$( \"section\", _context ).each( function ( i ) {\n\t\t\t\tvar h = this.parentNode.id != \"trees\" ? $( window ).height() - 111 : $( window ).height() - 101;\n\t\t\t\t$( this ).height( h );\n\t\t\t});\n\t\t\t$( \".handle > div\", _context ).each( function ( i ) {\n\t\t\t\tvar h = $( window ).height() - 101;\n\t\t\t\t$( this ).height( h );\n\t\t\t});\n\t\t\t$( \".handle > div > img\", _context ).each( function ( i ) {\n\t\t\t\tvar t = ( $( window ).height() - 125 ) / 2;\n\t\t\t\t$( this ).css( \"top\", t );\n\t\t\t});\n\t\t\t// show body if 1st time\n\t\t\tif ( ! _inited ) {\n\t\t\t\t_context.show();\n\t\t\t\t_inited = true;\n\t\t\t}\n\t\t}", "widthWindow (newValue, oldValue) {\n\t\t\tif (oldValue) {\n\t\t\t\tthis.prepareCarousel()\n\t\t\t\tthis.toggleFade()\n\t\t\t}\n\t\t}", "function view_home_resize() {\n\t\t\n\t}", "function seven_next_carousel()\n\t\t{\n\t\t\t if(100*length<option.width)\t return false;\n\t\t\t var tb=parseInt(option.width/160);\n\t\t\t var temp=Math.abs(Math.ceil(parseInt(handle.find(\"#seven_hviewport\").css(\"left\"))/160));\n\t\t\t if(temp<(length-(tb*2)))\n\t\t\t {\n\t\t\t\t handle.find(\"#seven_hviewport\").animate({\n\t\t\t\t\t \"left\":-100*(temp+tb),\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t\t duration:400,\n\t\t\t\t\t easing:\"swing\"\n\t\t\t\t });\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t handle.find(\"#seven_hviewport\").animate({\n\t\t\t\t\t \"left\":-(handle.find(\"#seven_hviewport\").width()-option.width)+\"px\",\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t \n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t\t duration:400,\n\t\t\t\t\t easing:\"swing\"\n\t\t\t\t });\n\t\t\t }\n\t\t}", "function setsize() {\n gsap.to(indexbtnitemcontainer, { duration: 0.9, ease: \"expo.out\", y: -(current_index * 65) });\n // gsap.to(indexbtn, { duration: 1.5, ease: \"expo.out\", height: \"65px\" });\n gsap.to(indexbtn, { duration: 0.9, ease: \"expo.out\", width: indexbtnitem[current_index].offsetWidth + \"px\" });\n // gsap.to(indexbtn, { duration: 1.5, ease: \"expo.out\", borderRadius: \"50px\" });\n\n}", "setSmallWindowModeSize(keepWidth) {\n\t\tthis.removeStyles(keepWidth);\n\t\tif (this.barPosition === 'top') {\n\t\t\tthis.setTopColapsedMenuSize();\n\t\t} else if (this.barPosition === 'bottom') {\n\t\t\tthis.setBottomColapsedMenuSize();\n\t\t} else if (this.barPosition === 'left') {\n\t\t\tthis.setLeftColapsedMenuSize();\n\t\t} else if (this.barPosition === 'right') {\n\t\t\tthis.setRightColapsedMenuSize();\n\t\t}\n\t}", "function setSkinListHeightAndScroll(isFirstTime) {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.demo-choose-skin');\n\n if (!isFirstTime) {\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n }\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '6px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "update() {\n const items = this.carouselService.settings.items;\n let start = this.carouselService.current(), end = start + items;\n if (this.carouselService.settings.center) {\n start = items % 2 === 1 ? start - (items - 1) / 2 : start - items / 2;\n end = items % 2 === 1 ? start + items : start + items + 1;\n }\n this.carouselService.slidesData.forEach((slide, i) => {\n slide.heightState = (i >= start && i < end) ? 'full' : 'nulled';\n });\n }", "function setSkinListHeightAndScroll(isFirstTime) {\n\tvar height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n\tvar $el = $('.demo-choose-skin');\n\n\tif (!isFirstTime){\n\t\t$el.slimScroll({ destroy: true }).height('auto');\n\t\t$el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n\t}\n\n\t$el.slimscroll({\n\t\theight: height + 'px',\n\t\tcolor: 'rgba(0,0,0,0.5)',\n\t\tsize: '6px',\n\t\talwaysVisible: false,\n\t\tborderRadius: '0',\n\t\trailBorderRadius: '0'\n\t});\n}", "function runMainProductsTabletSlider() {\n if ($(window).width() >= 768 && $(window).width() < 1152) {\n $(\".mainProducts__list\").slick({\n infinite: false,\n speed: 600,\n arrows:false,\n dots:false,\n swipe:true,\n slidesToShow: 2,\n slidesToScroll: 1,\n });\n $(\".mainProducts__list\").slick('setPosition');\n } else {\n if($(\".cardList-main\").hasClass(\"slick-slider\"))\n $('.cardList-main').slick(\"unslick\");\n }\n }", "function ScaleSlider() {\r\n var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth;\r\n var get_wWindow = $(window).width();\r\n \r\n if (parentWidth) {\r\n var sliderWidth = parentWidth;\r\n sliderWidth = Math.min(sliderWidth, get_wWindow);\r\n jssor_slider2.$ScaleWidth(sliderWidth);\r\n }\r\n else\r\n window.setTimeout(ScaleSlider, 30);\r\n }", "function qodefOnWindowResize() {\n qodefInitProductListMasonryShortcode();\n }" ]
[ "0.6966265", "0.6756647", "0.67326427", "0.67141485", "0.6712271", "0.6708533", "0.6708533", "0.6708533", "0.6639458", "0.6630527", "0.65997916", "0.65371406", "0.644696", "0.6425901", "0.6308349", "0.62622744", "0.62332076", "0.6208643", "0.6110219", "0.6070161", "0.60344255", "0.59734976", "0.5927078", "0.5925497", "0.5920856", "0.5915069", "0.588287", "0.5880783", "0.58752483", "0.586885", "0.58592737", "0.58361924", "0.5835053", "0.5823103", "0.5818757", "0.5817407", "0.5816394", "0.5811386", "0.58060193", "0.578013", "0.5773789", "0.5747014", "0.5732089", "0.57310104", "0.5730996", "0.5730379", "0.5724347", "0.5717037", "0.5715727", "0.5711053", "0.5708871", "0.5707222", "0.56949866", "0.5694249", "0.5692237", "0.5692118", "0.5687224", "0.568072", "0.56717277", "0.56704104", "0.56677413", "0.56667954", "0.56667954", "0.56649905", "0.56619513", "0.56560814", "0.56512374", "0.56510836", "0.564931", "0.56427586", "0.5638238", "0.5635738", "0.56349367", "0.5628676", "0.5624811", "0.5619133", "0.5617205", "0.5616227", "0.5613771", "0.56108284", "0.56081194", "0.5600763", "0.5600457", "0.5600457", "0.5600457", "0.55976224", "0.55976224", "0.5572211", "0.5562323", "0.55557305", "0.55553615", "0.55536795", "0.55510247", "0.55501276", "0.5547064", "0.5546403", "0.5544401", "0.5536895", "0.5512456", "0.55112034" ]
0.5904775
26
set nav bar back fit bigger size (> 576px)
function spreadNavBar() { for (i = 0; i < userBar.children.length; i++) { userBar.children[i].style.width = ""; } userBar.style.width = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mbnavresize(){\n\t\tvar browserHeight = $(window).height(); \n\t\t$('#mobile-nav').css(\"height\",browserHeight);\n\t}", "function resize() {\n if ($window.width() < 600) {\n return $nav.addClass('mobile-nav');\n }\n\n $nav.removeClass('mobile-nav');\n }", "resize(){\n var x = this.refs.myTopnav;\n if(x){\n if (x.className === \"App-header\") {\n x.className += \" responsive\";\n } else {\n x.className = \"App-header\";\n }\n } \n }", "function navFixResponsive() {\r\n // get window width\r\n let winWidth = window.innerWidth,\r\n navSettings = document.querySelector('nav .navbar-nav.settings'),\r\n navCollapse = document.querySelector('nav .navbar-collapse');\r\n \r\n if (winWidth <= 991) {\r\n // move notification and language outside the parent\r\n if (!navSettings.classList.contains('fix-responsize')) {\r\n // add class 'fix-responsive'\r\n navSettings.classList.add('fix-responsize');\r\n navSettings.closest('.container-fluid').insertBefore(navSettings, navSettings.parentElement);\r\n }\r\n } else {\r\n // check if class 'fix-responsive' exist.. if true .. inject the notification and language button to the 'navbar-collapse' in big screen\r\n if (navSettings.classList.contains('fix-responsize')) {\r\n navSettings.classList.remove('fix-responsize');\r\n navCollapse.insertAdjacentElement('beforeend', navSettings);\r\n navCollapse.style.opacity = 1;\r\n navCollapse.style.height = 'inherit';\r\n }\r\n }\r\n }", "navbarResponsive() {\n let x = document.getElementById(\"myTopnav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n }", "function adjustHeight(){\n\t\t\t\t\t\t var viewportHeight = jQuery(window).height();\n\t\t\t\t\t var canvasHeight = jQuery('nav.full_vertical').height(); \n\t\t\t\t\t\t var newHeight = canvasHeight;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(canvasHeight < viewportHeight) {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t var newHeight = viewportHeight\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t jQuery(\"body, .off-canvas, #responsive-nav-overlay\").css({'height': newHeight, 'overflow': 'hidden'});\n\t\t\t\t\t }", "function adjustNav() {\n\n\tif ($(document).width() < breakPoint) {\n\n\t\t$(\"nav.main-menu\").removeClass(\"full\").addClass(\"compact\");\n\t\t$(\"nav.main-menu ul\").hide();\n\t}\n\n\telse {\n\n\t\t$(\"nav.main-menu\").removeClass(\"compact\").addClass(\"full\");\n\t\t$(\"nav.main-menu ul\").show();\n\t}\n}", "function change_nav_size(){\n console.log(\"resizing!\");\n var currY = curr_pos();\n var navibar = document.getElementById(\"global-nav\");\n if (currY < 50){\n navibar.classList.add(\"navi_bar\"); \n navibar.classList.remove(\"navi_bar_s\"); \n }\n else{\n navibar.classList.remove(\"navi_bar\");\n navibar.classList.add(\"navi_bar_s\");\n }\n}", "function stickyBar() {\n if (window.pageYOffset > 0) {\n navbar.classList.add(\"nav-bg-trans\");\n navChild.classList.add(\"nav-child-shrink\"); \n navbar.classList.add(\"shadow-sm\");\n toTop.classList.add(\"show-me\"); \n \n } else {\n navbar.classList.remove(\"nav-bg-trans\");\n navChild.classList.remove(\"nav-child-shrink\"); \n navbar.classList.remove(\"shadow-sm\");\n toTop.classList.remove(\"show-me\"); \n }\n }", "function setBrandbar(i){\n\n\t\t\tvar newHeight = jQuery(window).height() - heightOfMenuBar;\n\t\t\tvar heightLimit = 590;\n\n\t\t\tif(jQuery(window).height() < heightLimit){\n\t\t\t\tnewHeight = heightLimit - heightOfMenuBar; // set to 572px, otherwise it becomes to small\n\t\t\t}\n\n\t\t\tjQuery('#headBar')\n\t\t\t\t.height(newHeight); // 82 = The Guide nav height\n\n\t\t}", "function displayMobileNavbar() {\n if (window.innerWidth < breakpoints.values.lg) {\n setMobileView(true);\n setMobileNavbar(false);\n } else {\n setMobileView(false);\n setMobileNavbar(false);\n }\n }", "function setmainNavHeight(){\n if(window.innerWidth <= 823) {\n const header = document.querySelector('header');\n const height = header.offsetHeight;\n mainNav.style.top = height + 'px';\n }\n}", "function setNavHeight(height) {\n\t\tif (!isMobile) {\n\t\t\tnav_primary = $('nav .level-1 > li > a').next();\n\t\t\tspace = parseInt(nav_primary.css('padding-top')) + parseInt(nav_primary.css('padding-bottom'));\n\t\t\tif (height && height > initialHeight) {\n\t\t\t\tsetHeight = parseInt(height) + space;\n\t\t\t\tnav_primary.css('min-height', setHeight + 'px');\n\t\t\t\t$('.navi-shadow').hide();\n\t\t\t} else {\n\t\t\t\tsetHeight = parseInt(initialHeight) + space;\n\t\t\t\tnav_primary.css('min-height', setHeight + 'px');\n\t\t\t\tif (height) {\n\t\t\t\t\t$('.navi-shadow').hide();\n\t\t\t\t} else {\n\t\t\t\t\t$('.navi-shadow').show();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function openNavMobile() {\n document.getElementById(\"nav-slide\").style.height = \"380px\";\n }", "function editNav() {\n let x = document.getElementById('myTopnav');\n if (x.className === 'topnav') {\n x.className += ' responsive';\n } else {\n x.className = 'topnav';\n }\n}", "function setArea(){\r\n\tvar width = window.innerWidth;\r\n\t\r\n\t\r\n\t$(\".nav-desktop a\").css(\"font-size\", 21*width/1100);\r\n\t$(\".nav-desktop a span\").css(\"font-size\", 20*width/1100);\r\n\t\r\n\tif(320 <= width && width <= 1024)\r\n\t{\r\n\t\t$('#hamburger').css(\"display\", \"block\");\r\n\t\t$('.nav-desktop').css(\"display\", \"none\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$('#hamburger').css(\"display\", \"none\");\r\n\t\t$('.nav-desktop').css(\"display\", \"block\");\r\n\t}\r\n}", "function responsiveNavBar() {\n var x = document.getElementById(\"topnav\");\n if (x.className === \"navbar\") {\n x.className += \" responsive\";\n } else {\n x.className = \"navbar\";\n }\n}", "function updatePrimaryNavHeight() {\n const {top} = $.one('.mh-frame__inner').getBoundingClientRect()\n if (top > 0) {\n $.one('.mh-nav').style.maxHeight = `calc(100% - ${top}px)`\n } else {\n $.one('.mh-nav').style.maxHeight = '100%'\n }\n}", "function screen_height() {\r\n height = $(window).height();\r\n $('.main-nav').css('padding-top', height / 2.8);\r\n }", "function navbarMobToggler() {\r\n let nav = document.querySelector('nav.navbar'),\r\n navList = nav.querySelector('.navbar-collapse');\r\n if (!this.classList.contains('active')) {\r\n if (!navList.classList.contains('ready')) {\r\n navList.classList.add('d-block');\r\n let navListHeight = navList.offsetHeight,\r\n cusStyle = document.createElement('style'),\r\n styleTxt = '.navbar .navbar-collapse.ready.active {height:' + navListHeight + 'px;} @keyframes navListDown {0% {height: 0px;} 100% {height: ' + navListHeight +'px;}}@keyframes navListUp {0% {height: ' + navListHeight +'px;} 100% {height: 0px;}}';\r\n cusStyle.appendChild(document.createTextNode(styleTxt));\r\n document.head.appendChild(cusStyle);\r\n }\r\n this.classList.add('active');\r\n navList.classList.add('ready');\r\n navList.classList.add('active');\r\n navList.classList.remove('d-block');\r\n } else {\r\n this.classList.remove('active');\r\n navList.classList.remove('active');\r\n }\r\n}", "handleAppBarResize(height) {\n this.setState({\n appBarHeight: height\n });\n }", "updateNavbarDisplay() {\n if (window.innerWidth < 700) {\n this.setState({ \n navbarDisplay: \"none\",\n navbarBtnAnimationClass: false,\n isMobile: true \n }) \n } else {\n this.setState({ \n navbarDisplay: \"flex\", \n isMobile: false\n })\n }\n\n }", "function onResize(){\n if(window.innerWidth >= 768){\n document.body.classList.remove('nav-open');\n };\n }", "onBackPress() {\n const { theme: { body } } = this.props;\n this.props.navigator.pop({\n navigatorStyle: {\n navBarHidden: true,\n navBarTransparent: true,\n screenBackgroundColor: body.bg,\n drawUnderStatusBar: true,\n statusBarColor: body.bg,\n },\n animated: false,\n });\n }", "function onResize() {\n if ($(window).width() < 751) {\n $('nav').removeClass('fixed-top');\n $('nav').addClass('fixed-bottom');\n $('#footer').removeClass('d-block');\n $('#footer').addClass('d-none');\n } else {\n $('nav').removeClass('fixed-bottom');\n $('nav').addClass('fixed-top');\n $('#footer').removeClass('d-none');\n $('#footer').addClass('d-block');\n }\n}", "checkScreenSize() {\n if (window.innerWidth > 768) {\n this.navClose();\n }\n }", "function stikyNav() {\n\n top = allWindow.scrollTop();\n\n if ( top >= 100 ) {\n navBar.addClass(\"nav-sticky\");\n\n } else {\n navBar.removeClass(\"nav-sticky\");\n }\n\n // SHow Also Scroll up Button\n if ( top >= 1000 ) {\n $('.scroll-up').addClass(\"show-up-btn\");\n } else {\n $('.scroll-up').removeClass(\"show-up-btn\");\n }\n }", "function navbarSceoll() {\n var iamHere = $(window).scrollTop(),\n nav = $('.navbar-custom');\n $(window).scroll(function () {\n if ($(this).scrollTop() > iamHere) {\n nav.addClass('up');\n iamHere = $(window).scrollTop();\n } else if ($(this).scrollTop() < iamHere) {\n nav.removeClass('up');\n iamHere = $(window).scrollTop();\n }\n });\n }", "function navFunction() {\r\n var x = document.getElementById(\"mynavbar\");\r\n if (x.className === \"navbar\") {\r\n x.className += \" responsive\";\r\n } else {\r\n x.className = \"navbar\";\r\n }\r\n}", "function open_nav() {\n var x = document.getElementById(\"myTopnav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n document.getElementById(\"nav-container\").style.height = \"484px\";\n // var no_show = document.getElementsByClassName(\"no-scroll\");\n // for (var i = 0; i < no_show.length; i++) {\n // no_show[i].style.height = \"60px\";\n // }\n } else {\n x.className = \"topnav\";\n document.getElementById(\"nav-container\").style.height = \"60px\";\n }\n}", "function handleSmallScreens() {\n document.querySelector('.navbar-toggler')\n .addEventListener('click', () => {\n let navbarMenu = document.querySelector('.navbar-menu')\n\n if (navbarMenu.style.display === 'flex') {\n navbarMenu.style.display = 'none'\n return\n }\n\n navbarMenu.style.display = 'flex'\n })\n}", "function handleSmallScreens() {\n document.querySelector('.navbar-toggler')\n .addEventListener('click', () => {\n let navbarMenu = document.querySelector('.navbar-menu')\n\n if (navbarMenu.style.display === 'flex') {\n navbarMenu.style.display = 'none'\n return\n }\n\n navbarMenu.style.display = 'flex'\n })\n}", "function recalculate_height() {\n var nav_height = $(window).outerHeight();\n $(\"#navigation\").height(nav_height - 56);\n }", "function openNav() {\r\n document.getElementById(\"myNav\").style.height = \"108%\";\r\n}", "render() {\n return (\n <>\n <Navbar\n varient=\"dark\"\n bg={this.state.isTop ? \"dark\" : \"transparent\"}\n sticky=\"top\"\n >\n <Navbar.Brand href=\"#home\">\n <div className=\"appName\">\n <GoFlame />\n {\" GuaGAN\"}\n </div>\n </Navbar.Brand>\n </Navbar>\n </>\n );\n }", "function resized(e){\n\t\tif(GLB._isMobile){\n\t\t\t// if(!_burger) _burger = new BurgerIcon(_topMenu);\n\t\t}\n\t}", "setSmallWindowModeSize(keepWidth) {\n\t\tthis.removeStyles(keepWidth);\n\t\tif (this.barPosition === 'top') {\n\t\t\tthis.setTopColapsedMenuSize();\n\t\t} else if (this.barPosition === 'bottom') {\n\t\t\tthis.setBottomColapsedMenuSize();\n\t\t} else if (this.barPosition === 'left') {\n\t\t\tthis.setLeftColapsedMenuSize();\n\t\t} else if (this.barPosition === 'right') {\n\t\t\tthis.setRightColapsedMenuSize();\n\t\t}\n\t}", "function navIcon() {\n var nav = document.getElementById(\"myTopnav\"); // Get the id of the navegation bar\n // The button click will change the status of the bar.\n if (nav.className === \"topnav\") { //If the options are hidden\n nav.className += \" responsive\"; // It will show all the options as a vertical list\n } \n else { //If the options are not hidden\n nav.className = \"topnav\"; // It will hide all the options\n }\n}", "function persistantActiveNavigationBar() {\n\t// Retrieve the full URL of the current page.\n\tlet fullURL = window.location.href \n\tstringPositionStart = fullURL.lastIndexOf('/Site/') + 6 // Finds the place in the URL (starting from the back) where \"/Site\" is and return the index. +6 means we start after the /Site/\n\tstringPositionEnd = fullURL.lastIndexOf('.html') // Find the \".html\" in the URL\n\tlet subPage = fullURL.slice(stringPositionStart, stringPositionEnd) // Select the current \"subPage\"\n\tlet activeBarStyling = '0.2vw solid #4D3142' // Bar styling added here to make it quicker to change values\n\t// Check what page we are on and retrieve the correct element based on the URL\n\tif (subPage.toLowerCase() === 'contact') {\n\t\t// For \"kontakt oss\"\n\t\tlet currentElement = document.getElementById('NavBarContact')\n\t\tcurrentElement.style.borderBottom = activeBarStyling\n\t} else if (subPage.toLowerCase() === 'baking101') {\n\t\t// For \"Baketips\"\n\t\tlet currentElement = document.getElementById('NavBarTechnique')\n\t\tcurrentElement.style.borderBottom = activeBarStyling\n\t} else if (subPage.toLowerCase() === 'recipe_list') {\n\t\t// For \"Oppskrifter\"\n\t\tlet currentElement = document.getElementById('NavBarRecipes')\n\t\tcurrentElement.style.borderBottom = activeBarStyling\n\t} else {\n\t}\n}", "_handleResize() {\n if ($('.navigation-mobile').is(':hidden')) {\n this._toggleMobileNav(false);\n }\n\n this._positionNavigation();\n this._navigationScroll(true);\n }", "function getNavBarName() {\n return $(window).height() >= (55/67) * $(window).width() - (325/67) ? \"SARA GW\" : \"SARA GOLDSTEIN-WEISS\";\n}", "function handleSmallScreens() {\r\n document.querySelector('.navbar-toggler')\r\n .addEventListener('click', () => {\r\n let navbarMenu = document.querySelector('.navbar-menu')\r\n\r\n if (navbarMenu.style.display === 'flex') {\r\n navbarMenu.style.display = 'none'\r\n return\r\n }\r\n\r\n navbarMenu.style.display = 'flex'\r\n })\r\n}", "function myToggler() {\n const x = document.getElementById(\"myTopnav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n}", "function setNavTabIndex() {\n const $navList = $(\".nav-list\").find(\"a\");\n if ($(\"nav\").hasClass(\"open-nav\") || window.innerWidth > 768) {\n $navList.attr(\"tabindex\", \"0\");\n } else {\n removeNav();\n $navList.attr(\"tabindex\", \"-1\");\n }\n}", "function addClassForSmallNav() {\n var windowWidth = window.innerWidth,\n mainNav = $(\"#navbar > ul\");\n \n if (windowWidth < 992) {\n mainNav.addClass(\"small-nav\");\n } else {\n mainNav.removeClass(\"small-nav\");\n }\n }", "function switchNavBar(){\n if (this.scrollY < 45){\n if (document.querySelector(\".navbar-toggler\").getAttribute(\"aria-expanded\") === \"true\" || false){\n document.querySelector(\".navbar\").classList.remove(\"topNavBar\");\n }\n else{\n document.querySelector(\".navbar\").classList.add(\"topNavBar\");\n }\n }\n}", "function responsiveIcon() {\n const nav = document.getElementById(\"myTopnav\");\n if (nav.className === \"topnav\") {\n nav.className += \" responsive\";\n } else {\n nav.className = \"topnav\";\n }\n}", "function openNav() {\n document.getElementById(\"myNav\").style.height = \"100%\";\n }", "function nonMobileDisplayNav() {\n // hamburger nav is only displayed at mobile media query size\n // bit of a hack\n var isNonMobile = $(\".hamburger-icon\").css(\"display\") === \"none\"\n if (isNonMobile) {\n $('#secondary-nav').css({\"height\": getNavHeight() + \"px\"});\n } else {\n var isMenuExpanded = $(\".hamburger-icon\").hasClass(\"hamburger-icon-open\");\n if (isMenuExpanded) {\n $('#secondary-nav').css({\"height\": getNavHeight() + \"px\"});\n } else {\n $('#secondary-nav').css({\"height\": \"0\"});\n }\n }\n }", "function viewNavbar_mobile(){\t\n\tif(showNavbar){\n\t\tif(window.pageYOffset<75)\n\t\t\topacity.style.display = \"none\";\n\t\telse\n\t\t\tdocument.getElementById(\"navbar-mobile-fixed\").style.display= \"none\";\n\t\tnav.style.display = \"flex\";\n\t}\n\telse{\n\t\tif(window.pageYOffset<75)\n\t\t\topacity.style.display = \"block\";\n\t\telse\n\t\t\tdocument.getElementById(\"navbar-mobile-fixed\").style.display= \"flex\";\n\t\tnav.style.display = \"none\";\n\t}\n\tshowNavbar = !showNavbar;\n}", "function resizingNav() {\n // at1400();\n if ($(window).width() < 480) {\n $('#account-links').hide(100);\n $(' div.arrow-down').show(200);\n $('div#welcome-message p').first().prependTo('#page-top');\n $($(\"nav.secondary-nav a\").get().reverse()).each(function(index) {\n $(this).detach().prependTo(\".hidden-menu-s\");\n })\n $(\"nav.secondary-nav\").addClass('hidden');\n $(\".ham-menu-s\").removeClass('hidden');\n\n $(\"nav.MainNav a\").each(function(index) {\n $(this).detach().appendTo(\".hidden-menu-m\");\n })\n $(\"nav.MainNav\").addClass('hidden');\n $(\".ham-menu-m\").removeClass('hidden');\n }\n else {\n $('#page-top p').first().prependTo('#welcome-message');\n $(\"nav.secondary-nav\").removeClass('hidden');\n $(\"nav.MainNav\").removeClass('hidden');\n if ($(window).width() < 1024) {\n $('#account-links').hide(100);\n $(' div.arrow-down').show(200);\n }\n else {\n $(' div.arrow-down').hide('easing');\n $('#account-links').show('easing');\n if ($(window).width() > 1400) {\n $('.hidden-menu-s a').each(function(index) {\n $(this).detach().appendTo(\"nav.secondary-nav\");\n })\n $(\".hidden-menu-s\").addClass('hidden');\n $(\".ham-menu-s\").addClass('hidden');\n\n $($('.hidden-menu-m a').get().reverse()).each(function(index) {\n $(this).detach().prependTo(\"nav.MainNav\");\n })\n $(\".hidden-menu-m\").addClass('hidden');\n $(\".ham-menu-m\").addClass('hidden');\n }\n }\n }\n\n\n}", "function smallMenuButton() {\n var x = document.querySelector(\"topnav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n}", "resize () {\n if (window.innerWidth >= 992) {\n this.button.classList.remove('is-active')\n this.button.classList.add('collapsed')\n this.setOverlay(false)\n this.navbarCollapse.classList.remove('show')\n } else {\n this.setOverlay(true)\n }\n }", "function toggleNavBar () {\n $('#navigatorbar').toggleClass('show');\n $('.sub-nav').toggleClass('show');\n $('#thumbnail').removeClass('active');\n }", "function setBarSize(size) {\n /* jshint validthis:true */\n var barMinSize = this.barMinSize || 20;\n\n if (size > 0 && size < barMinSize) {\n size = barMinSize;\n }\n\n if (this.bar) {\n $(this.bar).css(this.origin.size, parseInt(size, 10) + 'px');\n }\n }", "function windowResize() {\n if( $(window).width() < 768 ) {\n $(\".navbar-custom\").css(\"background-color\", \"black\"); \n $(\".navbar-custom .navbar-nav li a\").css(\"text-align\", \"center\"); \n }\n else\n $(\".navbar-custom\").css(\"background-color\", \"rgba(255,255,255,0)\");\n }", "function toggleNavbarShrink() {\n //Shrink navbar after scrolling\n $(window).scroll(function() {\n // For all pages except for albums - fixed-top navbar\n if ($(window).width() > 767) {\n if ($(window).scrollTop()> 100) {\n $(\".navbar.fixed-top\").addClass(\"navbar-shrink\");\n } else {\n $(\".navbar.fixed-top\").removeClass(\"navbar-shrink\");\n }\n } else {\n $(\".navbar.fixed-top\").removeClass(\"navbar-shrink\");\n }\n });\n }", "function setGutterHeight(){\n var header = document.querySelector('.navbar'),\n gutter = document.querySelector('.header_gutter');\n gutter.style.height = header.offsetHeight + 'px';\n }", "function view_home_resize() {\n\t\t\n\t}", "function stickyNav(){\n\tvar height = window.innerHeight - 50;\n\tif (window.pageYOffset > height){\n\t\tvar navbar = document.getElementsByTagName('nav')[0];\n\t\tnavbar.classList.add('fixed');\n\t}\n\tif (window.pageYOffset < height){\n\t\tvar navbar = document.getElementsByTagName('nav')[0];\n\t\tnavbar.classList.remove('fixed');\n\t}\n}", "resetNav() {\n $(\".nav-canvas\").css(\"position\", \"\")\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-hide\")\n $(\".navbar\").removeClass(\"navslide-hide\")\n $(\".nav-canvas\").removeClass(\"navslide-hide\")\n }", "function navResponsive() {\n \n if (screenWidth > 991) {\n \n $(\".main-nav .navbar-nav > .dropdown > a\").attr(\"data-toggle\", \"\");\n $(\".main-nav .navbar-nav.nav-search > .dropdown > a\").attr(\"data-toggle\", \"dropdown\");\n $('.main-nav .navbar-nav > .dropdown').removeClass('open');\n $('.main-nav .navbar-nav .dropdown-submenu').removeClass('open');\n $('.main-nav .navbar-nav > li').find(':focus').blur();\n if ( $('.main-nav .navbar-collapse').hasClass('in') ) {\n $('.main-nav .navbar-collapse').removeClass('in');\n }\n if($('.navbar-toggle').hasClass('active')){\n $('.navbar-toggle').removeClass('active');\n }\n \n }\n else if (screenWidth <= 991) {\n \n $(\".main-nav .navbar-nav > .dropdown > a\").attr(\"data-toggle\", \"dropdown\");\n $('.main-nav .nav > li .dropdown-menu').removeAttr('style');\n $('.main-nav .nav > li > .dropdown-menu').removeAttr('style');\n \n }\n}", "function navAppend(w) {\n var nav = $('.top-nav');\n\n if (w < 1024 && !$('#flyout-menu .top-nav').length) {\n nav.prependTo('#flyout-menu');\n nav.find('.mega-menu-target').hide();\n } \n\n if (w > 1023 && !$('.top-nav-wrapper .top-nav').length) {\n nav.prependTo('.top-nav-wrapper');\n nav.find('.mega-menu-target').show();\n } \n }", "function navigationShadow() {\n navBar = document.getElementsByClassName('navigation--top');\n if(navBar.length > 0){\n navHeightOnMobile = navBar[0].clientHeight;\n navHeightOnDesktop = navBar[1].clientHeight;\n\n var navOffset = window.pageYOffset;\n if (navHeightOnMobile != 0 || navHeightOnDesktop != 0) {\n if (navOffset >= 20) {\n navBar[0].setAttribute('style', shadowIn);\n navBar[1].setAttribute('style', shadowIn);\n } else {\n navBar[0].setAttribute('style', shadowOut);\n navBar[1].setAttribute('style', shadowOut);\n };\n };\n }\n\n var applicableNavSize = largerOfTwo(navHeightOnMobile, navHeightOnDesktop) - 25;\n mainBody.setAttribute('style', 'padding-top:' + applicableNavSize + 'px;');\n}", "function openNav() {\n document.getElementById(\"navbar-side\").style.width = \"80%\";\n }", "function adjustMobileLogo(nav){\n\n var isMobileLogo = nav.find('.mobile-logo');\n nav.find('.mobile-logo').remove();\n\n var mxHeight = nav.find('.mobile-menu-items').first().outerHeight();\n\n isMobileLogo.find('img')\n .css({\n 'max-height': mxHeight\n });\n nav.find('li.logo img')\n .css({\n 'max-height': mxHeight\n });\n $('.navbar.l1').length > 0 ?\n nav.find('li.logo').remove()\n : '';\n\n nav.find('.mobile-menu-items').prepend(isMobileLogo);\n return false;\n\n\n }", "function myFunction() {\n var x = document.getElementById(\"myTopnav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n }", "function showNav() {\n $('.mobile-nav-button').removeClass('active');\n $('.mobile-search-button').removeClass('active');\n //if (($(window).width() >= MIN_NON_TABLET_SIZE && !Modernizr.ipad) || ($(window).width()<MIN_NON_TABLET_SIZE && $('header.ot, header.campaign').length==0)) {\n //if ($(window).width() > MIN_NON_TABLET_SIZE && !Modernizr.ipad) {\n if ($(window).width() > MIN_NON_MOBILE_SIZE) {\n $('.main-header-nav').show().css({'height':'', 'right':''});\n }\n else {\n $('.main-header-nav').hide().find('.active').removeClass('active');\n $('.main-header-nav > ul').css('left', '0px');\n }\n showDisplayName();\n}", "function updNav () {\n let pos = [\n window.pageYOffset,\n document.documentElement.scrollTop,\n document.body.scrollTop\n ]\n let nav = document.getElementById(\"navbar\");\n let themeColor = {\n 'setting': document.getElementById('theme_color'),\n 'background': document.getElementById('theme_color_bg').content,\n 'theme': document.getElementById('theme_color_tm').content\n };\n\n if(pos[1] > 0 || pos[2] > 0 || pos[3] > 0) {\n nav.setAttribute(\"data-at-top\", false);\n themeColor.setting.content = themeColor.theme;\n }\n else {\n nav.setAttribute(\"data-at-top\", true);\n themeColor.setting.content = themeColor.background;\n }\n}", "function open_navbar() {\n\n\tif (mobile === false) {\n\t\tdocument.querySelector(\".nav-bar-outerdiv\").style.width = \"30rem\";\n\t\tdocument.querySelector(\"#nav-bar-icon-close\").style.display = \"inline-block\";\n\t\tdocument.querySelector(\"#nav-bar-icon-open\").style.display = \"none\";\n\t}\n\n\telse {\n\t\tdocument.querySelector(\".nav-bar-outerdiv\").style.width = \"100%\";\n\t\tdocument.querySelector(\"#nav-bar-icon-close\").style.display = \"inline-block\";\n\t\tdocument.querySelector(\"#nav-bar-icon-open\").style.display = \"none\";\n\t}\n}", "function initNavbar() {\n\n \t\tvar distanceY = window.pageYOffset || document.documentElement.scrollTop,\n \t\t\tshrinkOn = 1,\n \t\t\theader = document.querySelector(\"header\");\n \t\t//expandNav = document.querySelector(\"#header-wrap .header\");\n \t\tif (distanceY > shrinkOn) {\n \t\t\tclassie.add(header, \"smaller\");\n \t\t\t//classie.add(expandNav, \"expandedNav\");\n \t\t} else {\n \t\t\tif (classie.has(header, \"smaller\")) {\n \t\t\t\tclassie.remove(header, \"smaller\");\n \t\t\t\t//classie.remove(expandNav, \"expandedNav\");\n \t\t\t}\n \t\t}\n\n \t}", "function myFunctionForResponsive() {\n navbar.classList.toggle('responsive');\n }", "function scrollNav(){\n if(document.documentElement.scrollTop > 200 || document.documentElement.scrollTop > 200){\n document.getElementById('nav-1').className = \"navbar sticky-top py-1 fondo-nav \"\n }else{\n document.getElementById('nav-1').className = \" navbar navbar-expand-lg bg-light shadow-lg\"\n }\n}", "function respNavbar() {\n var x = document.getElementById(\"navbar1\");\n \n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n\n if (x.className === \"navbar\") {\n x.className += \" responsive\";\n } else {\n x.className = \"navbar\";\n }\n}", "function setSkinListHeightAndScroll() {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.demo-choose-skin');\n\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '4px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "function setSkinListHeightAndScroll() {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.demo-choose-skin');\n\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '4px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "function responsiveMenuHandler() {\n if (responsive === \"navbar bigNav\") {\n setResponsive(\"navbar bigNav responsive\");\n } else {\n setResponsive(\"navbar bigNav\")\n }\n }", "function navFixed() {\n var heightNav = $('.topbar-fixed').outerHeight();\n var heightTopBar = $('.topbar-absolute').outerHeight(true);\n $('.topbar-absolute').parent().css('height', heightNav);\n var topHambu = parseInt($('.side-nav__boton-sideNav').css('top'), 10);\n var scrollPx = $(this).scrollTop();\n\n var pxinit = 16;\n var heightSetted = false;\n\n function setHeight() {\n $('.topbar-helper').css('height', heightTopBar);\n heightSetted = true;\n }\n\n function resetHeight() {\n $('.topbar-helper').css('height', 0);\n heightSetted = false;\n }\n\n function px() {\n return pxinit - scrollPx;\n }\n\n $(window).scroll(function () {\n scrollPx = $(this).scrollTop();\n if (scrollPx <= 16) {\n $('.topbar-absolute').removeClass(\"stick\");\n resetHeight();\n } else {\n $('.topbar-absolute').addClass(\"stick\");\n if (!heightSetted) setHeight();\n }\n });\n}", "function setMenu() {\n\n\t\tvar w = parseInt($(\"nav\").css(\"width\"), 10);\n\n\t\tif (w < 1200) {\n\n\t\t\tif ($(\"#navigator2\").is(':empty')) {\n\t\t\t\t$(\"#navigator2\").prepend($(\"#IndexNav\"), $(\"#productsNav\"),$(\"#contactNav\"),$(\"#accountNav\"), $(\"#cartNav\"));\n\t\t\t\t$(\"#productsNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#accountNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#miniNavigator\").show();\n\t\t\t\t$(\"#miniNavigator\").effect(\"highlight\", { color: 'green' }, 500);\n\t\t\t\t$(\"#navigator2\").hide();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$(\"#navigator\").prepend($(\"#IndexNav\"), $(\"#productsNav\"),$(\"#contactNav\"),$(\"#accountNav\"), $(\"#cartNav\"));\n\t\t\t$(\"#productsNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#accountNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#miniNavigator\").hide();\n\t\t\t}\n\t}", "function setBottomPaddingToZero() {\n\tif (window.innerWidth > 700) {\n\t\tnavigation.style.paddingBottom = \"0%\";\n\t}\n}", "renderNavigation() {\n if (this.state.windowWidth <= 524) {\n return (\n <div className=\"mobile-nav\">\n <p className=\"mobile-bars\" onClick={this.handleNavClick}>\n <i className=\"fa fa-bars\" id=\"hamburger\" aria-hidden=\"true\" />\n </p>\n {this.renderMobileNav()}\n </div>\n );\n }\n return (\n <div className=\"navbar\">\n {this.navigationLinks()}\n </div>\n );\n }", "function Navigation2() {\n return (\n <div>\n <div id=\"nav\">\n \n <Navbar className=\"color-nav\" variant=\"light\">\n <div className=\"mininav\">\n <Nav>\n <Link to={\"products\"}>\n <div className=\"shopbutton\">\n <Button\n variant=\"outline-success\"\n size=\"sm\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <b>Shop</b>\n </Button>\n </div>\n </Link>\n <div className=\"checkbutton\">\n \n <Customs/>\n \n </div>\n \n </Nav>\n </div>\n </Navbar>\n </div>\n </div>\n );\n}", "function myFunction() {\n var x = document.getElementById(\"myTopnav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n }", "function fixedTopNav() {\n if ($(window).scrollTop() > 1) {\n $('#main-header').addClass('fixed-block');\n } else {\n $('#main-header').removeClass('fixed-block');\n }\n if ($(window).outerWidth() > 992) {\n $('#main-header').removeClass('fixed-block');\n }\n }", "function openNav() {\n document.getElementById('top-nav').style.height = \"43vh\";\n document.getElementById('close-btn').style.display = \"block\";\n // document.getElementById('mother-container').style.marginTop = \"50vh\";\n}", "function ToggleNavBar() {\n var x = document.getElementById(\"myTopnav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n}", "function Navigation() {\n return (\n <Container>\n <Navbar bg=\"light\" className=\"mb-4\" expand=\"lg\">\n <Navbar.Brand href=\"#home\"><Sun className=\"ms-4\"/>Pogoda dziś</Navbar.Brand>\n <Navbar.Toggle aria-controls=\"basic-navbar-nav\" />\n <Navbar.Collapse id=\"basic-navbar-nav\">\n <Nav className=\"me-auto text-center\">\n <Nav.Link href=\"#warning\">Ostrzeżenia</Nav.Link>\n <Nav.Link href=\"#info\">Informacje</Nav.Link>\n </Nav>\n </Navbar.Collapse>\n </Navbar>\n </Container>\n );\n}", "function myFunction() {\n var x = document.getElementById(\"myTopnav\");\n console.log(x);\n // console.log({this.state.topNav_className});\n if (x.className === \"w3-bar w3-dark-grey w3-green topnav\") {\n x.className += \" responsive\";\n }\n else {\n x.className = \"w3-bar w3-dark-grey w3-green topnav\";\n }\n\n // var y = document.getElementById(\"myTopnav2\");\n // if (y.className === \"topnav\"){\n // y.className += \" responsive\";\n // }\n // else{\n // //sync test nav bar as well\n // y.className = \"topnav\";\n // }\n }", "showResponsive () {\n let width = document.body.clientWidth\n\n if(width > 900) {\n this.setState({\n navbar: false,\n animation: !this.state.animation\n })\n }else {\n this.setState({\n navbar: true\n })\n }\n\n }", "function updateNavigation() {\n\tvar btnTop = $('#btnTop');\n\tvar dropDownMenu = $('.dropdown-menu');\n\tvar scroll = $(window).scrollTop();\n\tvar win_height = ($(\"header\").height())/3;\n\tvar $myNavBar = $(\".navbar\");\n\tvar $navElt = $(\".navbar-left a\");\n\tvar heightClient = win_height - scroll;\n\n\tif (heightClient <= 0) {\n\t\t$myNavBar.css({\"background-color\": \"#FFA1B5\"});\n\t\t$navElt.css({\"color\": \"white\"});\n\t\tdropDownMenu.css({\"width\": \"100%\"}, {\"background-color\": \"#FFA1B5 !important\"});\n\t\tbtnTop.show();\n\t\tsocialMenu.show();\n\n\t} else {\n\t\t$myNavBar.css({\"background-color\": \"transparent\"});\n\t\tdropDownMenu.css({\"background-color\": \"#FFA1B5 !important\"});\n\t\t$navElt.css({\"color\": \"white\"});\n\t\tbtnTop.hide();\n\t\tsocialMenu.hide();\n\t}\n}", "function Navbar() {\n return (\n <nav className=\"navbar is-transparent is-fixed-top\">\n <div className=\"container\">\n <div className=\"navbar-brand\">\n <a className=\"navbar-item\" href=\"#home\">\n {/* <img id=\"logo\" src={logo}></img> */}\n <h1>🍑 PASSION FRUITION</h1>\n </a>\n <div className=\"navbar-burger burger\" data-target=\"navbarExampleTransparentExample\">\n <span></span>\n <span></span>\n <span></span>\n </div>\n </div>\n\n <div id=\"navbarExampleTransparentExample\" className=\"navbar-menu\">\n <div className=\"navbar-start\">\n {/* <a className=\"navbar-item\" href=\"https://bulma.io/\">\n Home\n </a> */}\n </div>\n\n <div className=\"navbar-end\">\n {/* <a className=\"navbar-item nav-link\" href=\"#about-section\">\n ABOUT\n </a> */}\n <a className=\"navbar-item nav-link\" href=\"#portfolio\">\n <h1>PROJECTS</h1>\n </a>\n {/* <a className=\"navbar-item nav-link\" href=\"#contact\">\n CONTACT\n </a> */}\n <div className=\"buttons\">\n {/* <a className=\"navbar-item button resume\" target=\"_blank\" href={resume}>\n RESUME\n </a> */}\n </div>\n \n </div>\n </div>\n </div>\n \n </nav>\n )\n}", "function fix_height() {\n var heightWithoutNavbar = $(\"body > #wrapper\").height() - 61;\n $(\".sidebard-panel\").css(\"min-height\", heightWithoutNavbar + \"px\");\n\n var navbarHeigh = $('nav.navbar-default').height();\n var wrapperHeigh = $('#page-wrapper').height();\n\n if(navbarHeigh > wrapperHeigh){\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\n }\n\n if(navbarHeigh < wrapperHeigh){\n $('#page-wrapper').css(\"min-height\", $(window).height() + \"px\");\n }\n\n if ($('body').hasClass('fixed-nav')) {\n if (navbarHeigh > wrapperHeigh) {\n $('#page-wrapper').css(\"min-height\", navbarHeigh + \"px\");\n } else {\n $('#page-wrapper').css(\"min-height\", $(window).height() - 60 + \"px\");\n }\n }\n\n }", "function navBarOnClick() {\n var x = document.getElementById(\"navigation\");\n if (x.className === \"navigation\") {\n x.className += \" responsive\";\n } else {\n x.className = \"navigation\";\n }\n}", "function resizeScreen() {\n // If navbarMenu is Open, Close It\n if (navbarMenu.classList.contains('active')) {\n toggleMenu();\n }\n\n // If menuItemHasChildren is Expanded, Collapse It\n if (navbarMenu.querySelector('.menu-item-has-children.active')) {\n collapseSubMenu();\n }\n }", "function backtoTop() {\r\n var Hwith = window.innerWidth || document.documentElement && document.documentElement.clientWidth || 0;\r\n $(\".backtoTop\").removeClass(\"autohide\");\r\n if (Hwith >= 1339) {\r\n $(\".backtoTop\").removeClass(\"backfix-s\").addClass(\"backfix\");\r\n } else if (Hwith < 1339) {\r\n $(\".backtoTop\").removeClass(\"backfix\").addClass(\"backfix-s\");\r\n }\r\n }", "function changeNavbar() {\n const header = document.querySelector(\".topnav\");\n\n if (header.className === \"topnav\") {\n header.className += \" responsive\"\n } else {\n header.className = \"topnav\"\n }\n}", "function checkWidth() {\n if ($(window).width() < 514) {\n $('nav').removeClass('flex-column').addClass('d-flex').addClass('justify-content-between').addClass('align-items-top');\n } else {\n $('nav').removeClass('d-flex').removeClass('justify-content-between').removeClass('align-items-top').addClass('flex-column');\n }\n }", "function initScalingNavigation() {\r\n\tinitAutoScalingNav({\r\n\t\tmenuId: 'nav',\r\n\t\tconstant: 12,\r\n\t\tsideClasses: true\r\n\t});\r\n}", "function windowResizing() {\n if ($(window).width() > 992) {\n $(\"body\").removeClass(\"menuExpanded\");\n } else if ($(window).width() < 992 && $(\"#mobile-nav\").hasClass('show')) {\n $(\"body\").addClass(\"menuExpanded\");\n }\n}", "function show_menu_bars(){\n if(window.innerWidth <= 1000){\n setAct(true)\n setNavs(false)\n }\n else{\n setAct(false)\n setNavs(true)\n }\n }", "function menuSet(self){\n\t\tvar browserWidth = window.innerWidth;\n\t\tvar heightMenu = window.innerHeight - document.querySelector(\".main-menu\").getBoundingClientRect().bottom + \"px\";\n\t\tvar menuPosition = document.querySelector(\".main-menu\").getBoundingClientRect().bottom;\n\n\t\tif (browserWidth < 800 ) {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": heightMenu,\n\t\t\t\t\"position\": \"fixed\",\n\t\t\t\t\"top\": menuPosition +\"px\"\n\t\t\t});\n\n\t\t} else {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": \"\",\n\t\t\t\t\"top\": \"\",\n\t\t\t\t\"position\": \"\"\n\t\t\t});\n\t\t}\n\n\t}" ]
[ "0.6847338", "0.6158481", "0.6026186", "0.59826857", "0.59813595", "0.59051234", "0.589477", "0.5889853", "0.5866561", "0.58425844", "0.5840603", "0.5729784", "0.5727374", "0.5681031", "0.5634386", "0.56171983", "0.56153685", "0.55989206", "0.55475205", "0.55397195", "0.55280983", "0.5518902", "0.5510044", "0.55053407", "0.5499797", "0.54921705", "0.5488256", "0.54693985", "0.54623955", "0.5448096", "0.5427493", "0.5427493", "0.5425433", "0.54130924", "0.5411033", "0.5408503", "0.54061896", "0.5405127", "0.54026866", "0.53919834", "0.5386013", "0.5383364", "0.537898", "0.5376468", "0.5375717", "0.5356356", "0.53561866", "0.53538233", "0.53531533", "0.5335928", "0.53351724", "0.53317004", "0.53147656", "0.5313045", "0.5303724", "0.5303465", "0.5291714", "0.5288477", "0.52816254", "0.52769125", "0.5273128", "0.5269978", "0.5269608", "0.5268046", "0.52473813", "0.52431476", "0.523628", "0.5233706", "0.52285177", "0.5226031", "0.52180797", "0.52136767", "0.5212826", "0.52102554", "0.51941967", "0.51941967", "0.5191474", "0.5186157", "0.5185329", "0.5183048", "0.5182874", "0.51802576", "0.5179031", "0.51778907", "0.51727253", "0.5168617", "0.51652896", "0.51649565", "0.5157272", "0.51566803", "0.51548517", "0.51544374", "0.5153307", "0.5152735", "0.515207", "0.5150991", "0.5149426", "0.51492476", "0.5146478", "0.5146286", "0.51458216" ]
0.0
-1
remove absolute position for nav bar
function removeAbsolutePosition() { userBar.classList.remove("position-absolute"); userBar.style.right = "0px"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetNav() {\n $(\".nav-canvas\").css(\"position\", \"\")\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-hide\")\n $(\".navbar\").removeClass(\"navslide-hide\")\n $(\".nav-canvas\").removeClass(\"navslide-hide\")\n }", "function resetNavbar()\n {\n $(\"#nav-bar\").css(\"background-color\", navBarOriginCol);\n $(\"#nav-bar .link\").each(function(){\n $(this).find(\"div:first\").removeClass(\"hovered\");\n });\n }", "function positionNavLinks() {\n\tif (getBrowserWidth() < 992) {\n\t\tnavMenu.appendChild(navLinks);\n\n\t\t// remove transform from all submenus\n\t\tfor (var i = 0; i < navSubmenus.length; i++) {\n\t\t\tvar submenu = navSubmenus[i];\n\t\t\tsubmenu.style.transform = \"none\";\n\t\t}\n\t} else if (getBrowserWidth() >= 992) {\n\t\tnavContainer.appendChild(navLinks);\n\n\t\t// set default transform for all submenus\n\t\tfor (var i = 0; i < navSubmenus.length; i++) {\n\t\t\tvar submenu = navSubmenus[i];\n\t\t\tsubmenu.style.transform = \"translateX(-50%) translateY(25%)\";\n\t\t}\n\t}\n}", "function positionNav() {\n var nav = $('nav');\n var windowHeight = $(window).height();\n var positionBottom = windowHeight - nav.outerHeight(true);\n var scrollVal = $(window).scrollTop();\n\n if ( scrollVal > positionBottom ) {\n nav.css({'position':'fixed','top' :'0px'});\n } else {\n nav.css({'position':'absolute','top': positionBottom +'px'});\n }\n\n $(window).scroll(function() {\n var scrollVal = $(this).scrollTop();\n if ( scrollVal > positionBottom ) {\n nav.css({'position':'fixed','top' :'0px'});\n } else {\n nav.css({'position':'absolute','top': positionBottom +'px'});\n }\n });\n\n }", "function fix_position() {\n var uwidth = $('#user-nav > ul').width();\n $('#user-nav > ul').css({ width: uwidth, 'margin-left': '-' + uwidth / 2 + 'px' });\n\n var cwidth = $('#content-header .btn-group').width();\n $('#content-header .btn-group').css({ width: cwidth, 'margin-left': '-' + uwidth / 2 + 'px' });\n }", "function fix_position()\n\t{\n\t\tvar uwidth = $('#user-nav > ul').width();\n\t\t$('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'});\n \n var cwidth = $('#content-header .btn-group').width();\n $('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'});\n\t}", "function fix_position()\n\t{\n\t\tvar uwidth = $('#user-nav > ul').width();\n\t\t$('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'}); \n \n\t}", "function closeNav() {\n document.getElementById(\"myNav\").style.left = \"-100vw\";\n }", "function offSetManager() {\n\n var yOffset = 0;\n var currYOffSet = window.pageYOffset;\n\n if (yOffset < currYOffSet) {\n myNavBar.add();\n } else if (currYOffSet == yOffset) {\n myNavBar.remove();\n }\n }", "function RepositionNav(){\n\tvar windowHeight = $(window).height(); //get the height of the window\n\tvar navHeight = $('#nav').height() / 2;\n\tvar windowCenter = (windowHeight / 2); \n\tvar newtop = windowCenter - navHeight;\n\t$('#nav').css({\"top\": newtop}); //set the new top position of the navigation list\n}", "function setNavPlacementInDom () {\n var isFirst = navContainer[0].firstElementChild === nav[0];\n if (mobileSize && isFirst) { // move to last\n nav.remove();\n navContainer.append(nav);\n } else if (!mobileSize && !isFirst) { // move to first\n nav.remove();\n navContainer.prepend(nav);\n }\n }", "function fixAlignment() {\n if (window.pageYOffset > 40) {\n $(\".nav-wrapper\").addClass('white');\n } else {\n $(\".nav-wrapper\").removeClass('white');\n }\n}", "function closeNav() {\n document.getElementById(\"menubar\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "function fix_position()\r\n\t{\r\n\t\tvar uwidth = $('#user-nav > ul').width();\r\n\t\t$('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'});\r\n \r\n var cwidth = $('#content-header .btn-group').width();\r\n $('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'});\r\n\t}", "function reposition_topnav() {\n if($('.nav-horizontal').length > 0) {\n\n // top navigation move to left nav\n // .nav-horizontal will set position to relative when viewed in screen below 1024\n if($('.nav-horizontal').css('position') == 'relative') {\n\n if($('.left-panel .nav-bracket').length == 2) {\n $('.nav-horizontal').insertAfter('.nav-bracket:eq(1)');\n } else {\n // only add to bottom if .nav-horizontal is not yet in the left panel\n if($('.left-panel .nav-horizontal').length == 0)\n $('.nav-horizontal').appendTo('.left-panelinner');\n }\n\n $('.nav-horizontal').css({display: 'block'})\n .addClass('nav-pills nav-stacked nav-bracket');\n\n $('.nav-horizontal .children').removeClass('dropdown-menu');\n $('.nav-horizontal > li').each(function() {\n\n $(this).removeClass('open');\n $(this).find('a').removeAttr('class');\n $(this).find('a').removeAttr('data-toggle');\n\n });\n\n if($('.nav-horizontal li:last-child').has('form')) {\n $('.nav-horizontal li:last-child').hide();\n }\n\n } else {\n // move nav only when .nav-horizontal is currently from left-panel\n // that is viewed from screen size above 1024\n if($('.left-panel .nav-horizontal').length > 0) {\n\n $('.nav-horizontal').removeClass('nav-pills nav-stacked nav-bracket')\n .appendTo('.topnav');\n $('.nav-horizontal .children').addClass('dropdown-menu').removeAttr('style');\n $('.nav-horizontal li:last-child').show();\n $('.nav-horizontal > li > a').each(function() {\n\n $(this).parent().removeClass('nav-active');\n\n if($(this).parent().find('.dropdown-menu').length > 0) {\n $(this).attr('class','dropdown-toggle');\n $(this).attr('data-toggle','dropdown');\n }\n\n });\n }\n\n }\n\n }\n }", "function offSetManager(){\n \n var yOffset = 0;\n var currYOffSet = window.pageYOffset;\n \n if(yOffset < currYOffSet) {\n myNavBar.add();\n }\n else if(currYOffSet == yOffset){\n myNavBar.remove();\n }\n \n }", "function offSetManager(){\n \n var yOffset = 0;\n var currYOffSet = window.pageYOffset;\n \n if(yOffset < currYOffSet) {\n myNavBar.add();\n }\n else if(currYOffSet == yOffset){\n myNavBar.remove();\n }\n \n }", "function offSetManager(){\n\n var yOffset = 0;\n var currYOffSet = window.pageYOffset;\n\n if(yOffset < currYOffSet) {\n myNavBar.add();\n }\n else if(currYOffSet == yOffset){\n myNavBar.remove();\n }\n\n }", "function navbarShow() {\n $$('.main--navbar').removeClass('navbar-hidden');\n $$('.main--content').removeClass('align-top');\n}", "function reposition_topnav() {\n if(jQuery('.nav-horizontal').length > 0) {\n\n // top navigation move to left nav\n // .nav-horizontal will set position to relative when viewed in screen below 1024\n if(jQuery('.nav-horizontal').css('position') == 'relative') {\n\n if(jQuery('.leftpanel .nav-bracket').length == 2) {\n jQuery('.nav-horizontal').insertAfter('.nav-bracket:eq(1)');\n } else {\n // only add to bottom if .nav-horizontal is not yet in the left panel\n if(jQuery('.leftpanel .nav-horizontal').length == 0)\n jQuery('.nav-horizontal').appendTo('.leftpanelinner');\n }\n\n jQuery('.nav-horizontal').css({display: 'block'})\n .addClass('nav-pills nav-stacked nav-bracket');\n\n jQuery('.nav-horizontal .children').removeClass('dropdown-menu');\n jQuery('.nav-horizontal > li').each(function() {\n\n jQuery(this).removeClass('open');\n jQuery(this).find('a').removeAttr('class');\n jQuery(this).find('a').removeAttr('data-toggle');\n\n });\n\n if(jQuery('.nav-horizontal li:last-child').has('form')) {\n jQuery('.nav-horizontal li:last-child form').addClass('searchform').appendTo('.topnav');\n jQuery('.nav-horizontal li:last-child').hide();\n }\n\n } else {\n // move nav only when .nav-horizontal is currently from leftpanel\n // that is viewed from screen size above 1024\n if(jQuery('.leftpanel .nav-horizontal').length > 0) {\n\n jQuery('.nav-horizontal').removeClass('nav-pills nav-stacked nav-bracket')\n .appendTo('.topnav');\n jQuery('.nav-horizontal .children').addClass('dropdown-menu').removeAttr('style');\n jQuery('.nav-horizontal li:last-child').show();\n jQuery('.searchform').removeClass('searchform').appendTo('.nav-horizontal li:last-child .dropdown-menu');\n jQuery('.nav-horizontal > li > a').each(function() {\n\n jQuery(this).parent().removeClass('nav-active');\n\n if(jQuery(this).parent().find('.dropdown-menu').length > 0) {\n jQuery(this).attr('class','dropdown-toggle');\n jQuery(this).attr('data-toggle','dropdown');\n }\n\n });\n }\n\n }\n\n }\n }", "function DisableTopNavigationBar() {\n $('#topNavigationBar').find('a').prop('disabled', true);\n $('#topNavigationBar a').click(function (e) {\n e.preventDefault();\n });\n $('#topNavigationBar').css(\"visibility\", \"hidden\");\n }", "function offSetManager(){\n\n var yOffset = 0;\n var currYOffSet = window.pageYOffset;\n\n if(yOffset < currYOffSet) {\n myNavBar.add();\n }\n else if(currYOffSet == yOffset){\n myNavBar.remove();\n }\n\n }", "function unhide_navi(){\n document.querySelector('.navbar__menu').style.display = 'block';\n}", "function menuFix() {\n // When user scrolls past original position of nav\n if ($(window).scrollTop() >= navOffset) {\n $('nav.site-nav').addClass('navbar-fixed-top'); // add fixed position to nav,\n $('#cu-identity-wrap').addClass('menu-margin'); // account for new gap in page flow,\n } else {\n $('nav.site-nav').removeClass('navbar-fixed-top');\n $('#cu-identity-wrap').removeClass('menu-margin');\n }\n }", "function offSetManager() {\n\n var yOffset = 0;\n var currYOffSet = window.pageYOffset;\n\n if (yOffset < currYOffSet) {\n myNavBar.add();\n } else if (currYOffSet == yOffset) {\n myNavBar.remove();\n }\n }", "function removeNav() {\n $(\".nav-button\").removeClass(\"nav-button--open-nav\");\n $(\".nav-cover\").removeClass(\"nav-cover--open-nav\");\n $(\"nav\").removeClass(\"open-nav\");\n}", "function unburger () {\n $('.mobilenav').removeClass('menu-show')\n $('.top-menu').removeClass('top-animate')\n $('body').removeClass('noscroll')\n $('.mid-menu').removeClass('mid-animate')\n $('.bottom-menu').removeClass('bottom-animate')\n }", "function reposition_topnav() {\r\n if(jQuery('.nav-horizontal').length > 0) {\r\n \r\n // top navigation move to left nav\r\n // .nav-horizontal will set position to relative when viewed in screen below 1024\r\n if(jQuery('.nav-horizontal').css('position') == 'relative') {\r\n \r\n if(jQuery('.leftpanel .nav-bracket').length == 2) {\r\n jQuery('.nav-horizontal').insertAfter('.nav-bracket:eq(1)');\r\n } else {\r\n // only add to bottom if .nav-horizontal is not yet in the left panel\r\n if(jQuery('.leftpanel .nav-horizontal').length == 0)\r\n jQuery('.nav-horizontal').appendTo('.leftpanelinner');\r\n }\r\n \r\n jQuery('.nav-horizontal').css({display: 'block'})\r\n .addClass('nav-pills nav-stacked nav-bracket');\r\n \r\n jQuery('.nav-horizontal .children').removeClass('dropdown-menu');\r\n jQuery('.nav-horizontal > li').each(function() { \r\n \r\n jQuery(this).removeClass('open');\r\n jQuery(this).find('a').removeAttr('class');\r\n jQuery(this).find('a').removeAttr('data-toggle');\r\n \r\n });\r\n \r\n if(jQuery('.nav-horizontal li:last-child').has('form')) {\r\n jQuery('.nav-horizontal li:last-child form').addClass('searchform').appendTo('.topnav');\r\n jQuery('.nav-horizontal li:last-child').hide();\r\n }\r\n \r\n } else {\r\n // move nav only when .nav-horizontal is currently from leftpanel\r\n // that is viewed from screen size above 1024\r\n if(jQuery('.leftpanel .nav-horizontal').length > 0) {\r\n \r\n jQuery('.nav-horizontal').removeClass('nav-pills nav-stacked nav-bracket')\r\n .appendTo('.topnav');\r\n jQuery('.nav-horizontal .children').addClass('dropdown-menu').removeAttr('style');\r\n jQuery('.nav-horizontal li:last-child').show();\r\n jQuery('.searchform').removeClass('searchform').appendTo('.nav-horizontal li:last-child .dropdown-menu');\r\n jQuery('.nav-horizontal > li > a').each(function() {\r\n \r\n jQuery(this).parent().removeClass('nav-active');\r\n \r\n if(jQuery(this).parent().find('.dropdown-menu').length > 0) {\r\n jQuery(this).attr('class','dropdown-toggle');\r\n jQuery(this).attr('data-toggle','dropdown'); \r\n }\r\n \r\n }); \r\n }\r\n \r\n }\r\n \r\n }\r\n }", "function unfreeze() {\n if($(\"html\").css(\"position\") == \"fixed\") {\n var top = $(\"html\").scrollTop() ? $(\"html\").scrollTop() : $(\"body\").scrollTop();\n $(\"html\").css(\"position\", \"static\");\n $(\"html, body\").scrollTop(-parseInt($(\"html\").css(\"top\")));\n $(\"html\").removeAttr('style');\n //$(\"html\").css({\"position\": \"\", \"width\": \"\", \"height\": \"\", \"top\": \"\", \"overflow-y\": \"\"});\n\n // Prevent top banner going down for IE\n if (checkIE()) {\n $('.topbar').css('padding-top', top);\n }else{\n $('.topbar').css('padding-top', -top);\n }\n }\n }", "function reposition_topnav() {\r\n\t\t\t\t\t\tif (jQuery('.nav-horizontal').length > 0) {\r\n\r\n\t\t\t\t\t\t\t// top navigation move to left nav\r\n\t\t\t\t\t\t\t// .nav-horizontal will set position to relative\r\n\t\t\t\t\t\t\t// when viewed in screen below 1024\r\n\t\t\t\t\t\t\tif (jQuery('.nav-horizontal').css('position') == 'relative') {\r\n\t\t\t\t\t\t\t\tif (jQuery('.leftpanel .nav-bracket').length == 2) {\r\n\t\t\t\t\t\t\t\t\tjQuery('.nav-horizontal').insertAfter(\r\n\t\t\t\t\t\t\t\t\t\t\t'.nav-bracket:eq(1)');\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// only add to bottom if .nav-horizontal is\r\n\t\t\t\t\t\t\t\t\t// not yet in the left panel\r\n\t\t\t\t\t\t\t\t\tif (jQuery('.leftpanel .nav-horizontal').length == 0)\r\n\t\t\t\t\t\t\t\t\t\tjQuery('.nav-horizontal').appendTo(\r\n\t\t\t\t\t\t\t\t\t\t\t\t'.leftpanelinner');\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tjQuery('.nav-horizontal')\r\n\t\t\t\t\t\t\t\t\t\t.css({\r\n\t\t\t\t\t\t\t\t\t\t\tdisplay : 'block'\r\n\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\t.addClass(\r\n\t\t\t\t\t\t\t\t\t\t\t\t'nav-pills nav-stacked nav-bracket');\r\n\r\n\t\t\t\t\t\t\t\tjQuery('.nav-horizontal .children')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('dropdown-menu');\r\n\t\t\t\t\t\t\t\tjQuery('.nav-horizontal > li').each(\r\n\t\t\t\t\t\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t\t\t\t\t\tjQuery(this).removeClass('open');\r\n\t\t\t\t\t\t\t\t\t\t\tjQuery(this).find('a').removeAttr(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'class');\r\n\t\t\t\t\t\t\t\t\t\t\tjQuery(this).find('a').removeAttr(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'data-toggle');\r\n\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\tif (jQuery('.nav-horizontal li:last-child')\r\n\t\t\t\t\t\t\t\t\t\t.has('form')) {\r\n\t\t\t\t\t\t\t\t\tjQuery('.nav-horizontal li:last-child form')\r\n\t\t\t\t\t\t\t\t\t\t\t.addClass('searchform').appendTo(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'.topnav');\r\n\t\t\t\t\t\t\t\t\tjQuery('.nav-horizontal li:last-child')\r\n\t\t\t\t\t\t\t\t\t\t\t.hide();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// move nav only when .nav-horizontal is\r\n\t\t\t\t\t\t\t\t// currently from leftpanel\r\n\t\t\t\t\t\t\t\t// that is viewed from screen size above 1024\r\n\t\t\t\t\t\t\t\tif (jQuery('.leftpanel .nav-horizontal').length > 0) {\r\n\r\n\t\t\t\t\t\t\t\t\tjQuery('.nav-horizontal')\r\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'nav-pills nav-stacked nav-bracket')\r\n\t\t\t\t\t\t\t\t\t\t\t.appendTo('.topnav');\r\n\t\t\t\t\t\t\t\t\tjQuery('.nav-horizontal .children')\r\n\t\t\t\t\t\t\t\t\t\t\t.addClass('dropdown-menu')\r\n\t\t\t\t\t\t\t\t\t\t\t.removeAttr('style');\r\n\t\t\t\t\t\t\t\t\tjQuery('.nav-horizontal li:last-child')\r\n\t\t\t\t\t\t\t\t\t\t\t.show();\r\n\t\t\t\t\t\t\t\t\tjQuery('.searchform')\r\n\t\t\t\t\t\t\t\t\t\t\t.removeClass('searchform')\r\n\t\t\t\t\t\t\t\t\t\t\t.appendTo(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'.nav-horizontal li:last-child .dropdown-menu');\r\n\t\t\t\t\t\t\t\t\tjQuery('.nav-horizontal > li > a')\r\n\t\t\t\t\t\t\t\t\t\t\t.each(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction() {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery(this)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.parent()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.removeClass(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'nav-active');\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (jQuery(this)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.parent()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.find(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'.dropdown-menu').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery(this)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'class',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'dropdown-toggle');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery(this)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'data-toggle',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'dropdown');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "function handleTopNav() {\n\n\tvar $upperNav = $('.upper-nav-wrapper');\n\tvar upperNavHeight;\n\tvar classOut = 'nav-out';\n\t\n\tif ( $upperNav.length && $(window).width() > 768 ) {\n\t\t\t\n\t\tupperNavHeight = $upperNav.height();\n\t\t\n\t\tif ( scrollPos > 0 && scrollPos <= upperNavHeight ) {\n\t\t\t$upperNav.css( 'margin-top', - scrollPos );\n\t\t\t$upperNav.removeClass( classOut );\n\t\t\t//$('#main-navigation').css('top', 0);\n\t\t} else if ( scrollPos > topbarHeight ) {\n\t\t\t\n\t\t\tif ( !$upperNav.hasClass( classOut ) ) {\n\t\t\t\t$upperNav.addClass( classOut );\n\t\t\t\t$upperNav.css('margin-top', - upperNavHeight );\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$upperNav.removeClass( classOut );\n\t\t\t$upperNav.css('margin-top', 0);\n\t\t\t//$('#main-navigation').css('top', topbarHeight);\n\t\t}\n\t\t\n\t}\n\t\n}", "function closeNav_responsive() {\n options.jq.contentWell.show().animate({left: 0}, animConfig());\n options.jq.navContainer.animate({marginLeft: '-100%'}, animConfig(function () {\n options.jq.contentWell.removeAttr('style');\n options.jq.navContainer.removeAttr('style');\n }));\n setNavState(0);\n }", "function handleTransparentNavbar() {\n setTransparentNavbar(dispatch, (fixedNavbar && window.scrollY === 0) || !fixedNavbar);\n }", "function centeredNavBottomBarReposition() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $headerOuter = $headerOuterEl,\r\n\t\t\t\t\t$headerSpan9 = $('#header-outer[data-format=\"centered-menu-bottom-bar\"] header#top .span_9'),\r\n\t\t\t\t\t$headerSpan3 = $('#header-outer[data-format=\"centered-menu-bottom-bar\"] header#top .span_3'),\r\n\t\t\t\t\t$secondaryHeader = $headerSecondaryEl,\r\n\t\t\t\t\t$headerBtns = $headerSpan3.find('nav >ul.buttons'),\r\n\t\t\t\t\t$navLogoMargin = parseInt($('body.material #header-outer').attr('data-padding')),\r\n\t\t\t\t\t$navLogoHeight = parseInt($('body.material #header-outer').attr('data-logo-height')),\r\n\t\t\t\t\t$triggerCondition = ($navLogoMargin*2) + $navLogoHeight - parseInt(nectarDOMInfo.adminBarHeight) + parseInt(nectarDOMInfo.secondaryHeaderHeight);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($secondaryHeader.length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('#header-outer[data-remove-fixed=\"1\"]').length == 0 && $('#header-outer[data-condense=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\tnectarDOMInfo.secondaryHeaderHeight = $headerSecondaryEl.outerHeight();\r\n\t\t\t\t\t\t\t}, 50);\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\t\r\n\t\t\t\t\t// Helper to determine if custom mobile breakpoint is active.\r\n\t\t\t\t\tfunction condenseCustomBreakPointHelper() {\r\n\t\t\t\t\t\tvar $withinCustomBreakpoint = mobileBreakPointCheck();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Adding class to prevent logo from hiding when opening OCM\r\n\t\t\t\t\t\tif ( $withinCustomBreakpoint ) {\r\n\t\t\t\t\t\t\t$headerOuterEl.addClass('within-custom-breakpoint');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$headerOuterEl.removeClass('within-custom-breakpoint');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Bind events if \"Condense Header On Scroll\" effect is enabled.\r\n\t\t\t\t\tif ($('#header-outer[data-condense=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.on('scroll.centeredNavCondense', centeredNavBottomFixed_Scroll);\r\n\t\t\t\t\t\t$window.trigger('scroll');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.on('resize', function(){\r\n\t\t\t\t\t\t\tif(nectarDOMInfo.winW < 1000 ) {\r\n\t\t\t\t\t\t\t\t$headerOuter.addClass('force-condense-remove');\r\n\t\t\t\t\t\t\t\t$window.off('scroll.centeredNavCondense');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.smartresize(function () {\r\n\t\t\t\t\t\t\tcondenseCustomBreakPointHelper();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(nectarDOMInfo.winW >= 1000 ) {\r\n\r\n\t\t\t\t\t\t\t\t// Coming from mobile.\r\n\t\t\t\t\t\t\t\tif($headerOuter.hasClass('force-condense-remove')) {\r\n\r\n\t\t\t\t\t\t\t\t\t// Remove condense effect.\r\n\t\t\t\t\t\t\t\t\tcenteredNavBottomFixed_Scroll();\r\n\t\t\t\t\t\t\t\t\t$headerOuter.removeClass('force-condense-remove');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// See if the condense effect needs to be reapplied.\r\n\t\t\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif(nectarDOMInfo.scrollTop >= $triggerCondition) {\r\n\t\t\t\t\t\t\t\t\t\t\t$headerOuter.addClass('force-condense');\r\n\t\t\t\t\t\t\t\t\t\t\tcenteredNavBottomFixed_Scroll();\r\n\t\t\t\t\t\t\t\t\t\t\t$headerOuter.removeClass('force-condense');\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t// Bind scroll event.\r\n\t\t\t\t\t\t\t\t\t\t$window.on('scroll.centeredNavCondense', centeredNavBottomFixed_Scroll);\r\n\t\t\t\t\t\t\t\t\t},200);\r\n\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}); \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcondenseCustomBreakPointHelper();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfunction centeredNavBottomFixed_Scroll() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Bypass calculating.\r\n\t\t\t\t\t\tif (nectarDOMInfo.winW < 1000 || \r\n\t\t\t\t\t\t\t$('body.material-ocm-open').length > 0 || \r\n\t\t\t\t\t\t\t$('#header-outer[data-has-menu=\"true\"][data-format=\"centered-menu-bottom-bar\"] .span_9').css('display') == 'none') {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$bodyBorderTop = ($bodyBorderTop.length > 0 && nectarDOMInfo.secondaryHeaderHeight > 0) ? $bodyBorderTop.height() : 0;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Add condense effect.\r\n\t\t\t\t\t\tif ($headerOuter.hasClass('force-condense') || !$headerOuter.hasClass('fixed-menu') && nectarDOMInfo.scrollTop >= $triggerCondition) {\r\n\t\t\t\r\n\t\t\t\t\t\t\tvar amountToMove = (parseInt($headerSpan9.position().top) - $navLogoMargin - parseInt(nectarDOMInfo.adminBarHeight)) + parseInt(nectarDOMInfo.secondaryHeaderHeight) - $bodyBorderTop;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Megamenu removes transparency option\r\n\t\t\t\t\t\t\tif ($('#header-outer[data-megamenu-rt=\"1\"]').length > 0 && $('#header-outer .megamenu').length > 0 && $('#header-outer[data-transparent-header=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('no-transition');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerOuter.addClass('fixed-menu').removeClass('transparent').css({\r\n\t\t\t\t\t\t\t\t'top': '-' + amountToMove + 'px',\r\n\t\t\t\t\t\t\t\t'position': 'fixed'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $headerNavBarOffset = $('header#top .span_9 nav >ul').offset().top;\r\n\t\t\t\t\t\t\tvar $headerButtonsOffset = $headerBtns.offset().top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $headerButtonsHeight = ($headerSpan9.find('.sf-menu > li > a').length > 0) ? (20 - parseInt($headerSpan9.find('.sf-menu > li > a').height())) / 2 : 2;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerBtns.css('transform', 'translateY(' + (parseInt($headerNavBarOffset) - parseInt($headerButtonsOffset) - $headerButtonsHeight - 1) + 'px)');\r\n\t\t\t\t\t\t\t$headerBtns.find('.nectar-woo-cart').css('height', $headerOuter.height() + parseInt($headerOuter.css('top')) - parseInt(nectarDOMInfo.adminBarHeight));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Remove condense effect.\r\n\t\t\t\t\t\telse if ($headerOuter.hasClass('force-condense-remove') || $headerOuter.hasClass('fixed-menu') && nectarDOMInfo.scrollTop < $triggerCondition ) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerOuter.removeClass('fixed-menu').css({\r\n\t\t\t\t\t\t\t\t'top': '0',\r\n\t\t\t\t\t\t\t\t'position': 'absolute'\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t$headerBtns.css('transform', 'translateY(0px)');\r\n\t\t\t\t\t\t\t$headerBtns.find('.nectar-woo-cart').css('height', '');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($('#header-outer.transparent').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($('#header-outer[data-megamenu-rt=\"1\"]').length > 0 && \r\n\t\t\t\t\t\t\t\t$('#header-outer .megamenu').length > 0) {\r\n\t\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('no-transition');\r\n\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\t\t\tif ($('#header-outer[data-megamenu-rt=\"1\"]').length > 0 && \r\n\t\t\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t\t\t$('#header-outer .megamenu').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') == 'true' && \r\n\t\t\t\t\t\t\t\t\t$('.nectar-box-roll').length == 0 && \r\n\t\t\t\t\t\t\t\t\t$('.megamenu.sfHover').length == 0) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('no-transition');\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\telse if ($headerOuterEl.attr('data-transparent-header') == 'true' && \r\n\t\t\t\t\t\t\t\t\t$('.nectar-box-roll').length == 0 && \r\n\t\t\t\t\t\t\t\t\t$('.megamenu.sfHover').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('no-transition');\r\n\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} \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') == 'true' && $('.nectar-box-roll').length == 0) {\r\n\t\t\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\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\t\t\t\r\n\t\t\t\t\t\t\t} // endif transparent header conditional.\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} // End Remove condense effect.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} // End centeredNavBottomFixed_Scroll.\r\n\t\t\t\t\t\r\n\t\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function renderNavBar() {\n\t //if navBar, delete\n\t var oldNav = document.querySelector('.cat-nav-bar');\n\n\t if (oldNav) {\n\t oldNav.parentNode.removeChild(oldNav);\n\t }\n\n\t var newNavBar = createNavBar(cats);\n\n\t catHolderMaster.appendChild(newNavBar);\n\n\t}", "function sticky_nav_scroll() {\n if (window.pageYOffset > 100 && w >= 500) {\n $('.nav').removeClass('display-none');\n $('body').addClass('body-margin-modifier');\n }\n else {\n $('.nav').addClass('display-none');\n $('body').removeClass('body-margin-modifier');\n }\n }", "position() {\n const box = document.querySelector('.att');\n // The bounding info of the container\n const mainBox = {\n width: this.DOM.el.offsetWidth,\n heigt: this.DOM.el.offsetHeight\n };\n\n // Positoning the elements\n this.DOM.nav.style.left = box.style.left = `${mainBox.width - (450 - main.offsetLeft)}px`;\n this.DOM.nav.style.top = `${main.offsetTop - (main.offsetHeight / 2)}px`; \n }", "function navigationBar() {\n\t$('#galleryPage').hide();\n}", "function unSticky(){\n $subNav.removeClass('sticky'); \n $subNav.removeClass('slideDown');\n $subNav.find('.applyBtnSlide').removeClass('animated'); \n \n }", "function disableNavigation(index,px) {\n\tvar rightArrow = scrollBars[index].rightButton;\n\tvar leftArrow = scrollBars[index].leftButton;\n\tvar scroller = scrollBars[index];\n var elem = document.getElementById(scroller.ownerContentID);\n var x=getAbsX(elem);\n var divWidth=elem.offsetWidth;\n var windowWidth=getWidth();\n var navigationWidth = 20;\n\tvar menuLogoutWidth = 50;\n\tvar paddingLeft = 5;\n\tvar rightPos=x+divWidth;\n\tif(px <= 0) {\n \tif(rightPos<=windowWidth-(navigationWidth+10)){\n \t\trightArrow.style.visibility=\"hidden\";\n \t\tclearInterval(scrollInterval);\n \t}\n\t\tif(x<=(navigationWidth+paddingLeft)){\n\t\t\tleftArrow.style.visibility=\"visible\";\n\t\t\tclearInterval(scrollInterval);\n\t\t}\n\t}\n\telse {\n\t\tif(x>=(navigationWidth+paddingLeft)){\n\t\t\tleftArrow.style.visibility=\"hidden\";\n\t\t\tclearInterval(scrollInterval);\n\t\t}\n\t\tif(rightPos>=windowWidth-(menuLogoutWidth+navigationWidth)){\n \t\trightArrow.style.visibility=\"visible\";\n \t\tclearInterval(scrollInterval);\n \t}\n//\t\tvar y=(x*-1);\n//\t\tif(y>= divWidth-windowWidth){\n//\t\t\trightArrow.style.visibility=\"visible\";\n//\t\t}\n\t}\n}", "function fixNav() {\n\tif(width>900){\n\t\tif (window.pageYOffset > sticky) {\n\t\t fixedmenu.classList.add(\"fix-nav\");\n\t\t pagearea.classList.add(\"pad300\");\n\t\t} else {\n\t\t \tfixedmenu.classList.remove(\"fix-nav\");\n\t\t pagearea.classList.remove(\"pad300\");\n\t\t}\n\t}\n}", "function offSetManager(){\n\n var yOffset = 0;\n var currYOffSet = window.pageYOffset;\n\n if(yOffset < currYOffSet) {\n myNavBar.add();\n }\n else if(currYOffSet == yOffset){\n myNavBar.remove();\n }\n\n}", "function offSetManager(){\n\n var yOffset = 0;\n var currYOffSet = window.pageYOffset;\n\n if(yOffset < currYOffSet) {\n myNavBar.add();\n }\n else if(currYOffSet == yOffset){\n myNavBar.remove();\n }\n\n}", "function offSetManager(){\n\n var yOffset = 0;\n var currYOffSet = window.pageYOffset;\n\n if(yOffset < currYOffSet) {\n myNavBar.add();\n }\n else if(currYOffSet == yOffset){\n myNavBar.remove();\n }\n\n}", "function stickyBar() {\n if (window.pageYOffset > 0) {\n navbar.classList.add(\"nav-bg-trans\");\n navChild.classList.add(\"nav-child-shrink\"); \n navbar.classList.add(\"shadow-sm\");\n toTop.classList.add(\"show-me\"); \n \n } else {\n navbar.classList.remove(\"nav-bg-trans\");\n navChild.classList.remove(\"nav-child-shrink\"); \n navbar.classList.remove(\"shadow-sm\");\n toTop.classList.remove(\"show-me\"); \n }\n }", "function hideNav() {\n let navOffset = getNavWidth()[1]; //Get the sideNav Width\n document.getElementById(\"sideNav\").style.left = navOffset; //Set the sideNav left style property to negative width - this will transition the sideNav fully off of the left side of the window\n document.getElementById(\"sideNavDocOverlay\").style.zIndex = \"-1000\"; //Set the sideNavDocOverlay zIndex to -1000, ensuring that it drops behind all other content\n document.getElementById(\"sideNavDocOverlay\").style.backgroundColor = \"rgba(0,0,0,0.0)\"; //Set the sideNavDocOverlay backgroundColor style property to the default of 100% translucent\n document.getElementById(\"sideNavDocOverlay\").style.left = \"0px\"; //Set the sideNavDocOverlay left style property to 0. This will transition the overlay across the window in line with the sideNav transition\n}", "function hideStickyMegaBar() {\n $(\".header-mega-menu .mega-menu-lg-container\").removeClass('sticky-show');\n $(\".lg-down-header .mega-menu-lg-down-container\").removeClass('sticky-show');\n $(\".header .lg-navbar .login-button\").removeClass(\"d-none\").addClass(\"d-block\");\n $(\".header-mega-menu .login-button-sticky\").removeClass(\"d-block\").addClass(\"d-none\");\n $(\".sticky-navbar\").removeClass(\"login-button-sticky-block\").addClass(\"login-button-sticky-none\");\n addTop0AtCompareTable();\n }", "function reposition_topnav() {\n if ($('.nav-horizontal').length > 0) {\n topbarWidth = $('.topbar').width();\n headerRightWidth = $('.header-right').width();\n if ($('.header-left .nav-horizontal').length) headerLeftWidth = $('.header-left').width() + 40;\n else headerLeftWidth = $('.nav-sidebar.nav-horizontal > li').length * 140;\n var topbarSpace = topbarWidth - headerLeftWidth - headerRightWidth;\n // top navigation move to left nav if not enough space in topbar\n if ($('.nav-horizontal').css('position') == 'relative' || topbarSpace < 0) {\n if ($('.sidebar .nav-sidebar').length == 2) {\n $('.nav-horizontal').insertAfter('.nav-sidebar:eq(1)');\n } else {\n // only add to bottom if .nav-horizontal is not yet in the left panel\n if ($('.sidebar .nav-horizontal').length == 0) {\n $('.nav-horizontal').appendTo('.sidebar-inner');\n $('.sidebar-widgets').css('margin-bottom', 20);\n }\n }\n $('.nav-horizontal').css({\n display: 'block'\n }).addClass('nav-sidebar').css('margin-bottom', 100);\n createSideScroll();\n $('.nav-horizontal .children').removeClass('dropdown-menu');\n $('.nav-horizontal > li').each(function() {\n $(this).removeClass('open');\n $(this).find('a').removeAttr('class');\n $(this).find('a').removeAttr('data-toggle');\n });\n /* We hide mega menu in sidebar since video / images are too big and not adapted to sidebar */\n if ($('.nav-horizontal').hasClass('mmenu')) $('.nav-horizontal.mmenu').css('height', 0).css('overflow', 'hidden');\n } else {\n if ($('.sidebar .nav-horizontal').length > 0) {\n $('.sidebar-widgets').css('margin-bottom', 100);\n $('.nav-horizontal').removeClass('nav-sidebar').appendTo('.topnav');\n $('.nav-horizontal .children').addClass('dropdown-menu').removeAttr('style');\n $('.nav-horizontal li:last-child').show();\n $('.nav-horizontal > li > a').each(function() {\n $(this).parent().removeClass('active');\n if ($(this).parent().find('.dropdown-menu').length > 0) {\n $(this).attr('class', 'dropdown-toggle');\n $(this).attr('data-toggle', 'dropdown');\n }\n });\n }\n /* If mega menu, we make it visible */\n if ($('.nav-horizontal').hasClass('mmenu')) $('.nav-horizontal.mmenu').css('height', '').css('overflow', '');\n }\n }\n}", "removeNavAfterClick(e) {\n if ((e.target.tagName === 'LI' || e.target.tagName === 'A') && (this.state.isMobile)) {\n this.setState({\n navbarBtnAnimationClass: false,\n navbarDisplay: \"none\"\n })\n }\n }", "static closeNav() {\n ElementHandler.setElementCSSById('sidebarMenu', 'width', \"0px\");\n ElementHandler.setElementCSSById('openSidebar', 'width', \"0px\");\n ElementHandler.showElementById('openSidebar');\n }", "function closeNav() {\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '20px');\n $('#nav-list li').addClass('treelisthidden');\n storage.removeItem(treesettings);\n $('#sideNavigation').css('display', 'none');\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('#sidefoot').css('margin-left', '-250px');\n $('body.support_kb').find('.cover').css('display', 'block');\n //$('body.support_kb').find('#sideNavigation').css('margin-left','0');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '-250px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('#side-toggle').attr('class', 'fa fa-angle-double-right');\n $(\"#sidefoot\").css(\"width\", \"50px\");\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"disable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n }", "function MansNotHot(){\n $custom_nav_container.addClass('no-display');\n TweenMax.to($custom_nav_container, 0, {x:0});\n}", "function resetMenuBar() {\n\n\t$('#Overview').removeClass(\"active\");\n\t$('#ArticleAnalytics').removeClass(\"active\");\n\t$('#AuthorAnalytics').removeClass(\"active\");\n\n}", "function manageTopPosition()\n {\n var scrollHeight = $(window).scrollTop();\n\n if(scrollHeight > 50 && !tucked)\n {\n tucked = true;\n $(\"#top\").css({\"top\": determineTopHeight() + \"px\", \"position\": \"fixed\"});\n $(\"#nav-bar\").toggleClass(\"tucked\");\n $(\"#nav-bar > .link > div:first\").removeClass(\"hovered\");\n }\n else if (scrollHeight <= 50 && tucked)\n {\n tucked = false;\n $(\"#top\").css({\"top\": \"0\", \"position\": \"absolute\"});\n $(\"#name\").css(\"display\", \"flex\");\n $(\"#nav-bar\").toggleClass(\"tucked\");\n resetNavbar();\n $(\"#nav-bar > .link:first > div:first\").addClass(\"hovered\");\n }\n }", "function cerrar_nav() {\n\t\t$('.menu-responsive, .submenu-productos').animate({\n\t\t\twidth: 0\n\t\t}, {queue:false, duration: 300, complete: function() {\n\t\t\t$('.r-overlay').css('height', '0%').animate({\n\t\t\t\topacity: 0\n\t\t\t}, 200);\n\t\t}});\n\t\t$('.nav-mobile-close').hide();\n\t\t// $('.nav-mobile').show();\n\t}", "function hideMobileBar(){\n\t\t\t$(menu).show(0);\n\t\t\t$(showHideButton).hide(0);\n\t\t}", "function hideMobileBar(){\n\t\t\t$(menu).show(0);\n\t\t\t$(showHideButton).hide(0);\n\t\t}", "function navbarSceoll() {\n var iamHere = $(window).scrollTop(),\n nav = $('.navbar-custom');\n $(window).scroll(function () {\n if ($(this).scrollTop() > iamHere) {\n nav.addClass('up');\n iamHere = $(window).scrollTop();\n } else if ($(this).scrollTop() < iamHere) {\n nav.removeClass('up');\n iamHere = $(window).scrollTop();\n }\n });\n }", "function initHomepageNav() {\n hideNavBackground();\n $(window).scroll(hideNavBackground);\n}", "function centeredNavBottomBarInit() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('#header-outer[data-format=\"centered-menu-bottom-bar\"]').length > 0) {\r\n\t\t\t\t\t\tcenteredNavBottomBarReposition();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function closeNav() {\n document.getElementById(\"navpanel\").style.width = \"0\";\n }", "function navbarHidden() {\n $$('.main--navbar').addClass('navbar-hidden');\n $$('.main--content').addClass('align-top');\n}", "function closeNav()\n {\n $('body')\n .removeClass('nav-expanded');\n }", "function NavigationBarGenerator() {\n\t\tthis.bar = null;\n\t\tthis.leftItems = [];\n\t\tthis.middleItems = [];\n\t\tthis.rightItems = [];\n\t\n\t\t// remove margin of body\n\t\tconst body = document.querySelector(\"body\");\n\t\tbody.style = \"margin: 0px\";\n\t}", "function adjustNav() {\n\n\tif ($(document).width() < breakPoint) {\n\n\t\t$(\"nav.main-menu\").removeClass(\"full\").addClass(\"compact\");\n\t\t$(\"nav.main-menu ul\").hide();\n\t}\n\n\telse {\n\n\t\t$(\"nav.main-menu\").removeClass(\"compact\").addClass(\"full\");\n\t\t$(\"nav.main-menu ul\").show();\n\t}\n}", "function noAnimationInit(){\n\t$(\".navbar-header\").css({\n\t\t\"width\": \"100%\"\n\t});\n\t\n\t$(\"#content\").fadeIn();\n}", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"page-top\").style.marginLeft = \"0\";\n }", "function _enableNavBar() {\n if (_options.enableNavBar) {\n var $navBar = $(_renderDirNavbar(_currentDir));\n\n if ($(\"#pfsd-navbar-container\").length === 0) {\n $('<div id=\"pfsd-navbar-container\"></div>').insertBefore(\".modal-body\");\n }\n $(\"#pfsd-navbar-container\").empty();\n $(\"#pfsd-navbar-container\").append($navBar);\n _arrangeNavBar();\n }\n }", "function hideNav() {\n\t\tnav.classList.remove('activeNav');\n\t\theader.classList.remove('activeNav');\n\t\tnav.classList.add('inActiveNav');\n\t\theader.classList.add('inActiveNav');\n\t}", "function fixNav() {\n // headerHeight is determined because navSize will change due padding added\n var sticky = document.getElementById(\"navbar\").offsetTop;\n var headerHeight = document.getElementById(\"header\").offsetHeight;\n var navSize = document.getElementById(\"navbar\").offsetHeight;\n if (window.pageYOffset > sticky) {\n document.getElementById(\"main\").style.paddingTop = (navSize + i) + \"px\";\n document.body.classList.add(\"fixednav\");\n }\n if (window.pageYOffset < headerHeight ) {\n document.body.classList.remove(\"fixednav\");\n document.getElementById(\"main\").style.paddingTop = i + \"px\";\n }\n }", "function closeNav() {\n navigation.style.width = \"0\";\n main.style.left = \"0\";\n main.style.position = \"static\";\n main.style.filter = \"opacity(100%)\";\n triggered = 0;\n }", "function menu_standard() {\n\t$('#menu').removeClass('menu_reverse');\n\t$('.ico_home').removeClass('ico_home_reverse');\n\t$('.menu_child:not(.ico_home)').css('visibility', 'visible');\n}", "function navPostion(windowScroll)\n {\n let servicesTop = $(\"#services\").offset().top;\n if (windowScroll > servicesTop-200 ) \n {\n $(\".navbar\").css(\"backgroundColor\", \"rgba(0,0,0,0.8)\");\n $(\".navbar\").css(\"position\", \"fixed\");\n }\n else \n {\n $(\".navbar\").css(\"backgroundColor\", \"transparent\");\n $(\".navbar\").css(\"position\", \"absolute\");\n }\n }", "function navBar(){\n\t\t$('.nav-button').click(function(){\n\t\t\t$('.nav-content').toggleClass('nav-hide');\n\t\t});\t\n\t}", "function setSidebarPos() {\n var detach = $('body').find(\".main-sidebar\").detach();\n if (window.matchMedia('(min-width: 992px)').matches) {\n $(detach).appendTo($('body').find(\"#sidebarStatic\"));\n $('.slideout-panel').css({'transform':'translateX(0)'});\n } else {\n $(detach).appendTo($('body').find(\"#sidebarSlidout\"));\n }\n}", "function showHideNav(){\n if(\n $(window).scrollTop()>200){\n //show white navigation bar \n $(\"nav\").addClass(\"white-nav-top\");\n }\n\n else{\n\n //hide navigation bar\n $(\"nav\").removeClass(\"white-nav-top\");\n\n }\n }", "function hideNav() {\n\tif ($(window).width() <= 800){\n \t toggleNavElements();\n removeNavDropdownLinks();\n }\n}", "function fixedTopNav() {\n if ($(window).scrollTop() > 1) {\n $('#main-header').addClass('fixed-block');\n } else {\n $('#main-header').removeClass('fixed-block');\n }\n if ($(window).outerWidth() > 992) {\n $('#main-header').removeClass('fixed-block');\n }\n }", "function showMallNav() {\n classie.remove(mallNav, 'mallnav--hidden');\n }", "function fixMenuBar(){\n\t\tvar scrolTop = $(window).scrollTop();\n\t\tvar width = $(window).width();\n\t\t\tif (width<1215){\n\t\t\t\tif(scrolTop>=123){\n\t\t\t\t\t$('body').addClass(\"scroll_padding-top\")\n\t\t\t\t\t$(\".main-menu\").addClass(\"fixed\");\n\t\t\t\t} else {\n\t\t\t\t\t\t$(\".main-menu\").removeClass(\"fixed\");\n\t\t\t\t\t\t$('body').removeClass(\"scroll_padding-top\")\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tif(window.location.pathname== host_pathname || window.location.pathname== '/index.html'){\n\t\t\t\t\t//show-hide menu\n\t\t\t\t\tif(scrolTop>=645 && scrolTop<=860){\n\t\t\t\t\t\t$('.main-menu .catalog-list').removeClass('open')\n\t\t\t\t\t}\n\t\t\t\t\telse if(scrolTop<645) {\n\t\t\t\t\t\t$('.main-menu .catalog-list').addClass('open')\n\t\t\t\t\t}\n\n\t\t\t\t\t//fix menu\n\t\t\t\t\tif(scrolTop>=645){\n\t\t\t\t\t\t$('body').addClass(\"scroll_padding-top\");\n\t\t\t\t\t\t$(\".main-menu\").addClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$('body').removeClass(\"scroll_padding-top\")\n\t\t\t\t\t\t$(\".main-menu\").removeClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t//if we are not on index.html\n\t\t\t\t}else{\n\t\t\t\t\tif(scrolTop>=136){\n\t\t\t\t\t\t$('body').addClass(\"scroll_padding-top\");\n\t\t\t\t\t\t$(\".main-menu\").addClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$('body').removeClass(\"scroll_padding-top\")\n\t\t\t\t\t\t$(\".main-menu\").removeClass(\"fixed\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\n\t}", "function navAnimtion() {\n var scrollWidth = $(\".fairies-nav\").width();\n var ulWidth = $(\".fairies-nav ul\").width();\n var liLeft = $(\".fairies-nav li.active\").position().left;\n var liWidth = $(\".fairies-nav li.active\").outerWidth(true);\n $(\".fairies-nav ul\").removeAttr('class');\n if (liLeft + liWidth < scrollWidth / 2) {\n $(\".fairies-nav ul\").css(\"left\", \"0\");\n } else if (ulWidth - (liLeft + liWidth) < scrollWidth / 2) {\n var liLeftLast = $(\".fairies-nav li:last\").position().left;\n var ulLeftEnd = (liLeftLast + liWidth - scrollWidth) / scrollWidth * 100;\n if (ulLeftEnd < 0) {\n $(\".fairies-nav ul\").css(\"left\", \"0\");\n } else {\n $(\".fairies-nav ul\").css(\"left\", -ulLeftEnd + \"%\");\n }\n } else {\n var ulLeft = (liLeft + liWidth / 2 - scrollWidth / 2) / scrollWidth * 100;\n $(\".fairies-nav ul\").css({ left: -ulLeft + \"%\" });\n }\n}", "hideNavBar(status) {\n this.navBarHidden = status;\n this.navigator.hideNavBar(status);\n }", "function clearNavButtons(b) {\n var nextButtonCleaner = document.getElementById(\"stickyBlock1\");\n var prevButtonCleaner = document.getElementById(\"stickyBlock2\");\n var getSideBar = document.getElementById(\"rightSideBar\");\n var jumper = document.getElementById(\"jumpToPage\");\n if (b == 0) {\n getSideBar.removeChild(prevButtonCleaner);\n getSideBar.removeChild(jumpToPage);\n } else {\n return;\n }\n}", "function fixPositionSubmenu() {\n var menu = $('#main-nav .navbar-nav .dropdown-menu > .dropdown-submenu > .dropdown-menu');\n\n menu.each(function (e) {\n\n var leftPos = $(this).parent().offset().left + $(this).parent().width();\n if (leftPos + $(this).width() > $(\"body\").width()) {\n $(this).addClass(\"left\");\n } else {\n $(this).removeClass(\"left\");\n }\n });\n }", "function navAppend(w) {\n var nav = $('.top-nav');\n\n if (w < 1024 && !$('#flyout-menu .top-nav').length) {\n nav.prependTo('#flyout-menu');\n nav.find('.mega-menu-target').hide();\n } \n\n if (w > 1023 && !$('.top-nav-wrapper .top-nav').length) {\n nav.prependTo('.top-nav-wrapper');\n nav.find('.mega-menu-target').show();\n } \n }", "function closeNav() {\n document.getElementById(\"left_nav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.getElementById(\"navbarOnIndex\").style.marginLeft = \"0\";\n}", "function hide_navi(){\n document.querySelector('.navbar__menu').style.display = 'none';\n}", "function hideMallNav() {\n classie.add(mallNav, 'mallnav--hidden');\n }", "function hideNavbar(scroll) {\n if($('.nav').hasClass('hide')) {\n let current = $(window).scrollTop();\n let navHeight = $('.nav').height()+1;\n if (screenWidth >= medium) {\n navHeight = navHeight+$('.nav-items').height();\n };\n if(screenWidth < large) {\n if (current > prev) {// If Scrolling Down\n $('.nav').css('top', -navHeight + 'px');\n } else {// If Scrolling Up\n $('.nav').css('top', 0 + 'px');\n };\n };\n return current;\n };\n}", "function fixSloganPosition(slogan) {\n\t\t\t\t\n\t\t\t\tvar header = $('header'),\n\t\t\t\t\t\theaderRightEdge = header.position().left + header.outerWidth(),\n\t\t\t\t\t\theaderBottomEdge = header.position().top + header.outerHeight();\n\t\t\t\t \t\tleft = slogan.position().left;\n\t\t\t\t\t \tbottom = slogan.position().top + slogan.outerHeight();\n\n\t\t\t\tif(left <= headerRightEdge) {\n\t\t\t\t\tslogan.css({\n\t\t\t\t\t\ttop: headerBottomEdge + 10,\n\t\t\t\t\t\t'transform': 'translate(-50%,0)'\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tslogan.css({\n\t\t\t\t\t\ttop: '',\n\t\t\t\t\t\t'transform': ''\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "function navigationBar() {\n authToken = localStorage.getItem(\"authToken\");\n $('#container').show();\n\n if (authToken === null) {\n navBar.find('a').hide();\n navBar.find('.active').show();\n showMainView();\n $('#welcome-container').find(\"h2\").show()\n welcomeButtons.show()\n profile.hide()\n } else {\n $('#welcome-container').find(\"h2\").hide()\n welcomeButtons.hide()\n navBar.find('a').show();\n navBar.find('.active').show();\n loadAllListings()\n profile.show();\n profile.find(\"a:first-child\").text(\"Welcome \" + localStorage.getItem(\"username\"))\n }\n }", "function hideNav() {\n if(isNavVisible === true) {\n noNav();\n\n } else {\n yesNav();\n }\n}", "function menuSet(self){\n\t\tvar browserWidth = window.innerWidth;\n\t\tvar heightMenu = window.innerHeight - document.querySelector(\".main-menu\").getBoundingClientRect().bottom + \"px\";\n\t\tvar menuPosition = document.querySelector(\".main-menu\").getBoundingClientRect().bottom;\n\n\t\tif (browserWidth < 800 ) {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": heightMenu,\n\t\t\t\t\"position\": \"fixed\",\n\t\t\t\t\"top\": menuPosition +\"px\"\n\t\t\t});\n\n\t\t} else {\n\t\t\t$('.main-menu .catalog-list>ul').css({\n\t\t\t\t\"max-height\": \"\",\n\t\t\t\t\"top\": \"\",\n\t\t\t\t\"position\": \"\"\n\t\t\t});\n\t\t}\n\n\t}", "function closeNav() {\n document.getElementById('top-nav').style.height = \"0\";\n document.getElementById('close-btn').style.display = \"none\";\n // document.getElementById('mother-container').style.marginTop = \"0\";\n}", "static fixCanvasUIBar(container, canvas, navbar) {\n var canvasHeight = window.getComputedStyle(canvas).height;\n var containerHeight = window.getComputedStyle(container).height;\n\n canvasHeight = parseFloat(canvasHeight.substr(0, canvasHeight.length - 2));\n containerHeight = parseFloat(containerHeight.substr(0, containerHeight.length - 2));\n\n var shadowPaddingHeight = canvasHeight - containerHeight;\n if (shadowPaddingHeight < 0) {\n navbar.style.marginTop = `${shadowPaddingHeight}px`;\n }\n }", "function toClickNavicon() {\n\t\t\tcount++;\n\t\t\tif (count % 2 != 0) {\n\t\t\t\tsidebar.style.left = 0;\n\t\t\t\tmoveLayout.style.marginLeft = 200 + 'px'\n\t\t\t\twrapper.style.opacity = 0.2;\n\t\t\t\tnavicon.style.color = 'rgb(250,250,250)';\n\t\t\t\tdocument.body.style.overflow = 'hidden';\n\t\t\t} \n\t\t\tif (count % 2 == 0) {\n\t\t\t\tsidebar.style.left = -200 + 'px';\n\t\t\t\tmoveLayout.style.marginLeft = 0;\n\t\t\t\twrapper.style.opacity = 1;\n\t\t\t\tnavicon.style.color = 'rgb(88,77,57)';\n\t\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\t}\n\t\t}", "function menuHideLogo() {\n // Much sure the top bar is there\n if ($('.top-bar').length) {\n\n // If the menu icon is clicked\n $('.menu-icon a').click(function() {\n\n // Theres a small delay in the class we need to use being added so we set a time out\n setTimeout(function() {\n // if the top bar has the expanded class\n if ($('.top-bar').hasClass('expanded')) {\n // hide the logo and set nav to relative to pass content down\n $('.l-header__logo').css({'height' : '0','opacity' : '0'});\n $('.l-header__navigation').css('position','relative');\n } else {\n // else undo changes\n $('.l-header__navigation').css('position','absolute');\n $('.l-header__logo').css({'height' : 'auto','opacity' : '1'});\n }\n }, 0.1);\n\n });\n }\n }", "undoSiteAdjust() {\r\n\t\t$( '.main-header' ).removeClass( 'adjustedMargin' );\r\n\t}", "function setAriaHiddenOnNav() {\n var isHidden = mobileSize && !nav.hasClass('in');\n nav.attr('aria-hidden', isHidden ? 'true' : 'false');\n nav.find('a').each(function (i, anchor) {\n $(anchor).attr('tabIndex', isHidden ? '-1' : '0');\n });\n }", "function closeNav() {\r\n document.getElementById(\"myNav\").style.width = \"0%\";\r\n }" ]
[ "0.671372", "0.62194633", "0.60167515", "0.6008746", "0.5965312", "0.594582", "0.5910057", "0.5903915", "0.59012675", "0.5889023", "0.58834046", "0.58627933", "0.5846785", "0.58407426", "0.5816656", "0.5813924", "0.5813924", "0.5813561", "0.58104885", "0.5809983", "0.57998145", "0.5797535", "0.57881767", "0.57872725", "0.5784939", "0.578316", "0.57785916", "0.5776482", "0.57243264", "0.56890464", "0.56876105", "0.5654447", "0.5649628", "0.5641263", "0.56385857", "0.56340504", "0.56310123", "0.56300014", "0.5618255", "0.561579", "0.560891", "0.56019604", "0.56019604", "0.56019604", "0.5599054", "0.55989087", "0.559868", "0.5595812", "0.5589445", "0.5583626", "0.5580498", "0.5569346", "0.5561087", "0.5546469", "0.5544117", "0.5531041", "0.5531041", "0.5529488", "0.55278", "0.552091", "0.55169624", "0.55118567", "0.55069476", "0.5505", "0.55003524", "0.54991573", "0.54982454", "0.54854536", "0.5483722", "0.5466589", "0.5450095", "0.54498625", "0.5447759", "0.5443714", "0.5442931", "0.5440922", "0.54402983", "0.54397964", "0.5436252", "0.54361856", "0.541162", "0.54114056", "0.5410613", "0.54032546", "0.5401191", "0.5401065", "0.5396964", "0.53935224", "0.5388311", "0.53791994", "0.5364067", "0.53539413", "0.5352895", "0.5351962", "0.5347908", "0.5345163", "0.53422046", "0.534108", "0.5340518", "0.53397846" ]
0.6737305
0
change carousel elements fit the bigger window size
function spreadCarousel(i) { authorDeck[i].style.fontSize = "15px"; deckTitle[i].children[0].classList.remove("h5"); deckTitle[i].style.maxWidth = "50%"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustSize() {\n const childWidth = carousel.offsetWidth;\n carousel.style.height = childWidth + \"px\";\n carouselInner.style.height = childWidth + \"px\";\n const children = document.querySelectorAll(\".page-item\");\n children.forEach(child => {\n child.style.width = (childWidth / 2) * 0.96 + \"px\";\n });\n circle1.click();\n}", "function changeSize() {\n carouselWrapWidth = carouselWrap.offsetWidth;\n isResizing = true;\n carouselList.style.transition = \"\";\n moveCarousel();\n}", "function setHeightCarousel3() {\n $carousel3.each(function () {\n var $allImages = $(this).find('img');\n var size = $(this).attr('data-size') || 0.8;\n var resultH = wndH * size;\n var maxItemW = Math.min($(this).parent().width(), wndW) * size;\n $allImages.each(function () {\n if (this.naturalWidth && this.naturalHeight && resultH * this.naturalWidth / this.naturalHeight > maxItemW) {\n resultH = maxItemW * this.naturalHeight / this.naturalWidth;\n }\n });\n $allImages.css('height', resultH);\n $(this).children('.nk-carousel-inner').flickity('reposition');\n });\n }", "function onSizeChange(){\n\t\t\n\t\tvar galleryWidth = getGalleryWidth();\n\t\tg_carousel.setMaxWidth(galleryWidth);\n\t\tg_carousel.run();\n\t\t\t\n\t\tpositionElements();\n\t}", "function resizeslider(){\n\t$(\".slider .items\").css({\"height\":$(window).height()});\n\t$(\".slider\").css({\"height\":$(window).height()});\n}", "function changeSliderSize() {\n\t\t\twrapperA.css({\n\t\t\t\twidth: itemsA.length * (sliderWidth + 2 * sliderMargin) + \"vw\",\n\t\t\t\tmarginLeft: getWrapperMargin() + \"vw\"\n\t\t\t});\n\t\t\t\n\t\t\titemsA.css({\n\t\t\t\twidth: sliderWidth + \"vw\",\n\t\t\t\theight: sliderHeight + \"em\",\n\t\t\t\tmargin: \"0 \" + sliderMargin + \"vw\"\n\t\t\t});\n\t\t}", "function resizeCarousel(carousel) {\n const parentWidth = $(carousel).width();\n const Btns = $(carousel).find(\".btn-prev , .btn-next\");\n Btns.hide();\n let inner = $(carousel).find(\".CustomCarousel-inner\");\n const items = $(inner).find(\".item\");\n let pad = $(carousel).attr(\"data-padding\");\n if (pad == NaN) pad = 0;\n\n $(items).hide();\n let widthCount = 0;\n let visibleItems = 0;\n if ($(carousel).hasClass(\"spaced\")) {\n spaced(carousel, parentWidth, items, pad);\n }\n let last;\n let i = 0;\n let maxHeight = 200;\n $(items).each(function () {\n if ($(this).height() > maxHeight) maxHeight = $(this).height();\n if (i++ > 0) $(this).css(\"padding-left\", pad + \"px\");\n else $(this).css(\"padding-left\", 0);\n $(this).removeClass(\"Last\");\n widthCount += $(this).outerWidth();\n if (widthCount < parentWidth) {\n visibleItems++;\n $(this).show();\n $(this).addClass(\"Visib\");\n last = $(this);\n } else $(this).removeClass(\"Visib\");\n });\n $(carousel).height(maxHeight + \"px\");\n if (last) last.addClass(\"Last\");\n if (items.length > visibleItems) {\n Btns.height($(carousel).height());\n Btns.show();\n }\n}", "function setCarouselHeight() {\n setSingleCarouselHeight('testimonialCarousel');\n setSingleCarouselHeight('textCarousel');\n setSingleCarouselHeight('panelCarousel');\n}", "function ResCarouselSize() {\n \n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function () {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n }\n else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * itemNumbers });\n $(this).find(itemClass).each(function () {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function setHeightCarousel3() {\n $carousel3.each(function eachCarousel3() {\n var $allImages = (0, _utility.$)(this).find('img');\n var size = (0, _utility.$)(this).attr('data-size') || 0.8;\n var resultH = _utility.wndH * size;\n var maxItemW = Math.min((0, _utility.$)(this).parent().width(), _utility.wndW) * size;\n $allImages.each(function eachCarousel3Images() {\n if (this.naturalWidth && this.naturalHeight && resultH * this.naturalWidth / this.naturalHeight > maxItemW) {\n resultH = maxItemW * this.naturalHeight / this.naturalWidth;\n }\n });\n $allImages.css('height', resultH);\n (0, _utility.$)(this).children('.nk-carousel-inner').flickity('reposition');\n });\n }", "function ResCarouselSize() {\n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function() {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n } else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n } else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n } else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({\n 'transform': 'translateX(0px)',\n 'width': itemWidth * itemNumbers\n });\n $(this).find(itemClass).each(function() {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function ResCarouselSize() {\n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function () {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n }\n else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * itemNumbers });\n $(this).find(itemClass).each(function () {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function ResCarouselSize() {\n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function () {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n }\n else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * itemNumbers });\n $(this).find(itemClass).each(function () {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function ResCarouselSize() {\n var incno = 0;\n var dataItems = (\"data-items\");\n var itemClass = ('.item');\n var id = 0;\n var btnParentSb = '';\n var itemsSplit = '';\n var sampwidth = $(itemsMainDiv).width();\n var bodyWidth = $('body').width();\n $(itemsDiv).each(function () {\n id = id + 1;\n var itemNumbers = $(this).find(itemClass).length;\n btnParentSb = $(this).parent().attr(dataItems);\n itemsSplit = btnParentSb.split(',');\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\n\n\n if (bodyWidth >= 1200) {\n incno = itemsSplit[3];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 992) {\n incno = itemsSplit[2];\n itemWidth = sampwidth / incno;\n }\n else if (bodyWidth >= 768) {\n incno = itemsSplit[1];\n itemWidth = sampwidth / incno;\n }\n else {\n incno = itemsSplit[0];\n itemWidth = sampwidth / incno;\n }\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * itemNumbers });\n $(this).find(itemClass).each(function () {\n $(this).outerWidth(itemWidth);\n });\n\n $(\".leftLst\").addClass(\"over\");\n $(\".rightLst\").removeClass(\"over\");\n\n });\n }", "function resizeElements() {\n\t// Compute the max height so that the settings fit on the screen\n\t$('#song-list').height($(window).height() - $('#settings-container-inner').height() - 200);\n}", "function ResCarouselSize() {\r\n var incno = 0;\r\n var dataItems = (\"data-items\");\r\n var itemClass = ('.item');\r\n var id = 0;\r\n var btnParentSb = '';\r\n var itemsSplit = '';\r\n var sampwidth = $(itemsMainDiv).width();\r\n var bodyWidth = $('body').width();\r\n $(itemsDiv).each(function () {\r\n id = id + 1;\r\n var itemNumbers = $(this).find(itemClass).length;\r\n btnParentSb = $(this).parent().attr(dataItems);\r\n itemsSplit = btnParentSb.split(',');\r\n $(this).parent().attr(\"id\", \"MultiCarousel\" + id);\r\n\r\n\r\n if (bodyWidth >= 1200) {\r\n incno = itemsSplit[7];\r\n itemWidth = sampwidth / 5;\r\n }\r\n else if (bodyWidth >= 992) {\r\n incno = itemsSplit[1];\r\n itemWidth = sampwidth / incno;\r\n }\r\n else if (bodyWidth >= 768) {\r\n incno = itemsSplit[1];\r\n itemWidth = sampwidth / incno;\r\n }\r\n else {\r\n incno = itemsSplit[0];\r\n itemWidth = sampwidth / incno;\r\n }\r\n $(this).css({ 'transform': 'translateX(0px)', 'width': itemWidth * 8 });\r\n $(this).find(itemClass).each(function () {\r\n $(this).outerWidth(itemWidth);\r\n });\r\n\r\n $(\".leftLst\").addClass(\"over\");\r\n $(\".rightLst\").removeClass(\"over\");\r\n\r\n });\r\n }", "function resize() {\n // $pages.find('.sc-slides').find('.infos').height(window.innerHeight);\n // _controller.update(true);\n}", "function setSliderElementsSize($item,i){\n if($window_width > responsive_breakpoint_set[0]) {\n slider_graphic_coefficient = coefficients_graphic_array[0];\n slider_title_coefficient = coefficients_title_array[0];\n slider_subtitle_coefficient = coefficients_subtitle_array[0];\n slider_text_coefficient = coefficients_text_array[0];\n slider_button_coefficient = coefficients_button_array[0];\n }else if($window_width > responsive_breakpoint_set[1]){\n slider_graphic_coefficient = coefficients_graphic_array[1];\n slider_title_coefficient = coefficients_title_array[1];\n slider_subtitle_coefficient = coefficients_subtitle_array[1];\n slider_text_coefficient = coefficients_text_array[1];\n slider_button_coefficient = coefficients_button_array[1];\n }else if($window_width > responsive_breakpoint_set[2]){\n slider_graphic_coefficient = coefficients_graphic_array[2];\n slider_title_coefficient = coefficients_title_array[2];\n slider_subtitle_coefficient = coefficients_subtitle_array[2];\n slider_text_coefficient = coefficients_text_array[2];\n slider_button_coefficient = coefficients_button_array[2];\n }else if($window_width > responsive_breakpoint_set[3]){\n slider_graphic_coefficient = coefficients_graphic_array[3];\n slider_title_coefficient = coefficients_title_array[3];\n slider_subtitle_coefficient = coefficients_subtitle_array[3];\n slider_text_coefficient = coefficients_text_array[3];\n slider_button_coefficient = coefficients_button_array[3];\n }else if ($window_width > responsive_breakpoint_set[4]) {\n slider_graphic_coefficient = coefficients_graphic_array[4];\n slider_title_coefficient = coefficients_title_array[4];\n slider_subtitle_coefficient = coefficients_subtitle_array[4];\n slider_text_coefficient = coefficients_text_array[4];\n slider_button_coefficient = coefficients_button_array[4];\n }else if ($window_width > responsive_breakpoint_set[5]){\n slider_graphic_coefficient = coefficients_graphic_array[5];\n slider_title_coefficient = coefficients_title_array[5];\n slider_subtitle_coefficient = coefficients_subtitle_array[5];\n slider_text_coefficient = coefficients_text_array[5];\n slider_button_coefficient = coefficients_button_array[5];\n }\n else{\n slider_graphic_coefficient = coefficients_graphic_array[6];\n slider_title_coefficient = coefficients_title_array[6];\n slider_subtitle_coefficient = coefficients_subtitle_array[6];\n slider_text_coefficient = coefficients_text_array[6];\n slider_button_coefficient = coefficients_button_array[6];\n }\n\n // letter-spacing decrease quicker\n var slider_title_coefficient_letter_spacing = slider_title_coefficient;\n var slider_subtitle_coefficient_letter_spacing = slider_subtitle_coefficient;\n var slider_text_coefficient_letter_spacing = slider_text_coefficient;\n if($window_width <= responsive_breakpoint_set[0]) {\n slider_title_coefficient_letter_spacing = slider_title_coefficient/2;\n slider_subtitle_coefficient_letter_spacing = slider_subtitle_coefficient/2;\n slider_text_coefficient_letter_spacing = slider_text_coefficient/2;\n }\n\n $item.find('.thumb').css({\"width\": Math.round(window[\"slider_graphic_width_\" + i][0]*slider_graphic_coefficient) + 'px'}).css({\"height\": Math.round(window[\"slider_graphic_height_\" + i][0]*slider_graphic_coefficient) + 'px'});\n $item.find('.qode_slide-svg-holder svg').css({\"width\": Math.round(window[\"slider_svg_width_\" + i][0]*slider_graphic_coefficient) + 'px'}).css({\"height\": Math.round(window[\"slider_svg_height_\" + i][0]*slider_graphic_coefficient) + 'px'});\n\n $item.find('.q_slide_title').css({\"font-size\": Math.round(window[\"slider_title_\" + i][0]*slider_title_coefficient) + 'px'});\n $item.find('.q_slide_title').css({\"line-height\": Math.round(window[\"slider_title_\" + i][1]*slider_title_coefficient) + 'px'});\n $item.find('.q_slide_title').css({\"letter-spacing\": Math.round(window[\"slider_title_\" + i][2]*slider_title_coefficient_letter_spacing) + 'px'});\n $item.find('.q_slide_title').css({\"margin-bottom\": Math.round(window[\"slider_title_\" + i][3]*slider_title_coefficient) + 'px'});\n\n $item.find('.q_slide_subtitle').css({\"font-size\": Math.round(window[\"slider_subtitle_\" + i][0]*slider_subtitle_coefficient) + 'px'});\n $item.find('.q_slide_subtitle').css({\"line-height\": Math.round(window[\"slider_subtitle_\" + i][1]*slider_subtitle_coefficient) + 'px'});\n $item.find('.q_slide_subtitle').css({\"letter-spacing\": Math.round(window[\"slider_subtitle_\" + i][2]*slider_subtitle_coefficient_letter_spacing) + 'px'});\n $item.find('.q_slide_subtitle').css({\"margin-bottom\": Math.round(window[\"slider_subtitle_\" + i][3]*slider_subtitle_coefficient) + 'px'});\n\n $item.find('.q_slide_text').css({\"font-size\": Math.round(window[\"slider_text_\" + i][0]*slider_text_coefficient) + 'px'});\n $item.find('.q_slide_text').css({\"line-height\": Math.round(window[\"slider_text_\" + i][1]*slider_text_coefficient) + 'px'});\n $item.find('.q_slide_text').css({\"letter-spacing\": Math.round(window[\"slider_text_\" + i][2]*slider_text_coefficient_letter_spacing) + 'px'});\n\n $item.find('.qbutton:eq(0)').css({\"font-size\": Math.round(window[\"slider_button1_\" + i][0]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"font-size\": Math.round(window[\"slider_button2_\" + i][0]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(0)').css({\"line-height\": Math.round(window[\"slider_button1_\" + i][1]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"line-height\": Math.round(window[\"slider_button2_\" + i][1]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(0)').css({\"letter-spacing\": Math.round(window[\"slider_button1_\" + i][2]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"letter-spacing\": Math.round(window[\"slider_button2_\" + i][2]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(0)').css({\"height\": Math.round(window[\"slider_button1_\" + i][3]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"height\": Math.round(window[\"slider_button2_\" + i][3]*slider_button_coefficient) + 'px'});\n if(window[\"slider_button1_\" + i][4] != 0) {\n $item.find('.qbutton:eq(0)').css({\"width\": Math.round(window[\"slider_button1_\" + i][4]*slider_button_coefficient) + 'px'});\n }else{\n $item.find('.qbutton:eq(0)').css({\"width\": 'auto'});\n }\n if(window[\"slider_button2_\" + i][4] != 0) {\n $item.find('.qbutton:eq(1)').css({\"width\": Math.round(window[\"slider_button2_\" + i][4]*slider_button_coefficient) + 'px'});\n }else{\n $item.find('.qbutton:eq(1)').css({\"width\": 'auto'});\n }\n $item.find('.qbutton:eq(0)').css({\"padding-left\": Math.round(window[\"slider_button1_\" + i][5]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"padding-left\": Math.round(window[\"slider_button2_\" + i][5]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(0)').css({\"padding-right\": Math.round(window[\"slider_button1_\" + i][6]*slider_button_coefficient) + 'px'});\n $item.find('.qbutton:eq(1)').css({\"padding-right\": Math.round(window[\"slider_button2_\" + i][6]*slider_button_coefficient) + 'px'});\n\n $item.find('.separator').css({\"margin-top\": Math.round(window[\"slider_separator_\" + i][0]*slider_title_coefficient) + 'px'});\n $item.find('.separator').css({\"margin-bottom\": Math.round(window[\"slider_separator_\" + i][1]*slider_title_coefficient) + 'px'});\n\n }", "function changeToFit() { //fix\n if (($(window).width() < 559)) {\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"134px\";\n }\n for (i = 0; i < authorDeck.length; i++) {\n // the carousel elements\n authorDeck[i].style.fontSize = \"13px\";\n deckTitle[i].children[0].classList.add(\"h5\");\n deckTitle[i].style.maxWidth = \"50%\";\n changeFlowItemToFitSmallWindow(i)\n }\n // nav bar\n removeAbsolutePosition();\n userBar.style.width = \"100%\";\n for (i = 0; i < userBar.children.length; i++) {\n userBar.children[i].style.width = String($(window).width() / 4) + \"px\";\n }\n } else if (($(window).width() < 700)) {\n // nav bar\n spreadNavBar();\n removeAbsolutePosition();\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"134px\";\n }\n for (i = 0; i < userBar.children.length; i++) {\n userBar.children[i].style.width = \"\";\n }\n // carousel\n for (i = 0; i < authorDeck.length; i++) {\n spreadCarousel(i);\n changeFlowItemToFitSmallWindow(i)\n }\n } else if ($(window).width() < 977) {\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"134px\";\n }\n // nav bar\n spreadNavBar();\n userBar.classList.add(\"position-absolute\");\n userBar.style.right = \"-80px\";\n // carousel\n for (i = 0; i < imageFlowCard.length; i++) {\n spreadCarousel(i);\n changeFlowItemToFitSmallWindow(i);\n }\n } else if ($(window).width() < 1200) {\n // trending decks\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"134px\";\n }\n // navbar\n spreadNavBar();\n removeAbsolutePosition();\n for (var i = 0; i < imageFlowCard.length; i++) {\n // carousel\n spreadCarousel(i);\n changeFlowItemToFitLargeWindow(i);\n }\n } else {\n // navbar\n spreadNavBar();\n removeAbsolutePosition();\n for (i = 0; i < trendingDecks.length; i++) {\n trendingDecks[i].parentElement.style.height = \"166px\";\n }\n for (i = 0; i < imageFlowCard.length; i++) {\n // carousel\n spreadCarousel(i);\n changeFlowItemToFitLargeWindow(i);\n }\n }\n}", "function simpleLayoutChanges() {\n \"use strict\";\n var container = $('.container').width();\n $('.testimonial_carousel .item').each(function() {\n\n var self = $(this);\n var wpb_column = self.parents('.wpb_column').first().width();\n self.innerWidth(wpb_column + 'px');\n self.height(self.height() + 'px');\n self.parents('.caroufredsel_wrapper').first().height(self.height() + 'px');\n self.parents('.testimonial_carousel').first().height(self.height() + 'px');\n\n });\n\n $('.clients_caro .item').each(function() {\n var self = $(this);\n var wpb_column = self.parents('.vc_column-inner').width();\n\n if (container > 420 && container <= 724) {\n self.innerWidth((wpb_column / 3) + 'px');\n }\n if (container > 724 && container < 940) {\n self.innerWidth((wpb_column / 4) + 'px');\n }\n if (container > 940) {\n self.innerWidth((wpb_column / 6) + 'px');\n }\n });\n\n clientsCarousel();\n }", "_changeSliderSize() {\n\t\t\t\tlet width = this.model.get('width'),\n\t\t\t\t\theight = this.model.get('height');\n\n\t\t\t\tthis.$el.css({width, height});\n\t\t\t}", "function resize(){\n // adjust the container's height to fill the modal window\n $(container).height($(modal).height());\n // adjust each slide's width to fill the container\n var containerWidth = $(container).width();\n $(slides).each(function(){\n $(this).css('width', containerWidth);\n });\n // adjust the slider to fit all slides side-by-side\n slideWidth = $(slides).eq(0).width();\n var sliderWidth = slideWidth * slides.length;\n $(slider).width(sliderWidth);\n // adjust the slider's height to fill the container\n var sliderHeight = $(container).height()\n $(slider).height(sliderHeight);\n // adjust each image div to fill the space above its caption\n var imageHeight = $(captions).eq(0).position().top\n $(images).each(function(){\n $(this).height(imageHeight);\n });\n // make sure that the current slide is still in the proper position\n navigate(0, false);\n }", "function initCarousel($c, $w){\n $c.show().carouFredSel({\n align: false,\n items: Math.min($c.children().length - 1, 12),\n scroll: {\n items: 1,\n duration: 7500,\n timeoutDuration: 0,\n easing: 'linear',\n pauseOnHover: 'immediate'\n }\n });\n\n \n $w.bind('resize.affiliations', function() {\n var nw = $w.width();\n if (nw < 990) {\n nw = 990;\n }\n\n $c.width(nw * 3);\n $c.parent().width(nw);\n\n }).trigger('resize.affiliations');\n}", "onLayoutReposition() {\n this.slider.find('.slick-slide').css('max-width', this.getSliderWidth());\n this.slider.find('.images-list__item').css('max-height', this.getSliderHeight());\n }", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1920);\n jssor_1_slider.$ScaleWidth(refSize);\n }else{\n window.setTimeout(ScaleSlider, 30);\n }\n }", "setStyle (){\n // console.log(\"style\")\n let ratio = this.items.length / this.slidesVisible\n this.container.style.width = (ratio * 100)+ \"%\"\n this.items.forEach(item => item.style.width= ((100 / this.slidesVisible )/ ratio) + \"%\")\n }", "function ScaleSlider() {\n var bodyWidth = document.body.clientWidth;\n if (bodyWidth)\n jssor_slider1.$ScaleWidth(Math.min(bodyWidth, 1920));\n else\n $Jssor$.$Delay(ScaleSlider, 30);\n }", "function ScaleSlider() {\n var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;\n if (parentWidth) jssor_slider1.$ScaleWidth(Math.min(parentWidth, 720));\n else $Jssor$.$Delay(ScaleSlider, 30);\n }", "function GallerySize(){jQuery(\".codegallery\").css({\"height\":jQuery(\".codeimage:first img\").height(),\"width\":jQuery(\".codeimage:first img\").width()});jQuery(\".codeimage\").width(jQuery(\".codegallery\").width());jQuery(\".carousel\").css(\"width\",jQuery(\".codeimage\").width()*jQuery(\".codeimage\").length)}", "function ScaleSlider() {\n var bodyWidth = $(window).width();\n if (bodyWidth)\n jssor_slider1.$ScaleWidth(Math.min(bodyWidth, 1920));\n else\n window.setTimeout(ScaleSlider, 30);\n }", "function ScaleSlider() {\n var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth;\n if (parentWidth)\n jssor_slider2.$ScaleWidth(Math.min(parentWidth, 600));\n else\n window.setTimeout(ScaleSlider, 30);\n }", "function handleResize() {\n // 1. update height of step elements\n // var stepH = Math.floor(window.innerHeight * 0.7);\n // step.style('height', stepH + 'px');\n //\n // var figureHeight = window.innerHeight\n // var figureMarginTop = (window.innerHeight - figureHeight) / 2\n\n\n\n var figureHeight;\n\n if (window.innerWidth < 992 ) {\n figureHeight = window.innerWidth*(1272/2000);\n } else {\n figureHeight = window.innerWidth*(1272/2000*0.7);\n};\n\n\n // figureHeight = window.innerWidth*(1272/2000*0.7)\n var figureMarginTop = (window.innerHeight - figureHeight) / 2\n\n // var stepH = Math.floor(figureHeight * 0.9);\n // step.style('height', stepH + 'px');\n\n var stepMT = Math.floor(figureHeight * 0.9);\n step.style('\tmargin-bottom', stepMT + 'px');\n\n\n figure\n .style('height', figureHeight + 'px')\n .style('top', figureMarginTop + 'px');\n\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n }", "function ScaleSlider() {\n var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth;\n if (parentWidth)\n jssor_slider2.$ScaleWidth(Math.min(parentWidth, 750));\n else\n window.setTimeout(ScaleSlider, 30);\n }", "function newSize() {\n offsets = [];\n ih = window.innerHeight;\n TweenMax.set(\"#panelWrap\", { height: slides.length * ih });\n TweenMax.set(slides, { height: ih });\n for (let i = 0; i < slides.length; i++) {\n offsets.push(-slides[i].offsetTop);\n }\n TweenMax.set(container, { y: offsets[activeSlide] });\n dragMe[0].vars.snap = offsets;\n}", "function fitToContainer() {\n\tresizeButtons();\n\treconfigureArrows();\n}", "onResize() {\n var sizes = document.getElementById('demogl').getBoundingClientRect();\n\n this.sliders.forEach(function(slider) {\n slider.max = sizes[slider.getAttribute('data-size')];\n this.onSliderChange({ target: slider });\n }, this);\n }", "_updateCarouselLayout() {\n if (!this.getContainerElement()) {\n return;\n }\n var carouselSize = qx.bom.element.Dimension.getSize(\n this.getContainerElement()\n );\n\n this.__carouselWidth = carouselSize.width;\n\n if (this.getHeight() !== null) {\n this._setStyle(\"height\", this.getHeight() / 16 + \"rem\");\n } else {\n this._setStyle(\"height\", \"100%\");\n }\n\n qx.bom.element.Style.set(\n this.__carouselScroller.getContentElement(),\n \"width\",\n this.__pages.length * carouselSize.width + \"px\"\n );\n\n for (var i = 0; i < this.__pages.length; i++) {\n var pageContentElement = this.__pages[i].getContentElement();\n qx.bom.element.Style.set(\n pageContentElement,\n \"width\",\n carouselSize.width + \"px\"\n );\n\n qx.bom.element.Style.set(\n pageContentElement,\n \"height\",\n carouselSize.height + \"px\"\n );\n }\n\n if (this.__pages.length == 1) {\n this.__pagination.exclude();\n } else {\n if (this.isShowPagination()) {\n this.__pagination.show();\n }\n }\n\n this._refreshScrollerPosition();\n }", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1920);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function ScaleSlider() {\n var width = $galleryWide.parent().width();\n galleryWide.width = width;\n //if (bodyWidth)\n // galleryWide.$ScaleWidth(bodyWidth);\n //else\n // window.setTimeout(ScaleSlider, 30);\n }", "onResize() {\n var sizes = document\n .getElementById('demogl')\n .getBoundingClientRect();\n\n this.sliders.forEach(function(slider) {\n slider.max = sizes[slider.getAttribute('data-size')];\n this.onSliderChange({ target: slider });\n }, this);\n }", "function ScaleSlider() {\n// var refSize = jssor_1_slider.$Elmt.parentNode.clientHeight;\n// if (refSize) {\n// refSize = Math.min(refSize, $(window).height());\n// jssor_1_slider.$ScaleHeight(refSize);\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, $(window).width());\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function qodeNumberOfTestimonialsItemsResize(){\n\n\n var testimonialsSlider = $j('.testimonials_carousel, .testimonials_c_carousel');\n\n if(testimonialsSlider.length){\n testimonialsSlider.each(function(){\n var thisSliderHolder = $j(this);\n\n var items = qodeNumberOfTestimonialsItems(thisSliderHolder);\n\n thisSliderHolder.data('flexslider').vars.minItems = items;\n thisSliderHolder.data('flexslider').vars.maxItems = items;\n });\n }\n}", "function resizeZoom(event)\n{\n var jqDiv = $('#meeting > #zoom > .cloudcarousel'),\n wbCanvas = $(\"#wbCanvas\", jqDiv), // todo better wb access\n wb = wbCanvas.data('wb'),\n edit = jqDiv.data('gcEdit'),\n width, height, item, newWidth, newHeight,\n widthScale, heightScale, scale, left, top;\n if (jqDiv.length > 0)\n {\n width = $('#meeting > #zoom').width();\n height = $('#meeting > #zoom').height();\n item = $(jqDiv).data('item');\n newWidth = width; // * 1.0; //app.carousel.options.xSpotRatio;\n newHeight = height; // * 1.0; //app.carousel.options.ySpotRatio;\n widthScale = newWidth / item.orgWidth;\n heightScale = newHeight / item.orgHeight;\n scale = (widthScale < heightScale) ? widthScale : heightScale;\n item.orgWidth *= scale;\n item.orgHeight *= scale;\n item.plgOrgWidth *= scale;\n item.plgOrgHeight *= scale;\n if (wb) // todo better wb access\n {\n wb.setScale(item.plgOrgWidth, item.plgOrgHeight);\n } else if (edit) {\n edit.setScale(item.plgOrgWidth, item.plgOrgHeight);\n }\n\n // center div in zoom div\n left = (width - item.orgWidth) / 2;\n top = (height - item.orgHeight) / 2;\n\n $(jqDiv).css('width', item.orgWidth + 'px');\n $(jqDiv).css('height', item.orgHeight + 'px');\n $(jqDiv).css('left', left + 'px');\n $(jqDiv).css('top', top + 'px');\n\n $('#zoom > .close').css({\n 'left': (left + 10.0) + 'px'\n });\n\n if ($(jqDiv).hasClass('editor')) {\n $('#zoom > .close').css({'bottom': '10px'});\n } else {\n $('#zoom > .close').css({'top': (top + 10.0) + 'px'});\n }\n }\n}", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1080); //600\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function ScaleSlider() {\r\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\r\n if (refSize) {\r\n refSize = Math.min(refSize, 1920);\r\n jssor_1_slider.$ScaleWidth(refSize);\r\n }\r\n else {\r\n window.setTimeout(ScaleSlider, 30);\r\n }\r\n }", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1170);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1170);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function ScaleSlider() {\r\n var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth;\r\n var get_wWindow = $(window).width();\r\n \r\n if (parentWidth) {\r\n var sliderWidth = parentWidth;\r\n sliderWidth = Math.min(sliderWidth, get_wWindow);\r\n jssor_slider2.$ScaleWidth(sliderWidth);\r\n }\r\n else\r\n window.setTimeout(ScaleSlider, 30);\r\n }", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 820);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function setCarouselHeight() {\n \"use strict\";\n try {\n var selectedHeight,\n i;\n for (i = 0; i < carousels.length; i += 1) {\n selectedHeight = carousels[i].querySelector('.selected').offsetHeight;\n carousels[i].querySelector('.carouselLeft').style.height = selectedHeight + \"px\";\n carousels[i].querySelector('.carouselRight').style.height = selectedHeight + \"px\";\n carousels[i].style.height = selectedHeight + carousels[i].querySelector('.navDots').offsetHeight + \"px\";\n }\n } catch (ex) {\n console.log(ex.name + \": \" + ex.message);\n }\n }", "function ScaleSlider() {\n var refSize = jssor_2_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1920);\n jssor_2_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "applyWidthOnDxpImg() {\r\n for (const i of Object.keys(this.dxpCarouselSlide)) {\r\n this.dxpCarouselSlide[i].style.display = 'block';\r\n this.dxpCarouselSlide[i].style.width = `${this.carouselContainer.offsetWidth}px`;\r\n }\r\n }", "function ScaleSlider() {\r\n\t\t\tvar bodyWidth = document.body.clientWidth;\r\n\t\t\tif (bodyWidth)\r\n\t\t\t\tjssor_slider1.$ScaleWidth(Math.min(bodyWidth, 1920));\r\n\t\t\telse\r\n\t\t\t\twindow.setTimeout(ScaleSlider, 30);\r\n\t\t}", "function initCarouselControls() {\n\tvar imgWidth = 0;\t\t\n\t$('.jcarousel-img-container > img').load( function() {\t\t\n\t\t$(this).each( function(){\n\t\t\timgWidth += $(this).width();\n\t\t\tif ( imgWidth < (windowObj.width() * 0.6 )) {\n\t\t\t\t$('.jcarousel-next').fadeOut( 800 );\n\t\t\t} else {\n\t\t\t\t$('.jcarousel-next').fadeIn( 800 );\n\t\t\t}\n\t\t});\t\t\n\t});\n}", "function resizeSliderWrap(){\n\n // get the height of a porfolio image\n var listHeight = $j('li.active img').height();\n\n if (listHeight <= 200){\n listHeight = 736;\n }\n\n //update it\n $j('.slider').height(listHeight);\n}", "function setParallaxImgDimensions() {\n _parallaxContainer.each(function() {\n var $parallaxEl = $(this).find(\".parallax-element\");\n\n $parallaxEl.css({\n width: _windowWidth + \"px\",\n height: \"auto\"\n });\n\n if ($parallaxEl.outerHeight() <= _windowHeight) {\n $parallaxEl.css({\n height: _windowHeight + \"px\",\n width: \"auto\" \n });\n }\n });\n }", "function resize(index){ \r\n\t\tvar slideShow,slideBoxes, slideWidth, ratio, slideHeight;\r\n\t\tif (index === 'all'){\r\n\t\t\tfor(var i=0;i<s.slideShows.length;i++){\r\n\t\t\t\tslideShow \t= s.slideShows[i];\r\n\t\t\t\tslideBoxes = $(slideShow.slider).find('.wc-slide-box');\r\n\t\t\t\tslideWidth \t= slideBoxes.first().width();\r\n\t\t\t\tif(slideShow.wcParams.height){\r\n\t\t\t\t\tratio = slideShow.wcParams.height / s.defaultWidth; /*[1]*/\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tratio = s.defaultRatio; \r\n\t\t\t\t}\r\n\t\t\t\tslideHeight = slideWidth * ratio;\r\n\t\t\t\tslideBoxes.height(slideHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tslideShow \t= s.slideShows[index];\r\n\t\t\tslideBoxes \t= $(slideShow.slider).find('.wc-slide-box');\r\n\t\t\tslideWidth \t= slideBoxes.first().width();\r\n\t\t\tif(slideShow.wcParams.height){\r\n\t\t\t\tratio = slideShow.wcParams.height / s.defaultWidth; /*[2]*/\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tratio = s.defaultRatio; \r\n\t\t\t}\r\n\t\t\tslideHeight = slideWidth * ratio;\r\n\t\t\tslideBoxes.height(slideHeight);\r\n\t\t}\r\n\t}", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 600);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 600);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function ScaleSlider() {\r\n var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;\r\n if (parentWidth)\r\n jssor_slider1.$ScaleWidth(Math.max(Math.min(parentWidth, 2000), 300));\r\n else\r\n window.setTimeout(ScaleSlider, 30);\r\n }", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 960);\n refSize = Math.max(refSize, 300);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function resizeImgs() {\n window.galleryItemsWidth = $(galleryItemList[0]).innerWidth();\n for (var i = galleryItemsLength - 1; i >= 0; i--) {\n\n $item = $(galleryItemList[i]);\n\n var itemAttrWidth = $item.attr('width'),\n itemAttrHeight = $item.attr('height')\n itemCurrentHeight = Math.floor(galleryItemsWidth * itemAttrHeight / itemAttrWidth);\n $item.height(itemCurrentHeight);\n };\n }", "function resizeCards() {\n $('.card').css('width', window.innerHeight * 0.8 / 3.1);\n $('.card').css('height', window.innerHeight * 0.8 / 3.1);\n }", "function setupCarouselElements() {\n // element that will contain the slider and buttons\n viewportElement = document.createElement('div');\n viewportElement.className = 'carousel-viewport';\n\n // element that will contain the slides\n sliderElement = document.createElement('div');\n sliderElement.className = 'carousel-slider';\n\n elements.forEach(function (element, index) {\n // appending parent child elements into sliderElement\n sliderElement.appendChild(element);\n });\n\n viewportElement.appendChild(sliderElement);\n parentElement.appendChild(viewportElement);\n }", "function handleResize() {\n // 1. update height of step elements\n // var stepH = Math.floor(window.innerHeight * 0.75);\n // step.style(\"height\", stepH + \"px\");\n\n var figureHeight = window.innerHeight / 2;\n var figureMarginTop = (window.innerHeight - figureHeight) / 2;\n\n figure\n .style(\"height\", figureHeight + \"px\")\n .style(\"top\", figureMarginTop + \"px\");\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n}", "function setMainSliderHeight(){\n if (!isMobile) {\n var width = $('.b-main-slider-cont').width();\n $('.b-main-slider-cont').css('max-height', width/2);\n }\n }", "function handleResize() {\n // 1. update height of step elements\n var stepH = Math.floor(window.innerHeight * 0.75);\n step.style(\"height\", stepH + \"px\");\n\n var figureHeight = window.innerHeight / 2;\n var figureMarginTop = (window.innerHeight - figureHeight) / 2;\n\n figure\n .style(\"height\", figureHeight + \"px\")\n .style(\"top\", figureMarginTop + \"px\");\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n}", "function ScaleSlider() {\n\t\t\tvar refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n\t\t\tif (refSize) {\n\t\t\t\trefSize = Math.min(refSize, 1920);\n\t\t\t\tjssor_1_slider.$ScaleWidth(refSize);\n\t\t\t} else {\n\t\t\t\twindow.setTimeout(ScaleSlider, 30);\n\t\t\t}\n\t\t}", "function ScaleSlider() {\r\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\r\n if (refSize) {\r\n refSize = Math.min(refSize, 800);\r\n jssor_1_slider.$ScaleWidth(refSize);\r\n }\r\n else {\r\n window.setTimeout(ScaleSlider, 30);\r\n }\r\n }", "onResize(){\n setTimeout(() =>{\n this.slidesConfig();\n this.changeSlide(this.index.active)\n },600)\n \n }", "function galleryWorksSlider(){\n\n $('.gallery-works-main').slick({\n infinite: true,\n slidesToShow: 3,\n slidesToScroll: 3,\n arrows:false,\n dots:true,\n responsive: [\n {\n breakpoint: 666,\n settings: {\n slidesToShow: 2,\n slidesToScroll: 2\n }\n },\n {\n breakpoint: 375,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1\n }\n },\n ]\n });\n\n }", "function euGalleryAdjust() {\n\t\t\timg_height = $( 'ul.eu_gallery li figure .img_container' ).height();\n\n\t\t\t/**\n\t\t\t * Resize img_container\n\t\t\t */\n\t\t\timg_cont_w = $( '.img_container' ).width();\n\t\t\timg_cont_h = ( 387*img_cont_w ) / 582;\n\t\t\t$( '.img_container' ).height( img_cont_h );\n\t\t\t$( '.eu_gallery' ).height( $( '.eu_gallery li' ).height() );\n\n\t\t\t/**\n\t\t\t * Reposition the gallery controls\n\t\t\t */\n\t\t\ty_pos = img_height - 45;\n\t\t\t$( '.eu_expand_gallery' ).css( 'top', y_pos );\n\t\t\t$( '.eu_slide_number' ).css( 'top', y_pos - 45 );\n\t\t\t$( '.eu_prev, .eu_next' ).css('top', y_pos/2 );\n\t\t\tif( 720 >= $(window).width() ) {\n\t\t\t\t$( '.eu_slide_number' ).css( 'top', y_pos );\n\t\t\t}\n\t\t}", "function sizeAll() {\n\tvar h = window.innerHeight;\n\tvar\tw = window.innerWidth;\n\t\n\tif ( w > (h-250)*2) {\n\t\tTweenMax.set(demo, {height:h-240, width:(h-250)*2});\n\t\tTweenMax.set($controls, {y:h-240});\t\n\t}\telse {\n\t\tTweenMax.set(demo, {y:0, width:w-10, height:w/2});\n\t\tTweenMax.set($controls, {y:w/2+10});\t\n\t}\n}", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 980);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 600);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function fillCarousel() {\r\n\t\taddInsideHtml();\r\n\r\n\t\tfunction addInsideHtml() {\r\n\t\t\tvar ids = [\"101\", \"102\", \"103\", \"1122\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"117\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\"];\r\n\r\n\t\t\t// Set before looping inside!\r\n\t\t\tvar div_row = document.createElement(\"div\");\r\n\t\t\tdiv_row.classList.add(\"row\");\r\n\t\t\tvar div_item = document.createElement(\"div\");\r\n\t\t\tdiv_item.classList.add(\"carousel-item\", \"active\");\r\n\t\t\tdiv_item.appendChild(div_row);\r\n\t\t\t$(\"#container-bolin\")[0].appendChild(div_item);\r\n\r\n\t\t\tvar count = 0;\r\n\r\n\t\t\tfor (var i in ids) {\r\n\t\t\t\tvar id = ids[i];\r\n\t\t\t\t// Add Modals\r\n\t\t\t\tvar modal = generateModal(id);\r\n\t\t\t\t$(\"#modalsBulin\")[0].appendChild(modal);\r\n\t\t\t\t// Add Images\r\n\t\t\t\tvar res_img = addImages(id, count, div_row);\r\n\t\t\t\tcount = res_img[0];\r\n\t\t\t\tdiv_row = res_img[1];\r\n\t\t\t}\r\n\r\n\t\t\tfillChartsModal(ids);\r\n\r\n\t\t\t$('#carouselImages').carousel({\r\n\t\t\t\tinterval: 2800\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction generateModal(id) {\r\n\t\t\tvar div_out_modal = document.createElement(\"div\");\r\n\t\t\tdiv_out_modal.classList.add(\"modal\", \"fade\");\r\n\t\t\tdiv_out_modal.setAttribute(\"id\", \"modal-\" + id)\r\n\t\t\tdiv_out_modal.setAttribute(\"tabindex\", \"-1\")\r\n\t\t\tdiv_out_modal.setAttribute(\"role\", \"dialog\")\r\n\t\t\tdiv_out_modal.setAttribute(\"aria-labelledby\", \"painting\" + id)\r\n\t\t\tdiv_out_modal.setAttribute(\"aria-hidden\", \"true\")\r\n\r\n\t\t\tvar div_modal_dialog = document.createElement(\"div\");\r\n\t\t\tdiv_modal_dialog.classList.add(\"modal-dialog\", \"modal-lg\");\r\n\t\t\tdiv_modal_dialog.setAttribute(\"role\", \"document\");\r\n\r\n\t\t\tvar div_modal_content = document.createElement(\"div\");\r\n\t\t\tdiv_modal_content.classList.add(\"modal-content\");\r\n\r\n\t\t\tvar div_modal_header = document.createElement(\"div\");\r\n\t\t\tdiv_modal_header.classList.add(\"modal-header\");\r\n\r\n\t\t\t// Body Modal\r\n\t\t\tvar modal_title = document.createElement(\"h4\");\r\n\t\t\tmodal_title.classList.add(\"modal-title\", \"w-100\");\r\n\t\t\tmodal_title.setAttribute(\"id\", \"painting\" + id);\r\n\t\t\tmodal_title.innerText = \"Emotions analysis\";\r\n\r\n\t\t\tdiv_modal_header.appendChild(modal_title);\r\n\r\n\t\t\tdiv_modal_content.appendChild(div_modal_header);\r\n\r\n\t\t\tvar div_modal_body = document.createElement(\"div\");\r\n\t\t\tdiv_modal_body.classList.add(\"modal-body\");\r\n\r\n\t\t\tvar canvas = document.createElement(\"canvas\");\r\n\t\t\tcanvas.setAttribute(\"id\", \"canvas-\" + id);\r\n\t\t\tdiv_modal_body.appendChild(canvas);\r\n\r\n\t\t\tdiv_modal_content.appendChild(div_modal_body);\r\n\r\n\t\t\t// Statistics\r\n\t\t\tvar statistics = document.createElement(\"div\");\r\n\t\t\tstatistics.classList.add(\"row\", \"mg-20-top\");\r\n\r\n\t\t\tvar statistics_left = document.createElement(\"div\");\r\n\t\t\tstatistics_left.classList.add(\"col\");\r\n\r\n\t\t\tvar statistics_right = document.createElement(\"div\");\r\n\t\t\tstatistics_right.classList.add(\"col\");\r\n\r\n\t\t\tvar canvas_line = document.createElement(\"canvas\");\r\n\t\t\tcanvas_line.setAttribute(\"id\", \"canvasline-\" + id);\r\n\t\t\tstatistics_right.appendChild(canvas_line);\r\n\r\n\t\t\tstatistics.appendChild(statistics_left);\r\n\t\t\tstatistics.appendChild(statistics_right);\r\n\r\n\t\t\tdiv_modal_body.appendChild(statistics);\r\n\r\n\t\t\tvar div_modal_footer = document.createElement(\"div\");\r\n\t\t\tdiv_modal_footer.classList.add(\"modal-footer\");\r\n\r\n\t\t\tvar button_footer = document.createElement(\"button\");\r\n\t\t\tbutton_footer.classList.add(\"btn\", \"sunny-morning-gradient\", \"btn-sm\");\r\n\t\t\tbutton_footer.setAttribute(\"data-dismiss\", \"modal\");\r\n\t\t\tbutton_footer.innerText = \"Close\";\r\n\r\n\t\t\tdiv_modal_footer.appendChild(button_footer);\r\n\t\t\tdiv_modal_content.appendChild(div_modal_footer);\r\n\r\n\t\t\tdiv_modal_dialog.appendChild(div_modal_content);\r\n\t\t\tdiv_out_modal.appendChild(div_modal_dialog);\r\n\t\t\treturn div_out_modal;\r\n\t\t}\r\n\r\n\t\tfunction addImages(id, count, div_row) {\r\n\t\t\t// Add dynamically all the images in carousel\r\n\t\t\tvar div = document.createElement(\"div\");\r\n\t\t\tdiv.classList.add(\"col\", \"work\");\r\n\r\n\t\t\tvar a = document.createElement(\"a\");\r\n\t\t\ta.setAttribute(\"id\", \"a-\" + id);\r\n\t\t\ta.setAttribute(\"data-toggle\", \"modal\");\r\n\t\t\ta.setAttribute(\"data-target\", \"modal-\" + id);\r\n\t\t\ta.classList.add(\"work-box\", \"imageBolin\");\r\n\r\n\t\t\ta.addEventListener(\"click\", function () {\r\n\t\t\t\t$(\"#modal-\" + id).modal('show');\r\n\t\t\t});\r\n\r\n\t\t\tvar img = document.createElement(\"img\");\r\n\t\t\timg.setAttribute(\"src\", \"/static/images/bolin/\" + id + \".jpg\");\r\n\r\n\t\t\ta.appendChild(img);\r\n\r\n\t\t\tvar div_inner = document.createElement(\"div\");\r\n\t\t\tdiv_inner.classList.add(\"overlay\");\r\n\r\n\t\t\tvar div_inner2 = document.createElement(\"div\");\r\n\t\t\tdiv_inner2.classList.add(\"overlay-caption\");\r\n\r\n\t\t\tvar p = document.createElement(\"p\");\r\n\t\t\tvar span = document.createElement(\"span\");\r\n\t\t\tspan.classList.add(\"icon\", \"icon-magnifying-glass\");\r\n\t\t\tp.appendChild(span);\r\n\r\n\t\t\tdiv_inner2.appendChild(p);\r\n\t\t\tdiv_inner.appendChild(div_inner2);\r\n\r\n\t\t\ta.appendChild(div_inner);\r\n\r\n\t\t\tdiv.appendChild(a);\r\n\r\n\t\t\tif (count != 0 & count % 6 == 0) {\r\n\t\t\t\tvar div_row = document.createElement(\"div\");\r\n\t\t\t\tdiv_row.classList.add(\"row\");\r\n\r\n\t\t\t\tvar div_item = document.createElement(\"div\");\r\n\t\t\t\tdiv_item.classList.add(\"carousel-item\");\r\n\r\n\t\t\t\tdiv_item.appendChild(div_row);\r\n\r\n\t\t\t\t$(\"#container-bolin\")[0].appendChild(div_item);\r\n\t\t\t}\r\n\t\t\tdiv_row.appendChild(div);\r\n\t\t\tcount = count + 1;\r\n\t\t\treturn [count, div_row];\r\n\t\t}\r\n\r\n\t\tfunction fillChartsModal(keys) {\r\n\t\t\tif (keys.length > 0) {\r\n\t\t\t\tvar id = keys[0];\r\n\t\t\t\tkeys = keys.slice(1);\r\n\t\t\t\tvar idPic = null;\r\n\r\n\t\t\t\tif (id == \"1122\")\r\n\t\t\t\t\tidPic = \"112\";\r\n\t\t\t\telse idPic = id;\r\n\r\n\r\n\t\t\t\t$.ajax({\r\n\t\t\t\t\turl: '/experiment/painting?id=' + idPic,\r\n\t\t\t\t\ttype: 'GET',\r\n\t\t\t\t\tsuccess: function (result) {\r\n\t\t\t\t\t\tvar datas = {}\r\n\r\n\t\t\t\t\t\tfor (var r in result) {\r\n\t\t\t\t\t\t\tdatas[r] = normalizeData(result[r]);\r\n\t\t\t\t\t\t\tdatas[r][\"name\"] = result[r][\"name\"];\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar datasMean = {\r\n\t\t\t\t\t\t\t\"name\": null,\r\n\t\t\t\t\t\t\t\"anger\": 0,\r\n\t\t\t\t\t\t\t\"contempt\": 0,\r\n\t\t\t\t\t\t\t\"disgust\": 0,\r\n\t\t\t\t\t\t\t\"fear\": 0,\r\n\t\t\t\t\t\t\t\"happiness\": 0,\r\n\t\t\t\t\t\t\t\"sadness\": 0,\r\n\t\t\t\t\t\t\t\"surprise\": 0\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tvar emotions = ['anger', 'contempt', 'disgust', 'fear', 'happiness', 'sadness', 'surprise']\r\n\t\t\t\t\t\tvar t = 0;\r\n\r\n\t\t\t\t\t\tfor (var i in datas) { // average to avoid time\r\n\t\t\t\t\t\t\tt++;\r\n\t\t\t\t\t\t\tdatasMean['name'] = datas[i]['name'];\r\n\t\t\t\t\t\t\tfor (var el in emotions) {\r\n\t\t\t\t\t\t\t\tvar emotion = emotions[el];\r\n\t\t\t\t\t\t\t\tdatasMean[emotion] = (((datasMean[emotion] * (t - 1)) / t) + datas[i][emotion] / t);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Generate radar chart\r\n\t\t\t\t\t\tvar chartGenerated = fillChart('radar', `canvas-${id}`, datasMean['name'], datasMean);\r\n\r\n\t\t\t\t\t\tvar chartTimeGenerated = fillChartTime('line', `canvasline-${id}`, datas);\r\n\r\n\t\t\t\t\t\tfillChartsModal(keys);\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror: function (error) { // error retrieve data of an image\r\n\t\t\t\t\t\tconsole.log(error);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t// });\r\n\t\t\t} else return\r\n\r\n\t\t};\r\n\t}", "function ScaleSlider() {\r\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\r\n if (refSize) {\r\n refSize = Math.min(refSize, 600);\r\n jssor_1_slider.$ScaleWidth(refSize);\r\n }\r\n else {\r\n window.setTimeout(ScaleSlider, 30);\r\n }\r\n }", "function slideshowWidth(){\n\t\t\t$('.home-slideshow-outer,#home-slideshow,.home-slide').width( $( window ).width() ).height( $( window ).height());\n\t\t}", "function changeResize() {\n setWidth(window.innerWidth);\n }", "function SizeDependWidth() {\n wImageCur = va.wSlide;\n hImageCur = M.R(wImageCur / rateImage);\n }", "function updateSliderWidthAndHeight() {\n slider._width = $slider.width();\n slider._height = $slider.height();\n }", "function changeInsightsSliderSize() {\n\t\t\twrapperI.css({\n\t\t\t\twidth: itemsI.length * sliderInsightsWidth + \"vw\"\n\t\t\t});\n\t\t\t\n\t\t\tpaddingI.css({\n\t\t\t\tpadding: \"0 \" + sliderInsightsPadding + \"vw\"\n\t\t\t});\n\t\t\t\n\t\t\titemsI.each(function() {\n\t\t\t\tif(parseFloat($(this).css(\"width\")) != 0) {\n\t\t\t\t\t$(this).css({\n\t\t\t\t\t\twidth: sliderInsightsWidth + \"vw\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t$(this).css({\n\t\t\t\t\theight: sliderInsightsHeight + \"em\"\n\t\t\t\t});\n\t\t\t});\n\t\t\t\n\t\t\tcontrolI.css({\n\t\t\t\tmarginLeft: sliderInsightsPadding + \"vw\",\n\t\t\t\twidth: (Math.floor(100/sliderInsightsWidth) * sliderInsightsWidth - 2 * sliderInsightsPadding) + \"vw\"\n\t\t\t});\n\t\t}", "function handleResize() {\n\t\t\t// 1. update height of step elements\n\t\t\tvar stepH = Math.floor(window.innerHeight * 0.75);\n\t\t\tstep.style('height', stepH + 'px');\n\t\t\tvar figureHeight = window.innerHeight / 1.2\n\t\t\tvar figureMarginTop = (window.innerHeight - figureHeight) / 2\n\t\t\tfigure\n\t\t\t\t.style('height', figureHeight + 'px')\n\t\t\t\t.style('top', figureMarginTop + 'px');\n\t\t\t// 3. tell scrollama to update new element dimensions\n\t\t\tscroller.resize();\n\t\t}", "function seven_next_carousel()\n\t\t{\n\t\t\t if(100*length<option.width)\t return false;\n\t\t\t var tb=parseInt(option.width/160);\n\t\t\t var temp=Math.abs(Math.ceil(parseInt(handle.find(\"#seven_hviewport\").css(\"left\"))/160));\n\t\t\t if(temp<(length-(tb*2)))\n\t\t\t {\n\t\t\t\t handle.find(\"#seven_hviewport\").animate({\n\t\t\t\t\t \"left\":-100*(temp+tb),\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t\t duration:400,\n\t\t\t\t\t easing:\"swing\"\n\t\t\t\t });\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t handle.find(\"#seven_hviewport\").animate({\n\t\t\t\t\t \"left\":-(handle.find(\"#seven_hviewport\").width()-option.width)+\"px\",\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t \n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t\t duration:400,\n\t\t\t\t\t easing:\"swing\"\n\t\t\t\t });\n\t\t\t }\n\t\t}", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1900);\n jssor_1_slider.$ScaleWidth(refSize);\n }\n else {\n window.setTimeout(ScaleSlider, 30);\n }\n }", "function launchCarousel() {\n var isTablet = $(window).width() < 1025; // no more touch\n\n $('.lv-hero').bxSlider({\n auto: true, //(isTablet ? false : true),\n mode: 'horizontal', // fade (much have fixed height or won't work)\n adaptiveHeight: true,\n responsive: true,\n touchEnabled: true,\n speed: 1000,\n pause: 4000,\n slideMargin: 0,\n slideSelector: \".lv-hero-item\",\n minSlides: 1,\n controls: true,\n nextSelector: \".lv-hero-carousel-next-btn\",\n prevSelector: \".lv-hero-carousel-prev-btn\",\n nextText: \"\",\n prevText: \"\",\n infiniteLoop: true,\n useCSS: true,\n pager: false,\n pagerSelector: '.lv-hero-carousel-bullets'\n // onSliderLoad: function(){ $('.lv-hero-caption').show().addClass('fadeInLeft');},\n // onSlideBefore: function(){ $('.lv-hero-caption').hide().removeClass('fadeInLeft');},\n // onSlideAfter: function(){ $('.lv-hero-caption').show().addClass('fadeInLeft');}\n });\n }", "function adjustElementsSize() {\n\t\t\tvar $div = $( '.shake-me' );\n\t\t\t$div.css( { left: $div.next().width() });\n\n return;\n// console.log( windowHeight, referenceHeight );\n\n // if( windowHeight < referenceHeight ) {\n // var heightRatio = windowHeight / referenceHeight;\n\t\t\t\t//\n // //Get all the images\n // $( '#parallax > div img.layer' ).each( function() {\n // var $img = $( this );\n // var ratio = $img.width() / $img.height();\n\t\t\t\t//\n // if( ! isNaN( ratio ) ) {\n // $img.height( $img.height() * heightRatio );\n // $img.width( $img.height() * ratio );\n\t\t\t\t//\n // console.log( $img.attr( 'src' ), $img.height(), ratio );\n // }\n // });\n // } else {\n // jQuery( '#parallax > div img' ).css( { width: '', height: '' } );\n // }\n }", "function updateSlideWidth() {\n let slideWidth = document.querySelector('.slider-about-1__item')\n .offsetWidth;\n // console.log(slideWidth);\n // document.querySelectorAll('.slider-about-1__item').forEach( el => {\n // \tel.style.width = slideWidth + 'px';\n // \t// console.log(el);\n // });\n document.querySelector('.slider-about-3').style.width =\n slideWidth + 'px';\n sliderAbout3.update();\n sliderAbout1.update();\n // console.log('updatewidth');\n }", "widthWindow (newValue, oldValue) {\n\t\t\tif (oldValue) {\n\t\t\t\tthis.prepareCarousel()\n\t\t\t\tthis.toggleFade()\n\t\t\t}\n\t\t}", "function ScaleSlider( ) {\n var parentWidth = $(\"#slider1_container\").parent( ).width( );\n if ( parentWidth ) {\n jssor_slider1.$ScaleWidth( parentWidth );\n }\n else\n window.setTimeout( ScaleSlider, 30 );\n }", "resizeToFitContent() {}", "resizeToFitContent() {}", "resizeToFitContent() {}", "resizeToFitContent() {}", "resizeToFitContent() {}", "function resizeSlide(){\n\twindowWidth = $(window).width();\n\tif(windowWidth > 1498){\n\t\t$('.article-s-home .figure').addClass('full-img');\n\t}\n\telse{\n\t\t$('.article-s-home .figure').removeClass('full-img');\n\t}\n\t\n\twidthSlide = windowWidth - 397;\n\t$('.text-slider-home').css({left:(windowWidth-940)/2})\t\n\t$('#slider-home').removeClass('center-slider-home');\n\t\n\t$('#my-slider-home, .article-s-home').css({width:widthSlide});\n\t$('#slider-move-home').css({left: -widthSlide*stepSlider});\n}", "function instragramSlider(){\n if ( $('.instragram-slider').length){\n $('.instragram-slider').owlCarousel({\n loop:true,\n margin:30,\n dotsSpeed: 2000,\n navSpeed: 2000,\n animateOut: 'slideOutDown',\n animateIn: 'flipInX',\n nav:false,\n items: 6,\n autoplay: true,\n autoplayTimeout: 1000,\n autoplaySpeed:2000,\n smartSpeed: 2000,\n dots: false,\n responsiveClass:true,\n responsive:{\n 0:{\n items:3, \n margin:20,\n },\n 599:{\n items:6,\n \n }\n }\n });\n }\n }", "function handleResize() {\n\t// 1. update height of step elements\n\tvar stepH = Math.floor(window.innerHeight * 0.75);\n\tstep.style(\"height\", stepH + \"px\");\n\n\tvar figureHeight = window.innerHeight / 2;\n\tvar figureMarginTop = (window.innerHeight - figureHeight) / 2;\n\n\tfigure\n\t.style(\"height\", figureHeight + \"px\")\n\t.style(\"top\", figureMarginTop + \"px\");\n\n\t// 3. tell scrollama to update new element dimensions\n\tscroller.resize();\n}", "function change_bague_size(){\n\n if (orientation_value == \"paysage\"){\n // récupert la hauteur de la fenêtre\n var windows_height = $(window).height();\n\n // définit la taille (hauteur = largeur) des bagues\n var magic360size = 240;\n\n // si la fenêtre n'est pas assez grande, on réduit la taille des bagues\n if (windows_height < 400)\n magic360size = 183;\n\n $(\"div.Magic360Contener\").css({\n 'width': magic360size + 'px',\n 'height': magic360size + 'px'\n });\n\n // vérifie le type de configurateur\n var type_configurateur = $(\"select[name='type_configurateur']\").val();\n\n // définit la taille de l'élément qui contient les bagues selon si 1 ou 2 bagues sont affichées\n if (type_configurateur == 1 || type_configurateur == 2){\n $('.articles_pictures').css('width', (magic360size + 20) + 'px');\n }\n else if (type_configurateur == 3 || type_configurateur == 4){\n $('.articles_pictures').css('width', (magic360size * 2 + 40) + 'px');\n }\n }\n else if (orientation_value == \"portrait\"){\n $(\"div.Magic360Contener\").css({\n 'width': '240px',\n 'height': '240px'\n });\n\n $('.articles_pictures').css('width', '265px');\n }\n}", "function resizer() {\n const $components = config.componentCollection;\n const breakPoints = config.breakPoints;\n let size;\n for (let i = 0; i < $components.length; i++) {\n if (\n !$($components[i]).is(':visible') &&\n $($components[i])\n .parent()\n .is('.bannerSlides')\n ) {\n // Handle Hidden Banners in widgets\n size = $($components[i])\n .parent()\n .width();\n } else if (\n !$($components[i]).is(':visible') &&\n $($components[i])\n .parent()\n .parent()\n .parent()\n .is('.widgetContent')\n ) {\n // Handle Hidden Banners in FLEX widgets\n size = $($components[i])\n .parent()\n .parent()\n .width();\n } else {\n size = $($components[i]).width();\n }\n switch (true) {\n case size < breakPoints[0]:\n if ($components[i].currentSize !== sizes.small) {\n functions.small($components[i]);\n $components[i].currentSize = sizes.small;\n }\n break;\n case size >= breakPoints[0] && size < breakPoints[1]:\n if ($components[i].currentSize !== sizes.medium) {\n functions.medium($components[i]);\n $components[i].currentSize = sizes.medium;\n }\n break;\n case size >= breakPoints[1] && size < breakPoints[2]:\n if ($components[i].currentSize !== sizes.large) {\n functions.large($components[i]);\n $components[i].currentSize = sizes.large;\n }\n break;\n case size >= breakPoints[2]:\n if ($components[i].currentSize !== sizes.huge) {\n functions.huge($components[i]);\n $components[i].currentSize = sizes.huge;\n }\n break;\n default:\n break;\n }\n\n // Allows for dynamic text resizing for components that define such functionality\n functions.textResizer($components[i]);\n }\n }" ]
[ "0.7251054", "0.71811527", "0.7005349", "0.69967544", "0.68612456", "0.68535626", "0.66815627", "0.6639926", "0.6637101", "0.66313964", "0.6604823", "0.6604014", "0.6604014", "0.6604014", "0.65877485", "0.6485035", "0.6479362", "0.639398", "0.6381118", "0.6349011", "0.6294054", "0.62279135", "0.6224953", "0.6221392", "0.620659", "0.62063324", "0.61971897", "0.6188063", "0.61798894", "0.61755264", "0.61745167", "0.61714554", "0.6164478", "0.61424196", "0.6139028", "0.6136757", "0.6117723", "0.61066675", "0.6097028", "0.60874027", "0.60775876", "0.6073101", "0.6071536", "0.6070654", "0.6051794", "0.6051162", "0.6051162", "0.6051032", "0.60463226", "0.6044464", "0.6038892", "0.60309756", "0.60284513", "0.600971", "0.600557", "0.6003143", "0.6002999", "0.59905386", "0.59905386", "0.5990089", "0.5982195", "0.59751886", "0.59528834", "0.5945524", "0.5943042", "0.594133", "0.5930679", "0.5926046", "0.59251636", "0.5923549", "0.59213257", "0.59212327", "0.58968765", "0.58946717", "0.5886669", "0.5886552", "0.5871157", "0.58670104", "0.5865917", "0.586491", "0.5861991", "0.586071", "0.5859546", "0.5847716", "0.58409864", "0.5838977", "0.5829104", "0.5828802", "0.582615", "0.58233595", "0.58089936", "0.58089936", "0.58089936", "0.58089936", "0.58089936", "0.58042127", "0.58041763", "0.58016485", "0.57956064", "0.5793995" ]
0.587088
77
fetch function logs received data & renders img
function fetchImg() { fetch("https://xkcd.now.sh/?comic=latest") .then((response) => response.json()) .then((data) => { console.log(data); img.src = data.img; }) //logs if an error occurs .catch((err) => console.log(err)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 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}", "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 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 fetchDogs() {\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(data => renderDogs(data));\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 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}", "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 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 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 imagesFetched(data) {\n //console.log(\"DATA: \", data);\n data.data.forEach(printImages);\n}", "function parseImg() {\n let parsedData = JSON.parse(this.responseText);\n renderImg(parsedData.message);\n}", "function fetchVirtualTour() {\n let image = `<img class=\"rounded mx-auto d-block\" src=\"./image/panoramic.png\" width=\"1000\" height=\"450\" alt=\"library virtual tour\" \">`\n fetch('./text/VirtualTour.txt')\n .then(res => res.text())\n .then(data => {\n\n outlet.innerHTML = `${image}${data}`;\n\n\n })\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}", "componentDidMount(){\n fetch(\"/api/collage\")\n .then(res => res.json())\n .then(collage => this.setState({collage}, () => console.log('Images fetched ...', collage)));\n }", "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 renderGalleryItem(){\n fetch(`https://source.unsplash.com/collection/${collectionID}/${imageWidth}x${imageHeight}/`).then((response)=> { \n let galleryItem = document.createElement('div');\n galleryItem.classList.add('gallery-item');\n galleryItem.innerHTML = `\n <img class=\"gallery-image\" src=\"${response.url}\" alt=\"gallery image\"/>\n `\n document.body.appendChild(galleryItem);\n }) \n}", "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 getImage() {\n send(json_get_image_message());\n}", "postFaceUrl() {\n // JSON object with imgUrl, imgWidth, imgHeight\n const body = {\n imgUrl: this.state.imgUrl,\n imgWidth: document.querySelector('img').width, // TODO: better way to handle getting these values ...\n imgHeight: document.querySelector('img').height\n };\n\n // api call to backend\n const options = {\n method: 'POST',\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify(body)\n };\n\n fetch(`${this.state.url}/image`, options)\n .then(res => res.json())\n // setState() with results\n .then(json => {\n if (json.name === 'Error') { // TODO: handle this better ...\n this.setState({ error: json });\n } else {\n this.setState(json);\n }\n })\n .catch(error => {\n this.setState(error)\n });\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}", "fetchData() {\n this.service.getAllImages(function (data) {\n for (let i = 0; i < data.length; i++) {\n this.sideDrawer.addElements(data[i].images);\n this.map.drawMarker(data[i].images);\n }\n }.bind(this), function (error) {\n // handle error\n }.bind(this));\n }", "getTopicDistributionFn () {\n fetch(test_url + '/TM/topicdistribution', {\n mode: 'cors',\n method: 'GET'\n })\n .then((resp) => resp.text())\n .then(function (data) {\n var wcImage = document.getElementById('topicDistributionImg');\n wcImage.src = \"data:image/png;charset=utf-8;base64,\" + data;\n })\n .catch(function (error) {\n console.log(JSON.stringify(error));\n });\n }", "componentDidMount() {\n // Send an HTTP request to the server.\n fetch(\"http://localhost:8081/timeline\",\n {\n method: 'GET' // The type of HTTP request.\n }).then(res => {\n // Convert the response data to a JSON.\n console.log(res);\n return res.json();\n }, err => {\n // Print the error if there is one.\n console.log(err);\n }).then(imageList => {\n if (!imageList) return;\n this.createImageCols(imageList);\n }, err => {\n // Print the error if there is one.\n console.log(err);\n });\n\n }", "function fetchData(url, select, img) {\n fetch(url) // First getting data\n .then(function (response) {\n return response.json();\n })\n .then(function (myJson) {\n addPokemonToDOM(myJson, select, img); // Add data to DOM\n })\n .catch(function (error) {\n console.log(error);\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}", "componentDidMount() {\n fetch(\"https://dog.ceo/api/breeds/image/random\")\n .then((res) => res.json())\n .then(data => this.setState({\n url: data.message\n }))\n }", "function displayImages(responseJson){\n console.log(responseJson);\n $('.results').html('');\n responseJson.message.forEach(fetchedImage => {\n $('.results').append(`<img src=\"${fetchedImage}\" class= \"results\">`);\n });\n //remove hidden class\n $('.results').removeClass('hidden');\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 onTrayLoad(url) {\n fetch(url)\n .then(\n function (response) {\n if (response.status !== 200) {\n alert('Looks like there was a problem. Status Code: ' +\n response.status);\n return;\n }\n\n response.json().then(function (data) {\n\n data.results.forEach(element => {\n imageName = element.poster_path;\n\n getImage(imageName, \"poster_sizes\").then(imageUrl => {\n\n const imageItem = document.createElement('div');\n imageItem.classList.add(\"image-item\");\n imageItem.setAttribute(\"movie-id\", element.id);\n imageItem.style.backgroundImage = \"url(\" + imageUrl + \")\";\n\n const rating = document.createElement('div');\n rating.classList.add('rating');\n rating.innerHTML = '<i class=\"fas fa-star\"></i> &nbsp' + element.vote_average;\n imageItem.appendChild(rating);\n\n main.appendChild(imageItem);\n });\n\n });\n\n });\n })\n .catch(function (err) {\n alert('Fetch Error :-S', err);\n });\n}", "function fetchdata(){\n\n\timgToggle();\n req = new XMLHttpRequest();\n req.open(\"GET\",'https://contesttrackerapi.herokuapp.com/',true);\n req.send();\n req.onload = function(){\n\n imgToggle();\n \n res = JSON.parse(req.responseText);\n putdata(res);\n\n // cache creation\n localStorage.cache = req.responseText;\n\n };\n req.onerror = function(){\n imgToggle();\n if(localStorage.cache){\n localData = JSON.parse(localStorage.cache);\n putdata(localData);\n }\n\n };\n}", "function render(project) { // a key\n $('.footer-test').html(project.text) //put the response on the dom\n var imageHtml = '';\n project.images.forEach(function(img) {\n imageHtml += '<img src=\"' + img + '\" /></br>'\n console.log(img);\n // put the image wherever\n });\n $('#imageZone').html(imageHtml); //put the response on the dom\n\n }", "function getDataAndRenderLogEntries() {\n console.log(\"test\")\n var target = document.getElementById(\"log\");\n while (target.firstChild) {\n target.removeChild(target.firstChild);\n}\n fetch('/load', {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\"\n }\n })\n .then(function (response) {\n return response.json();\n })\n .then(function (response) {\n for (var i = 0; i < response.length; i++) {\n var newEntry = document.createElement('div');\n newEntry.setAttribute('class', 'entry');\n\n var date = document.createTextNode(response[i].date);\n newEntry.appendChild(date);\n\n var role = document.createTextNode(response[i].role);\n newEntry.appendChild(role);\n\n var champion = document.createElement(\"img\");\n champion.setAttribute('src', ddragonSearch(response[i].champion));\n newEntry.appendChild(champion);\n\n if (response[i].wl === true) {\n newEntry.setAttribute('class', 'win');\n } else {\n newEntry.setAttribute('class', 'lose')\n }\n\n var notes = document.createElement('div');\n notes.setAttribute('class', 'text');\n\n var notesTextNode = document.createTextNode(response[i].notes);\n notes.appendChild(notesTextNode);\n newEntry.appendChild(notes);\n target.appendChild(newEntry);\n }\n })\n .catch(function(err) { console.log(err) });\n}", "async function fetchUrl() { // fetch with async function // at first, fetch returns with a promise and this promise will be fulfilled with the response of the url (server)\n const response = await fetch(url); // await only works inside async functions, we save the response into a variable, fetch gets a url, but it takes time to load (first it's a promise), promise fills itself with the response\n const json = await response.json(); // .json(); method tries to convert the response to js object\n\n // catching errors goes here\n /*\n useEffect(() => {\n fetch('link')\n .then((response) => response.json())\n .then((data) => setData(data));\n }, []);\n */\n\n setData(json); // set state of data to be the json when images are loaded\n setLoading(false); // set loading to false when images are loaded\n }", "render() {\n\n return this.data()\n .then(data => {\n return { \"image\": this.urlOrBlob, ...this.properties }\n })\n }", "function createImages(responseJson) {\n console.log(\"i will create your images\");\n console.log(responseJson.message);\n const html = `<img src=${responseJson.message}>`\n\n console.log(html);\n\n $(\".perro\").html(html);\n $(\".hidden\").removeClass(\"hidden\");\n}", "function fetchImageDataAndUpdateState() {\n\n const titleList = images.reduce((newList, img) => [...newList, img.title], []);\n\n hydrateDetailPageImages(titleList, currDetailPage).then(function(detailPage) {\n\n // Update wiki page from our in memory list\n wikiPages[pageID] = detailPage;\n\n // Dispatch our pages list update and set data for the current detail view\n dispatchUpdates(wikiPages, wikiPages[pageID]);\n\n }).catch((e) => {\n console.error('Failed to hydrate image info on details page', e);\n dispatchUpdates(wikiPages, wikiPages[pageID]);\n });\n }", "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 }", "render() {\n return (\n <img\n alt={\"img-\" + this.num}\n src={this.src}\n style={this.styles}\n onError={this.failedToLoad}\n />\n );\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 }", "fetchRoverImage(e) {\n let camera = this.state.camera;\n let rover = this.state.rover;\n let num = this.state.sol;\n let imageURL = `https://api.nasa.gov/mars-photos/api/v1/rovers/${rover}/photos?sol=${num}&camera=${camera}&api_key=${API_KEY}`;\n\n fetch(imageURL).then(response => {\n return response.json();\n }).then(data => {\n this.setState({ images: data.photos});\n })\n\n\n}", "componentDidMount() {\n fetch(\"https://picsum.photos/v2/list\")\n .then(res => res.json())\n .then(data => {\n this.setState({ images: data });\n })\n .catch(err => {\n console.log('Error happened during fetching!', err);\n });\n }", "fetchImage(user, state){\n // Get self image or friend image\n HttpRequest.fetchImage(`${process.env.REACT_APP_HOSTURL}/user_image/`, user)\n .then(url => this.setState({[state]: url}));\n }", "async setImage() {\n try {\n if (this.hasProperty(this.parsedMessage, \"metadata\")) {\n const metadata = this.parsedMessage.metadata;\n const injectedObject = metadata[\"@injected\"];\n if (\n injectedObject &&\n this.hasProperty(injectedObject, \"extensions\")\n ) {\n const extensionsObject = injectedObject[\"extensions\"];\n if (\n extensionsObject &&\n this.hasProperty(extensionsObject, \"thumbnail-generation\")\n ) {\n const thumbnailGenerationObject =\n extensionsObject[\"thumbnail-generation\"];\n\n const imageToDownload = this.chooseImage(\n thumbnailGenerationObject\n );\n\n try {\n const response = await this.downloadImage(imageToDownload);\n const url = URL.createObjectURL(response);\n let img = new Image();\n img.src = url;\n img.onload = () => (this.imageUrl = img.src);\n } catch (error) {\n logger(\"error\", error);\n }\n }\n }\n } else {\n let img = new Image();\n img.src = this.parsedMessage.data.url;\n img.onload = () => (this.imageUrl = img.src);\n }\n } catch (error) {\n logger(\"error\", error);\n }\n }", "function fetchIndex() {\n let image = `\n <div class=\"container\"><img class=\"rounded mx-auto d-block\" width=\"1000\" height=\"450\" src=\"./image/lib.jpg\" alt=\"library banner\" ></div>`\n let topTitle = ` <h4>Welcome to the eLibrary®</h4>`\n fetch('./text/Indext.txt')\n .then(res => res.text())\n .then(data => {\n\n outlet.innerHTML = ` ${topTitle}${image}${data}`;\n\n\n })\n}", "function getDogImage(str) {\n \n fetch(`https://dog.ceo/api/breed/${str}/images`)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => {\n\n console.log('Valid breed');\n\n let randomIndex = Math.floor(Math.random() * (responseJson.message.length-1));\n makeImageString(responseJson.message[randomIndex]);\n \n\n // console.log(htmlStr.newStr);\n // $('.images').html(htmlStr.newStr);\n\n });\n // console.log(htmlStr.newStr);\n // render(htmlStr.newStr);\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 }", "function handleImg(imgData) {\n //console.log(imgData);\n const imgContainer = document.getElementById(\"response-imgContainer\");\n const img = document.createElement('img');\n img.height=315;\n img.width=420;\n img.src=imgData.url\n\n imgContainer.appendChild(img);\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 randomImg(){\n var randomImgDiv = document.querySelector(\"#randomImg\")\n randomImgDiv.innerHTML = \"\"\n fetch('https://foodish-api.herokuapp.com/api/')\n .then(function(response){\n response.json()\n .then(function(data){\n var randomImgEl = document.createElement(\"img\")\n randomImgEl.setAttribute(\"src\", data.image)\n randomImgEl.setAttribute(\"class\", \"random-img\")\n randomImgDiv.appendChild(randomImgEl)\n })\n })\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 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}", "getImagesName() {\n fetch(`https://maximum-arena-3000.codio-box.uk/api/images/${this.state.prop_ID}`, {\n method: \"GET\",\n body: null,\n headers: {\n \"Authorization\": \"Basic \" + btoa(this.context.user.username + \":\" + this.context.user.password)\n }\n })\n .then(status)\n .then(json)\n .then(dataFromServer => {\n this.setState({\n propertyImagesName: dataFromServer\n });\n })\n .catch(error => {\n message.error('Could not retrieve the images!', 5);\n });\n }", "getData() {\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"/data\", true);\n xhr.addEventListener('loadend', (e) => {\n console.log(xhr.responseText);\n let responseData = JSON.parse(xhr.responseText);\n let imgEle = this.postcardEle.getElementsByTagName(\"img\")[0];\n let textEle = this.postcardEle.getElementsByClassName(\"text\")[0];\n imgEle.src = \"../images/\" + responseData.photo;\n textEle.textContent = responseData.message;\n textEle.style[\"font-family\"] = responseData.font;\n this.postcardEle.style.backgroundColor = responseData.color;\n });\n xhr.send();\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 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}", "async function getPhotoData(){\n const photoStream=await fetch(`https://jsonplaceholder.typicode.com/photos/?_page=${pgnCount}`);\n const photos=await photoStream.json();\n photos.forEach(photo=>{\n div.innerHTML+=`\n <div class='card col-lg-3 col-md-4 col-sm-6 mx-1 d-flex shadow card-img-top m-2'>\n <img class='rounded-circle w-150 p-2' src='${photo.thumbnailUrl}'>\n <div class=\"card-body text-center\">\n <h5 class=\"card-title title text-muted\">${photo.id}</h5>\n <p class=\"card-text subtext\">${photo.title}</p>\n </div>\n </div>\n `\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 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}", "componentDidMount() {\n fetch(this.props.restaurant.img.metadataUrl)\n .then(response => response.json())\n .then(data => {\n data.status === \"OK\" && this.setState({ imgUrl: this.props.restaurant.img.url })\n });\n }", "async componentDidMount () {\n const response = await fetch(\"https://avatars2.githubusercontent.com/u/22461722?s=400&u=404c9d39b94f9a3c69af974eff7db43b932c39ad&v=4\");\n const imageBlob=await response.blob();\n const imageSrc=window.URL.createObjectURL(imageBlob);\n this.setState({\n imageSrc: imageSrc,\n })\n }", "async function loadImageFromDB() {\n const request = new XMLHttpRequest();\n let url = \"\";\n await request.open(\"GET\", \"https://sad-start-api.herokuapp.com/\", true);\n request.onload = function() {\n var data = JSON.parse(this.response);\n if (request.status >= 200 && request.status < 400) {\n url = data[0].img_url;\n setImage(url);\n } else {\n console.log(\"error\");\n url = \"https://via.placeholder.com/750x650/FFFFFF?text=oops!\";\n setImage(url);\n }\n };\n request.send();\n}", "async function getCameraImage() {\n const response = await fetch(api_url + productNumber);\n const data = await response.json();\n\n const cameraImage = document.createElement(\"img\");\n cameraImage.alt = \"Picture of a \" + data.name + \" camera\";\n cameraImage.src = data.imageUrl;\n cameraImage.className = \"camera-details-img\";\n\n document.getElementById(\"product-image\").appendChild(cameraImage);\n await getCameraDetails();\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 }", "display_collection_photoData(results){\n for(var i=0;i<results.length;i++){\n const div = document.createElement(\"div\");\n const img = document.createElement(\"img\");\n const label = document.createElement(\"label\");\n const p = document.createElement(\"p\");\n const h4 = document.createElement(\"h4\");\n\n collection_section.appendChild(div);\n div.appendChild(h4)\n div.appendChild(img);\n div.appendChild(label);\n div.appendChild(p);\n\n h4.textContent = `${results[i].timestamp}`;\n div.classList.add(\"collect-section-2-div\");\n img.classList.add(\"collect-section-2-img\");\n\n if(`${results[i].label}` == \"\" || `${results[i].label}` == undefined){\n label.textContent = \"\";\n }else{\n label.textContent = `${results[i].label}`;\n }\n \n if(results[i].imageurl.split(\".\")[1] == \"cloudfront\"){\n img.setAttribute(\"src\", `${results[i].imageurl}`);\n }\n else{\n img.setAttribute(\"src\", `${results[i].imageurl}` + \"&w=500&h=300&dpr=2\");\n }\n \n if(results[i].description == null) {\n p.textContent = \"\"\n } else {\n p.textContent = `${results[i].description}`;\n }\n \n }\n }", "async function fetchPhoto() {\n const res = await fetch(\n `https://api.nasa.gov/planetary/apod?api_key=${apiKey}`\n );\n const data = await res.json();\n setPhotoData(data);\n console.log(data);\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 getListOnLoad(){\n // code supposed to run once DOM is loaded \n fetch('http://127.0.0.1:3000/getListOfTa', {\n method: 'GET',\n mode: 'cors',\n headers: {'Content-Type': 'application/x-www-form-urlencoded','Access-Control-Allow-Origin':'*','Accept': 'application/json'},\n }).then((response) => { \n response.json().then(data => { \n var dataArray = data.data;\n if((dataArray.length)){ \n var html = '';\n dataArray.forEach(element => { \n html +=('<img src=\"assets/images/'+ element.image +'\" class=\"img-circle\" id=\"img-div-'+element.id+'\" data-category=\"'+element.id +'\" onclick=\"getTADetailsbyid('+element.id+')\" alt=\"service-image\" width=\"120\" height=\"120\" />'); \n });\n $(\"#myList\").html(html);\n }\n });\n })\n}", "function rendermain(){\n var Init = { method:'GET',headers:{'Access-Control-Allow-Origin':'*'},mode:'cors'};\n fetch(stackurl,Init)\n .then((resp) => resp.json())\n .then((data) => {\n renderpage(data)\n });\n}", "async function fetchPicture(req, res) {\n try {\n let location = encodeURIComponent(req.body.location);\n let response = await fetch(`https://pixabay.com/api/?key=XXXX&q=${location}&per_page=25&image_type=photo`);\n let data = await response.json();\n res.status(200).send(data);\n } catch (error) {\n console.log(error);\n res.status(400).send(error);\n }\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}", "async function getApicture() {\n\n const apiInfo = await fetch(pictureApi + '/' + pictureGenerator.value)\n const apiData = await apiInfo.json()\n\n apiData.message.forEach(pic => {\n const newPicture = document.createElement('div')\n newPicture.classList = 'pic'\n let text = 'url(' + pic + ')'\n newPicture.style.backgroundImage = text\n picture.appendChild(newPicture)\n })\n}", "getGiphyFromApi(value) {\n const url = `https://api.giphy.com/v1/gifs/search?api_key=s4hChOYKBIq9xaHgXIXafwYQwcoHxYkM&q=${value}&limit=5`;\n const promise = fetch(url);\n promise.then(response => {\n var jsonResponse = response.json();\n jsonResponse.then(result => {\n this.setState({imageData:result.data})\n }).catch(\n err => { console.log(err); }\n ); \n }).catch(err => {\n console.log(\"Error is coming from the server side\",err);\n })\n }", "function addImage(){\n\t\t\tlet htmlContent = '';\n\t\t\tdata = JSON.parse(this.responseText);\n\t\t\tconsole.log(data.results);\n\n\t\t\tif(data && data.results && data.results[1]){\n\t\t\t\tconst firstImage = data.results[1];\n\t\t\t\thtmlContent = `<figure>\n\t\t\t\t<img src=\"${firstImage.urls.regular}\" alt=${searchText}>\n\t\t\t\t<figcaption>${searchText} by ${firstImage.user.name} </figcaption>\n\t\t\t\t</figure>\n\t\t\t\t`\n\t\t\t}else{\n\t\t\t\thtmlContent = `<div class=\"error-no-image\">No Image available</div>`\n\t\t\t}\n\t\t\tresultContainer.insertAdjacentHTML('afterbegin', htmlContent);\n\t\t}", "async getRedditPic(url) {\n let downloadedImg = document.createElement('img')\n downloadedImg.src = url\n return console.log(downloadedImg)\n }", "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 gifMe() {\n const apiKey = 'api_key=bl5whSB0fw8HbwziUfOz6cNj3TYl8Wkx';\n //added api key as well as query parameters to fetch api and receive data related to music\n fetch('https://api.giphy.com/v1/gifs/random?'+ apiKey +'&rating=PG-13&tag=music')\n //returns data as JSON\n .then(function (response) {\n return response.json();\n }) \n //appends the gif to the image element on the html\n .then(function (data) {\n console.log(data);\n img.attr('src', data.data.images.fixed_height.url);\n })\n //catches errors and diplays on the console\n .catch(function (error) {\n console.log('error!');\n console.error(error);\n }) \n}", "async getImages() {\n return fetch('https://pixabay.com/api/?key=9656065-a4094594c34f9ac14c7fc4c39&q=dogs&image_type=photo&per_page=6', {\n method: 'GET'\n }).then(async (response) => {\n var data = await response.json(); // use await to resolve promise\n this.setState({images: data.hits}); // filter down to hits here\n console.log(data.hits);\n }).catch(function(err) { //TODO add error handling \n this.setState({ error: true }); \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}", "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}", "renderNewImage() {\n\n document.getElementById('img').src = `${this.url}`\n document.getElementById('p1').innerText = `${this.caption}`\n\n }", "function sendDataByGet (sendDataStr) {\n const img = new Image()\n img.src = `${BASE_URL}?${sendDataStr}&t=${Date.now()}`\n}", "async function fetchUiData(url){\n const serverResponse = await fetch(url);\n const serverData = await serverResponse.json();\n console.log(serverData);\n \n resDate.innerHTML = `Date is: ${serverData.date}`;\n resTemp.innerHTML = `Temperature is: ${serverData.temp}`;\n resContent.innerHTML = `Content is: ${serverData.userRes}`;\n }", "async function fetchCommentImage(blobKey) {\n if (blobKey == null) {\n return null;\n }\n const response = await fetch(`/serve-images?blob-key=${blobKey}`);\n // check that response was successful\n if (response.ok) {\n // parse the body of the response as a Blob.\n const blob = await response.blob();\n // create a URL for accessing the Blob.\n const imageURL = window.URL.createObjectURL(blob);\n return imageURL; \n }\n else {\n console.log(\"Error fetching image: \" + response.status + \" \" + response.statusText);\n return undefined;\n }\n}", "getRequest() {\n axios.get(`http://ec2-52-12-174-123.us-west-2.compute.amazonaws.com:3000/images/${window.location.pathname.slice(1)}`)\n .then((response)=>{\n this.setState({\n data: [...response.data],\n color: response.data[0].color,\n button1color: response.data[0].color,\n button2color: response.data[3].color,\n bigImage: response.data[0].url,\n thumbnail1: response.data[0].url,\n thumbnail2: response.data[1].url,\n thumbnail3: response.data[2].url\n })\n })\n .catch((error)=>{\n console.log(error)\n })\n }", "function handleResponse2() {\n\tconsole.log(\"Entered handleResponse2: \" + oReq.responseText);\n\n\tvar requestedRecords = oReq.responseText;\n\tvar recordsObj = JSON.parse(requestedRecords); \n\tvar zeroIndex = \"0\";\n\t\n\tvar startOfURL = \"http://lotus.idav.ucdavis.edu/public/ecs162/UNESCO/\";\n\tvar photoName = recordsObj[\"0\"][\"fileName\"];\n\tconsole.log(\"Photoname: \" + photoName);\n\t\n\tvar photoURL = encodeURI(startOfURL + photoName);\n\n\tconsole.log(\"Filename: \" + photoName);\n\tconsole.log(\"Final url: \" + photoURL);\n//\tvar display = document.getElementById(\"photoImg\");\n//\tdisplay.src = photoURL;\t\n\n\t// Print all photo names requested\n\tconsole.log(\"End of Part 4: Printing all fileNames of photos requested...\");\n\tvar len = Object.keys(recordsObj).length;\n\tvar URL=\"http://lotus.idav.ucdavis.edu/public/ecs162/UNESCO/\"\n\t//This will be the object that has each photos fileName, width and height\n\tfor (i = 0; i < len; i++) {\n\t var photoRow = new Object();\n\t var iStr = i.toString();\n\t photoRow.src = encodeURI(URL+recordsObj[iStr][\"fileName\"]);\n\t photoRow.width = recordsObj[iStr][\"width\"];\n\t photoRow.height = recordsObj[iStr][\"height\"];\n\t photos.push(photoRow);\t \n\t console.log(i + \": \" + photoName); \n\t}\n\tcallReact();\n\tfunction callReact(){\n\t\tconst reactContainer = document.getElementById(\"react\");\n\t\tvar reactApp = ReactDOM.render(React.createElement(App),reactContainer);\n\t\twindow.dispatchEvent(new Event('resize'));\n\t}//where we reder React DOM\n\tfor (var i = 0; i < photos.length; i++){\n\t\tconsole.log(photos[i]);\n\t}\n\n }", "async function sendimg(){\n img = document.getElementById('file').files[0]\n let response = await fetch('/imageprocessing', {\n method: \"POST\",\n header:{\n 'content-type': 'image/png'\n },\n body: img\n });\n if (response.status == 200) {\n let result = await response.text()\n window.location.hash = '#home'\n window.location.reload()\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}", "function fetchUser() {\n fetch(`https://api.github.com/users/${user_name}`)\n .then(response => response.json())\n .then(function (data) {\n \n console.log(data);\n if (data.message === \"Not Found\") {\n alert(\"user not found\");\n return false;\n } else {\n user_img.innerHTML = `<img src=\"${data.avatar_url}\">`;\n userName.innerHTML = data.login;\n followers_.innerHTML = data.bio;\n followe.innerHTML = data.name;\n\n }\n })\n\n \n}", "function retrieveImage(imageInfo) {\n\n var imageName = imageInfo[1];\n var status = $(\"#ajax_result\").text();\n var image = \"swap/\" + imageName;\n\n if (status === \"AJAX request successfully received - image cached.\") {\n\n // use to view update on page, comment out cleanupSwap() call on line 64 or won't load image\n $(\"#ajax_result\").append( \"<img src='\" + image + \"'>\" );\n\n // convert image to base64 string\n getBase64FromImageUrl(image, function(dataUri) {\n\n var base64String = dataUri;\n console.log(\"retrieveImage base64String: \", base64String);\n\n // cleanupSwap(imageName); // comment this out if using \n });\n }\n}", "function DownL_Image(){\n\n\tvar xhr = Titanium.Network.createHTTPClient({\n\tonload: function() {\n // first, grab a \"handle\" to the file where you'll store the downloaded data\n\t\tvar f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'mygraphic.png');\n\t\tf.write(this.responseData); // write to the file\n\t\tTi.App.fireEvent('graphic_downloaded', {filepath:f.nativePath});\n\t},\n\ttimeout: 10000\n});\n\n\nTi.API.info(\"percorso passato da lbl_indirizzo:\"+path_img);\nxhr.open('GET',\"http://i.imgur.com/xigIkvV.jpg\");\nxhr.send();\nTi.App.addEventListener('graphic_downloaded', function(e) {\n // you don't have to fire an event like this, but perhaps multiple components will\n // want to know when the image has been downloaded and saved\n\tTi.API.info(\"percorso passato da eventlister:\"+e.filepath);\n\t$.imw_image.image = e.filepath;\n});\n\t\n}", "loadImageFromRecipientFromServer(recipient) {\n axios\n .get(\"http://localhost:9002/api/imagefromuser/\" + recipient)\n .then(res => {\n this.setState({\n chosenRecipientImg: res.data[0].image,\n });\n })\n .catch(err => {\n console.log(err); this.props.history.push('/error')\n\n\n });\n }", "function fetchData() {\n let targetEl = this,\n url = `/svgdata/${this.dataset.target}`;\n\n fetch(url)\n .then(res => res.json())\n .then(data => {\n console.log(data);\n\n //populate the popover\n buildPopover(data, targetEl);\n })\n\n .catch((err) => console.log(err));\n }", "function viewFullImg(uri){\n\tconst html = `<img src=\"${uri}\">`\n\tdocument.getElementById(\"results\").innerHTML = html;\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 getApiData(data){\n if (data.hits.count === 0) {\n errorMessage();\n return;\n }\n let markup = data.hits.map(getCard).join('');\n document.querySelector(\"#content\").innerHTML = markup; \n console.log(\"count\",data.hits.length);\n var imgCount = data.hits.length;\n document.getElementById(\"imgCount\").innerHTML = imgCount; \n console.log(data)\n}", "function displayResults(responseJson) {\n // print json dog image url info to console\n console.log(responseJson);\n // empty old results\n $('.results').empty();\n\n //replace the existing images with new ones\n for (let i=0; i<responseJson.message.length; i++) {\n // replace placeholder images with dog images\n $('.results').append(\n `<img src=\"${responseJson.message[i]}\" class=\"results-img\">`\n )\n //display the results section\n $('.results').removeClass('hidden');\n }\n}", "function gotResult(err, img) {\n resultImg.attribute('src', img.src);\n\n document.getElementById(\"loading\").style.opacity = 0;\n gotImage = true;\n// if (isTransferring) {\n // style.transfer(gotResult);\n //}\n}", "async function getSteam(){\n try {\n //get the Json data from the steam api\n const response = await fetch(api_url);\n const data = await response.json();\n console.log(data);\n // aswell as casting it into html on the page\n document.getElementById(\"imaginedude\").innerHTML = `\n <h1 class=\"sameColor text-center\"> Recent games played</h1>\n ${data.response.games.map(gamelogoTemplate).join('')}`\n\n } catch (error) {\n document.getElementById(\"imaginedude\").innerHTML =`API failed to load please try again later`;\n console.log(\"steam no work\");\n console.log(error);\n }\n \n}" ]
[ "0.76220137", "0.7257569", "0.7170124", "0.69319105", "0.6903238", "0.67679304", "0.6741538", "0.66811144", "0.6650101", "0.6615473", "0.65605325", "0.65182436", "0.6492356", "0.6472035", "0.64686", "0.64657307", "0.6452677", "0.64498097", "0.64253324", "0.631699", "0.63162947", "0.6316215", "0.63101256", "0.63026005", "0.62978774", "0.6281467", "0.62778956", "0.6275064", "0.6265606", "0.6259893", "0.625081", "0.6233457", "0.6229701", "0.62274635", "0.61774", "0.6176046", "0.61708033", "0.61665314", "0.615181", "0.61276174", "0.6116772", "0.610739", "0.60983723", "0.60975343", "0.6088193", "0.6083637", "0.60720146", "0.60652226", "0.60624176", "0.60499084", "0.60483867", "0.60447305", "0.6044029", "0.60142577", "0.6004327", "0.60019386", "0.597933", "0.59673584", "0.59602237", "0.5955337", "0.59427094", "0.5937009", "0.5931055", "0.5924125", "0.590573", "0.5903656", "0.59036404", "0.59011555", "0.5888676", "0.58867884", "0.58856237", "0.58845687", "0.5883856", "0.58825713", "0.58774877", "0.5856992", "0.58562315", "0.58531725", "0.58494174", "0.58469605", "0.5846834", "0.5837573", "0.5826552", "0.5823237", "0.5811769", "0.58111566", "0.580409", "0.5798714", "0.5797298", "0.5791826", "0.57904315", "0.57815564", "0.57792675", "0.5769315", "0.57652754", "0.57652336", "0.57612085", "0.57592", "0.57492965", "0.57480776" ]
0.70341665
3
Write a function that determines whether the passed in arrays are similar. Similar means they contain the same elements, and the same number of occurrences of elements. var arr1 = [1, 2, 2, 3, 4], arr2 = [2, 1, 2, 4, 3], arr3 = [1, 2, 3, 4], arr4 = [1, 2, 3, "4"] arraysSimilar(arr1, arr2); // Should equal true arraysSimilar(arr2, arr3); // Should equal false arraysSimilar(arr3, arr4); // Should equal false
function arraysSimilar(arr1, arr2) { if (arr1.length !== arr2.length) return false; arr1.sort(); arr2.sort(); for (let i = 0; i < arr1.length; i++) { if (arr1[i] !== arr2[i]) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arraysSimilar(arr1, arr2) {\n \n arr1 = arr1.sort((a, b) => a - b);\n arr2 = arr2.sort((a, b) => a - b);\n \n if (arr1.length > arr2.length) {\n return arr1.every((el, index) => el === arr2[index]);\n } else {\n return arr2.every((el, index) => el === arr1[index]);\n }\n\n}", "function arraysSimilar(arr1, arr2) {\r\n arr1.sort((a, b) => a - b)\r\n arr2.sort((a, b) => a - b)\r\n return arr1.length > arr2.length ?\r\n arr1.every((v, i) => v === arr2[i]) :\r\n arr2.every((v, i) => v === arr1[i])\r\n}", "function arraysMatch(arr1, arr2) {\n for (let i = 1; i < 4; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}", "function equalArrays(ar1, ar2) {\n if (ar1.length != ar2.length) {\n return false;\n }\n\n for (let i = 0; i < ar1.length; i++) {\n if (ar1[i] != ar2[i]) {\n return false;\n }\n }\n\n return true;\n}", "function eqArrays(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}", "function hasSameElements(arr1, arr2, exact) {\r\n var test1 = exact ? arr1.sort() : arr1;\r\n var test2 = exact ? arr2.sort() : arr2;\r\n if (test1.length !== test2.length) {\r\n return false;\r\n }\r\n for (var x=0; x<arr1.length; x++) {\r\n if (test1[x] !== test2[x]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function arraysEqual(arr1, arr2){\n // If the arrays are different lengths, false\n if (arr1.length != arr2.length) return false;\n\n // Compare each element in the array\n for (var i=0;i<arr1.length;i++){\n if (arr1[i] != arr2[i]) return false;\n }\n\n return true;\n\n}", "function CompareArrays(arr1, arr2)\r\n{\r\n\tif(arr1.length != arr2.length)\r\n\t\treturn false;\r\n\t\r\n\tfor(i = 0; i < arr1.length; ++i)\r\n\t\tif(arr1[i] != arr2[i])\r\n\t\t\treturn false;\r\n\treturn true;\r\n}", "function equalArrays(arr1, arr2){\n\n newArr1 = arr1.sort();\n newArr2 = arr2.sort();\n var compare;\n\n for (i = 0; i < newArr1.length; i++){\n if (newArr1[i] == newArr2[i]){\n compare = true;\n }else{\n compare = false;\n }\n }\n return compare;\n}", "function areArraysEqual(arr1, arr2) {\n var sortedArr1 = arr1.sort();\n var sortedArr2 = arr2.sort();\n for (var i = 0; i < arr1.length; i++) {\n if (sortedArr1[i] !== sortedArr2[i]) {\n return false;\n }\n }\n return arr1.length === arr2.length;\n}", "function matches(arr1, arr2) {\n for (let i = 1; i < 4; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}", "function arrayEqual(array1, array2) {\n if (array1.length !== array2.length) {\n console.log(\"arrayEqual wrong length: \" + array1.length + \" \" + array2.length)\n return false;\n } else {\n for (var i = 0; i < array1.length; i++) {\n if (array1[i].toString().toLowerCase() != array2[i].toString().toLowerCase()) {\n //console.log( typeof (array1[i]) + \" - \" + typeof (array2[i]))\n return false;\n }\n }\n }\n return true;\n}", "function arraysAreEqual(arrOne,arrTwo){\r\n if (arrOne.length!==arrTwo.length) return false;\r\n for (let i =0;i<arrTwo.length;i++){\r\n if (arrOne[i]!== arrTwo[i]) return false;\r\n }\r\n return true;\r\n}", "function areArraysEqual(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n array1 = array1.sort();\n array2 = array2.sort();\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true; array1\n}", "function compareArrays(firstArray,secondArray){\n\tlet identical = true;\n \n // First, the length of the arrays is compared\n let firstLength = firstArray.length;\n let secondLength = secondArray.length\n \n\tif(firstLength != secondLength){\n // If the length is not equal, the arrays are not identical\n\t\tidentical = false;\n\t} else {\n // If the length is equal, every position of the array is compared\n\t\tfor (let i = 0; i < firstLength; i++) {\n\t\t\tif(firstArray[i] != secondArray[i]){\n\t\t\t\tidentical = false;\n\t\t\t}\n\t\t}\n\t}\n // Return the verdict\n\treturn identical \n}", "function arraysEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) { return false; }\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) { return false; }\n }\n return true;\n}", "function arraysEqual(array1, array2) {\n var equal = true;\n if (array1.length !== array2.length) {\n equal = false;\n } else {\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n equal = false;\n break;\n }\n }\n }\n return equal;\n}", "function arraysEqual(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "function arraysEqual(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "function arraysEqual(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "function eqArrays(array1, array2) {\n let isSame = (array1.length === array2.length) && array1.every(function(element, index) {\n return element === array2[index];\n });\n return isSame;\n //console.log(isSame);\n}", "function arraysEqual(array1, array2) {\r\n if (array1.length !== array2.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < array1.length; i++) {\r\n if (array1[i] !== array2[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function arraysEqual(array1, array2) {\r\n if (array1.length !== array2.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < array1.length; i++) {\r\n if (array1[i] !== array2[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function checkArrays(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (var i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n } \n }\n return true;\n}", "function checkArrays(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (var i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n } \n }\n return true;\n}", "function arraysEqual(ar1, ar2) {\n const n = ar1.length;\n if (n !== ar2.length) { return false; }\n for (let i = 0; i < n; i++) {\n if (ar1[i] !== ar2[i]) { return false; }\n }\n return true;\n}", "function compareArrs(arr1, arr2) {\n if(arr1.length !== arr2.length) {\n return false;\n }\n\n for(let i = 0; i < arr1.length; i++) {\n if(arr1[i] !== arr2[i]) {\n return false;\n }\n }\n\n return true;\n}", "arrayCompare(array1, array2) {\n //check if the input are both arrays and have the same lenght\n if (!Array.isArray(array1) || !Array.isArray(array2) || array1.length !== array2.length) {\n return false;\n }\n // .concat() to not mutate arguments\n const arr1 = array1.concat().sort();\n const arr2 = array2.concat().sort();\n //check if the elements in each array are the same\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n }", "function arraysEqual(ar1, ar2) {\n var n = ar1.length;\n if (n !== ar2.length) { return false; }\n for (var i = 0; i < n; i++) {\n if (ar1[i] !== ar2[i]) { return false; }\n }\n return true;\n}", "function arraysMatching(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n\n let cache = {};\n for (let i = 0; i < arr1.length; i++) {\n if (cache[arr1[i]] === undefined) {\n cache[arr1[i]] = 1;\n } else {\n cache[arr1[i]]++;\n }\n }\n\n for (let j = 0; j < arr2.length; j++) {\n if (cache[arr2[j]] === undefined || cache[arr2[j]] === 0) {\n return false;\n }\n cache[arr2[j]]--;\n }\n return true;\n}", "function arraysMatching(arr1, arr2){\n if (arr1.length !== arr2.length){\n return false;\n } else {\n var lib = {};\n for (var i = 0; i < arr1.length; i++){\n lib[arr1[i]] = true;\n }\n for (var j = 0; j < arr2.length; j++){\n if (lib[arr2[j]] === undefined){\n return false;\n }\n }\n return true;\n }\n}", "function arraysAreEqual(arr1, arr2) {\n // `arr1` and `arr2` must be arrays.\n if (!Array.isArray(arr1) || !Array.isArray(arr2)) {\n return false;\n }\n\n // Arrays must be the same length.\n if (arr1.length !== arr2.length) {\n return false;\n }\n\n // `arr2` must contain every element in `arr1`.\n return arr1.every(element => arr2.includes(element));\n}", "function areArraysEqual(array1, array2) {\n if (!Array.isArray(array1) || !Array.isArray(array2)) {\n return false;\n }\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; ++i) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "function arraysEqual(ar1, ar2) {\r\n\t const n = ar1.length;\r\n\t if (n !== ar2.length) { return false; }\r\n\t for (let i = 0; i < n; i++) {\r\n\t if (ar1[i] !== ar2[i]) { return false; }\r\n\t }\r\n\t return true;\r\n\t}", "function arraysEqual(_arr1, _arr2) {\n\n if (!Array.isArray(_arr1) || !Array.isArray(_arr2) || _arr1.length !== _arr2.length)\n return false;\n\n var arr1 = _arr1.concat().sort();\n var arr2 = _arr2.concat().sort();\n\n for (var i = 0; i < arr1.length; i++) {\n\n if (arr1[i] !== arr2[i])\n return false;\n\n }\n\n return true;\n}", "function testArraysEqual(array1, array2) {\n if(array1.length !== array2.length) {\n\t\treturn false;\n }\n for(var i=0; i<array1.length; i++) {\n if(Array.isArray(array1[i]) && Array.isArray(array2[i])) {\n if(!testArraysEqual(array1[i], array2[i])) {\n return false;\n }\n } else if(array1[i] !== array2[i]) {\n\t\t\treturn false;\n }\n }\n return true;\n}", "function same(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n\n arr1 = arr1.map(x => x * x);\n\n const frequencyCounter1 = {};\n const frequencyCounter2 = {};\n const longestArray = Math.max(arr1.length, arr2.length);\n for (let i = 0; i < longestArray; i++) {\n if (arr1[i]) {\n frequencyCounter1[arr1[i]] = ++frequencyCounter1[arr1[i]] || 1;\n }\n if (arr2[i]) {\n frequencyCounter2[arr2[i]] = ++frequencyCounter2[arr2[i]] || 1;\n }\n }\n \n for (let key in frequencyCounter1) {\n if (frequencyCounter1[key] !== frequencyCounter2[key]) {\n return false;\n }\n }\n return true;\n}", "function arraysEqual(_arr1, _arr2) {\n if (!Array.isArray(_arr1) || ! Array.isArray(_arr2) || _arr1.length !== _arr2.length)\n return false;\n var arr1 = _arr1.concat().sort();\n var arr2 = _arr2.concat().sort();\n for (var i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i])\n return false;\n }\n return true;\n}", "function arraysEqual(ar1, ar2) {\n var n = ar1.length;\n if (n !== ar2.length) {\n return false;\n }\n for (var i = 0; i < n; i++) {\n if (ar1[i] !== ar2[i]) {\n return false;\n }\n }\n return true;\n }", "function equalArrays(a,b) {\n if (a.length != b.length) return false; // Different-size arrays not equal\n for(var i=0; i < a.length; i++) // Loop through all elements\n if (a[i] !== b[i]) return false; // If any differ, arrays not equal\n return true;\n}", "function arrayOfDifferentArrays(arrayOfArrays){\n var areArraysDifferent = true;\n arrayOfArrays.forEach(function(element,index){\n for (var i = index+1; i<arrayOfArrays.length; i++) {\n if (! arraysContainDifferentElements(element, arrayOfArrays[i])){\n areArraysDifferent = false;\n }\n };\n });\n return areArraysDifferent;\n}", "function arraysEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) { \n return(false); \n }\n for (var i = arr1.length; i--;) {\n if(arr1[i] !== arr2[i]) {\n return(false);\n }\n }\n return true;\n}", "function arrayIsEquals(array1, array2) {\n\tif (array1.length != array2.length) {\n\t\treturn false;\n\t}\n\n\tfor (let i=0; i<array1.length; i++) {\n\t\tif (array1[i] !== array2[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function areSameArr (a,b){\n for(var i = 0 ; i < a.length ; i++){\n if (a[i] !== b[i]){\n return false;\n }\n }\n return true;\n}", "function arrayCompare(a, b) {\n //if the lengths of the two arrays are not equal, return false\n if (a.length !== b.length) return false;\n const uniqueValues = new Set([...a, ...b]);\n //otherwise iterate through the two arrays and see if their contents match\n for (const v of uniqueValues) {\n const aCount = a.filter(e => e === v).length;\n const bCount = b.filter(e => e === v).length;\n //if the contents do not match, return false\n if (aCount !== bCount) return false;\n }\n //otherwise return true\n return true;\n }", "function areIsomorphic(array1, array2) {\n let lengthsOfArr1 = array1.map(arr => arr.length);\n let lengthsOfArr2 = array2.map(arr => arr.length);\n \n if(lengthsOfArr1.length !== lengthsOfArr2.length)\n return false;\n \n // dimensions of arrays match, check the lengths of rows/cols\n for(let i = 0; i < lengthsOfArr1.length; i++) {\n if(lengthsOfArr1[i] !== lengthsOfArr2[i])\n return false;\n }\n return true;\n}", "function compareArrays(a1, a2) {\n if (Array.isArray(a1) == false) return false;\n if (Array.isArray(a2) == false) return false;\n if (a1.length !== a2.length) return false;\n for (var i = 0; i < a1.length; i++) { if (a1[i] !== a2[i]) return false; }\n return true;\n }", "function checkArrays(arr1, arr2) {\n if (arr1.length !== arr2.length) return false;\n for (let i = 0; i < arr1.length; i++) {\n if (!compareItems(arr1[i], arr2[i])) return false;\n }\n return true;\n}", "function equalArrays(array1, array2) {\n // if the other array is a falsy value, return\n if (!array1 || !array2)\n return false;\n\n // compare lengths - can save a lot of time\n if (array1.length != array2.length)\n return false;\n\n for (var i = 0, l=array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array2[i] instanceof Array) {\n // recurse into the nested arrays\n if (!equalArrays(array1[i],array2[i]))\n return false;\n }\n else if (array1[i] != array2[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n}", "function equalArrays(array1, array2) {\n // if the other array is a falsy value, return\n if (!array1 || !array2)\n return false;\n\n // compare lengths - can save a lot of time\n if (array1.length != array2.length)\n return false;\n\n for (var i = 0, l=array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array2[i] instanceof Array) {\n // recurse into the nested arrays\n if (!equalArrays(array1[i],array2[i]))\n return false;\n }\n else if (array1[i] != array2[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n}", "function isAllEqual(array1, array2) {\n if (array1.size != array2.size)\n return false;\n for (var i = 0; i < array1.size; i++) {\n if (array1[i] != array2[i])\n return false;\n }\n return true;\n}", "function compareArrays (array1, array2) {\n if (array1 == undefined || array1.length == 0) {\n return false;\n }\n if (array1 == undefined || array1.length == 0) {\n return false;\n }\n if (array1.length != array2.length) {\n return false\n } else {\n array1 = array1.sort();\n array2 = array2.sort();\n for (let i = 0; i < array1.length; i++) {\n if (array1[i] != array2[i]) {\n return false\n }\n }\n }\n return true;\n}", "function areEqualArrays(array1, array2) {\n\t var temp = new Array();\n\t \n\t if((!array1[0]) || (!array2[0])) {\n\t return false;\n\t }\n\n\t if(array1.length != array2.length) {\n\t return false;\n\t }\n\t for(var i = 0; i < array1.length; i++) {\n\t key = (typeof array1[i]) + \"~\" + array1[i];\n\t if(temp[key]) {\n\t \ttemp[key]++;\n\t } else {\n\t \ttemp[key] = 1;\n\t }\n\t }\n\t \n for(var i = 0; i < array2.length; i++) {\n\t key = (typeof array2[i]) + \"~\" + array2[i];\n\t if(temp[key]) {\n\t if(temp[key] == 0) {\n\t \treturn false;\n\t } else {\n\t \ttemp[key]--;\n\t }\n\t } else {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function equalArray(array1, array2) {\n if (!Array.isArray(array1) && !Array.isArray(array2)) {\n return array1 === array2;\n }\n\n if (array1.length !== array2.length) {\n return false;\n }\n\n for (var i = 0, len = array1.length; i < len; i++) {\n if (!equalArray(array1[i], array2[i])) {\n return false;\n }\n }\n return true;\n}", "function arrayEquals(array1, array2) {\n // if the other array is a falsy value, return\n if (!array2) {\n return false;\n } // compare lengths - can save a lot of time\n\n\n if (array1.length !== array2.length) {\n return false;\n }\n\n for (let i = 0, l = array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array2[i] instanceof Array) {\n // recurse into the nested arrays\n if (!array1[i].equals(array2[i])) {\n return false;\n }\n } else if (array1[i] !== array2[i]) {\n // Warning - two different object instances will never be\n // equal: {x:20} != {x:20}\n return false;\n }\n }\n\n return true;\n}", "function areTheyEqual(array_a, array_b) {\n const setA = new Set(array_a);\n const setB = new Set(array_b);\n return setA.size === setB.size && [...setA].every((v) => setB.has(v));\n}", "function same(arr1, arr2) {\r\n //check if 2 arrays have the same length\r\n if (arr1.length !== arr2.length) {\r\n return false;\r\n }\r\n let frequencyCounter1 = {}\r\n let frequencyCounter2 = {}\r\n //keys - arr values and values - frequency of arr values repetition;\r\n for (let val of arr1) {\r\n frequencyCounter1[val] = (frequencyCounter1[val] || 0) + 1\r\n }\r\n for (let val of arr2) {\r\n frequencyCounter2[val] = (frequencyCounter2[val] || 0) + 1\r\n }\r\n // check if the key is present in the arr2 and if the value is the same\r\n for (let key in frequencyCounter1) {\r\n if (!(key in frequencyCounter2)) {\r\n return false\r\n }\r\n if (frequencyCounter2[key] !== frequencyCounter1[key]) {\r\n return false\r\n }\r\n }\r\n return true\r\n}", "function CompareArrays(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n for (let a = 0; a < array1.length; a++) {\n if (array2.indexOf(array1[a]) === -1) {\n return false;\n }\n }\n return true;\n}", "function arrayEquals (array1, array2) {\n if (array1 === array2) {\n return true\n }\n if (array1.length !== array2.length) {\n return false\n }\n for (var i = 0, length = array1.length; i < length; ++i) {\n if (array1[i] !== array2[i]) {\n return false\n }\n }\n return true\n}", "function checkIfSameArrays(arrayA, arrayB) {\r\n\tconsole.log('In checkIfSameArrays(arrayA.length=%s, arrayB.length=%s)'\r\n\t\t, arrayA.length, arrayB.length);\r\n\r\n\tvar rtnBool = true, i=0, element, arrayA1 = new Array(), arrayB1 = new Array();\r\n\r\n\tarrayA1 = getArrayFromArray(arrayA);\r\n\tarrayB1 = getArrayFromArray(arrayB);\r\n//\tconsole.log(' cISA: \\n\\tarrayA1=%s \\n\\tarrayB1=%s', arrayA1, arrayB1);\r\n\tconsole.log(' cISA: \\n\\tarrayA1=%s \\n\\tarrayB1=%s', JSON.stringify(arrayA1), JSON.stringify(arrayB1));\r\n\r\n//\tif(arrayA.length() != arrayB.length()) {\r\n//\t\trtnBool = false;\r\n//\t} else {\r\n////\t\tconsole.log(' cISA: arrayA=%s arrayB=%s', arrayA, arrayB);\r\n//\t\tconsole.log(' cISA: \\n\\tarrayA=%s \\n\\tarrayB=%s', arrayA.print(), arrayB.print());\r\n//\t\t// check contents\r\n//\t\twhile(i < arrayA.length()) {\r\n//\t\t\telement = arrayA[i];\r\n//\r\n//\t\t\tif(!arrayB.includes(element)) {\r\n//\t\t\t\trtnBool = false;\r\n//\t\t\t\tbreak;\r\n//\t\t\t}\r\n//\r\n//\t\t\ti++;\r\n//\t\t}\r\n//\t}\r\n\t\r\n\tif(arrayA1.length != arrayB1.length) {\r\n\t\trtnBool = false;\r\n\t} else {\r\n\t\twhile(i < arrayA1.length) {\r\n\t\t\tif(!arrayB1.includes(arrayA1[i])) {\r\n\t\t\t\trtnBool = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}\r\n\t\r\n\tconsole.log(' cISA: rtnBool=', rtnBool);\r\n\treturn rtnBool;\r\n}", "function areSimilar(a, b) {\n var sortedA = a.slice(0).sort().join('');\n var sortedB = b.slice(0).sort().join('');\n console.log(a,b);\n if(sortedA == sortedB){\n var count = 0;\n for(var i = 0; i<a.length; i++){\n if(a[i] !== b[i]){\n count++;\n }\n }\n return count<=2;\n } else {\n return false;\n }\n}", "function isArraySimilar(source, compare) {\n\n return (\n source.length === array.length\n && arrayCommon(source, array).length === arrayUnique(source).length\n );\n\n }", "function eqArrays(array1, array2){ \n if (array1.length !== array2.length) {\n return false;\n } \n for (let i = 0; i < array1.length; i++) { //check item at same index if the same; not nested for loop, not need both 1 and 2\n if(array1[i] !== array2[i]) { //end condition is not equal\n return false; \n } \n } \n return true; //return boolean\n }", "function same2(arr1, arr2){\n // check if the length of both arrays are same, if not return false\n if(arr1.length !== arr2.length){\n return false;\n }\n \n // create empty object to store the frequency of values in both arrays\n let freqCounter1 = {};\n let freqCounter2 = {};\n\n // loop both arrays and add the frequency to the corresponding object\n for (let val of arr1) {\n freqCounter1[val] = (freqCounter1[val] || 0) + 1;\n }\n\n for (let val of arr2) {\n freqCounter2[val] = (freqCounter2[val] || 0) + 1;\n }\n \n // loop first object that contains frequency of value in first array\n for (let key in freqCounter1) {\n // check if the key (squared) is not in the second object, if so return false\n if ( !(key ** 2 in freqCounter2) ) {\n return false;\n }\n \n // check if the value in both object is not same, if so return false\n if( freqCounter1[key] !== freqCounter2[key ** 2] ) {\n return false;\n }\n }\n \n // return true, means the arrays are same\n return true;\n}", "function arraysEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) return false;\n for (var i = arr1.length; i--; ) {\n if (arr1[i] !== arr2[i]) return false;\n }\n\n return true;\n}", "function arraysEqual(arr1, arr2) {\n if(arr1.length !== arr2.length)\n return false;\n for(var i = arr1.length; i--;) {\n if(arr1[i] !== arr2[i])\n return false;\n }\n return true;\n}", "function arrEq(arr1, arr2) {\n for(var i = 0; i < arr1.length; i++){\n if (arr1[i] != arr2[i]) return false;\n }\n return true;\n}", "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n } else {\n return a === b;\n }\n}", "function arraysEqual(arr1, arr2) {\n if(arr1.length !== arr2.length)\n return false;\n for(var i = arr1.length; i--;) {\n if(arr1[i] !== arr2[i])\n return false;\n }\n return true;\n}", "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n }\n else {\n return a === b;\n }\n}", "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n }\n else {\n return a === b;\n }\n}", "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n }\n else {\n return a === b;\n }\n}", "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n }\n else {\n return a === b;\n }\n}", "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n }\n else {\n return a === b;\n }\n}", "isEqualArray(arr1, arr2) {\n\t\tconst height = arr1.length;\n\t\tconst width = arr1[0].length;\n\t\tfor (let i = 0; i < height; i++) {\n\t\t\tfor (let j = 0; j < width; j++) {\n\t\t\t\tif (arr1[i][j] !== arr2[i][j]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function stringArraysHaveSameElements(arrayA, arrayB) {\n if (arrayA.length === arrayB.length &&\n arrayA.sort().join() === arrayB.sort().join()) {\n return true;\n }\n return false;\n}", "function isEqual(array1, array2) {\n return array1.every((val, idx) => val === array2[idx]);\n}", "function match(array1, array2){\n if(array1.length !== array2.length) {\n return false\n } else if (array1.sort().every(function(value, index) {return value === array2.sort()[index]})) {\n return true;\n } else {\n return false;\n }\n}", "function compareArrays(array1, array2) {\n\n var length = Math.min(array1.length, array2.length);\n for (var i = 0; i < length; ++i) {\n if (array1[i] !== array2[i]) {\n return \"Arrays are different in element \" + i + \": \" + array1[i] + \" vs \" + array2[i];\n }\n }\n\n if (array1.length !== array2.length) {\n return \"Arrays have different length \" + array1.length + \" vs \" + array2.length;\n }\n\n return null;\n}", "equalsArray(a, b) {\n if (a === b) return true;\n if (a == null || b == null) return false;\n if (a.length !== b.length) return false;\n\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) { return false; }\n }\n return true;\n }", "function isEquivalentArray(a, b) {\r\n return Array.isArray(b)\r\n ? a.length === b.length && a.every((value, i) => value === b[i])\r\n : a.length === 1 && a[0] === b;\r\n}", "function isEquivalentArray(a, b) {\r\n return Array.isArray(b)\r\n ? a.length === b.length && a.every((value, i) => value === b[i])\r\n : a.length === 1 && a[0] === b;\r\n}", "function arrayEqual (array1, array2) {\n // if the other array is a falsy value, return\n if (!array2)\n return false;\n \n // compare lengths - can save a lot of time\n if (array1.length != array2.length)\n return false;\n \n for (var i = 0, l=array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array2[i] instanceof Array) {\n // recurse into the nested arrays\n if (!array1[i].compare(array2[i]))\n return false;\n }\n else if (array1[i] != array2[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n}", "function arraysEqual(a1,a2) {\n return JSON.stringify(a1)==JSON.stringify(a2);\n}", "function arrayEquals(arrA, arrB) {\n\tlet equals = true\n\n\tarrA.forEach((a, i) => {\n\t\tif(!equals)\n\t\t\treturn\n\n\t\tif(i >= arrB.length || arrB[i] !== a)\n\t\t\tequals = false\n\t})\n\n\treturn equals\n}", "function countIdenticalArrays(arr1, arr2, arr3, arr4) {\r\n \r\n /*let i;\r\n let arrayCount = [];\r\n for (i = 0; i < array.length; i++) {\r\n if (array.indexOf(array[i]) !== array.lastIndexOf(array[i])) {\r\n console.log(array[i]);\r\n }\r\n }\r\n console.log(arrayCount);\r\n */\r\n \r\n let array = [arr1, arr2, arr3, arr4];\r\n let arrayCount = [];\r\n let i;\r\n let k;\r\n for (i = 0; i < array.length; i++) {\r\n if (array[i] === array[i++]) {\r\n console.log(array[i]);\r\n }\r\n }\r\n}", "function simpleArrayEquals(arr1, arr2) {\n return Array.isArray(arr1) && Array.isArray(arr2) && arr2.sort().toString() !== arr1.sort().toString();\n }", "function isEquivalentArray(a, b) {\n return Array.isArray(b)\n ? a.length === b.length && a.every((value, i) => value === b[i])\n : a.length === 1 && a[0] === b;\n}", "function isSameArray(array1, array2) {\n logger.info(\"Cart ::: isSameArray\");\n if ((array1.length == 0) && array2.length == 0) return true;\n if (array1.length < array2.length) {\n let tempArray = array1;\n array1 = array2;\n array2 = tempArray;\n }\n for (let i = 0; i < array1.length; i++) {\n if (array1[i] != array2[i]) {\n return false;\n }\n }\n return true;\n}", "function arrayEqual(array1, array2) {\r\n\treturn (array1.length == array2.length) && array1.every(function(element, index) {\r\n\t\treturn element === array2[index]; \r\n\t});\r\n}", "function isEqual(array1, array2) {\n\t\tif (array1.length !== array2.length) return false;\n\t\tfor (let i=0; i<array1.length; i++) {\n\t\t\tif (array1[i] !== array2[i]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function compareArrays(arr1,arr2){\n var boo=false;\n for(var jj=0;jj<arr1.length;jj++){\n if(arr2.includes(arr1[jj]))\n {\n boo=true;\n break;\n }\n }\n return boo;\n}", "function compareArray(a1, a2) {\n if (a1.length != a2.length) return false;\n for (var i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) return false;\n }\n return true;\n }", "function compareArray(a1, a2) {\n if (a1.length != a2.length) return false;\n for (var i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) return false;\n }\n return true;\n }", "function compareArray(a1, a2) {\n if (a1.length != a2.length) return false;\n for (var i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) return false;\n }\n return true;\n }", "function compareArray(a1, a2) {\n if (a1.length != a2.length) return false;\n for (var i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) return false;\n }\n return true;\n }", "function arrayEquals(arr1, arr2) {\n\t\tif(arr1 === arr2) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif(arr1.length !== arr2.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor(let i = 0; i < arr1.length; i++) {\n\t\t\tif(arr1[i] !== arr2[i]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function arraysContainDifferentElements(array1, array2){\n var difference1 = array1.filter(function(element){\n return array2.indexOf(element)<0;\n });\n var difference2 = array2.filter(function(element){\n return array1.indexOf(element)<0;\n });\n var totalDifference = difference1.length + difference2.length;\n if (totalDifference == 0){\n return false;\n } else {\n return true;\n }\n}", "function arrayEQ(arr1, arr2) {\n if (arr1.length === arr2.length) {\n return arr1[0] === arr2[0] && arr1[1] === arr2[1];\n }\n return false;\n}", "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n\n var aSorted = Object(C_Users_Abid_Loqmen_Desktop_NGforce_thesis_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(a).sort();\n\n var bSorted = Object(C_Users_Abid_Loqmen_Desktop_NGforce_thesis_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(b).sort();\n\n return aSorted.every(function (val, index) {\n return bSorted[index] === val;\n });\n } else {\n return a === b;\n }\n}" ]
[ "0.7854473", "0.7801491", "0.7498858", "0.7266912", "0.71843976", "0.71412563", "0.7140647", "0.71113557", "0.7084376", "0.706554", "0.7052794", "0.70436126", "0.70310944", "0.7012549", "0.69973093", "0.6995364", "0.69826484", "0.6973935", "0.6973935", "0.6973935", "0.6972645", "0.696894", "0.696894", "0.696725", "0.696725", "0.6962826", "0.69596297", "0.69292974", "0.69123745", "0.69075364", "0.69041", "0.68968564", "0.68962836", "0.6875136", "0.6870058", "0.6864436", "0.68540686", "0.6833805", "0.6830698", "0.68272394", "0.68197954", "0.68141776", "0.6813827", "0.68133", "0.6812641", "0.6809524", "0.68082935", "0.6802617", "0.6801709", "0.6801709", "0.68013906", "0.6795216", "0.67915094", "0.67836356", "0.67822", "0.67607254", "0.67602074", "0.67398816", "0.67243737", "0.6712228", "0.6709885", "0.6702793", "0.66883695", "0.6684844", "0.6680221", "0.6671476", "0.667086", "0.66682726", "0.6665796", "0.66560304", "0.66560304", "0.66560304", "0.66560304", "0.66560304", "0.66386414", "0.6634432", "0.662339", "0.6617299", "0.6607414", "0.6594564", "0.6588064", "0.6588064", "0.6586042", "0.6581071", "0.6575936", "0.6573032", "0.6566874", "0.6552472", "0.65271693", "0.65201974", "0.6513791", "0.65111786", "0.64981014", "0.64981014", "0.64981014", "0.64981014", "0.64958125", "0.6489245", "0.6481399", "0.64749473" ]
0.7920142
0
frontend SPA routing function
async function render() { const page = await isomorphicRouter.resolve(location.pathname); if (page.redirect) { window.location = page.redirect; } else { document.body.innerHTML = page.content; if (window.location.pathname === "/") { mainPageFunction(); } else if (window.location.pathname === "/login") { loginFunction(); } else if (window.location.pathname === "/register") { registerFunction(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showHome(request){\n request.serveFile(\"index.html\"); \n}", "bindSPA() {\r\n if (process.env.NODE_ENV !== 'production') return;\r\n const indexPath = path.join(__dirname, '../../public/index.html');\r\n const publicPath = path.join(__dirname, '../../public');\r\n const index = fs.readFileSync(indexPath);\r\n this.app.use(koaStatic(publicPath));\r\n this.app.use(async (ctx) => {\r\n ctx.body = index.toString();\r\n });\r\n }", "@appRoute(\"(/)\")\n startIndexRoute () {\n System.import(\"../views/home\").then(View => App.getContentContainer().show(new View.default()) );\n }", "function index(req, res) {\n // redirect to sb before spa version\n res.redirect(req.browsePrefix);\n}", "function routing() {\n switch (document.location.hash) {\n case '':\n ajaxRequestWithCallback('views/home.html', importInViewForHome);\n break;\n case \"#game\":\n ajaxRequestWithCallback('views/game.html', importInViewAndStartGame);\n break;\n case \"#score\":\n ajaxRequestWithCallback('views/score.html', importInViewAndShowScore);\n break;\n case \"#controls\":\n ajaxRequestWithCallback('views/controls.html', importInViewAndShowControls);\n break;\n case \"#modal\":\n ajaxRequestWithCallback('views/modal.html', importInViewAndSaveScore);\n break;\n default:\n ajaxRequestWithCallback('views/pageNotFound.html', importInView);\n break;\n }\n }", "function home(request){\n request.serveFile(\"index.html\");\n}", "function route(view_eng){\n this.app.use(this.exp.static(__dirname + '/../public'));\n console.log(\"static directory: \" + __dirname + '/../public');\n if(view_eng){ this.app.set('view engine', view_eng); }\n \n this.app.get('/', renderHomePage);\n this.app.get('/test', renderDownloadPage(this.sessions));\n this.app.get('/:id', renderDownloadPage(this.sessions));\n}", "function GET_homeRoute(req, res){\r\n // the render function causes express to use the templating engine\r\n res.render('pages/home');\r\n}", "function loadingPage(req, res, next) {\n console.log(\"GET '/'\");\n res.render('index');\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 App(){\n return(\n <div>\n <S>\n <R path=\"/info\">\n <Detail/>\n </R>\n <R path='/login'>\n <Login/>\n </R>\n <R path=\"/\">\n <Home/> \n </R>\n </S>\n </div>\n );\n}", "function showHome(request){\n\trequest.respond(\"This is the home page.\");\n}", "function goToURL() {\n location.href = 'http://127.0.0.1:8000/apps/reservoir-management/sabana-yegua/';\n}", "index(request, response) {\n \n // display confirmation message in log\n logger.info('about rendering');\n \n // create view data object (contains data to be sent to the view e.g. page title)\n const viewData = {\n title: 'Your shelf',\n shelves: shelfStore.getAllShelves(),\n };\n \n // render the about view and pass through the data\n response.render('shelf', viewData);\n }", "function indexhHandler(req,res){\n res.render('index_page')\n}", "gotoListPage() {\n goto.route('/snippets');\n }", "function router() {\n var route = window.location.hash.substring(1);\n var copy = routes.filter(function(element) {\n return element.name === route;\n })\n\n var template = (copy[0] ? copy[0].template : 'pages/home.html');\n \n var req = new XMLHttpRequest();\n req.addEventListener('load', function() {\n content.innerHTML = this.responseText;\n }, false);\n req.open('get', template, true);\n req.send(null);\n }", "show(req, res) {\n logging.logTheinfo(\"widgets show Router\");\n res.status(200).send(\"show\");\n\n }", "function render(url) {\n\n /**\n * Get request keyword from url\n * @type {string}\n */\n const request = url.split('/')[0];\n\n get(\"loading-status\").update(\"Organizando as informações...\");\n\n const routes = {\n\n /**\n * Home\n */\n '': function () {\n /**\n * App Page element\n * @type {Element}\n */\n let page = new Element({\n properties: {\n id: \"app\",\n className: \"\"\n }\n });\n\n /**\n * Page Header\n */\n new Element({\n type: \"header\",\n properties: {\n className: \"app-header\"\n },\n content: [\n new Element({\n type: \"h1\",\n content: \"Busca Marvel\",\n properties: {\n className: \"app-title\"\n }\n }),\n new Element({\n type: \"h2\",\n content: \"Teste front-end\",\n properties: {\n className: \"app-subtitle\"\n }\n }),\n new Element({\n type: \"h3\",\n content: \"Paulo Cézar Francisco Júnior\",\n properties: {\n className: \"app-developer hide-on-mobile\"\n }\n })\n ]\n }, page);\n\n /**\n * Detail\n */\n new Element({\n properties: {\n className: \"app-line\"\n },\n content: new Element\n }, page);\n\n /**\n * Search box\n */\n new Element({\n type: \"section\",\n properties: {\n id: \"search-container\",\n placeholder: \"Pesquisar\"\n },\n content: [\n new Element({\n type: \"label\",\n content: \"Nome do Personagem\",\n properties: {\n htmlFor: \"search-box\",\n className: \"app-search-label\"\n }\n }),\n new Element({\n type: \"input\",\n properties: {\n id: \"search-box\",\n className: \"app-search-box\",\n title: \"Digite o nome de um herói da Marvel\",\n placeholder: \"ex. Iron Man\",\n oninput: function(){\n filterList();\n }\n }\n }),\n ]\n }, page);\n\n /**\n * Heroes List\n */\n new Element({\n type: \"section\",\n properties: {\n className: \"app-hero-list\",\n },\n content: [\n new Element({\n properties: {\n className: \"app-hero-list-header\",\n },\n content: [\n new Element({\n content: \"Nome\"\n }),\n new Element({\n content: \"Séries\",\n properties: {\n className: \"hide-on-mobile\"\n }\n }),\n new Element({\n content: \"Eventos\",\n properties: {\n className: \"hide-on-mobile\"\n }\n })\n ]\n }),\n new Element({\n properties: {\n id: \"hero-list\",\n className: \"app-hero-list-rows\",\n },\n content: goPage(1, HERO_LIST, true)\n }),\n ]\n }, page);\n\n new Element({\n properties: {\n id: \"pagination-container\",\n className: \"app-pagination-container row-4\",\n },\n type: \"section\",\n content: [\n new Element({\n properties: {\n className: \"app-pagination\"\n },\n content: [\n new Element({\n type: \"span\",\n content: \"&#9664;\",\n properties: {\n className: \"disabled\",\n id: \"app-pagination-prev\",\n onclick: function () {\n goPage(prevPage());\n }\n }\n }),\n new Element({\n type: \"ul\",\n properties: {\n id: \"pagination-list\"\n },\n content: [\n new Element({\n type: \"li\",\n content: \"1\",\n properties: {\n className: \"app-pagination-page active\",\n onclick: function () {\n goPage(1);\n }\n }\n })\n ]\n }),\n new Element({\n type: \"span\",\n content: \"&#9654;\",\n properties: {\n className: \"disabled\",\n id: \"app-pagination-next\",\n onclick: function () {\n goPage(nextPage());\n }\n }\n })\n ]\n })\n ]\n }, page);\n\n new Element({\n properties: {\n id: \"footer\",\n },\n type: \"footer\",\n content: [\n new Element({\n type: \"span\",\n properties: {\n id: \"copyright\"\n },\n content: HERO_DATA.copyright\n })\n ]\n }, page);\n\n ROOT.update(page, function(){\n trigger(\"list-updated\");\n });\n },\n\n /**\n * Detail page\n */\n '#hero': function () {\n\n /**\n * App Page element\n * @type {Element}\n */\n let page = new Element({\n properties: {\n id: \"app\",\n className: \"detail\"\n }\n });\n\n /**\n * Get the hero name\n * @type {string}\n */\n let idHero = url.split('#hero/')[1].trim();\n\n let hero = HERO_LIST.find(function (h) {\n if(parseInt(h.id) === parseInt(idHero)){\n return h;\n }\n });\n\n let series = [\n new Element({\n properties: {\n className: \"detail-block\"\n },\n content: [\n new Element({\n type: \"header\",\n properties: {\n className: \"detail-block-header\"\n },\n content: \"Não há dados para exibir nesta categoria.\"\n })\n ]\n })\n ];\n\n let events = [\n new Element({\n properties: {\n className: \"detail-block\"\n },\n content: [\n new Element({\n type: \"header\",\n properties: {\n className: \"detail-block-header\"\n },\n content: \"Não há dados para exibir nesta categoria.\"\n })\n ]\n })\n ];\n\n if(hero.series.returned > 0){\n\n /**\n * Fetch (more) information about series\n */\n series = hero.series.items.map(function(s){\n idSerie = \"detail-serie-\" + s.resourceURI.toString().split(\"/\").slice(-1).toString().trim();\n\n setTimeout(function(){\n fetch(s.resourceURI.toString().replace(\"http://\", \"https://\") + \"?apikey=5e8ca1959f7f23db54436ae4b3661243\").then(r => r.json()).then(function(json){\n let data = json.data.results[0];\n get(\"detail-serie-\" + data.id).update(new Element({\n properties: {\n className: \"detail-card\"\n },\n content: [\n new Element({\n properties: {\n className: \"detail-card-description\"\n },\n content: data.description || \"Sem descrição.\"\n }),\n new Element({\n type: \"a\",\n properties: {\n className: \"detail-card-link\",\n href: data.urls[0].url,\n target: \"_blank\",\n title: \"Veja mais no site da MARVEL\"\n },\n content: \"&#9654; Veja mais em MARVEL.com\"\n }),\n new Element({\n properties: {\n className: \"detail-card-properties\"\n },\n content: [\n new Element({\n content: [\n \"Creators:\",\n data.creators.items.map(function(c){\n return c.name;\n }).join(\", \")\n ].join(\" \").trim()\n })\n ]\n }),\n ]\n }));\n }).catch(function(err){\n get(idSerie).update(\"Desculpe, não foi possível obter dados da MARVEL.\");\n console.error(err);\n });\n }, 300);\n\n return new Element({\n properties: {\n className: \"detail-block\"\n },\n content: [\n new Element({\n type: \"header\",\n properties: {\n className: \"detail-block-header\"\n },\n content: s.name\n }),\n new Element({\n type: \"section\",\n properties: {\n className: \"detail-block-content\",\n id: idSerie,\n style: {\n textAlign: \"center\"\n }\n },\n content: [\n new Element({\n className: \"detail-loading\",\n type: \"img\",\n properties: {\n src: \"img/loading.gif\",\n alt: \"Obtendo dados...\",\n height: \"40\",\n width: \"40\"\n }\n }),\n ]\n })\n ]\n });\n });\n }\n\n if(hero.events.returned > 0){\n\n /**\n * Fetch (more) information about events\n */\n events = hero.events.items.map(function(s){\n idEvent = \"detail-event-\" + s.resourceURI.toString().split(\"/\").slice(-1).toString().trim();\n\n setTimeout(function(){\n fetch(s.resourceURI.toString().replace(\"http://\", \"https://\") + \"?apikey=5e8ca1959f7f23db54436ae4b3661243\").then(r => r.json()).then(function(json){\n let data = json.data.results[0];\n console.log(data);\n get(\"detail-event-\" + data.id).update(new Element({\n properties: {\n className: \"detail-card\"\n },\n content: [\n new Element({\n properties: {\n className: \"detail-card-description\"\n },\n content: data.description || \"Sem descrição.\"\n }),\n new Element({\n properties: {\n className: \"detail-card-properties\"\n },\n content: [\n new Element({\n content: [\n \"Criadores:\",\n data.creators.items.map(function(c){\n return c.name;\n }).join(\", \")\n ].join(\" \").trim()\n })\n ]\n }),\n ]\n }));\n }).catch(function(err){\n get(idSerie).update(\"Desculpe, não foi possível obter dados da MARVEL.\");\n console.error(err);\n });\n }, 300);\n\n return new Element({\n properties: {\n className: \"detail-block\"\n },\n content: [\n new Element({\n type: \"header\",\n properties: {\n className: \"detail-block-header\"\n },\n content: s.name\n }),\n new Element({\n type: \"section\",\n properties: {\n className: \"detail-block-content\",\n id: idEvent\n },\n content: [\n new Element({\n className: \"detail-loading\",\n type: \"img\",\n properties: {\n src: \"img/loading.gif\",\n alt: \"Obtendo dados...\",\n height: \"40\",\n width: \"40\",\n style: {\n display: \"block\",\n margin: \"10px auto\",\n }\n }\n }),\n ]\n })\n ]\n });\n });\n }\n\n /**\n * Back home link\n */\n new Element({\n type: \"a\",\n properties: {\n onclick: function(){\n window.location.hash = \"\";\n },\n id: \"back-home\",\n title: \"Voltar à busca\"\n },\n content: \"&#9664;\"\n }, page);\n\n /**\n * Page Header\n */\n new Element({\n type: \"header\",\n properties: {\n id: \"detail-header\",\n className: \"app-header\"\n },\n content: [\n new Element({\n content: [\n new Element({\n id: \"detail-img\",\n type: \"img\",\n properties: {\n src: (['path', 'extension'].map(p => hero.thumbnail[p])).join(\".\").replace(\"http://\", \"https://\"),\n alt: hero.name,\n height: \"180\",\n width: \"180\"\n }\n }),\n new Element({\n type: \"h1\",\n content: hero.name,\n properties: {\n className: \"app-title\"\n }\n }),\n ]\n }),\n new Element({\n type: \"h3\",\n content: HERO_DATA.copyright,\n properties: {\n className: \"detail-logo hide-on-mobile\"\n }\n })\n ]\n }, page);\n\n new Element({\n properties: {\n id: \"detail-content\",\n },\n type: \"section\",\n content: [\n new Element({\n type: \"section\",\n properties: {\n className: \"detail-content-section\"\n },\n content: [\n new Element({\n type: \"header\",\n content: \"Séries\"\n }),\n new Element({\n type: \"section\",\n content: series\n })\n ]\n }),\n new Element({\n type: \"section\",\n properties: {\n className: \"detail-content-section\"\n },\n content: [\n new Element({\n type: \"header\",\n content: \"Eventos\"\n }),\n new Element({\n type: \"section\",\n content: events\n })\n ]\n })\n ]\n }, page);\n\n /**\n * Footer\n */\n new Element({\n properties:{\n id: \"detail-footer\"\n },\n content: [\n new Element({\n content: HERO_DATA.attributionText\n }),\n new Element({\n content: \"PAULO CÉZAR FRANCISCO JÚNIOR\"\n })\n ]\n }, page);\n\n ROOT.update(page);\n }\n };\n\n /**\n * Load the page requested\n */\n if (routes[request]) {\n get(\"loading-status\").addClass(\"hidden\");\n routes[request]();\n }\n /**\n * If the request is not registered, load main page\n */\n else {\n window.location.hash = \"\";\n }\n}", "function pagesController(app) {\n\n //Express routes\n app.get('/pages/my-page', function(req, res) {\n res.send('Got my-page successfully');\n });\n\n}", "function router() { // private function\n\n var path = location.hash; \n console.log('path is ' + path);\n // prints something like /home\n\n // Use the url like an index (JS associative array notation) to find the desired\n // component (function) to run. The component will place content in the content\n // area. If a link is clicked for which a route was never set, give error message.\n if (!routes[path]) {\n document.getElementById(contentId).innerHTML = \"<p>Error: unknown link '\" + path +\n \"' never added to the routing table.</p>\";\n } else {\n routes[path](contentId);\n }\n }", "function App() {\n\n const showMenuHome = (routers) => {\n if (routers && routers.length > 0) {\n return routers.map((item, index) => {\n return (\n <HomeTemplate\n key={index}\n exact={item.exact}\n path={item.path}\n Component={item.component}\n\n />\n\n )\n\n })\n }\n }\n var Snow = require(\"react-snow-effect\")\n return (\n <BrowserRouter history={history}>\n <Snow />\n <Switch>\n <Suspense fallback={Loading}>\n {showMenuHome(routerHome)}\n <Route exact path=\"/detail/:id\" Component={DetailMovie} />\n <Route path=\"/admin\" exact component={AdminTemplate}></Route>\n <Route path=\"/user\" exact component={UserTemplate}></Route>\n\n </Suspense>\n\n\n </Switch>\n </BrowserRouter>\n );\n}", "@appRoute(\"features(/)\")\n startFeaturesRoute () {\n System.import(\"../views/features\").then(View => App.contentRegion.show(new View.default()));\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 }", "viewRoute() {\n\n this.router.use(auth.isLoggedIn());\n \n this.router.get('/signup', signup);\n this.router.get('/login', login);\n this.router.get('/forgot-password', forgotPassword);\n this.router.get('/reset-password', resetPassword);\n this.router.get('/forgot-password/success', forgotPasswordSuccess);\n this.router.get('/team', team);\n this.router.get('/volunteer', volunteer);\n this.router.get('/', home);\n this.router.get('/about-us', about);\n this.router.post('/', (req, res, next) => (req.page='home', next()), home);\n\n \n this.router.get(\n '/donor',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => res.redirect('/donor/dashboard')\n );\n \n this.router\n .get(\n '/donor/dashboard',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => ((req.page = 'dashboard'), next()),\n donorDashboard\n );\n \n this.router\n .get(\n '/donor/donations',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => ((req.page = 'donations'), next()),\n donorDashboard\n );\n \n this.router\n .get(\n '/donor/donations/verify',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n verifyMonetaryDonation\n )\n \n return this.router;\n}", "function homeRoute(request, response){\n //if url == \"/\" && GET\n console.log(\"weee3eeeeeeeeeesdfgaaauifyueeeeeerrreeeeeeeeee still reading stuff\");\n //if url == \"/\" && POST\n //redirect to /:username\n}", "routes() {\n this.app.use(indexRoutes_1.default);\n this.app.use(\"/api/games\", gamesRoutes_1.default); //Le decimos la ruta de la cual tiene acceso a esa peticion\n //Defecto es '/'\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}", "@action route() {\n this.currentPage = Home\n }", "async function storePages() {\n\n try {\n\n routes = [{\n path: '/index',\n title: \"Jack & Jek\",\n classes: \"mainIndex container-fluid\",\n mainHTML: await getMainHTML('/', \"<!-- START HERO SECTION -->\").then((mainString) => {\n return mainString\n }),\n scripts: [\"controller/index/heroCarousel.js\"]\n },\n {\n path: '/menu',\n title: \"Jack & Jek | Menú\",\n classes: \"mainMenu container-fluid\",\n mainHTML: await getMainHTML('/pages/menu.html', \"<!-- START BURGERS ARTICLE -->\").then((mainString) => {\n return mainString\n }),\n scripts: []\n },\n {\n path: '/orders',\n title: \"Jack & Jek | Pedidos\",\n classes: \"mainOrders container-fluid row\",\n mainHTML: await getMainHTML('/pages/orders.html', \"<!-- START ORDER SECTION -->\").then((mainString) => {\n return mainString\n }),\n scripts: [\"../controller/orders/products.js\", \"../controller/orders/items.js\",\n \"../controller/orders/ordersFunctions.js\", \"../controller/orders/listeners.js\",\n \"../controller/orders/orders.js\"\n ]\n },\n {\n path: '/contact',\n title: \"Jack & Jek | Contacto\",\n classes: \"mainContact container-fluid row\",\n mainHTML: await getMainHTML('/pages/contact.html', \"<!-- START CONTACT SECTION -->\").then((mainString) => {\n return mainString\n }),\n scripts: []\n },\n {\n path: '/jobs',\n title: \"Jack & Jek | Empleos\",\n classes: \"mainJobs container-fluid row\",\n mainHTML: await getMainHTML('/pages/jobs.html', \"<!-- START ABOUT US SECTION -->\").then((mainString) => {\n return mainString\n }),\n scripts: []\n },\n {\n path: '/404',\n title: \"Jack & Jek | Error 404\",\n classes: \"mainNotFound\",\n mainHTML: `\n <h2>Error 404</h2>\n <h3>Página no encontrada.</h3>`,\n scripts: []\n }\n ]\n\n } catch (error) {\n console.log('Error al cargar las rutas: ', error);\n }\n\n}", "function route() { // main loop!\n\tlet current = getCurrent();\n\n\tif ( current !== hashRoute ){\n\t\thashRoute = current;\n\t\trenderNav(); // render proper nav for any page change per user, one line to handle ALL requirements.\n let [i, idStr] = hashRoute.split(\"/\");\n\t\tif ( hashRoute == \"#home\" ){\n home();\n\t\t} else if ( hashRoute == \"#register\" ){\n\t\t\tregister();\n\t\t} else if ( hashRoute == \"#logout\" ){\n logout();\n\t\t} else if ( hashRoute.includes(\"recepie\") ){\n\t\t\trecepieInfo( idStr );\n\t\t} else if ( hashRoute.includes(\"edit\") ){\n\t\t\trecepieEdit( idStr );\n\t\t} else if ( hashRoute.includes(\"archive\") ){\n\t\t\tdeleteRecepie( idStr );\n\t\t} else if ( hashRoute.includes(\"like\") ){\n\t\t\tlikeRecepie( idStr );\n } else if ( hashRoute == \"#share\" ){\n\t\t\trecepieShare();\n\t\t} else if ( // !user || \n // !userObj ||\n // window.location.hash == \"\" ||\n hashRoute == \"#login\"\n ){\n login();\n\t\t} else if( hashRoute == \"#makeFood\" ){\n makeFood(); // for testing\n }\n\t}\n\tsetTimeout( route, 150 );\n}", "function htmlRoutes(app) {\n // Route to the homepage\n app.get(\"/\", function (req, res) {\n res.sendFile(path.join(__dirname, \"../public/home.html\"));\n });\n\n // Route to the survey page\n app.get(\"/survey\", function (req, res) {\n res.sendFile(path.join(__dirname, \"../public/survey.html\"));\n });\n}", "function index(req, res) {\n \n}", "function getURL(route, paramArray){\n\tif(route === myApp.route) {\n\t\tconsole.log(\"== page already routed '\"+ route +\"' ==\");\n\t\treturn false;\n\t}\n\n // client-side routing handled using page.js\n\tvar path = '/'+route;\n\tif(paramArray && paramArray.length>0) {\n\t\tfor(var i=0; i<paramArray.length; i++) {\n\t\t\tpath = path + '/' + paramArray[i]; // eg. '/editor/1'\n\t\t}\n\t}\n\n\tconsole.log(\"=> getURL route: \" + route);\n\tpage(path);\n}", "function landing(req, res) {\n \n return staticFile(landingPage, req, res);\n}", "function handleRoute(e) {\n\te.preventDefault();\n\tlet _hash = location.hash;\n\t// Check: If user is not sign im, than cannot access other pages, and user is redirected on HomePage to sign in\n\tif (!localStorage.getItem('userName') && _hash != \"\") {\n\t\tlocation.hash = \"\";\n\t};\n\t// possible Routs options (empty route for HomePage and #cardslist for CardsPage) and non-valid route redirects on empty Route back on HomePage)\n\tswitch (_hash) {\n\t\tcase '':\n\t\t\thomePage.style.display = 'block';\n\t\t\tcardsPage.style.display = 'none';\n\t\t\tbtnToTop.style.display = 'none';\n\t\t\tbreak;\n\t\tcase '#cardslist':\n\t\t\thomePage.style.display = 'none';\n\t\t\tcardsPage.style.display = 'block';\n\t\t\twelcomeMsg.innerText = `Hello, ${localStorage.getItem('userName')}`;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tlocation.hash = '';\n\t\t\tbreak;\n\t}\n\t// invoke fetching data on page load and hashchange, only if data array is empty (no data fetched)\n\tif (dataArr.length === 0) {\n\t\tfetchData();\n\t};\n\tfetchTypes();\n}", "function generalRoutes(){\t\n\t\n\t// default GET\n\tapp.get('*',\n\t\tfunction (req, res) {\n\t\t res.sendfile('./public/index.html');\n\t\t});\n \n }", "function pageHome(request, response) {\r\n response.send('<h1>Welcome to Phonebook</h1>')\r\n}", "function htmlRoutes(app, path){\n app.get(\"/\", function(req, res){\n res.sendFile(path.join(__dirname, \"../public/home.html\"));\n });\n app.get(\"/survey\", function(req, res){\n res.sendFile(path.join(__dirname, \"../public/survey.html\"));\n });\n}", "initRouter() {\n Router.config(AppConfig.get('routes'));\n \n Router.onBeforeAction((r, p) => {\n const token = Accounts.getToken()\n if(!r.ignoreLogin && !token) Accounts.logout()\n })\n\n /** Login **/\n Router.on('login', (rota, req) => {\n this.component(<LoginComponent />);\n });\n Router.on('/logout', () => {\n Accounts.logout('/login');\n });\n\n /** Inicio **/\n Router.on('home', (rota, req) => {\n Router.redirect(rota.submenu[0].path);\n });\n Router.on('profile', (rota, req) => {\n this.component(<NewsFeed jsonUrl='/feed' userName={req.params.username}/>);\n });\n Router.on('/novidades', (rota, req) => {\n this.component(<NewsFeed jsonUrl='/feed'/>);\n });\n\n Router.on('messages', (rota, req) => {\n Router.redirect(rota.submenu[0].path);\n });\n Router.on('/social/conversations', (rota, req) => {\n this.component(<MessagesList />);\n });\n\n Router.on('settings', (rota, req) => {\n page.redirect(rota.submenu[0].path);\n });\n Router.on('/social/privacy', (rota, req) => {\n this.component(<h1>Privacy</h1>);\n });\n Router.notFound((rota, req) => {\n this.component(<h1>404 {rota.path}</h1>);\n });\n Router.init();\n }", "function router() {\n\tele(\"error\").innerText = \"\";\n\tele(\"content\").innerHTML = \"\";\n\tif (!state.isSignedIn) return;\n\n\tconst view = (hash) => {\n\t\tif (hash.startsWith(\"#sheet/\")) {\n\t\t\treturn editSheetView(hash.substr(\"#sheet/\".length));\n\t\t} else {\n\t\t\treturn listView()\n\t\t}\n\t}\n\tif (location.hash === \"\") {\n\t\tconst hash = localStorage.getItem(\"lastLocation\") || \"\";\n\t\tif (hash !== \"\") {\n\t\t\tlocation.hash = hash\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\tlocalStorage.setItem(\"lastLocation\", location.hash);\n\t}\n\tloadInc();\n\tview(location.hash).catch(uncaughtErrorHandler).finally(() => {\n\t\tloadDec();\n\t});\n}", "function homeRouteHandler(request, response) {\n response.status(200).send('Welcome to City Explorer App');\n}", "function updateRoute() {\n const path = window.location.pathname;\n const route = routes[path];\n if (!route) {\n return navigate('/login');\n }\n\n document.title = route.title;\n\n const template = document.getElementById(route.templateId);\n const view = template.content.cloneNode(true);\n const app = document.getElementById('app');\n app.innerHTML = '';\n \n if (typeof route.init === 'function') {\n route.init(view);\n }\n \n if (view) {\n app.appendChild(view);\n }\n}", "async index({ request, response, view }) {\n }", "function fnRoute( $urlRouterProvider, $stateProvider ) {\n\t\t$urlRouterProvider.otherwise( \"/\" );\n\t\t$stateProvider.state( \"boilerplate\", {\n\t\t\turl : \"/:show_message\",\n\t\t\ttemplateUrl : \"/ui-directory-search/v0/public/app/routes/boilerplate/_.html\",\n\t\t\tcontroller : \"BoilerplateController\",\n\t\t\tcontrollerAs : \"vm\"\n\t\t});\n\t}", "function handler(req, res) {\n // for now we just do render statics\n // this.content will define either json or a db index to query\n console.log(\"Path Context: \" + req.path);\n console.log(this.view);\n console.log(this.content);\n // res.render(this.view, {content: this.content, template: config.template, title: config.siteTitle, nav: this.global_navigation, path: this.optional_path || this.path});\n res.render(this.view, {content: this.content, template: config.template, title: config.siteTitle, nav: this.global_navigation, path: this.path, optionalPath: this.optional_path});\n}", "function splashPage(req, res) {\n res.render(\"index\");\n}", "function routeRootSSR( path, server ) {\n\tserver.route({\n\t\tmethod: 'GET',\n\t\tpath,\n\t\t// handler: handleRender\n\t\thandler: ( request, reply ) => { \n\t\t\t// let { query, headers = {} } = request\n\n\t\t\treturn handleRender({\n\t\t\t\trequest,\n\t\t\t\treply, \n\t\t\t})\n\t\t},\n\t\toptions: {\n\t\t\tcors: true\n\t\t}\n\t});\n}", "get routes(){\n\t\treturn {\n\t\t\t'get /': [actionFilter, 'index'],\n\t\t\t'get /home/about': 'about'\n\t\t}\n\t}", "_routePageChanged(page) {\n const routes = ['repository-list'];\n this.page = page || 'repository-list'; // defaults to home route if no page\n\n // if we are trying to access anything other than / or /repository-list return 404 page\n if (routes.indexOf(this.page) === -1){\n this.page = '404';\n }\n }", "function indexEjsHandler(req, res) {\r\n console.log('////////////////////////// FUNCTION LOAD //////////////////////////')\r\n\r\n // pokiData.forEach( data => {\r\n // sortedPoki.push(data.name);\r\n // sortedPoki.sort();\r\n // });\r\n\r\n // res.render('pages/show', {pokiOBJ: sortedPoki});\r\n res.render('pages/index', {cards: redBeltCard});\r\n}", "loadCurrentRoute() {\n switch (this.currentRoute()) {\n case '/':\n import(/*webpackChunkName: \"home\" */ './IndexController').then(IndexController => {\n IndexController.default.init();\n });\n\n break;\n case '/restaurant':\n import(/*webpackChunkName: \"restaurant\" */ './RestaurantController').then(\n RestaurantController => {\n RestaurantController.default.init();\n }\n );\n\n break;\n }\n }", "constructor() {\n this.productsRoute = \"/products/\";\n }", "function HomeHandler (request, reply) {\n reply.view('views/home.html');\n}", "function route(req, res, module, app, next) {\n\n // Add dev tools view \n res.menu.admin.addMenuItem({name:'Development',path:'admin/dev',url:'#',description:'Dev tools ...',security:[]});\n res.menu.admin.addMenuItem({name:'Calipso Events',path:'admin/dev/events',url:'/admin/dev/events',description:'View events and event listeners ...',security:[]});\n \n // Router\n module.router.route(req, res, next);\n\n}", "get(...args) {\n this.route('get', ...args);\n }", "setupRoutes() {\n this.app.use(this.express.static(__dirname + '/www'));\n this.app.use(this.express.static(__dirname + '/module1/www'));\n this.app.use(this.express.static(__dirname + '/module2/www'));\n this.app.use(this.express.static(__dirname + '/module3/www'));\n this.app.use(this.express.static(__dirname + '/module4/www'));\n this.app.use(this.express.static(__dirname + '/module5/www'));\n this.app.use(this.express.static(__dirname + '/projects/www'));\n this.app.use(this.express.static(__dirname + '/module1/frontend'));\n this.app.use(this.express.static(__dirname + '/module2/frontend'));\n this.app.use(this.express.static(__dirname + '/module3/frontend'));\n this.app.use(this.express.static(__dirname + '/module4/frontend'));\n this.app.use(this.express.static(__dirname + '/module5/frontend'));\n \n this.app.all('/meta/*', function(req, res, next) {\n var path = req.path.substr('/meta/'.length);\n var dirname = require('path').dirname(path);\n var filename = require('path').basename(path);\n if (require('fs').existsSync(dirname + '/meta.json')) {\n res.send(require('fs').readFileSync(dirname + '/meta.json', \n 'utf8'));\n }\n else {\n res.send('{}');\n }\n });\n\n this.app.all('/readings/*', function(req, res, next) {\n var path = req.path.substr('/readings/'.length);\n var dirname = require('path').dirname(path);\n var filename = require('path').basename(path);\n filename = filename.split('.');\n filename.splice(-1, 0, 'modified');\n filename = filename.join('.');\n try {\n if (require('fs').existsSync(dirname + '/' + \n filename)) {\n res.send(require('fs').readFileSync(dirname + '/' + \n filename, 'utf8'));\n } else {\n res.send(require('fs').readFileSync(__dirname + '/' + \n path, 'utf8'));\n }\n } catch(e) {\n res.send('');\n }\n });\n \n this.app.all('/reset/*', function(req, res, next) {\n var path = req.path.substr('/reset/'.length);\n var dirname = require('path').dirname(path);\n var filename = require('path').basename(path);\n filename = filename.split('.');\n filename.splice(-1, 0, 'modified');\n filename = filename.join('.');\n try {\n if (require('fs').existsSync(__dirname + '/' + dirname + '/' + \n filename)) {\n require('fs').unlinkSync(__dirname + '/' + dirname + \n '/' + filename);\n } else {\n console.info('An error: file not found?');\n }\n res.send();\n } catch(e) {\n res.send('');\n }\n });\n \n this.app.all('/run/*', function(req, res, next) {\n res.send('Node runner is being worked on. Check back soon.');\n return;\n // TODO:\n var status = '';\n var file = req.path.substr('/run/'.length);\n // open the log file for writing\n var log = __dirname + '/' + file.replace(/\\\\/g, '/')\n .replace(/\\//g, '_') + '.log';\n require('fs').writeFileSync(log, '');\n var ws = require('fs').createWriteStream(log);\n let original = process.stdout.write;\n process.stdout.write = process.stderr.write = ws.write.bind(ws);\n\n // run the file now\n require(__dirname + '/' + file);\n \n // begin the read\n let sent = false;\n var rs = require('fs').createReadStream(log);\n res.set('etag', (new Date()).getTime());\n rs.on('data', function(data) {\n res.write(data);\n });\n rs.on('end', function() {\n res.end();\n try {require('fs').unlinkSync(log);} catch(e) {console.log(e);}\n try {ws.end();} catch(e) {console.log(e);}\n process.stdout.write = process.stderr.write = original;\n sent = true;\n });\n setTimeout(() => {\n if (!sent) {\n rs.pause();\n ws.end();\n res.send();\n try {require('fs').unlinkSync(log);} catch(e) {}\n }\n }, 60000);\n });\n \n this.app.post('/save/*', function(req, res, next) {\n var path = req.path.substr('/save/'.length);\n var dirname = require('path').dirname(path);\n var filename = require('path').basename(path);\n let data = '';\n req.on('data', function(datum) {\n data += datum;\n });\n req.on('end', function() {\n filename = filename.split('.');\n filename.splice(-1, 0, 'modified');\n filename = filename.join('.');\n require('fs').writeFileSync(dirname + '/' + filename, data);\n res.send();\n });\n });\n }", "function router(app) {\n\n}", "loginGet(req, res) {\n res.render('index/login');\n }", "function display(path) {\n\tredirect('/api' + path);\n}", "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 showHome(req, res){\n if(typeof req.session.user !== 'undefined'){\n return res.redirect('/admin');\n }\n return res.render('pages/index', { title: 'Express' });\n}", "function route() {\n if (getUrlParam(\"photo\")) {\n loadPhotoCardBasedOnUrl();\n }\n else {\n loadPhotosBasedOnUrl();\n }\n }", "function Router(nav1){\n\n \nvisitorauthorsRouter.get('/', function(req,res){\n Authorsdata.find()\n .then(function(authors){\n\n res.render(\"visitorauthors\",{\n nav1,\n title:'Library',\n authors\n })\n })\n \n})\n\nvisitorauthorsRouter.get('/:id',function(req,res){\n const id=req.params.id;\n Authorsdata.findOne({_id:id})\n .then(function(author){\n res.render('visitorauthor',{\n nav1,\n title:'Library App',\n author\n })\n })\n \n})\n \n \n \n return visitorauthorsRouter;\n }", "function getHome(req, res, next){\n let movArr = model.getRanMovie();\n let movName = movArr[0].Title;\n let data = renderHome({movie: movArr, name: movName, session: req.session});\n res.status(200).send(data);\n}", "async index ({ request, response, view }) {\n }", "async index ({ request, response, view }) {\n }", "async index ({ request, response, view }) {\n }", "async index ({ request, response, view }) {\n }", "function route(app){\n app.use('/data',dataRoute);\n app.use('/', mainRoute);\n}", "function config($routeProvider) {\n\n // templates as files\n\n $routeProvider.when('/', {\n templateUrl: 'main/main.html',\n controller: 'MainController', // main/main-controller.js i loaded in index.html\n controllerAs: 'vm'\n\n }).when('/about', {\n templateUrl: 'about/about.html',\n controller: 'AboutController', // about/about-controller.js i loaded in index.html\n controllerAs: 'vm'\n\n }).when('/film/:id', {\n templateUrl: 'film/film.html',\n controller: 'FilmController', // film/film-controller.js i loaded in index.html\n controllerAs: 'vm'\n\n }).when('/404', {\n templateUrl: '404/404.html',\n }).otherwise({\n redirectTo: '/404' // go to 404\n });\n\n //$routeProvider.when('/', {\n // template: '<h1> this is the main page </h1> <a href=\"#/about\">Go to About</a>'\n // }).when('/about', {\n // template: '<h1> about page </h1> <a href=\"#/\">Go Home</a>'\n //});\n\n\n // You need to start http server to be able to run SPA with templates in files\n // php -S localhost:8887\n // and call http://localhost:8887 and works\n\n // http://localhost:8000/#/\n // http://localhost:8000/#/film/1\n // http://localhost:8000/#/about\n}", "async index({request, response}) {\r\n\r\n\t\t\r\n\t}", "function AboutRoute(db) {\n //var ctrl = new AboutCtrl(db);\n \n return [\n {\n method: 'GET',\n path: '/',\n handler: (request, h) => {\n \n return 'Hello, world!';\n }\n },\n {\n method: 'GET',\n path: '/{name}',\n handler: (request, h) => {\n \n return 'Hello, ' + encodeURIComponent(request.params.name) + '!';\n }\n }\n ];\n}", "function routeDontFound() {\n var dinamic = dinamicRoutes();\n dinamic.status && __webpack_require__(\"./src sync recursive ^\\\\.\\\\/.*\\\\.ts$\")(\"./\" + project + \"/js/components/\" + dinamic.route.component + \".ts\").page();\n}", "function App() {\n return (\n <Router>\n <div className=\"App\">\n <Header />\n <Route\n exact\n path=\"/\"\n render={() => <div>Get home page from svyat</div>}\n />\n <Route\n path=\"/about\"\n render={() => <div>Get about page from svyat</div>}\n />\n\n <Route exact path=\"/account\" component={Account} />\n\n <Route path=\"/login\" component={LoginForm} />\n <Route path=\"/signup\" component={Form} />\n\n {/* change url to match endpoint for imageid, change prop picURL to match endpoint for image source */}\n {/* <Route\n path={`/account/image/${clicked.id}`}\n component={() => <ImagePage picURL={clicked.src} />}\n /> */}\n </div>\n </Router>\n );\n}", "function index(req, res) {\n res.render('index');\n}", "initializeRoutes()\n {\n // Dynamic pages\n this.express.get(\"/\", function(_request, _response){\n _response.render(\"index/index.njk\");\n });\n\n // Static paths\n this.express.use(\"/css\", express.static(__dirname + \"/../frontend/css\"));\n this.express.use(\"/javascript\", express.static(__dirname + \"/../frontend/javascript\"));\n\n // External libraries\n this.express.use(\"/bootstrap\", express.static(__dirname + \"/../../node_modules/bootstrap/dist\"));\n this.express.use(\"/bootstrap-table\", express.static(__dirname + \"/../../node_modules/bootstrap-table/dist\"));\n this.express.use(\"/deep-eql\", express.static(__dirname + \"/../../node_modules/deep-eql\"));\n this.express.use(\"/flatpickr\", express.static(__dirname + \"/../../node_modules/flatpickr/dist\"));\n this.express.use(\"/font-awesome\", express.static(__dirname + \"/../../node_modules/@fortawesome/fontawesome-free\"));\n this.express.use(\"/jspdf\", express.static(__dirname + \"/../../node_modules/jspdf/dist\"));\n this.express.use(\"/jspdf-autotable\", express.static(__dirname + \"/../../node_modules/jspdf-autotable/dist\"));\n this.express.use(\"/native-toast\", express.static(__dirname + \"/../../node_modules/native-toast/dist\"));\n this.express.use(\"/jquery\", express.static(__dirname + \"/../../node_modules/jquery/dist\"));\n this.express.use(\"/jquery-ui\", express.static(__dirname + \"/../../node_modules/jquery-ui-dist\"));\n this.express.use(\"/popper-js\", express.static(__dirname + \"/../../node_modules/popper.js/dist/umd\"));\n this.express.use(\"/select2\", express.static(__dirname + \"/../../node_modules/select2/dist\"));\n\n this.initializeQueryResponses();\n this.express.post(\"/createOrder\", this.createOrderResponse.bind(this));\n }", "getSubRoute(){\n var app = \"\"\n var doc = \"\"\n var url = window.location.href.split(\"#\")\n if (url.length > 1) {\n var parts = url[1].split(\"/\")\n app = parts[1]\n doc = parts[2]\n }\n return [app,doc]\n }", "viewRoute() {\n\n this.router.use(auth.isLoggedIn());\n \n this.router.get('/signup', auth.isLoggedIn(true), signup);\n this.router.get('/login', auth.isLoggedIn(true), login);\n this.router.get('/forgot-password', forgotPassword);\n this.router.get('/reset-password', resetPassword);\n this.router.get('/forgot-password/success', forgotPasswordSuccess);\n this.router.get('/team', team);\n this.router.get('/volunteer', volunteer);\n this.router.get('/', home);\n this.router.get('/about-us', about);\n this.router.post('/', (req, res, next) => (req.page='home', next()), home);\n\n // Donor routes\n this.router.get(\n '/donor',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => res.redirect('/donor/dashboard')\n );\n \n this.router.get(\n '/donor/dashboard',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => ((req.page = 'dashboard'), next()),\n donorDashboard\n );\n \n this.router.get(\n '/donor/donations',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => ((req.page = 'donations'), next()),\n donorDashboard\n );\n\n this.router.get(\n '/donor/donations/new',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => ((req.page = 'new-food-donation'), next()),\n donorDashboard\n );\n \n this.router.get(\n '/donor/donations/verify',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n verifyMonetaryDonation\n );\n \n this.router.get(\n '/donor/live-chat',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => ((req.page = 'live-chat'), next()),\n donorDashboard\n );\n \n this.router.get(\n '/donor/edit-account',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => ((req.page = 'edit-account'), next()),\n donorDashboard\n );\n \n // Admin routes\n this.router.get(\n '/admin',\n auth.authenticateApp(),\n auth.authorizeApp('admin'),\n (req, res, next) => res.redirect('/admin/dashboard')\n );\n\n this.router.get(\n '/admin/dashboard',\n auth.authenticateApp(),\n auth.authorizeApp('admin'),\n (req, res, next) => ((req.page = 'dashboard'), next()),\n adminDashboard\n );\n\n this.router.get(\n '/admin/donations',\n auth.authenticateApp(),\n auth.authorizeApp('admin'),\n (req, res, next) => ((req.page = 'donations'), next()),\n adminDashboard\n );\n\n this.router.get(\n '/admin/donation-stations',\n auth.authenticateApp(),\n auth.authorizeApp('admin'),\n (req, res, next) => ((req.page = 'donation-stations'), next()),\n adminDashboard\n );\n\n this.router.get(\n '/admin/live-chat',\n auth.authenticateApp(),\n auth.authorizeApp('admin'),\n (req, res, next) => ((req.page = 'live-chat'), next()),\n adminDashboard\n );\n\n this.router.get(\n '/admin/users',\n auth.authenticateApp(),\n auth.authorizeApp('admin'),\n (req, res, next) => ((req.page = 'users'), next()),\n adminDashboard\n );\n\n this.router.get(\n '/admin/users/edit/:id',\n auth.authenticateApp(),\n auth.authorizeApp('admin'),\n (req, res, next) => ((req.page = 'user-edit'), next()),\n adminDashboard\n );\n \n this.router.get(\n '/admin/users/new',\n auth.authenticateApp(),\n auth.authorizeApp('admin'),\n (req, res, next) => ((req.page = 'user-new'), next()),\n adminDashboard\n );\n \n return this.router;\n}", "function routeDontFound() {\n var dinamic = dinamicRoutes();\n dinamic.status && __webpack_require__(\"./src/ts/components sync recursive ^\\\\.\\\\/.*\\\\.ts$\")(\"./\" + dinamic.route.component + \".ts\").page();\n}", "function sendIndex(req, res) {\n res.redirect(constants.FRONTEND_URL);\n}", "function updateRoute() {\n\n}", "_homeRoute () {\n this.currentView = views.HOME\n }", "index(req, res) {\n res.render('search');\n }", "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 }", "index(request, response) {\n const viewData = {\n title: \"Login or Signup\",\n };\n response.render(\"index\", viewData);\n }", "function initRoute(app, conf, restrict) {\n var SITE_URL = envs('SITE_URL');\n app.get(conf.path, restrict, function(req, res, next) {\n // If we don't have the site url set, get it from the header or env\n if (!res.locals.site) res.locals.site = req.get('x-site-url') || SITE_URL || req.base;\n\n // Expose the base url to the view\n res.locals.base = req.base;\n res.render(app.get('index view') || 'index');\n });\n}", "function routes() {\n return [\n {path: /.*/, fn: allPages,template: 'templateAll',block: 'side.template.all'},\n {path: 'GET /template', fn: templatePage, template: 'templateShow',block: 'content.template'},\n {path: 'GET /templateSecure', fn: templatePage, permit: calipso.permission.Helper.hasPermission('template:permission'), template: 'templateShow',block: 'content.template'}\n ];\n}", "startLinkRouting() {}", "function makeRouter(app) {\n\n app.get('/', (req, res, next) => {\n // console.log(models.model('hotel').findAll.toString());\n var hotels = Hotel.findAll();\n var restaurants = Restaurant.findAll();\n var activities = Activity.findAll();\n Promise.all([hotels, restaurants, activities]).then( result => {\n res.render('index',{\n hotels: result[0],\n restaurants: result[1],\n activities: result[2]\n })\n } ).catch( err => console.trace( err ) )\n })\n\n app.get('/map', (req, res, next) => {\n var hotels = Hotel.findAll();\n var restaurants = Restaurant.findAll();\n var activities = Activity.findAll();\n Promise.all([hotels, restaurants, activities]).then( result => {\n res.render('index',{\n hotels: result[0],\n restaurants: result[1],\n activities: result[2],\n mapKey: config.mapKey\n })\n } ).catch( err => console.trace( err ) )\n })\n}", "start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n this._router.resolve();\n }", "function main() {\n getRoutes();\n}", "function getIndex(req, res) {\n res.render('index', {\n title: nav.title,\n });\n }", "routeChange() {\n\n // Validating the routes object\n if (!router.routes) return;\n if (router.routes.constructor !== Object) throw err(9);\n\n const route = router.getRoute(window.location.pathname);\n const entries = Object.entries(router.routes);\n\n // Looping through all routes in the routes-object\n for (let i = 0; i < entries.length; i++) {\n const entryRoute = router.getRoute(entries[i][0]);\n let match = true;\n\n // Checking if the current URL matches the route\n for (let a = 0; a < entryRoute.length; a++) {\n if (route[a] === undefined || (entryRoute[a] !== \"**\" && entryRoute[i] !== route[i])) {\n match = false;\n break;\n }\n }\n\n // Change content if match was found\n if (match) {\n router.page = entries[i][1];\n window.dispatchEvent(router.newRouteEvent);\n return;\n }\n }\n\n }", "routes() {\n this.app.use('/images', express.static('uploads'));\n this.app.use('/users/', userRoutes);\n this.app.use('/tokens/', tokenRoutes);\n this.app.use('/shop/', shopRoutes);\n this.app.use('/products/', productRoutes);\n this.app.use('/order/', orderRoutes);\n this.app.use('/address/', addressRoutes);\n this.app.use(\"/creditCard/\", creditCardRoutes)\n }", "function set_routes() {\n\n // Check your current user and roles\n app.get( '/status/:id', function( request, response ) {\n acl.userRoles( request.params.id || false, function( error, roles ){\n response.json( {'User': request.user ,\"Roles\": roles });\n });\n });\n\n // Only for users and higher\n app.all( '/secret', [ acl.middleware( 1, get_user_id) ],function( request, response ) {\n\n response.send( 'Welcome Sir!' +request.params.id);\n }\n );\n\tapp.use('/user',require('./routers/userR.js'));\n app.use('/event',require('./routers/eventR.js'));\n //accept error\n app.use(acl.middleware.errorHandler('json')); \n \n}", "function route(...etc)\n{\n etc.unshift(stockAPI);\n let sOut = etc.reduce((acc, curr)=>acc+=curr+'/');\n return sOut;\n}", "routes() {\n const publicPath = path.join(__dirname, '..', 'tmp', 'frontend', 'build');\n this.server.use('/v1/api', routes);\n this.server.use('/', express.static(publicPath));\n this.server.use('/users/*', express.static(publicPath));\n }", "setupNav() {\n this.router.on({}, () => {\n $('iframe').one('load', function() {\n this.style.height = (document.body.offsetHeight - \n $('iframe').offset().top) + \"px\";\n $('body').css('overflow-y', 'hidden');\n });\n });\n this.router.on({'page': 'quiz1'}, () => {\n this.changePage('https://docs.google.com/forms/d/e/1FAIpQLSdKVApwuQjnD3auoJI8ESKtfS-w6PlCptSHTbkxNGyPH1Iv6A/viewform?usp=sf_link');\n });\n this.router.on({'page': 'quiz2'}, () => {\n this.changePage('https://docs.google.com/forms/d/e/1FAIpQLSdt06Q9VWQHuVUZCfk0fnhMb6InsBAcI3bDrFXcKiSmiqgNvA/viewform?usp=sf_link');\n });\n this.router.on({'page': 'module1'}, () => {\n this.changePage('module1.html');\n });\n this.router.on({'page': 'module2'}, () => {\n this.changePage('module2.html');\n });\n this.router.on({'page': 'module3'}, () => {\n this.changePage('module3.html');\n });\n }", "function index(req, res) {\n res.redirect('/index.html');\n}" ]
[ "0.6692601", "0.6601388", "0.65549296", "0.6467946", "0.62904286", "0.6274216", "0.6139856", "0.60973436", "0.6083141", "0.60679996", "0.6043313", "0.6041538", "0.60323346", "0.60252225", "0.6024456", "0.59553266", "0.5947571", "0.5945766", "0.59270537", "0.592425", "0.587602", "0.5869532", "0.58677393", "0.58628017", "0.5844882", "0.5832268", "0.5819789", "0.5818438", "0.58171195", "0.5799789", "0.5784923", "0.5766909", "0.57642764", "0.5764235", "0.5761244", "0.5760565", "0.57599723", "0.5741452", "0.5733949", "0.57333785", "0.57274634", "0.57274437", "0.5726575", "0.5724257", "0.57228106", "0.5720684", "0.5707735", "0.5697326", "0.5695131", "0.56928474", "0.5687605", "0.56850064", "0.56838167", "0.5680914", "0.56758463", "0.5671482", "0.5669296", "0.5662557", "0.5661371", "0.56589496", "0.56552166", "0.56522447", "0.5651278", "0.5647874", "0.5644748", "0.5643641", "0.5643641", "0.5643641", "0.5643641", "0.5641183", "0.5638239", "0.563666", "0.5624679", "0.56245035", "0.56138825", "0.56073993", "0.5590725", "0.55867404", "0.5585657", "0.5583029", "0.5573228", "0.55719906", "0.55609107", "0.55546725", "0.55536443", "0.5549127", "0.5548333", "0.55477065", "0.55421466", "0.55410844", "0.55340034", "0.55306417", "0.55239004", "0.5514075", "0.5512097", "0.55095124", "0.55061543", "0.54928446", "0.5492642", "0.5489309" ]
0.56037307
76
let result = [];
function dir(pathname, ext, callback) { // const path = process.argv[2]; // const ext = process.argv[3]; file.readdir(pathname, 'utf8', (err, list) => { const result = list.filter(filename => path.extname(filename) === `.${ext}`); return callback(result); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toArray() {}", "toArray() {}", "toArray() {}", "toArray() {\n return [];\n }", "toArray() {\n let arr = [];\n this.map((data) => { arr.push(data); return data});\n return arr;\n }", "asArray() {\n const result = new Array();\n this.toArray(result, 0);\n return result;\n }", "toArray() {\n\n }", "ToArray() {\n\n }", "arrays(count) {\n let arr = [];\n for (let i=0; i<count; i++) {\n arr.push([]);\n }\n return arr;\n }", "function solution(arr) {\n var answer = [];\n return answer;\n}", "async toArray() {\n const result = [];\n let x = await this.next();\n while (!x.done) {\n result.push(x.value);\n x = await this.next();\n }\n return result;\n }", "function Array$empty() {\n return [];\n }", "function Array$empty() {\n return [];\n }", "function createArr(res){\r\n\tlet a = [];\r\n\tlet k = _.keys(res[0]);\r\n\ta.push(k)\r\n\tres.forEach(v => {a.push(_.values(v))});\r\n\treturn a;\r\n}", "function foo() {\n return [1, 2, 3];\n}", "function foo() {\n return [1, 2, 3];\n}", "function foo() {\n return [1, 2, 3];\n}", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "toArray() {\n return this._results.slice();\n }", "async toArrayForTest() {\n const stream = this.prefetch(100);\n const result = [];\n let x = await stream.next();\n while (!x.done) {\n result.push(x.value);\n x = await stream.next();\n }\n return result;\n }", "function jsNewArray() {\n var arr = [];\n return arr;\n}", "function initializeResults() {\n let currentResults = [];\n let temp;\n for (let i = 0; i < clueshints.length; i++) {\n temp = { clue: clueshints[i].order_num, time: -1 };\n currentResults.push(temp);\n }\n return currentResults;\n }", "toArray () {\n return this.list.slice()\n }", "flattenValue() {\n return this.toArray().reduce((acc, [, value]) => {\n acc = acc.concat(value);\n return acc;\n }, []);\n }", "function buildArray(result, item) {\n result.push(item)\n return result\n}", "toArray() {\n let arr = [];\n this.traverse((currentNode) => {\n arr.push(currentNode.value);\n });\n return arr;\n }", "function listToArray() {\n\n}", "function f() {\n return [1, 2]; // [1 , 2]\n}", "function resultToArray(result){\n var rows = result.rows, row, arr = [];\n for(var i = 0, l = rows.length; i < l; i++) {\n arr.push(rows.item(i));\n }\n return arr;\n }", "function emptyCalculation() {\r\n calculationArr = [];\r\n }", "toArray() {\n return this._array.slice();\n }", "toArray() {\n let arr = [];\n let n = this._dummy.next;\n\n while (n !== this._dummy) {\n arr.push(n.data);\n n = n.next;\n }\n\n return arr;\n }", "splitResults(results)\n {\n var pageArr = [];\n let count = 0;\n\n while(results.length > 0) {\n pageArr.push([]);\n\n for (let i = 0; i < this.props.citiesPerPage; i++) {\n if (results.length > 0)\n pageArr[count].push(results.shift());\n }\n\n if (pageArr[count].length === 0)\n pageArr.pop();\n\n count++;\n }\n\n //console.log(pageArr);\n return pageArr;\n }", "toArray() {\r\n let result = new Array(this.rows);\r\n result = this.data.splice(0);\r\n return result;\r\n }", "function arrayToList() {\n\n}", "function Array$zero() {\n return [];\n }", "function Array$zero() {\n return [];\n }", "function collectortoarray(q,c){\n \n var inpt=[];\n let counter = 0;\n \n c.forEach((value) => {\n inpt[counter]=[q[counter][0],value.content];\n counter++;\n });\n\n console.log(inpt);\n return inpt;\n}", "_returnEmptyArray() {\n const that = this,\n emptyArray = [];\n let current = emptyArray;\n\n if (that.dimensions > 1) {\n for (let i = 1; i < that.dimensions; i++) {\n current[0] = [];\n current = current[0];\n }\n }\n\n return emptyArray;\n }", "function f() {\n return [1, 2, 3];\n}", "function f() {\n return [1, 2, 3];\n}", "function data(){\n return [1,2,3]; \n}", "function data(){\n return [1,2,3]; \n}", "function Array(){\n return false;\n}", "messagesToArray(){\n // for (let value of this.messages.values()){\n // var arr = [];\n // arr.push(value);\n // }\n // return arr;\n // }\n return Array.from(this.messages.values());\n }", "toArray() {\n return [this.x, this.y, this.z]\n }", "function fizzbuzz(arr) {\n var answer = [];\n\n}", "valueOf() {\n const ret = [];\n ret.push(...this);\n return ret;\n }", "array() {\n var track = this.track();\n return track ? track.array() : null;\n }", "function r(){this._array=[],this._set={}}", "function pushArr(){\n var arr = [];\n for(var i = 0; i < 50; i++){\n if(i % 2 == 1){\n arr.push(i);\n }\n }\n console.log(arr); // or: return arr;\n}", "toArray() {\n\t\t\t\treturn this.slice(0);\n\t\t\t}", "function fn(){\n return [1, 2];\n}", "valueOf () {\r\n const ret = []\r\n ret.push(...this)\r\n return ret\r\n }", "function coba1 () {\n\treturn [1,2];\n}", "function f() {\n return [1, 2];\n}", "toArray() {\r\n // copy\r\n return this.values.map((v) => v);\r\n }", "getResult() {}", "function numarray(n) {\n resultArr = [n];\n for (i = 0; i < n; i++) {\n resultArr[i] = i ;\n }\n console.log(resultArr);\n}", "toArray() {\n\t\t\treturn this.array.slice();\n\t\t}", "function loadArray3(result){\n finaldata = generateData3(result); \n finalArrayData = new Array(); \n for(i=0;i<finaldata.length;i++){ \n finalArrayData.push(finaldata[i].value);\n } \n store2.loadData(finaldata); \n return finalArrayData;\n \n }", "function data(){\n return [1,2]; //undefined\n}", "function createArray(){\n\tvar array = [];\n\tfor(var i = 0; i < 20; i++){\n\tarray[i] = i*5;\n\t}\n\treturn(array);\n}", "toArray()\r\n {\r\n var a = [], list, k = size;\r\n for (var i = 0; i < k; i++)\r\n {\r\n list = this.#table[i];\r\n var l = list.length; \r\n \r\n for (var j = 0; j < l; j++)\r\n a.push(list[j]);\r\n }\r\n return a;\r\n }", "toArray() {\n let answer = [];\n let node = this;\n while (node) {\n answer.push(node.value);\n node = node.next;\n }\n return answer;\n }", "function f() {\n return [1, 2];\n }", "toArray() {\n return Array.from(this.items);\n }", "function f1() {\n return [1, 2, 3];\n}", "function toArray(list)\r\n{\r\n return list;\r\n // return Array.prototype.slice.call(list || [], 0);\r\n}", "function data(){\n return [1,2,3,4,5]; \n}", "function data(){\n return [1,2,3,4,5]; \n}", "collecTracks(listAlbums){\n let resultadoTracks = listAlbums.map((fAlbum) => fAlbum.getTracks());\n let flatResultado = resultadoTracks.reduce(function(a, b) { \n return a.concat(b); \n }, new Array);\n return flatResultado;\n }", "function spreadResult(result) {\n var _results = [];\n if (result && Object.keys(result).length) {\n if (typeof result.entries !== 'undefined') _results.push(result.entries);\n if (typeof result.assets !== 'undefined') _results.push(result.assets);\n if (typeof result.content_type !== 'undefined' || typeof result.schema !== 'undefined') _results.push(result.content_type || result.schema);\n if (typeof result.count !== 'undefined') _results.push(result.count);\n if (typeof result.entry !== 'undefined') _results = result.entry;\n if (typeof result.asset !== 'undefined') _results = result.asset;\n if (typeof result.items !== 'undefined') _results.push(result);\n }\n return _results;\n}", "function getArray() {\n var a = new Array(10);\n\n for (var i = 0; i < a.length; i++) {\n a[i] = i;\n }\n\n return a;\n}", "function getArray1(items) {\n return new Array().concat(items);\n}", "function getArray(items) {\n return new Array().concat(items);\n}", "function getArray(items) {\n return new Array().concat(items);\n}", "function getArray(items) {\n return new Array().concat(items);\n}", "toArray()\r\n {\r\n return [this.x, this.y];\r\n }", "value() {\n return [];\n }", "function ejemploSet7(){\n let set = new Set([1,2,3,4,5,6]),\n array = [...set];\n console.log('array',array);\n}", "function ex1() {\n const myArray = [1, 2, 3, 4, 5]\n return myArray\n }", "function toArray() {\n return this.map();\n }", "toArray()\n\t{\n\t\t//TODO: done\n\t\treturn [this.x, this.y, this.z];\n\t}", "function create_array()\n{\n\tarr = [];\n\n\tfor (i=0; i<10; i++)\n\t{\n\t arr.push(Math.floor((Math.random() * 100) + 1));\n\t}\n\tconsole.log(\"This is array 1 [\" + arr + \"]\");\n\treturn arr;\n}", "function createEmptyArray(){\n let arr=[];\n for (let i=0; i<10; i++){\n row=[];\n for (let j=0; j<10; j++){\n row.push(0); \n }\n arr.push(row); \n }\n return arr;\n}", "function concatResult() {\n var checkBut = document.getElementById('sumResult');\n if (checkBut.checked) {\n console.log('clear data array ');\n } else {\n window.dataStFull = [];\n console.log('not cheked, do not clear array with result');\n }\n}", "function overAll(root) {\n if(!root) return [[]];\n let res = [];\n let temp = [];\n helper(root, temp, res);\n console.log(res);\n return res;\n}", "function myFunction4() {\n return [1, 2, 3, 4, 5];\n}", "toArray() {\n let new_array = _.values(this);\n new_array.pop();\n return new_array;\n }", "function Array() {}", "function createArray() {\n\tvar temp = [];\n\n\tfor (var i = 1; i <= circles.length; i++) {\n\t\ttemp.push(addColors());\n\t}\n\treturn temp;\n}", "function combine() {\n let arr = [].concat.apply([], arguments); //[1, 2, 2, 2, 3, 3]没有去重复的新数组 \n return Array.from(new Set(arr));//new Set(arr): Set(3) {1, 2, 3}\n}", "function resetArray()\n{\n inputArray = [`0`];\n}", "function pushResultsToArrays() {\n for(var i = 0; i < Product.allProducts.length; i++) {\n totalClicksArr.push(Product.allProducts[i].totalClicks);\n }\n for(var j = 0; j < Product.allProducts.length; j++) {\n allProductNames.push(Product.allProducts[j].stringName);\n }\n for(var k = 0; k < Product.allProducts.length; k++) {\n productBgColors.push(Product.allProducts[k].backgroundColor);\n }\n for(var l = 0; l < Product.allProducts.length; l++) {\n timesShownArr.push(Product.allProducts[l].timesShown);\n }\n}", "function example() {\n return [1, 2, 3];\n }", "function haeEdellisettilaukset(result){\n for(i=0; i < result.tilaukset.length; i++){\n tilausArray.push(result.tilaukset[i]);\n }\n }" ]
[ "0.6934184", "0.6934184", "0.6934184", "0.6894386", "0.6685867", "0.66789174", "0.66142255", "0.65533453", "0.65247273", "0.6512517", "0.64939433", "0.6424334", "0.6424334", "0.64064777", "0.6403621", "0.6403621", "0.6403621", "0.63671833", "0.63671833", "0.63671833", "0.63671833", "0.63671833", "0.63671833", "0.63615453", "0.6338516", "0.631142", "0.6283029", "0.627894", "0.62735504", "0.6272048", "0.62190443", "0.6202204", "0.6192625", "0.61896056", "0.6186398", "0.61753106", "0.6165579", "0.61640334", "0.61578405", "0.6143073", "0.6143073", "0.6112827", "0.6112474", "0.60939074", "0.60939074", "0.6085402", "0.6085402", "0.6084784", "0.60702926", "0.6049097", "0.60375243", "0.603538", "0.60165393", "0.59988457", "0.5992951", "0.59843403", "0.5978179", "0.59748757", "0.59706604", "0.59667474", "0.5965833", "0.59622705", "0.59614885", "0.5956588", "0.59565735", "0.59423745", "0.5940423", "0.5928696", "0.5924293", "0.5921211", "0.5915764", "0.5893456", "0.58915746", "0.5874871", "0.5874871", "0.58747566", "0.5873849", "0.58719", "0.58591986", "0.5853867", "0.5853867", "0.5853867", "0.5850189", "0.5850116", "0.5849575", "0.5840678", "0.58310497", "0.58293223", "0.5818976", "0.58114094", "0.58114076", "0.5805319", "0.57966805", "0.5796104", "0.5792805", "0.579169", "0.57854795", "0.5778063", "0.5761338", "0.5757625", "0.5755133" ]
0.0
-1
Notes: Some drawbacks makes inheritance difficult methods are redefined for each new Trail created. All instances should share this method. / / Constructor with Prototypes
function OtherTrail(location, type, distance) { this.location = location; this.type = type; this.distance = distance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Trail (obj) {\n this.name = obj.name;\n this.location = obj.location;\n this.stars = obj.stars;\n this.star_votes = obj.star_votes;\n this.summary = obj.summary;\n this.trail_url = obj.url;\n this.conditions = obj.conditionsStatus;\n this.condition_date = obj.conditionDate.slice(0,10);\n this.condition_time = obj.conditionDate.slice(11,19);\n}", "constructor(lizardTailLength, lizardMass, crawlSpeed){\n\t\tsuper(lizardTailLength, lizardMass);//Only for constructor functions. Use .this to call them. Super is basically Animal.constructor\n\t\tthis.crawl = crawlSpeed;\n\t\tconsole.log(\"Lizard Tail: \" + this.lenTail);//Call the value from Animal/parent class\n\t}", "function Trail(data) {\n let conditions = data.conditionDate.split(' ');\n\n this.name = data.name;\n this.location = data.location;\n this.length = data.length;\n this.stars = data.stars;\n this.star_votes = data.starVotes;\n this.summary = data.summary;\n this.trail_url = data.url;\n this.conditions = data.conditionStatus;\n this.condition_date = conditions[0];\n this.condition_time = conditions[1];\n}", "constructor() {\n super(...arguments);\n var prototype = Object.getPrototypeOf(this);\n }", "constructor() {\n super(...arguments);\n var prototype = Object.getPrototypeOf(this);\n }", "function PrototypeBasedClass () {\n}", "constructor(race) {\n this.race = race;\n }", "constructur() {}", "function Level3() {\n var self = this;\n initializeRawTrajectories();\n}", "constructor() {\n super(); //also added \"super()\" so that it can call the parent constructor from class A \n this.levels++; \n }", "constructor() {\n var prototype = Object.getPrototypeOf(this);\n }", "__previnit(){}", "constructor(){\n //Call constructor in your parent class LightningElement\n super();\n console.log('childLwcDay10 constructor');\n }", "function Prototype() {\n }", "function l(t,e){function o(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}", "constructor(race, name = null) {\n super(to_list(race), name || '<unknown>')\n }", "function ex3A() {\n let Person = function (name) {\n this.name = name;\n }\n\n//create subclass\n let Teacher = function (name) {\n Person.call(this, name);\n }\n Teacher.prototype.teach = function (subject) {\n console.log(this.name + \" is now teaching \" + subject);\n }\n//create an object\n let anna = new Teacher(\"Anna Dole\");\n anna.teach(\"English\");\n}", "function a(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e}", "function a(t,e){function a(){}a.prototype=e.prototype,t.superClass_=e.prototype,t.prototype=new a,t.prototype.constructor=t}", "function Base() {}", "function Tl(e,t){function n(){this.constructor=e}El(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "function Base() {\n}", "function BaseClass() {}", "function BaseClass() {}", "function Traveller(posPoint, nodeId) {\r\n\tthis.icon = new paper.Raster({\r\n \r\n\t\tsource: easterEnabled?'img/easter.png':'img/traveller_rocket.png',\r\n\t\tposition: posPoint,\r\n\t\tdata: {\r\n\t\t\tid: nodeId\r\n\t\t}\r\n\t\t\t});\r\n\r\n\t//rotates the traveller to be pointing at the given point - returns the rotation in degrees\r\n\tthis.rotateT = function(endPoint){\r\n\t\tthis.icon.rotation = 0;\r\n\t\tthis.icon.rotate(\r\n\t\t\t(Math.atan2(endPoint.y - this.icon.position.y, endPoint.x - this.icon.position.x) * 180 / Math.PI) + 90);\r\n\t\treturn this.icon.rotation;\r\n\t}\r\n\t\r\n\t//adds the final click function to traveller\t\r\n\tthis.icon.onClick = function(event) {\r\n\t\t//checks to see if the node below is clickable\r\n\t\tif(board.nodeArray[this.data.id].icon.data.selectable){\r\n\t\t\t//checks how the button shoud work - if only one user path is set, then it steps back\r\n\t\t\tif(board.pathArray.length <= 1) {\r\n\t\t\t\tboard.stepBackUserPath();\r\n\t\t\t} else {\r\n\t\t\t\tboard.setUserPath(this.data.id);\r\n\t\t\t\t//checks if the user path is complete\r\n\t\t\t\tif (board.isPathComplete()) {\r\n\t\t\t\t\tboard.moveTraveller();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//pops an alert and steps back path if not complete\r\n\t\t\t\t\talert('You missed some objectives.');\r\n\t\t\t\t\tboard.stepBackUserPath();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "constructor(x, y, speed, image, radius, trailImage) {\n // Position\n this.x = x;\n this.y = y;\n // Velocity and speed\n this.vx = speed;\n this.vy = speed;\n this.speed = speed;\n // Display properties\n this.image = image;\n this.trailImage = trailImage;\n this.radius = radius;\n // An array to display a trail of danger zones\n this.trail = [];\n // Setting up a for loop to generate the number of trail \"bits\"\n for (let i = 0; i < 50; i++) {\n let location = {\n x: this.x,\n y: this.y,\n };\n this.trail.push(location);\n }\n }", "function Base() {\n }", "function __() { this.constructor = subClass; }", "constructor() {\n /** A list of end span event listeners */\n this.eventListenersLocal = [];\n /** Bit to represent whether trace is sampled or not. */\n this.IS_SAMPLED = 0x1;\n /** A configuration for starting the tracer */\n this.logger = logger.logger();\n this.activeLocal = false;\n this.contextManager = cls.getNamespace();\n this.clearCurrentTrace();\n this.activeTraceParams = {};\n }", "function Derived() {} // private", "function ta(t,e){function r(){this.constructor=t}Qs(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}", "function constructorDecorator(...args) {\n const instance = new OriginalClass(...args);\n\n // Decorator for the _create() method.\n // We save the decorated _create() and we will use it if type != 'auto_segmentation'\n const decoratedCreate = instance._create;\n instance._create = () => {\n if (instance._type !== 'auto_segmentation') {\n decoratedCreate.call(instance);\n return;\n }\n\n instance._drawInstance = instance._frameContent.polyline().draw({ snapToGrid: 0.1 }).addClass('shapeCreation').attr({\n 'stroke-width': 0,\n z_order: Number.MAX_SAFE_INTEGER,\n });\n instance._createPolyEvents();\n\n /* the _createPolyEvents method have added \"drawdone\"\n * event handler which invalid for this case\n * because of that reason we remove the handler and\n * create the valid handler instead\n */\n instance._drawInstance.off('drawdone').on('drawdone', (e) => {\n let actualPoints = window.cvat.translate.points.canvasToActual(e.target.getAttribute('points'));\n actualPoints = PolyShapeModel.convertStringToNumberArray(actualPoints);\n\n if (actualPoints.length < 4) {\n showMessage('It is need to specify minimum four extreme points for an object');\n instance._controller.switchCreateMode(true);\n return;\n }\n\n const { frameWidth } = window.cvat.player.geometry;\n const { frameHeight } = window.cvat.player.geometry;\n for (let idx = 0; idx < actualPoints.length; idx += 1) {\n const point = actualPoints[idx];\n point.x = Math.clamp(point.x, 0, frameWidth);\n point.y = Math.clamp(point.y, 0, frameHeight);\n }\n\n e.target.setAttribute('points',\n window.cvat.translate.points.actualToCanvas(\n PolyShapeModel.convertNumberArrayToString(actualPoints),\n ));\n\n const polybox = e.target.getBBox();\n const area = polybox.width * polybox.height;\n\n if (area > AREA_TRESHOLD) {\n $.ajax({\n url: `/dextr/create/${window.cvat.job.id}`,\n type: 'POST',\n data: JSON.stringify({\n frame: window.cvat.player.frames.current,\n points: actualPoints,\n }),\n contentType: 'application/json',\n success: () => {\n function intervalCallback() {\n $.ajax({\n url: `/dextr/check/${window.cvat.job.id}`,\n type: 'GET',\n success: (jobData) => {\n if (['queued', 'started'].includes(jobData.status)) {\n if (jobData.status === 'queued') {\n dextrCancelButton.prop('disabled', false);\n }\n setTimeout(intervalCallback, 1000);\n } else {\n dextrOverlay.addClass('hidden');\n if (jobData.status === 'finished') {\n if (jobData.result) {\n instance._controller.finish({ points: jobData.result }, 'polygon');\n }\n } else if (jobData.status === 'failed') {\n const message = `Segmentation has fallen. Error: '${jobData.stderr}'`;\n showMessage(message);\n } else {\n let message = `Check segmentation request returned \"${jobData.status}\" status.`;\n if (jobData.stderr) {\n message += ` Error: ${jobData.stderr}`;\n }\n showMessage(message);\n }\n }\n },\n error: (errorData) => {\n dextrOverlay.addClass('hidden');\n const message = `Can not check segmentation. Code: ${errorData.status}.`\n + ` Message: ${errorData.responseText || errorData.statusText}`;\n showMessage(message);\n },\n });\n }\n\n dextrCancelButton.prop('disabled', true);\n dextrOverlay.removeClass('hidden');\n setTimeout(intervalCallback, 1000);\n },\n error: (errorData) => {\n const message = `Can not cancel ReID process. Code: ${errorData.status}.`\n + ` Message: ${errorData.responseText || errorData.statusText}`;\n showMessage(message);\n },\n });\n }\n\n instance._controller.switchCreateMode(true);\n }); // end of \"drawdone\" handler\n }; // end of _create() method\n\n return instance;\n } // end of constructorDecorator()", "constructor() {\r\n //So basically there are 4 methods, first it's binding and the rest aren't.\r\n this.initialize=this.initialize.bind(this)\r\n this.initialize()\r\n this.sequenceMaker()\r\n setTimeout(this.sublevelPosition,500)\r\n }", "function test2(){ \n var p2 = new Perro();\n /*\n Perro.prototype = new Animal(); \n Perro.prototype.constructor = Perro; \n -- con esto heredamos todos los metodos --\n */\n p2.dormir();\n p2.ladrar();\n p2.jugar();\n p2.morder();\n}", "function Surrogate(){ this.constructor = child; }", "function l(e,t){function r(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "function n(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e}", "function n(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e}", "function n(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e}", "function CrossScenario(){\r\n this.car = new Car();\r\n this.person = new Person();\r\n}", "function classicalInher() {\n // Shape - superclass\n function Shape() {\n this.x = 0;\n this.y = 0;\n }\n\n // superclass method\n Shape.prototype.move = (x, y) => {\n this.x += x;\n this.y += y;\n console.info('Shape moved to ' + x + ', ' + y);\n }\n\n // Rectangle - subclass\n function Rectangle() {\n console.log(this);\n Shape.call(this); // call super constructor\n }\n\n // subclass extends superclass\n Rectangle.prototype = Object.create(Shape.prototype);\n Rectangle.prototype.constructor = Rectangle;\n\n var rect = new Rectangle();\n\n console.log('Is rect an instance of Rectangle?',\n rect instanceof Rectangle); // true\n console.log('Is rect an instance of Shape?',\n rect instanceof Shape); // true\n rect.move(1, 1); // Outputs, 'Shape moved.'\n}", "function Spriter_Base() {\n this.initialize.apply(this, arguments);\n}", "constructor(make, year, type)\n {\n //Calling super constructor of vehicle base class\n super(make, year);\n //Initializing child class variables\n this._type = type;\n }", "constructor(make, year, type)\n {\n //Calling super constructor of vehicle base class\n super(make, year);\n //Initializing child class variables\n this._type = type;\n }", "function _construct()\n\t\t{;\n\t\t}", "function task1 () {\n \n function Animal(name) {\n this.name = name;\n }\n\n Animal.prototype.walk = function() {\n console.log( \"ходит \" + this.name );\n };\n\n function Rabbit(name) {\n this.name = name;\n }\n Rabbit.prototype = Animal.prototype;\n\n Rabbit.prototype.walk = function() {\n console.log( \"прыгает! и ходит: \" + this.name );\n };\n\n var a = new Animal('a')\n\n var r = new Rabbit('r')\n\n a.walk() // прыгает и ходит????\n r.walk()\n}", "constructor(name, hull, firePower, accuracy) { // constructors are info about class (this. belongs to constructor)\n this.name = name;\n this.hull = hull;\n this.firePower = firePower;\n this.accuracy = accuracy;\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnTrail.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudtrail_CfnTrailProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnTrail);\n }\n throw error;\n }\n cdk.requireProperty(props, 'isLogging', this);\n cdk.requireProperty(props, 's3BucketName', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrSnsTopicArn = cdk.Token.asString(this.getAtt('SnsTopicArn', cdk.ResolutionTypeHint.STRING));\n this.isLogging = props.isLogging;\n this.s3BucketName = props.s3BucketName;\n this.cloudWatchLogsLogGroupArn = props.cloudWatchLogsLogGroupArn;\n this.cloudWatchLogsRoleArn = props.cloudWatchLogsRoleArn;\n this.enableLogFileValidation = props.enableLogFileValidation;\n this.eventSelectors = props.eventSelectors;\n this.includeGlobalServiceEvents = props.includeGlobalServiceEvents;\n this.insightSelectors = props.insightSelectors;\n this.isMultiRegionTrail = props.isMultiRegionTrail;\n this.isOrganizationTrail = props.isOrganizationTrail;\n this.kmsKeyId = props.kmsKeyId;\n this.s3KeyPrefix = props.s3KeyPrefix;\n this.snsTopicName = props.snsTopicName;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::CloudTrail::Trail\", props.tags, { tagPropertyName: 'tags' });\n this.trailName = props.trailName;\n }", "function i(e,t){function i(){}i.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new i,e.prototype.constructor=e}", "function Trainer(name, workHours) {\n //Properties:\n //o\tAll parent properties\n //o\tcourses – A visible empty array (filled with Course instances only)\n //o\tfeedbacks – A visible empty array (filled with strings only)\n app.employee.call(this, name, workHours);\n this.courses = [];\n this.feedbacks = [];\n }", "createLaser() {\n this.lasers.push(new Laser(this.player));\n }", "newTurtle() {\n return this;\n }", "constructor( ) {}", "travel() {\n new Travel(this.player).travel();\n }", "function i(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}", "constructor() { super() }", "function a(e,t){function i(){this.constructor=e}o(e,t),e.prototype=null===t?RS(t):(i.prototype=t.prototype,new i)}", "constructor(_t, _r) {\nthis._t = _t;\nthis._r = _r;\n}", "function Trip(api) {\n var self = this;\n\n // api is the object returned by the API. We leave this as read-only\n // and add any other info we want as a sibling data piece.\n self.api = api;\n\n // When drawing the lines for the trip, we need to identify when\n // the current stop shows up. Since the line doesn't always pass\n // exactly through the stop, we start by looking for stops\n // at min distance away, then incrementing until we get to max (after\n // which we give up if the line never crosses).\n self.stop_line_dist_min = 0;\n self.stop_line_dist_max = 100;\n\n self.weight = 8;\n self.before_opacity = 0.4;\n self.after_opacity = 1.0;\n}", "constructor(title, author,pages,technology) { // constructor com as informações cosntantes da nova classe\n super(title,author,pages); // informações herdadas da classe superior\n this.technology = technology; // nova atribuição da nova classe.\n\n }", "initialize() {\n // Needs to be implemented by derived classes.\n }", "constructor(params) {\n super(params);\n\n const oThis = this;\n }", "function R(e,t){function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "function inherited() { }", "function i(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "function i(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "function i(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "constructor () { super() }", "function TraceAPI() {\n this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();\n this.wrapSpanContext = spancontext_utils_1.wrapSpanContext;\n this.isSpanContextValid = spancontext_utils_1.isSpanContextValid;\n this.deleteSpan = context_utils_1.deleteSpan;\n this.getSpan = context_utils_1.getSpan;\n this.getSpanContext = context_utils_1.getSpanContext;\n this.setSpan = context_utils_1.setSpan;\n this.setSpanContext = context_utils_1.setSpanContext;\n }", "constructor(name, fin) {\n // inheriting from the parent class\n super(fin);\n // updating the property of Cat class\n this.leg = 4;\n this.name = name;\n }", "constructor (){}", "function Ln(t,e){function r(){this.constructor=t}Dn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}", "function i(t,e){function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "constructor() {\n throw new Error('Not implemented');\n }", "function Track() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "constructor(parameters = {}) {\n const presets = {\n name: 'ABC',\n level: -1,\n tooltip: \"you hovered\",\n view: {\n x: 200,\n y: 200,\n size: 50,\n normX: 0,\n normY: 0\n },\n siblings: [],\n children: [],\n parents: [],\n paths: 0\n }\n //presets go on this and parameters override presets\n Object.assign(this, presets, parameters)\n }", "constructor(name,age,major){\n //this is initialize parent class\n super(name,age);\n this.major=major\n }", "constructor() {\n super();\n this.faces = [];\n this.sectors = [];\n this.junctions = [];\n this.nodeType = PlanarNode;\n this.edgeType = PlanarEdge;\n this.faceType = PlanarFace;\n this.sectorType = PlanarSector;\n this.junctionType = PlanarJunction;\n }", "consstructor(){\n this.traverseMethod = 'pre-order';\n }", "function ParentConstructor() {\n}", "function BaseConstructor() {\n\t this.constructed_objects = {};\n\t this.constructing_nodes = [];\n\t this.deferred_constructors = [];\n\t }", "function e(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e}", "function A() {\n\t\tt.call(this)\n\t}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function Trees() {\n}", "function Trees() {\n}", "function peg$subclass(child,parent){function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor}", "function example3 () {\n function Animal(name) {\n this.name = name;\n this.speed = 0;\n }\n\n Animal.prototype.run = function(speed) {\n this.speed += speed;\n console.log( this.name + ' бежит, скорость ' + this.speed );\n };\n\n function Rabbit(name) {\n this.name = name;\n this.speed = 0;\n }\n\n Rabbit.prototype = Object.create(Animal.prototype)\n Rabbit.prototype.constructor = Rabbit\n\n Rabbit.prototype.jump = function() {\n this.speed++;\n console.log( this.name + ' прыгает' );\n };\n\n //total overriding\n Rabbit.prototype.run = function () {\n this.speed++\n this.jump()\n }\n\n // extend parent method\n Rabbit.prototype.run = function() {\n Animal.prototype.run.apply(this, arguments) // don't forget about proper context\n this.jump()\n };\n\n var rabbit = new Rabbit('Кроль');\n}", "function peg$subclass(child,parent){function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();}", "function Turtle() {\n // Construct new turtle.\n // Optional argument is passed to Init()\n // Define public properties\n this.log = '';\n this.logging = false;\n \n // Initialize (define and initialize remaining public properties\n if ( arguments.length >= 1 ) {\n this.Init(arguments[0]);\n }\n else {\n this.Init();\n }\n}", "constructor(name, weapon, type){ // Constructor is something only for subclass\n // console.log(this) - js wont allow us to run this in subclass untill we use the super() keyword\n super(name, weapon); // Super calls the super class of elf (Character). It goes up and calls the constructor\n console.log('this from subclass', this)\n this.type = type\n }", "constructor() {\n\t\t// ...\n\t}", "function a(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "function prototypeInheritance() {\n function Workshop(teacher) {\n this.teacher = teacher\n }\n \n Workshop.prototype.ask = function ask(question) {\n console.log(this.teacher, question)\n }\n \n function AnotherWorkshop(teacher) {\n Workshop.call(this, teacher)\n }\n \n AnotherWorkshop.prototype = Object.create(Workshop.prototype)\n \n AnotherWorkshop.prototype.speakUp = function(msg) {\n this.ask(msg.toUpperCase())\n }\n \n const JSRecentParts = new AnotherWorkshop('Bruno')\n JSRecentParts.speakUp('is this inherirance?')\n}", "constructor(scope) {\n\n this._frames = [];\n this._sources = [];\n this._dead = false;\n this._scope = scope;\n this._children = []; // from forks\n this._parent = null;\n this._context = null; // for methods\n this._target = null; // e.g. dom node for events, styles, etc.\n\n // temporary api states (used for interactively building the bus)\n\n this._spork = null; // beginning frame of split sub process\n this._holding = false; // multiple commands until duration function\n this._head = null; // point to reset accumulators\n this._locked = false; // prevents additional sources from being added\n\n if(scope)\n scope._buses.push(this);\n\n const f = new Frame(this);\n this._frames.push(f);\n this._currentFrame = f;\n\n }", "constructor() {\n this._t = performance.now() / 1000;\n\n Object.seal(this);\n }" ]
[ "0.6282079", "0.58154017", "0.5739216", "0.5664521", "0.5664521", "0.56559753", "0.56233734", "0.55981845", "0.55822885", "0.5549351", "0.5526625", "0.551295", "0.5506489", "0.5498839", "0.54565525", "0.54511565", "0.5442098", "0.5440068", "0.5435475", "0.5428987", "0.54253626", "0.54091054", "0.5404985", "0.5404985", "0.5400167", "0.539346", "0.53826386", "0.538134", "0.5375695", "0.53745055", "0.53733325", "0.53497964", "0.5333812", "0.5322246", "0.53199404", "0.53193074", "0.5316471", "0.5316471", "0.5316471", "0.53119886", "0.53081125", "0.53066576", "0.5302906", "0.5302906", "0.530078", "0.52921015", "0.5285392", "0.5277572", "0.5272524", "0.5260868", "0.52520776", "0.524643", "0.52324545", "0.5232252", "0.52230525", "0.5222638", "0.5206737", "0.5196644", "0.51941925", "0.51848334", "0.5182977", "0.5177205", "0.5169069", "0.5161894", "0.51583797", "0.51583797", "0.51583797", "0.51576465", "0.5152577", "0.51431775", "0.5139726", "0.51368415", "0.513434", "0.51220435", "0.5119143", "0.51191396", "0.51191396", "0.51191396", "0.5106655", "0.51024663", "0.5101083", "0.50977546", "0.5096183", "0.5094831", "0.50928634", "0.50917006", "0.5090577", "0.5090577", "0.50872946", "0.50872946", "0.50840807", "0.50837344", "0.50784147", "0.5076536", "0.50739217", "0.5070832", "0.5063735", "0.5063072", "0.5062569", "0.5059945" ]
0.52178335
56
This function downloads an XML document from the server, parses it, and presents the parsed document as a DOM tree
function load(url) { var xmlHTTP; if (window.XMLHttpRequest) { xmlHTTP = new XMLHttpRequest(); } else { xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP"); } xmlHTTP.open("GET", url, false); xmlHTTP.send(null); parser = new DOMParser(); xmlDoc = parser.parseFromString(xmlHTTP.responseText, "application/xml"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadXMLDocument( url )\n{\n var xmlHttpRequest = new XMLHttpRequest();\n xmlHttpRequest.open( \"get\", url, false );\n xmlHttpRequest.send( null );\n doc = xmlHttpRequest.responseXML;\n} // end function loadXMLDocument", "function getDoc()\n{\n\n\tvar request = new XMLHttpRequest(); // Create XHR object\n\t\n\t// To ensure that responses sent as XML are property handled\n\tif(request.overrideMimeType){\n\t\trequest.overrideMimeType(\"text/xml\");\n\t}\n\n\t// Check XHR object was successfully created\n\tif(request){\n\t\t// This will cause the xml file in the /htdoc folder to be sent\n\t\t// variable 'request' when the XHR GET request is sent\n\t\t// Set parameters for the HTTP request\n\t\trequest.open(\"GET\",\"temperature.xml\",true);\n\t\trequest.onreadystatechange = function()\n\t\t{\n\t\t\tif( (request.readyState == 4) && (request.status == 200) )\n\t\t\t{\n\t\t\t\tvar xmlDocument = request.responseXML;\n\t\t\t\t// Now we call the method displayClasses to extract XML data\n\t\t\t\tdisplayClasses(xmlDocument);\n\n\t\t\t}\n\t\t}\n\t\trequest.send(null); // send HTTP request\n\t}\n}", "function loadXMLDoc(filename)\n{\n\tif (window.XMLHttpRequest)\n\t {\n\t xhttp=new XMLHttpRequest();\n\t }\n\telse // code for IE5 and IE6\n\t {\n\t xhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t }\n\txhttp.open(\"GET\",filename,false);\n\txhttp.send();\n\treturn xhttp.responseXML;\n}", "function loadXMLDoc(filename)\n{\n if (window.XMLHttpRequest)\n {\n xhttp=new XMLHttpRequest();\n }\n else\n {\n xhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xhttp.open(\"POST\",filename,false);\n xhttp.send();\n return xhttp.responseXML;\n}", "function loadDocument(url, callback) {\r\n if (currentCall) {\r\n currentCall.abort();\r\n }\r\n currentCall = createXMLHttpRequest();\r\n currentCall.open(\"GET\", url, !!callback);\r\n currentCall.setRequestHeader(\"Accept\", \"application/xml\");\r\n if (callback) {\r\n currentCall.onreadystatechange = function () { callback(currentCall); }\r\n }\r\n currentCall.send();\r\n return callback ? currentCall : currentCall.responseXML;\r\n }", "function loadXMLDoc(dname) {\r\n\tif (window.XMLHttpRequest) {\r\n\t\txhttp = new XMLHttpRequest();\r\n\t} else {\r\n\t\txhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t}\r\n\txhttp.open(\"GET\", dname);\r\n\txhttp.send(\"\");\r\n\treturn xhttp.responseXML;\r\n}", "function loadXmlDoc(file) {\n if (window.XMLHttpRequest) {\n xhr = new XMLHttpRequest();\n } else {\n xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xhr.open(\"GET\", file, false);\n xhr.send(\"\");\n return xhr.responseXML;\n}", "function loadXML(url) {\n\t//Creating a Native empty Dom Element\n\tvar xml = $.ajax({\n\t\turl: url,\n\t\tdataType: \"xml\",\n\t\tasync: false,\n\t\terror: function() {\n\t\t\tlogJS('XML retrieval error')\n\t\t}\n\t}).responseXML;\n\t//logJS(pnxRecord);\n\treturn xml;\n}", "function getXML(url){\n\n return new Promise(function(resolve, reject) {\n //Access-Control-Allow-Origin: *\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"document\"; //formato XML\n xhr.onload = function() {\n var status = xhr.status;\n var readyState = xhr.readyState;\n if (status == 200 && readyState == 4) {\n resolve(xhr.response); //ya se llama a response aqui no hace falta llamarlo abajo\n } else {\n reject(status);\n }\n };\n xhr.send();\n });\n}", "function loadXML(){\n XMLrequest(link);\n console.log('loadXML -- OK');\n}", "function loadXML(file) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n // console.log(this);\n // console.log(this.responseXML);\n // console.log(this.responseText);\n xml.convertXML(this.responseText);\n // document.querySelector('#loader').style.display = \"none\";\n }\n }\n xhttp.open(\"GET\", file, true);\n xhttp.send();\n}", "function loadXmlDocument(url, callback)\r\n{\r\n\tvar loader = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n\tloader.onreadystatechange = function()\r\n\t{\r\n\t\tif (loader.readyState == 4) \r\n\t\t{\r\n\t\t\tvar status = loader.parseError.errorCode;\r\n\t\t\tcallback(loader, status);\r\n\t\t}\r\n\t}\r\n\tloader.load(url);\r\n}", "function loadXMLDoc(url) {\n\tvar req;\n\tvar timeoutid;\n\tif (window.XMLHttpRequest) {\n\t\treq = new XMLHttpRequest();\n\t\tshowstatusdiv('Loading...');\n\t\ttimeoutid = window.setTimeout( function(){if(callInProgress(req)){req.abort();}}, 30000);\n\t\treq.open(\"GET\", url, false);\n\t\treq.send(null);\n\t\twindow.clearTimeout(timeoutid);\n\t\thidestatusdiv();\n\t} else if (window.ActiveXObject) {\n\t\treq = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tif (req) {\n\t\t\tshowstatusdiv('Loading...');\n\t\t\ttimeoutid = window.setTimeout( function(){if(callInProgress(req)){req.abort();}}, 30000);\n\t\t\treq.open(\"GET\", url, false);\n\t\t\treq.send();\n\t\t\twindow.clearTimeout(timeoutid);\n\t\t\thidestatusdiv();\n\t\t}\n\t}\n\tif (req.readyState == 4) {\n\t\t// only if \"OK\"\n\t\tif (req.status == 200) {\n\t\t\treturn(req.responseText);\n\t\t} else {\n\t\t\tshowstatusdiv('Error ' + req.status + ' getting google data: ' + req.statusText);\n\t\t\treturn('');\n\t\t}\n\t} else {\n\t\tshowstatusdiv('Error: loadXMLDoc continued with readystate: ' + req.readyState);\n\t\treturn('');\n\t}\n}", "function Xml_LoadDocument(strUrl,fncCallback,blnXmlHttp,strXmlHttpBody,blnIsFormBodu)\r\n{\r\n // IE does not load static resources with XMLHttp (dwgx and swgx are replaced in runtime)\r\n if(mcntIsIE && (\".dwgx\"!=\".swgx\" && !blnXmlHttp))\r\n {\r\n Xml_LoadXmlDom(strUrl,fncCallback);\r\n return;\r\n } \r\n\t// create HTTP object\r\n\tvar objXmlHTTP\t= Xml_CreateXmlHttp();\r\n\t\r\n\t// define http definitions\r\n\tobjXmlHTTP.open(strXmlHttpBody ? \"POST\" : \"GET\", strUrl, true);\r\n\r\n\t//jrt HACK IE10 Quirks模式下不支持Ajax调用时候返回XMLDocment对象\r\n if(mcntIsIE) try { objXmlHTTP.responseType = 'msxml-document'; } catch (e) { }\r\n\r\n\t// set callback function\r\n\tobjXmlHTTP.onreadystatechange = function()\r\n\t{\r\n\t\t// if response is ready\r\n\t\tif (objXmlHTTP.readyState == 4) \r\n\t\t{\r\n\t\t\t// Check if current request status is offline.\r\n if (!Web_IsOfflineRequestStatus(objXmlHTTP))\r\n {\r\n\t\t\t // get response xml body\r\n\t\t\t var objXmldoc = objXmlHTTP.responseXML;\r\n\r\n\t\t\t // get error object\r\n\t\t\t var objError = objXmldoc.parseError;\r\n \t\t\t\r\n\t\t\t // get the error code\r\n\t\t\t var intErrot = objError?objError.errorCode:0;\r\n \t\t\t\r\n\t\t\t // check node error\r\n\t\t\t if (intErrot == 0)\r\n\t\t\t {\r\n\t\t\t\t // response object \r\n\t\t\t\t var objResponse = null;\r\n \t\t\t\t\r\n\t\t\t\t // if response ok\r\n\t\t\t\t if(objResponse = objXmldoc.documentElement)\r\n\t\t\t\t {\r\n\t\t\t\t\t // Return a xmldocument to the caller\r\n\t\t\t\t\t fncCallback(objXmldoc);\r\n\t\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t // Open error window and display content\r\n\t\t\t\t open().document.write(String(objXmlHTTP.responseText).replace(\"ASP.NET\",\"WebGui\"));\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// release xmlhttp object\r\n\t\t\tobjXmlHTTP = null;\r\n\t\t}\r\n\t};\r\n\t\r\n\tif(blnIsFormBodu)\r\n\t{\r\n\t objXmlHTTP.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n objXmlHTTP.setRequestHeader(\"Content-length\", strXmlHttpBody.length);\r\n }\r\n\t\r\n\tobjXmlHTTP.send(strXmlHttpBody);\r\n}", "function getXmlDocument(sFile) {\n // get course manifest file\n var jqXML = $.ajax({\n type: 'GET',\n url: sFile,\n dataType: 'xml',\n async: false\n });\n\n //return XML\n return jqXML.responseText;\n}", "function cargarRSS() {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (this.readyState == 4) {\n cargarXML(this);\n }\n };\n xhr.open(\"GET\", \"colombia.xml\", true);\n xhr.send();\n }", "function loadXML(url, callback) {\n var xhr = createXMLHttpRequest();\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4 && xhr.status == 200) {\n callback(xhr.responseXML);\n }\n }\n\n xhr.open(\"GET\", url);\n xhr.send();\n}", "function loadXMLDoc(){\n\tvar xhttp = false;\n\ttry{\t\t\n\t\txhttp=new XMLHttpRequest();\n\t}catch (e){\t\t\n\t\ttry{\n\t\t\txhttp=new ActiveXObject(\"MSXML2.XMLHTTP\");\n\t\t}catch (e){\n\t\t\ttry{\n\t\t\t\txhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t}catch (e){\n\t\t\t\talert('Error creating the request.');\n\t\t\t}\n\t\t}\n\t}\n\treturn xhttp;\n}", "function loadXMLDoc(dname) {\n\t\ttry //Internet Explorer\n\t\t{\n\t\t\txmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n\t\t} catch (e) {\n\t\t\ttry //Firefox, Mozilla, Opera, etc.\n\t\t\t{\n\t\t\t\txmlDoc = document.implementation.createDocument(\"\", \"\", null);\n\t\t\t} catch (e) {\n\t\t\t\talert(e.message)\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\txmlDoc.async = false;\n\t\t\txmlDoc.load(dname);\n\t\t\treturn (xmlDoc);\n\t\t} catch (e) {\n\t\t\talert(e.message)\n\t\t}\n\t\treturn (null);\n\t}", "function parseXMLDoc(xmlString) {\n var xmlDoc;\n try //Internet Explorer\n {\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = \"false\";\n xmlDoc.loadXML(xmlString);\n }\n catch (e) {\n try //Firefox, Mozilla, Opera, etc.\n {\n parser = new DOMParser();\n xmlDoc = parser.parseFromString(xmlString, \"text/xml\");\n }\n catch (e) {}\n }\n return xmlDoc;\n }", "function getDocHtml(url){\n \tvar xHttp = new XMLHttpRequest();\n \t/*\nonreadystatechange => Defines a function to be called when the readyState property changes*/\n \txHttp.onreadystatechange = function(){\n \t\tif(this.readyState == 4 && this.status == 200){\n \t\t\tdocument.getElementById('demo').innerHTML = this.responseText;\n \t\t\tconsole.log(xHttp.statusText);\n \t\t\t// responseText => Returns the response data as a string\n \t\t\t// responseXML => Returns the response data as XML data\n \t\t}\n \t};\n \t// \n// To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object:\n \txHttp.open('GET',url,true);\n \txHttp.send();\n }", "function getXML(file){\n reader.onload = function (file) {\n var xmlDoc = $.parseXML( file.target.result),\n $xml = $( xmlDoc );\n $xml.find( \"result\" ).each(function () {\n $title = $(this).find( \"title\" ).text();\n $url = $(this).find( \"url\" ).text();\n $description = $(this).find( \"description\" ).text();\n appendToScreen($title, $url, $description);\n });\n };\n reader.readAsText(file);\n}", "function parseXML(url) {\n var parser = new xml2js.Parser();\n var deferred = Q.defer();\n\n request(url, function (error, response, body) {\n if (error) {\n deferred.reject(new Error(error));\n } else if (response.statusCode == 200) {\n parser.parseString(body, function (error, result) {\n if (error) {\n deferred.reject(new Error(error));\n } else {\n deferred.resolve(result);\n }\n });\n } else {\n deferred.reject(new Error(\"Invalid response code\"));\n }\n });\n return deferred.promise;\n}", "function getXMLResponse (url) {\r\n\tvar http;\r\n\tif (window.XMLHttpRequest) {\r\n\t\t// code for IE7+, Firefox, Chrome, Opera, Safari\r\n\t\thttp=new XMLHttpRequest();\r\n\t}\r\n\telse if (window.ActiveXObject) {\r\n\t\t// code for IE6, IE5\r\n\t\thttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t}\r\n\telse {\r\n\t\talert(\"Your browser does not support XMLHTTP!\");\r\n\t}\r\n\thttp.open(\"GET\",url,false);\r\n\thttp.send(\"\");\r\n\treturn http.responseXML;\r\n}", "function getXSL(xmlUrl) {\n\tvar xhr = $.ajax({\n\t\turl: xmlUrl,\n\t\tdatatype: \"xml\",\n\t\tcontentType: \"application/xml\",\n\t\tasync: false,\n\t\tsuccess: function(response) {\n }\n\t});\n\n\tvar parser = new DOMParser();\n\tvar doc = parser.parseFromString(xhr.responseText, \"application/xml\");\n\treturn doc;\n}", "function getXML(xmlUrl) {\n\tvar xhr = $.ajax({\n\t\turl: xmlUrl,\n\t\tdatatype: \"xml\",\n\t\tcontentType: \"application/xml\",\n\t\tasync: false,\n\t\tsuccess: function(response) {\n }\n\t});\n\treturn xhr.responseXML;\n}", "function loadxml(dname){\n if (window.XMLHttpRequest){\n xhttp=new XMLHttpRequest();\n }else{\n xhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xhttp.open(\"GET\",dname,false);\n xhttp.send(\"\");\n return xhttp.responseXML;\n}", "function getXML() {\n\t\tvar XML = null;\n\t\t$.ajax({\n\t\t\turl: xmlFile,\n\t\t\tdataType: 'xml',\n\t\t\tasync: false,\n\t\t\tsuccess: function(data) {\n\t\t\t\tXML = data;\n\t\t\t}\n\t\t});\n\t\treturn XML;\n\t}", "function twcheese_requestXML(targetUrl)\n\t{\n\t\tvar xmlhttp;\n\t\tif (window.XMLHttpRequest)\n\t\t\txmlhttp=new XMLHttpRequest();\n\t\telse\n\t\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\txmlhttp.open(\"GET\",targetUrl,false);\n\t\txmlhttp.send(\"\");\n\n\t\treturn xmlhttp.responseText;\n\t}", "function parseDocument(data, options) {\n var handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_1.Parser(handler, options).end(data);\n return handler.root;\n}", "static toDOM(theXML, errCB = null) {\nvar doc, errMsg, i, len, pErr, pErrs;\ndoc = DOMParse.parseFromString(theXML, \"text/xml\");\npErrs = doc.getElementsByTagName(\"parsererror\");\nif (pErrs.length > 0) {\nerrMsg = \"\";\nfor (i = 0, len = pErrs.length; i < len; i++) {\npErr = pErrs[i];\nerrMsg += Access._justText(pErr);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Access.XHR: ${errMsg}`);\n}\nif (errCB) {\nerrCB(\"error\", errMsg);\n}\nreturn null;\n} else {\nreturn doc;\n}\n}", "function getXML(url){\n\tvar xml=Asiainfo.remoteData(url,false);\n\tif (xml != null && xml.length > 0) {\n var doc = mxUtils.parseXml(xml);\n var dec = new mxCodec(doc);\n dec.decode(doc.documentElement, graph.getModel());\n }\n}", "function parseXML(text) {\n var xmlDoc;\n\n if (typeof DOMParser != \"undefined\") {\n var parser = new DOMParser();\n xmlDoc = parser.parseFromString(text, \"text/xml\");\n } else {\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = \"false\";\n xmlDoc.loadXML(text);\n }\n\n return xmlDoc;\n}", "function parseXML(text) {\n var xmlDoc;\n\n if (typeof DOMParser != \"undefined\") {\n var parser = new DOMParser();\n xmlDoc = parser.parseFromString(text, \"text/xml\");\n } else {\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = \"false\";\n xmlDoc.loadXML(text);\n }\n\n return xmlDoc;\n}", "function parseDocument(data, options) {\n var handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_1.Parser(handler, options).end(data);\n return handler.root;\n }", "function loadXml(fileName) {\n if (window.XMLHttpRequest)\n {\n xhttp = new XMLHttpRequest();\n }\n else // code for IE5 and IE6\n {\n xhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xhttp.open(\"GET\",fileName, false);\n xhttp.send();\n return xhttp.responseXML;\n}", "function parseDocument(data, options) {\n var handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_1.Parser(handler, options).end(data);\n return handler.root;\n}", "function parseXML(xmlText){\n var xmlDoc;\n try{\n xmlDoc=new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async=\"false\";\n xmlDoc.loadXML(xmlText);\n }\n\n catch(e){\n try{\n parser=new DOMParser();\n xmlDoc=parser.parseFromString(xmlText,\"text/xml\");\n }\n catch(e){\n alert(e.message);\n return;\n }\n }\n return xmlDoc;\n}", "function cargaXML(url) {\r\n // Primero vamos a ver si la URL es una URL :)\r\n if(url==''){\r\n return;\r\n }\r\n // Usuario inteligente...\r\n if (window.XMLHttpRequest) {\r\n req = new XMLHttpRequest();\r\n req.onreadystatechange = processReqChange;\r\n req.open(\"GET\", url, true);\r\n req.send(null);\r\n // ...y usuario de Internet Explorer Windows\r\n } else if (window.ActiveXObject) {\r\n isIE = true;\r\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n if (req) {\r\n req.onreadystatechange = processReqChange;\r\n req.open(\"GET\", url, true);\r\n req.send();\r\n }\r\n }\r\n}", "function getXML(id){\n var httpURL = \"http://video.google.com/timedtext?lang=en&v=\" + id;\n var getCC = new XMLHttpRequest();\n\n getCC.onreadystatechange = function(){\n if(this.readyState == 4 && this.status == 200){\n $(\"#handler\").text(getCC.responseText);\n }\n }\n getCC.open(\"GET\", httpURL, false);\n getCC.send();\n\n var rawXmlTxt = $(\"#handler\").text();\n\n $(\"#handler\").text(\"\");\n\n parser = new DOMParser();\n\n xmlDoc = parser.parseFromString(rawXmlTxt, \"text/xml\");\n\n return xmlDoc;\n}", "function loadXMLDoc(url,wlcampo) {\r\n // branch for native XMLHttpRequest object\r\n// alert('entro en loadXMLDoc');\r\n if (window.XMLHttpRequest) {\r\n req = new XMLHttpRequest();\r\n req.onreadystatechange = processReqChange;\r\n req.open(\"GET\", url, true);\r\n req.send(null);\r\n // branch for IE/Windows ActiveX version\r\n } else if (window.ActiveXObject) {\r\n isIE = true;\r\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n reqr = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n if (req) {\r\n req.onreadystatechange = processReqChange;\r\n req.open(\"GET\", url, true);\r\n req.send();\r\n }\r\n }\r\n}", "function loadDocument(uri) {\n var parser = null;\n var source = null;\n var resolver = null;\n try {\n parser = cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROLE);\n resolver = cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE);\n source = resolver.resolveURI(uri);\n var is = new Packages.org.xml.sax.InputSource(source.getInputStream());\n is.setSystemId(source.getURI());\n return parser.parseDocument(is);\n } finally {\n if (source != null)\n resolver.release(source);\n cocoon.releaseComponent(parser);\n cocoon.releaseComponent(resolver);\n }\n}", "function cargaXML(url) {\n // Primero vamos a ver si la URL es una URL :)\n if(url==''){\n return;\n }\n // Usuario inteligente...\n if (window.XMLHttpRequest) {\n req = new XMLHttpRequest();\n req.onreadystatechange = processReqChange;\n req.open(\"GET\", url, true);\n req.send(null);\n // ...y usuario de Internet Explorer Windows\n } else if (window.ActiveXObject) {\n isIE = true;\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n if (req) {\n req.onreadystatechange = processReqChange;\n req.open(\"GET\", url, true);\n req.send();\n }\n }\n}", "function getXml(){\n //var xmlUrl = 'http://partyflock.nl/feed/agenda/city/1.xml'\n var xmlUrl = 'js/parties.xml'\n $http.get(\n xmlUrl,\n {transformResponse:function(data) {\n // convert the data to JSON and provide\n // it to the success function below\n var x2js = new X2JS();\n var json = x2js.xml_str2json( data );\n return json;\n }\n }\n ).\n success(function(data, status) {\n // send the converted data back\n // to the callback function\n jsonFile = data;\n return data;\n })\n }", "function parseDocument(data, options) {\n var handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_js_1.Parser(handler, options).end(data);\n return handler.root;\n}", "function parseDocument(data, options) {\n const handler = new esm_DomHandler(undefined, options);\n new Parser_Parser(handler, options).end(data);\n return handler.root;\n}", "function getFile(filename, callback)\n{ oxmlhttp = null;\n try\n { oxmlhttp = new XMLHttpRequest();\n oxmlhttp.overrideMimeType(\"text/html\");\n }\n catch(e)\n { \n \treturn null\n }\n if(!oxmlhttp) return null;\n try\n { oxmlhttp.open(\"GET\",filename,true);\n \toxmlhttp.send(null);\n }\n catch(e)\n { return null;\n }\n oxmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n \tvar parser = new DOMParser();\n \tvar xmlDoc = parser.parseFromString(this.responseText, \"text/html\");''\n \tcallback(xmlDoc);\n }\n\t };\n}", "function loadXML( filename, callback)\n{\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: filename,\n\t\tdataType: \"xml\",\n\t\tsuccess: callback\n\t});\n}", "function getXMLDoc(simId)\r\n{\r\n\tvar url = \"/simulation-servlet/rest/simulation/\"+simId;\r\n\tvar http;\r\n\tif (window.XMLHttpRequest)\r\n\t{\r\n\t\t// code for IE7+, Firefox, Chrome, Opera, Safari\r\n\t\thttp=new XMLHttpRequest();\r\n\t}\r\n\telse if (window.ActiveXObject)\r\n\t{\r\n\t\t// code for IE6, IE5\r\n\t\thttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\talert(\"Your browser does not support XMLHTTP!\");\r\n\t}\r\n\thttp.open(\"GET\",url,false);\r\n\thttp.send(\"\");\r\n\treturn http.responseXML;\r\n}", "function loadXMLDoc() {\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n getQuestionsXml(this);\r\n }\r\n };\r\n xmlhttp.open(\"GET\", \"questions.xml\", true);\r\n xmlhttp.send();\r\n}", "function LoadXMLDoc(url, method, callback, post_params) {\n var xmlhttp;\n\n // always for modern browsers\n xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = callback.bind(null, xmlhttp);\n\n xmlhttp.open(method, url, true);\n if (method.toLowerCase() == 'post') {\n xmlhttp.setRequestHeader(\"Content-type\", \"application/json\");\n post_params = post_params || {};\n // xmlhttp.send(JSON.stringify(post_params));\n }\n else //GET\n {\n xmlhttp.send();\n }\n}", "function ParseXMLString(str)\n{\n if (window.ActiveXObject)\n {\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\"); \n xmlDoc.async = false;\n xmlDoc.loadXML(str);\n }\n else if (document.implementation && document.implementation.createDocument) \n {\n var parser = new DOMParser(); \n xmlDoc = parser.parseFromString(str, \"text/xml\"); \n }\n else \n return null;\n \n return xmlDoc; \n}", "function requestXML() {\n\tvar fileType = $(\"#fileType option:selected\").text();\n\t\n\tvar filename = $(\"#txtBoxExportFilename\").val();\n\tif (!filename) {\n\t\tfilename = \"save\";\n\t}\n\t\n\tif (fileType == \"XML\") {\n\t\tvar treeJSONOBJ = eachchild(root);\n\t\tvar treeJSON = JSON.stringify(treeJSONOBJ);\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open( /* method */ \"POST\",\n\t\t\t/* target url */\n\t\t\t\"/GoalModelEditor/requestXML\"\n\t\t\t/* , async, default to true */\n\t\t);\n\t\txhr.overrideMimeType(\"application/octet-stream\");\n\t\txhr.send(treeJSON);\n\t\txhr.onreadystatechange = function () {\n\t\t\tif (xhr.readyState == 4) {\n\t\t\t\tif (xhr.status == 200) {\n\t\t\t\t\tconsole.log(\"upload complete\");\n\t\t\t\t\tconsole.log(\"response: \" + xhr.responseText);\n\t\t\t\t\t/*\n\t\t\t\t\t * var text = $(\"#textarea\").val(); var filename =\n\t\t\t\t\t * $(\"#input-fileName\").val()\n\t\t\t\t\t */\n\t\t\t\t\tvar blob = new Blob([xhr.responseText], {\n\t\t\t\t\t\ttype: \"text/plain;charset=utf-8\"\n\t\t\t\t\t});\n\t\t\t\t\tsaveAs(blob, filename + \".xml\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (fileType == \"PNG\") {\n\t\texportPNG(filename);\n\t}\n}", "function getXMLObject(){\n\tif (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari\n\t\txmlhttp=new XMLHttpRequest();\n\t}else{// code for IE6, IE5\n\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\txmlhttp.open(\"GET\",\"d.xml\",false);\n\txmlhttp.send();\n\txmlDoc=xmlhttp.responseXML;\n\t\n\tpitanja = xmlDoc.getElementsByTagName(\"pitanje\"); //array koji drzi sva pitanja\n}", "function createDocument(body) {\r\n var doc;\r\n if (window.DOMParser) {\r\n doc = (new DOMParser()).parseFromString('', 'text/xml');\r\n }\r\n else {\r\n doc = new ActiveXObject('Microsoft.XMLDOM');\r\n }\r\n return doc;\r\n }", "function loadXMLDoc() {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n myFunction(this);\n }\n };\n xmlhttp.open(\"GET\", \"data.xml\", true);\n xmlhttp.send();\n}", "function parseDOM(data,options){var handler=new domhandler_1.DomHandler(void 0,options);new Parser_1.Parser(handler,options).end(data);return handler.dom;}", "function string2XML(xmlstr) {\n\n if (document.all) {\n\n var xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async=\"false\";\n xmlDoc.loadXML(xmlstr);\n\n } else {\n\n var parser = new DOMParser();\n var xmlDoc = parser.parseFromString(xmlstr,\"text/xml\")\n\n }\n\n //don't return the datanode\n return xmlDoc;\n\n}", "async load (filename) {\n const xml = await fs.readFile(filename, { encoding: \"utf8\" })\n this.options.log(2, `loading XML file ${chalk.blue(filename)}: ${xml.length} bytes`)\n const dom = slimdomSAX.sync(xml, { position: false })\n let m\n if ((m = xml.match(/^(<\\?xml.+?\\?>\\r?\\n)/)) !== null)\n dom.PI = m[1]\n return dom\n }", "function loadXMLDoc_admin(url, params)\n{\n if(window.XMLHttpRequest) {\n try {\n req = new XMLHttpRequest();\n } catch(e) {\n req = false;\n }\n } else if(window.ActiveXObject) {\n try {\n req = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch(e) {\n try {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch(e) {\n req = false;\n }\n }\n }\n if(req) {\n req.onreadystatechange = processReqChange_admin;\n req.open(\"POST\", url, true);\n req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n req.send(params);\n return true;\n }\n}", "async processXmlFile(xmlFile) {\n const response = await fetch(xmlFile);\n const xmlData = await response.text();\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(xmlData, \"text/xml\");\n\n this.processDoc(xmlFile, doc);\n }", "function webpageRequest(url){\r\n\tvar dom = '';\r\n\tvar request = new XMLHttpRequest();\r\n\trequest.open('GET', url, false);\r\n\trequest.onload = function (){\r\n\t\tif(this.status == 200 || this.status == 0){\r\n\t\t\tdom = cheerio.load(this.responseText);\r\n\t\t}\r\n\t}\r\n\r\n\trequest.send();\r\n\r\n\treturn dom;\r\n}", "function loadXMLDoc(type)\n{\n\t //---create and send the POST query---//\n\t xmlhttp.open(\"POST\", \"XML_response.php\" ,true);\n\t xmlhttp.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n\t xmlhttp.send(\"type=\"+type);\n\t xmlhttp.onreadystatechange=function()\n\t {\n\t\t //---Call back function test the status of the query response---//\n\t\t if (xmlhttp.readyState==4 && xmlhttp.status==200)\n\t\t\t{\n\t\t\t\tvar doc = xmlhttp.responseXML;\n\t\t\t\t\n\t\t\t\t//---catch the size node value---//\n\t\t\t\tvar element = doc.getElementsByTagName('size')[0].childNodes[0];\n\t\t\t\tsize = element.data;\n\t\t\t\t\n\t\t\t\t//---it's a msg query ?---//\n\t\t\t\tif(type == 'msgQuery')\n\t\t\t\t{\n\t\t\t\t\t//---if the size of the number of message in xml file is different to the number of message displayed...a refresh query is useful---//\n\t\t\t\t\tif(currentSize != size)\n\t\t\t\t\t{\n\t\t\t\t\t\trefreshMsg(size);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//---......it's a user query ---//\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t//---if the size of the number of user in xml file is different to the number of user displayed...a refresh query is useful---//\n\t\t\t\t\tif(currentSizeL != size)\n\t\t\t\t\t{\n\t\t\t\t\t\tlogOnRefresh(size);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t };\n}", "function fetchUrl() {\n xmlText = \"\";\n var loading = _ById('loading');\n loading.style.display = 'block';\n var url = _ById('srcUrl').value;\n var xhr = new XMLHttpRequest();\n xhr.overrideMimeType('text/html');\n xhr.onload = renderText;\n xhr.onerror = function() {\n loading.style.display = 'none';\n alert('Enter valid address, example: http://www.espncricinfo.com/')\n _ById('srcUrl').value = '';\n }\n\n xhr.open('GET', url);\n xhr.responseType = 'document';\n xhr.send();\n\n\n}", "function getXml() {\r\n let\r\n url_stat = \"http://localhost:\" + vlcPort + \"/requests/status.xml\",\r\n url_art = \"http://localhost:\" + vlcPort + \"/art\",\r\n user = \"\",\r\n pwd = vlcPasswd;\r\n\r\n dir = exec(\"wget -O ./public/status.xml \" + url_stat +\r\n \" --user=\" + user + \" --password=\" + pwd,\r\n function (err, stdout, stderr) {\r\n if (err) {\r\n return err;\r\n }\r\n });\r\n}", "function cargaXML_2(url) {\r\n // Primero vamos a ver si la URL es una URL :)\r\n if(url==''){\r\n return;\r\n }\r\n // Usuario inteligente...\r\n if (window.XMLHttpRequest) {\r\n req_2 = new XMLHttpRequest();\r\n req_2.onreadystatechange = processReqChange_2;\r\n req_2.open(\"GET\", url, true);\r\n req_2.send(null);\r\n // ...y usuario de Internet Explorer Windows\r\n } else if (window.ActiveXObject) {\r\n isIE_2 = true;\r\n req_2 = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n if (req_2) {\r\n req_2.onreadystatechange = processReqChange_2;\r\n req_2.open(\"GET\", url, true);\r\n req_2.send();\r\n }\r\n }\r\n}", "function sendTheAJAX() {\nvar url = \"http://linuxfr.org/news.atom\";\nvar req = new XMLHttpRequest();\n\nreq.open(\"GET\", url, true);\n\nreq.onerror = function() { console.log(\"Échec de chargement \"+req.status+\" \"+url); };\n\nreq.onload = function() {\n if (req.status === 200 || req.status === 304) {\n console.log(req.responseXML);\n document.getElementById('article_content').textContent = req.responseText;\n }};\n\nreq.send();\n}", "function loadDocument(uri) {\r\n\tvar resolver = cocoon.getComponent( \"org.apache.excalibur.source.SourceResolver\");\r\n\tvar source = resolver.resolveURI(uri);\r\n\ttry {\r\n\t\tvar document = Packages.org.apache.cocoon.components.source.SourceUtil.toDOM(source);\r\n\t} finally {\r\n\t\tresolver.release(source);\r\n\t\tcocoon.releaseComponent(resolver);\r\n\t}\r\n\treturn document;\r\n}", "function loadDoc(url) {\r\n\r\n \r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function () {\r\n\r\n\r\n if (this.readyState == 4 && this.status == 200) {\r\n objetos = JSON.parse(this.responseText);;\r\n for (let i = 0; i < objetos.articles.length; i++) {\r\n divs(objetos.articles[i]);\r\n }\r\n\r\n }\r\n };\r\n xhttp.open(\"GET\", url, true);\r\n xhttp.send();\r\n}", "function mySaveFunction(uri, xmlDocument)\r\n{\r\n // HTTP POST the XML document to the save.aspx file.\r\n var result = HTTPTools.postXML(\"save.aspx\", xmlDocument); \r\n \r\n // Show a dialog with the result.\r\n alert(result);\r\n \r\n // Save successful!\r\n return true; \r\n}", "function cargaXML_2(url) {\n // Primero vamos a ver si la URL es una URL :)\n if(url==''){\n return;\n }\n // Usuario inteligente...\n if (window.XMLHttpRequest) {\n req_2 = new XMLHttpRequest();\n req_2.onreadystatechange = processReqChange_2;\n req_2.open(\"GET\", url, true);\n req_2.send(null);\n // ...y usuario de Internet Explorer Windows\n } else if (window.ActiveXObject) {\n isIE_2 = true;\n req_2 = new ActiveXObject(\"Microsoft.XMLHTTP\");\n if (req_2) {\n req_2.onreadystatechange = processReqChange_2;\n req_2.open(\"GET\", url, true);\n req_2.send();\n }\n }\n}", "function loadXMLDoc() {\n xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n myFunction(this);\n\n }\n };\n xmlhttp.open(\"GET\", \"jobs.xml\", true);\n xmlhttp.send();\n}", "function loadXMLDoc(url, cfunc) {\n if (window.XMLHttpRequest) {\n // code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp = new XMLHttpRequest();\n } else {\n // code for IE6, IE5\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange = cfunc;\n xmlhttp.open(\"GET\", url + \"&rand=\" + Math.floor(Math.random() * 1000), true);\n xmlhttp.send();\n }", "function loadFromServer(fileName, callback) {\n\tvar fileExts = {xdsl:true,dne:true};\n\tvar format = fileName.replace(/^.*\\.([^.]*)$/, '$1');\n\tif (!fileExts[format]) {\n\t\tformat = \"xdsl\";\n\t}\n\t$.get(fileName, function(data) {\n\t\topenBns.push(new BN({source: data, outputEl: $(\".bnview\"), format: format}));\n\t\tcurrentBn = openBns[openBns.length-1];\n\t\tcurrentBn.fileName = baseName(fileName);\n\t\tdocument.title = baseName(fileName) + \" - \" + titlePostfix;\n\t\t$(\".status\").text(currentBn.nodes.length+\" nodes\");\n\t\tif (callback) callback();\n\t}, \"text\");\n}", "function xml_loaded (e, request) \n{\n\n\txml_request = null;\n\tif (request.responseXML)\n\t{\t\t\n\t\t// Clear the results array\n\t\twhile(results.length > 0)\n\t\t{\n\t\t\tresults.pop();\n\t\t}\n\t\t\n\t\t// Get the top level <rss> element \n\t\tvar rss = findChild(request.responseXML, 'rss');\n\t\tif (!rss) return;\n\t\t\n\t\t// Get single subordinate channel element\n\t\tvar channel = findChild( rss, 'channel');\n\t\tif (!channel) return;\n\t\t\n\t\t// Store the podcast description for use on the widget back\n\t\tpodcast_description = findChild(channel, 'description');\n\t\tif( (podcast_description == null) || (podcast_description.firstChild == null) ) \n\t\t{ \n\t\t\tpodcast_description = \"No podcast description provided\"; \n\t\t}\n\t\telse {\n\t\t\tpodcast_description = podcast_description.firstChild.data;\n\t\t}\n\t\t\t\t\t\t\t\n\t\t// Get all item elements subordinate to the channel element.\n\t\t// For each element, get title, pubDate, subtitle, description, and episode URL. \n\t\tfor( var item = channel.firstChild; item != null; item = item.nextSibling)\n\t\t{\n\t\t\tif( item.nodeName == 'item' ) \n\t\t\t{\n\t\t\t\tvar title = findChild (item, 'title');\n\t\t\t\n\t\t\t\t// we have to have the title to include the item in the list \n\t\t\t\tif( title != null ) \n\t\t\t\t{\n\t\t\t\t\tvar title = findChild(item, 'title');\n\t\t\t\t\tif( (title == null) || (title.firstChild == null) ) \n\t\t\t\t\t{ \n\t\t\t\t\t\ttitle = \"No episode title provided\"; \n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttitle = title.firstChild.data;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar date = findChild(item, 'pubDate');\n\t\t\t\t\tvar dateString = null;\n\t\t\t\t\tif( (date == null) || (date.firstChild == null) )\n\t\t\t\t\t{\n\t\t\t\t\t\tdateString = null;\n\t\t\t\t\t\tdate = null;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdateString = date.firstChild.data;\n\t\t\t\t\t\tdate = new Date(Date.parse(date.firstChild.data));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar description = findChild(item, 'description');\n\t\t\t\t\tif( (description == null) || (description.firstChild == null) ) \n\t\t\t\t\t{ \n\t\t\t\t\t\tdescription = \"No episode description provided\"; \n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdescription = description.firstChild.data;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar subtitle = findChild(item, 'itunes:subtitle');\n\t\t\t\t\tif( (subtitle == null) || (subtitle.firstChild == null) ) \n\t\t\t\t\t{\n\t\t\t\t\t\tsubtitle = description;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsubtitle = subtitle.firstChild.data;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar link = findChild (item, 'link');\n\t\t\t\t\tif(link == null) \n\t\t\t\t\t{ \n\t\t\t\t\t\tlink = null; \n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlink = link.firstChild.data;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar enclosure = findChild(item, 'enclosure')\n\t\t\t\t\tif(enclosure == null) \n\t\t\t\t\t{\n\t\t\t\t\t\t// if there's no enclosure, there's no episode to play; ignore the entry and move on.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tenclosure = enclosure.getAttribute('url');\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tresults[results.length] = {\n\t\t\t\t\t\ttitle:title,\n\t\t\t\t\t\tdate:date,\n\t\t\t\t\t\tdateString:dateString,\n\t\t\t\t\t\tsubtitle:subtitle,\n\t\t\t\t\t\tdescription:description,\n\t\t\t\t\t\tlink:link,\n\t\t\t\t\t\ttrack:enclosure\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Sort by date\n\t\tresults.sort(compFunc);\n\t\t\n\t\t// Since we have results, pause the loading animation\n\t\tstopLoadingAnimation();\n\t\t\n\t\t// Copy titles into the pop-up menu\n\t\tpopulate_menu(results);\n\t\t\n\t\t// Place the most recent episode's information on the widget\n\t\tupdate_episode(results[0]);\n\t\t\n\t\t// Reset the last updated value track how often the widget refreshes\n\t\tlast_updated = (new Date).getTime();\n\t}\n}", "function Xparse(src) {\r\n var frag = new _frag();\r\n // remove bad \\r characters and the prolog\r\n frag.str = _prolog(src);\r\n // create a root element to contain the document\r\n var root = new _element();\r\n root.name=\"ROOT\";\r\n // main recursive function to process the xml\r\n frag = _compile(frag);\r\n // all done, lets return the root element + index + document\r\n root.contents = frag.ary;\r\n root.index = _Xparse_index;\r\n _Xparse_index = new Array();\r\n return root;\r\n}", "function loadXMLDoc(url, params, submitmethod, changehandler)\n{\n\tif ((submitmethod != 'GET') && (submitmethod != 'POST'))\n\t{\n\t\tsubmitmethod = 'GET';\n\t}\n\t\n\t//Use the native object available in all browsers (IE >= 7)\n\tif (window.XMLHttpRequest)\n\t{\n\t\trequest = new XMLHttpRequest();\n\t\tvar is_activex = false;\n\t}\n\t//Use the ActiveX version for IE < 7\n\telse if (window.ActiveXObject)\n\t{\n\t\trequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tvar is_activex = true;\n\t}\n\t\n\tif (!request)\n\t{\n\t\treturn false;\n\t}\n\t\n\teval(\"request.onreadystatechange = \"+changehandler);\n\tif (submitmethod == 'POST')\n\t{\n\t\trequest.open(submitmethod, url, true);\n\t\trequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=' + ajax_page_charset);\n\t\trequest.send(params);\n\t}\n\telse\n\t{\n\t\trequest.open(submitmethod, url + '?' + params, true);\n\t\trequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=' + ajax_page_charset);\n\t\tif (is_activex)\n\t\t{\n\t\t\t// This seems to be an issue in the ActiveX-Object: no parameter needed\n\t\t\trequest.send();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The native versions take null as a parameter\n\t\t\trequest.send(null);\n\t\t}\n\t}\n\t\n\treturn true;\n}", "function getDownloadView() {\r\n var xmlhttp = getXMLHTTP();\r\n\r\n xmlhttp.onreadystatechange = function() {\r\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n var div = document.getElementById('custom-main-container');\r\n div.innerHTML = xmlhttp.responseText;\r\n }\r\n };\r\n xmlhttp.open('POST', '../controller/DownloadSongController.php');\r\n xmlhttp.send();\r\n\r\n setSelectedSection(DOWNLOAD_SECTION);\r\n}", "function loadXML() {\n // make new http request, its a js thing\n var xmlhttp = new XMLHttpRequest();\n\n // GET, file location and name, and some other propertie i forget\n xmlhttp.open(\"GET\", \"https://thejanik.000webhostapp.com/entries.xml\", true);\n xmlhttp.send();\n\n // when there is a change in the request's state, itll check all is green and run the table loading function\n xmlhttp.onreadystatechange = function () {\n // all green\n if (this.readyState == 4 && this.status == 200) {\n loadTable(this);\n }\n // cant find the xml\n if (this.status == 404) {\n console.log(\"couldn't find the xml file\")\n }\n }\n}", "function loadXMLString(strXml)\n{\n if (empty(strXml))\n strXml = '';\n var xml;\n if (window.DOMParser) {\n var DOMParser = new DOMParser();\n return DOMParser.parseFromString(strXml, 'text/xml');\n }\n if (window.ActiveXObject) {\n xml = new ActiveXObject('Microsoft.XMLDOM');\n xml.async = 'false';\n xml.loadXML(strXml);\n return xml;\n }\n if ((document.implementation) && (document.implementation.createDocument)) {\n xml = document.implementation.createDocument('', '', null);\n xml.async = false;\n xml.load(strXml);\n return xml;\n }\n alert('Seu navegador nao esta apto a ler um arquivo XML');\n return;\n}", "function GetXmlDocument() \r\n{\r\n Samples.AspNet.WebService.GetXmlDocument(\r\n SucceededCallbackWithContext, FailedCallback,\r\n \"XmlDocument\")\r\n}", "function parseXML(xml) {\n\t\tif ( window.DOMParser == undefined && window.ActiveXObject ) {\n\t\t\tDOMParser = function() { };\n\t\t\tDOMParser.prototype.parseFromString = function( xmlString ) {\n\t\t\t\tvar doc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\tdoc.async = 'false';\n\t\t\t\tdoc.loadXML( xmlString );\n\t\t\t\treturn doc;\n\t\t\t};\n\t\t}\n\n\t\ttry {\n\t\t\tvar xmlDoc = ( new DOMParser() ).parseFromString( xml, 'text/xml' );\n\t\t\tif ( $.isXMLDoc( xmlDoc ) ) {\n\t\t\t\tvar err = $('parsererror', xmlDoc);\n\t\t\t\tif ( err.length == 1 ) {\n\t\t\t\t\tthrow new Error('Error: ' + $(xmlDoc).text() );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error('Unable to parse XML');\n\t\t\t}\n\t\t\treturn xmlDoc;\n\t\t} catch( e ) {\n\t\t\tvar msg = ( e.name == undefined ? e : e.name + ': ' + e.message );\n\t\t\t$(document).trigger('xmlParseError', [ msg ]);\n\t\t\treturn undefined;\n\t\t}\n\t}", "function parseXML(xml) {\n\t\tif ( window.DOMParser == undefined && window.ActiveXObject ) {\n\t\t\tDOMParser = function() { };\n\t\t\tDOMParser.prototype.parseFromString = function( xmlString ) {\n\t\t\t\tvar doc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\tdoc.async = 'false';\n\t\t\t\tdoc.loadXML( xmlString );\n\t\t\t\treturn doc;\n\t\t\t};\n\t\t}\n\n\t\ttry {\n\t\t\tvar xmlDoc = ( new DOMParser() ).parseFromString( xml, 'text/xml' );\n\t\t\tif ( $.isXMLDoc( xmlDoc ) ) {\n\t\t\t\tvar err = $('parsererror', xmlDoc);\n\t\t\t\tif ( err.length == 1 ) {\n\t\t\t\t\tthrow new Error('Error: ' + $(xmlDoc).text() );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error('Unable to parse XML');\n\t\t\t}\n\t\t\treturn xmlDoc;\n\t\t} catch( e ) {\n\t\t\tvar msg = ( e.name == undefined ? e : e.name + ': ' + e.message );\n\t\t\t$(document).trigger('xmlParseError', [ msg ]);\n\t\t\treturn undefined;\n\t\t}\n\t}", "function fetchMarkupDoc(){\n\t\t\tvar request = $http({\n\t\t\t\tmethod: \"post\",\n\t\t\t\turl: \"/data/get-markup-document\"\n\t\t\t});\n\n\t\t\treturn(request.then(function(response){\n\t\t\t\treturn response.data;\n\t\t\t}, handleError));\n\t\t}", "function asyncXML () {\n return new Promise(function (resolve, reject) {\n fs.readFile('./books.xml', 'utf-8', (error, text) => {\n var xmlBooks\n if (error) {\n reject(error)\n } else {\n resolve(parser.parseString(text, (err, result) => {\n if (err) {\n reject(err)\n } else {\n resolve(result['catalog']['book'])\n }\n }))\n }\n })\n })\n }", "function xmlLoaded(xmlRequest) \n{\n\tif (xmlRequest.status == 200) {\n\t\t// Parse and interpret results\n\t\t// XML results found in xmlRequest.responseXML\n\t\t// Text results found in xmlRequest.reponseText\n\t\tvar r=xmlRequest.responseText;\n\t\tvar a=r.split('\\n');\n\t\tvar n=a.length;\n\t\tvar i,l,b;\n\t\tfor (i=0;i<n;i++)\n\t\t{\n\t\t\tl=a[i];\n\t\t\tif (l.length>0)\n\t\t\t{\n\t\t\t\tb=l.split(',');\n\t\t\t\tif (b[0]=='might')\n\t\t\t\t\tdocument.getElementById('txtMight').innerText=b[2]+'\\n'+b[3]+' '+b[4];\n\t\t\t\tif (b[0]=='expand')\n\t\t\t\t\tdocument.getElementById('txtExpand').innerText=b[2]+'\\n'+b[3]+' '+b[4];\n\t\t\t\tif (b[0]=='wealth')\n\t\t\t\t\tdocument.getElementById('txtWealth').innerText=b[2]+'\\n'+b[3]+' '+b[4];\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\talert(\"Error fetching data: HTTP status \" + xmlRequest.status);\n\t}\n}", "function getXML(list)\n {\n var thisXMLhttp = new XMLHttpRequest();\n thisXMLhttp.open(\"GET\", list, false);\n thisXMLhttp.send();\n var thisXMLDoc = thisXMLhttp.responseXML;\n\n return thisXMLDoc;\n }", "async loadDocumentContent (documentPath) {\n const doc = await this.fetch(`/load_document?d=${documentPath}`) \n return this.parseDocument(doc);\n }", "function loadDoc(url, cFunction) {\n var xhttp;\n xhttp=new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n cFunction(this);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "function parseXML(xml) {\n\t\tif ( window.DOMParser == undefined && window.ActiveXObject ) {\n\t\t\tDOMParser = function() { };\n\t\t\tDOMParser.prototype.parseFromString = function( xmlString ) {\n\t\t\t\tvar doc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\tdoc.async = 'false';\n\t\t\t\tdoc.loadXML( xmlString );\n\t\t\t\treturn doc;\n\t\t\t};\n\t\t}\n\n\t\ttry {\n\t\t\tvar xmlDoc = ( new DOMParser() ).parseFromString( xml, 'text/xml' );\n\t\t\tif ( $.isXMLDoc( xmlDoc ) ) {\n\t\t\t\tvar err = $('parsererror', xmlDoc);\n\t\t\t\tif ( err.length == 1 ) {\n\t\t\t\t\tthrow('Error: ' + $(xmlDoc).text() );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow('Unable to parse XML');\n\t\t\t}\n\t\t\treturn xmlDoc;\n\t\t} catch( e ) {\n\t\t\tvar msg = ( e.name == undefined ? e : e.name + ': ' + e.message );\n\t\t\t$(document).trigger('xmlParseError', [ msg ]);\n\t\t\treturn undefined;\n\t\t}\n\t}", "function fetchSCMLFile(path, callback, name) {\n var httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === 4) {\n var data = XML2jsobj(httpRequest.responseXML.documentElement);\n if (callback) callback(data, name);\n }\n };\n httpRequest.open('GET', path);\n httpRequest.send(); \n}", "function gotOrder(xmlDoc)\n{\n hideLoading(); // hide the \"loading...\" popup\n let evtForm = document.evtForm;\n let root = xmlDoc.documentElement;\n if (root && root.nodeName == 'ordered')\n {\n refresh(); // refresh the page\n }\n else\n { // error\n let msg = \"Error: \";\n if (root)\n {\n for(let i = 0; i < root.childNodes.length; i++)\n { // loop through children\n let node = root.childNodes[i];\n if (node.nodeValue != null)\n msg += node.nodeValue;\n } // loop through children\n } // have XML response\n else\n msg += xmlDoc;\n alert (msg);\n } // error\n}", "function doGet(host, endpoint, success) {\n\n console.log('doGet(dom):' + host + endpoint);// + ' agency:' + agency + ' route:' + route + ' lat:' + lat + ' lon:' + lon + ' success:' + success);\n\n var options = {\n host: host,\n port: 80,\n path: endpoint,\n method: 'GET',\n headers: {\n connection: 'keep-alive'\n }\n };\n\n var req = http.request(options, function(res) {\n\n //console.log(\"statusCode: \", res.statusCode);\n //console.log(\"headers: \", res.headers);\n\n res.setEncoding('utf-8');\n\n var xml = '';\n\n res.on('data', function(data) {\n xml += data;\n });\n\n res.on('end', function() {\n\n try {\n var dom = libxmljs.parseXml(xml);\n\n //console.log('doGet: ' + dom);\n success(dom);\n } catch (err) {\n console.log('doGet:XML parse error (' + err + ') for ' + host + endpoint);\n console.log('doGet:while parsing:'+ xml);\n }\n\n });\n });\n req.end();\n\n req.on('socket', function (socket) {\n socket.setTimeout(1000 * 60 * 2); // Two minute timeout\n socket.on('timeout', function() {\n req.abort();\n });\n });\n\n req.on('error', function(err) {\n console.log('doGet:HTTP error (' + err + ') for ' + host + endpoint);\n });\n}", "function displayWholeXml(xmlName) {\n var fileName = xmlName;\n if (xmlName === undefined) {\n fileName = \"MusicXMLs/\" + getRealMusicPieceName() + \".xml\";\n }\n //Need some code here to execute the jar file with the specified parameters.\n $.ajax({\n type : \"GET\",\n url : fileName,\n success : function(results) {\n //tempVariableHolder = results;\n var doc = new Vex.Flow.Document(results);\n formatter = doc.getFormatter();\n formatter.setWidth(800).draw($(\"#xmlholder\")[0]);\n },\n error : function(something) {\n alert(\"There was a problem. Please try again or contact the Music Scoring team.\");\n }\n });\n}", "function fetchXml(pmcid, dcat, callback){\n var uri = 'http://www.pubmedcentral.nih.gov/oai/oai.cgi?verb=GetRecord&identifier=oai:pubmedcentral.nih.gov:' + pmcid.slice(3) + '&metadataPrefix=pmc';\n\n dcat.log('GET', uri);\n request(uri, function(error, resp, xml){\n if (error) return callback(error);\n\n dcat.log(resp.statusCode, uri);\n\n if (resp.statusCode >= 400){\n var err = new Error(xml);\n err.code = resp.statusCode;\n return callback(err);\n }\n\n callback(null, xml);\n });\n}", "function parseXML(XMLDoc) {\n\t\t// Clear the exist dir content\n\t\t/*\n\t\tdir_content = {\n\t\t\tpath: ['dir', 'subDir', 'subSubDir'], // Path to current dir\n\t\t\tinf: {\n\t\t\t\t\tis_writable: 1 // The current dir is writable (1) or not (0)\n\t\t\t\t},\n\t\t\tdirs:[\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'fauna', // Dir name\n\t\t\t\t\t\tempty: 0, // Directory is empty (1) or not (0)\n\t\t\t\t\t\treadable: 1, // Directoy is readable\n\t\t\t\t\t\tdate: 1253824760 // Dir date as unix timestamp\n\t\t\t\t\t},\n\t\t\t\t\t{name: 'flora', empty: 1, readable: 1},\n\t\t\t\t\t{name: 'biiiiiig foldeeeeeeeer nameeeeeeeeeeeeee ', empty: 1, readable: 1}\n\t\t\t\t]\n\t\t\t},\n\t\t\tfiles:[\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'filename', // File name\n\t\t\t\t\t\tfilesize: 100, // File size in bytes\n\t\t\t\t\t\tdate: 1253824760, // File date as unix timestamp\n\t\t\t\t\t\timg_size: '1024x768', // If file is image contains the image size\n\t\t\t\t\t\tthumb: '/thmb/filename.jpg' // If file is image contains the path to image thumbnail\n\t\t\t\t\t}\n\t\t\t]\n\t\t}\n\t\t*/\n\n\t\tvar\n\t\t\trootNodeName,\n\t\t\txmlRoot,\n\t\t\tpath,\n\t\t\tinf,\n\t\t\tdirs,\n\t\t\tfiles,\n\t\t\ti\n\t\t;\n\t\t// Create the template\n\t\tdir_content = {\n\t\t\tpath: [],\n\t\t\tinf: {},\n\t\t\tdirs: [],\n\t\t\tfiles: []\n\t\t};\n\n\t\t// Parse the XML Document\n\n\t\t// catching potential errors with IE and Opera\n\t\tif (!XMLDoc || !XMLDoc.documentElement) {\n\t\t\tthrow 'Invalid XML structure:\\n' + XMLDoc.responseText;\n\t\t}\n\t\t// catching potential errors with Firefox\n\t\trootNodeName = XMLDoc.documentElement.nodeName;\n\t\tif (rootNodeName == 'parsererror') {\n\t\t\tthrow 'Invalid XML structure';\n\t\t}\n\t\t// obtain the XML's document element\n\t\txmlRoot = XMLDoc.documentElement;\n\n\t\t// Get the XML elements\n\t\tpath = xmlRoot.getElementsByTagName('path');\n\t\tinf = xmlRoot.getElementsByTagName('inf');\n\t\tdirs = xmlRoot.getElementsByTagName('dirs');\n\t\tfiles = xmlRoot.getElementsByTagName('files');\n\n\t\t/*------------------------------- Path ---------------------------------------------------*/\n\t\tif (path && path.length > 0) {\n\t\t\tpath = path.item(0).getElementsByTagName('dir');\n\t\t\tfor (i = 0; i < path.length; i++) {\n\t\t\t\tdir_content.path[dir_content.path.length] = path.item(i).getAttribute('name');\n\t\t\t}\n\t\t}\n\n\t\t/*------------------------------- Inf ---------------------------------------------------*/\n\t\tif (inf && inf.length > 0) {\n\t\t\tdir_content.inf = getAttributes(inf.item(0));\n\t\t}\n\n\t\t/*--------------------------------- Dirs -------------------------------------------------*/\n\t\tif (dirs && dirs.length > 0) {\n\t\t\tdirs = dirs.item(0).getElementsByTagName('dir');\n\t\t\tfor (i = 0; i < dirs.length; i++) {\n\t\t\t\tdir_content.dirs[dir_content.dirs.length] = getAttributes(dirs.item(i));\n\t\t\t}\n\t\t}\n\n\t\t/*------------------------- Files --------------------------------------------------------*/\n\t\tif (files && files.length > 0) {\n\t\t\tfiles = files.item(0).getElementsByTagName('file');\n\t\t\tfor (i = 0; i < files.length; i++) {\n\t\t\t\tdir_content.files[dir_content.files.length] = getAttributes(files.item(i));\n\t\t\t}\n\t\t}\n\t}", "function showXMLinfo (plik, aleCo) {\n var xhttp,\n xmlDoc,\n txt,\n x,\n i;\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n xmlDoc = this.responseXML;\n txt = \"\";\n x = xmlDoc.getElementsByTagName(aleCo);\n for (i = 0; i < x.length; i++) {\n txt = txt + x[i].childNodes[0].nodeValue + \"<br>\";\n }//for\n document.getElementById(\"ajax-i-xml-store\").innerHTML = txt;\n }//if\n };//function\n xhttp.open(\"GET\", plik, true);\n xhttp.send();\n}//showXMLinfo", "function handleListsResponse(){\n\n //lists request\n if(listsReq.readyState == 4 && listsReq.status == 200){\n var response = listsReq.responseText;\n if(response){\n populateTreeSelection(listsReq.responseXML.documentElement);\n }\n }\n}", "function cjXMLLoadString(txt) {\n if (typeof DOMParser != \"undefined\") {\n // Mozilla, Firefox, and related browsers \n return (new DOMParser()).parseFromString(text, \"application/xml\");\n } else if (typeof ActiveXObject != \"undefined\") {\n // Internet Explorer. \n var doc = XML.newDocument(); // Create an empty document \n doc.loadXML(text); // Parse text into it \n return doc; // Return it \n } else {\n // As a last resort, try loading the document from a data: URL \n // This is supposed to work in Safari. Thanks to Manos Batsis and \n // his Sarissa library (sarissa.sourceforge.net) for this technique. \n var url = \"data:text/xml;charset=utf-8,\" + encodeURIComponent(text);\n var request = new XMLHttpRequest();\n request.open(\"GET\", url, false);\n request.send(null);\n return request.responseXML;\n }\n}", "function XMLUrl(url , data) {\n\tjQuery.ajax({\n\t\turl:\t\turl,\n\t\tdataType:\t'xml',\n\t\ttype:\t\t'post',\n\t\tdata:\t\tdata,\n\t\tsuccess:\tfunction(response) {\n\t\t\t\t\t\tparseXML(response);\n\t\t\t\t\t\tjQuery.unblockUI();\n\t\t\t\t\t},\n\t\tjxbfDefault: true\n\t});\n}" ]
[ "0.71768", "0.6804874", "0.6602855", "0.6547652", "0.65258425", "0.64092875", "0.6398657", "0.62760615", "0.6272318", "0.61477983", "0.6146318", "0.6143171", "0.6057159", "0.60571164", "0.6019636", "0.6017943", "0.6005374", "0.6004845", "0.5990158", "0.5959289", "0.5927034", "0.59204656", "0.5913335", "0.59033144", "0.5898046", "0.58957213", "0.58826566", "0.581744", "0.57747847", "0.57642674", "0.57620585", "0.57551545", "0.57458615", "0.57458615", "0.5731578", "0.5713792", "0.56939083", "0.5688704", "0.5678451", "0.56762713", "0.5663829", "0.56585014", "0.5640817", "0.56278324", "0.5611315", "0.5604762", "0.5579136", "0.55790883", "0.5565433", "0.55391127", "0.5525965", "0.55246204", "0.5495163", "0.54940635", "0.54819095", "0.54416114", "0.54285026", "0.5426485", "0.54218614", "0.5415914", "0.5400655", "0.5389612", "0.538955", "0.5387901", "0.5383258", "0.5376278", "0.5349851", "0.53237736", "0.5323336", "0.5313437", "0.5310662", "0.52999973", "0.5296754", "0.52962995", "0.5290621", "0.52901053", "0.5283992", "0.52789545", "0.52723867", "0.52691394", "0.52669775", "0.5245139", "0.5245139", "0.52438945", "0.52304846", "0.5230319", "0.52301025", "0.5229918", "0.52268285", "0.52245396", "0.5206614", "0.51847315", "0.518381", "0.5179146", "0.5179077", "0.51772344", "0.5148525", "0.5137627", "0.51180065", "0.510973" ]
0.6762838
2
This function evaluates an XPath expression against the DOM tree of the XML document and returns a text result. It is useful for getting attributes and text values.
function getSimpleText(path) { // For Internet Explorer, use the following... if (window.ActiveXObject) { var node = xmlDoc.selectSingleNode(path); return node.childNodes[0].nodeValue; } // For all other browsers, use the following... else { var snapshot = xmlDoc.evaluate(path, xmlDoc, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); return snapshot.snapshotItem(0).textContent; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processXPathExpression()\n{\n var xpathExpression = document.getElementById( \"inputField\" ).value;\n var result;\n outputHTML = \"\";\n\n if ( !doc.evaluate ) // Internet Explorer \n {\n result = doc.selectNodes( xpathExpression );\n\n for ( var i = 0; i < result.length; i++ )\n {\n outputHTML += \"<p>\" + result.item( i ).text + \"</p>\";\n } // end for\n } // end if\n else // other browsers\n {\n result = doc.evaluate( xpathExpression, doc, null, \n XPathResult.ORDERED_NODE_ITERATOR_TYPE, null );\n var current = result.iterateNext();\n\n while ( current ) \n {\n outputHTML += \"<p>\" + current.textContent + \"</p>\";\n current = result.iterateNext();\n } // end while\n } // end else\n\n displayHTML();\n} // end function processXPathExpression", "function getXPathResult(expr) {\n\treturn document.evaluate(expr, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n}", "function xpEval(xpathExpr) { return document.evaluate(xpathExpr, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); }", "function xpath(query){return document.evaluate(query, document, null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);}", "function xpath(query) {return document.evaluate(query, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);}", "fetchText(selector) {\n \n let text = '', elements = this.getElementsByXPath(selector);\n if (elements && elements.length) {\n Array.prototype.forEach.call(elements, function _forEach(element) {\n text += element.textContent || element.innerText || element.value || '';\n });\n }\n return text;\n }", "fetchText(selector) {\n \n let text = '', elements = this.getElementsByXPath(selector);\n if (elements && elements.length) {\n Array.prototype.forEach.call(elements, function _forEach(element) {\n text += element.textContent || element.innerText || element.value || '';\n });\n }\n return text;\n }", "function showResult(xmlDoc){\n /* TASK: Create a variable that shows the result of the function */\n\n var textToShow = \"\";\n\n /* TASK: Create a variable that stores the XPath path expression used to retrieve data */\n\n var path = \"/current_observation/*\";\n\n /*\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n TASK: Use evaluate() XPath function to get the node you want and store it in the \"nodes\" variable\n INFO: https://developer.mozilla.org/en-US/docs/Web/API/Document/evaluate\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n */\n\n var nodes = xmlDoc.evaluate(path, xmlDoc, null, XPathResult.ANY_TYPE, null);\n\n /* TASK: Use iterateNext() function to return the nodes from the specified path\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n INFO: (MDN): \"The XPathResult object returned is a node-set of matched nodes which will behave as an iterator,\n allowing us to access the individual nodes contained by using the iterateNext() method of the XPathResult.\n Once we have iterated over all of the individual matched nodes, iterateNext() will return null.\"\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n */\n\n var result = nodes.iterateNext();\n\n /* TASK: Loop through the nodes to return them all */\n\n while (result) {\n /* TASK: Retrieve the text from the current node and assign to the textToShow variable */\n textToShow += \"<tr><td>\" + result.textContent + \"</td></tr>\";\n result = nodes.iterateNext();\n }\n\n /* TASK: Insert the text to show into an HTML element with an id=\"weatherData\" */\n\n document.getElementById(\"weatherData\").innerHTML = textToShow;\n\n}", "function xpath(query) {\r\n return document.evaluate(query, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n}", "function xpath(query, root, type)\n{\n var res;\n try {\n res = document.evaluate(query, root, null, type, null);\n } catch (e) {\n debug(\"Failed to run an XPath query \\\"\" + query + \"\\\", got exception <\" + e.name + \">, error was: <\" + e.message + \">\");\n } finally {\n return res;\n }\n}", "function XPath(path) {\r\n\t\treturn document.evaluate(path, document, null,\r\n\t\t\tXPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\t}", "runXPath(xmlDoc, xpath, node) {\n return xmlDoc.evaluate(xpath, node, ns => {\n if (ns == \"tei\") return \"http://www.tei-c.org/ns/1.0\";\n });\n }", "getNodeValue() {}", "function xpath(path)\n {\n return document.evaluate(\n path, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\n }", "function evaluateXPath(aNode, aExpr) {var xpe = new XPathEvaluator();var nsResolver = xpe.createNSResolver(aNode.ownerDocument == null ? aNode.documentElement : aNode.ownerDocument.documentElement);var result = xpe.evaluate(aExpr, aNode, nsResolver, 0, null);var found = [];var res;while (res = result.iterateNext()){found.push(res);}return found;}", "function xpath(query) {\r\n return document.evaluate(query, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n}", "getElementByXPath(expression, scope) {\n scope = scope || document;\n let a = document.evaluate(expression, scope, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n if (a.snapshotLength > 0) {\n return a.snapshotItem(0);\n }\n }", "getElementByXPath(expression, scope) {\n scope = scope || document;\n let a = document.evaluate(expression, scope, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n if (a.snapshotLength > 0) {\n return a.snapshotItem(0);\n }\n }", "function evalXPath(expression, rootNode)\r\n {\r\n try\r\n {\r\n var xpathIterator = rootNode.ownerDocument.evaluate(\r\n expression,\r\n rootNode,\r\n null, // no namespace resolver\r\n XPathResult.ORDERED_NODE_ITERATOR_TYPE,\r\n null); // no existing results\r\n }\r\n catch (err)\r\n {\r\n GM_log(\"Error when evaluating XPath expression '\" + expression + \"'\" + \": \" + err);\r\n return null;\r\n }\r\n var results = [];\r\n\r\n // Convert result to JS array\r\n for (var xpathNode = xpathIterator.iterateNext();\r\n xpathNode;\r\n xpathNode = xpathIterator.iterateNext()) \r\n {\r\n results.push(xpathNode);\r\n }\r\n return results;\r\n }", "function xmlText(oNode)\r\n{\r\n\tif(oNode==null)return \"\";\r\n\r\n\tif(oNode.text)return oNode.text;\r\n if(typeof(oNode.textContent) != \"undefined\") return oNode.textContent; \r\n\tif(oNode.nodeValue && oNode.nodeValue!=\"\") return oNode.nodeValue;\r\n\tif(oNode.firstChild) \r\n\t{\r\n\t\treturn oNode.firstChild.nodeValue;\r\n\t}\r\n\t\r\n\treturn \"\";\r\n}", "function getNode(xpath,context,doc) {\r\n if( !doc ) doc = document;\r\n if( !context ) context = doc;\r\n return doc.evaluate(xpath,context,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null)\r\n .singleNodeValue;\r\n}", "function xpath(query) {\r\n return document.evaluate(\r\n query, \r\n document, \r\n null,\r\n XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, \r\n null\r\n );\r\n}", "function find(xpath, xpres){\n\t\tvar ret = document.evaluate(xpath, document, null, xpres, null);\n\t\treturn xpres == XPFirst ? ret.singleNodeValue : ret;\n\t}", "function getText(domObject, value) {\n var text = null;\n try {\n switch (domObject) {\n case \"id\":\n text = document.getElementById(value).innerHTML;\n console.log(\"status pass : Inner Text = \", text);\n break;\n case \"class\":\n text = document.getElementsByClassName(value).innerHTML;\n console.log(\"status pass : Inner Text = \", text);\n break;\n case \"xpath\":\n var iterator = document.evaluate(value,\n document, null, XPathResult.ANY_TYPE, null);\n try {\n var thisNode = iterator.iterateNext();\n text = thisNode.innerHTML;\n } catch (e) {\n console.log('Error: Document tree modified during iteration ' + e);\n }\n console.log(\"status pass : Inner Text = \", text);\n break;\n case \"css\":\n document.getElementById(value).click(); //ToDo-must impliment\n console.log(\"status pass : button clicked\", domObject, value);\n break;\n case \"tag\":\n document.getElementById(value).click(); //ToDo-much more detailed implimentation\n console.log(\"status pass : button clicked\", domObject, value);\n break;\n default:\n console.log(\"status fail : domObject type not supported\");\n }\n } catch (err) {\n console.log(err);\n }\n return text;\n}", "function getFirstXPathResult(expr){\r\n var node = (arguments[1])? arguments[1]: document;\r\n var res = document.evaluate(expr, node, null,\r\n XPathResult.FIRST_ORDERED_NODE_TYPE, null);\r\n return res.singleNodeValue;\r\n}", "function xpath(query) {\r\n\treturn document.evaluate(query, document, null,\r\n\t\tXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n}", "function evalXPath (XPath, onTop) {\r\n\t\r\n\tif (onTop) {\r\n\t\tXPathNode = top. document. evaluate(XPath, top. document, null,\r\n\t\t\tXPathResult. ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\t\treturn XPathNode. snapshotItem(0);\r\n\t} else {\r\n\t\tXPathNode = document. evaluate(XPath, document, null,\r\n\t\t\tXPathResult. ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\t\treturn XPathNode. snapshotItem(0);\r\n\t}\r\n\t\r\n}", "function evaluateXpath(docObj, xpathExpression, contextNode, resultType, resultObj)\r\n{\r\n LOG.debug(\"XPATH: \" + xpathExpression);\r\n if (contextNode && contextNode != docObj) {\r\n LOG.debug(\"XPATH Context: \" + contextNode.tagName);\r\n }\r\n var t = new IntervalTimer();\r\n\r\n try {\r\n var provided = (resultObj != null);\r\n var result = docObj.evaluate(\r\n xpathExpression\r\n , contextNode || docObj\r\n , null\r\n , resultType || XPathResult.ANY_TYPE\r\n , resultObj);\r\n if (provided)\r\n result = resultObj;\r\n }\r\n catch (err) {\r\n logStackTrace(err);\r\n throw err;\r\n }\r\n\r\n LOG.debug(t.getElapsed() + \"ms XPATH Result: \" + fmtXpathResultType(result));\r\n\r\n return result;\r\n}", "getText() {\n return this._node.__execute(() => this.element.getText());\n }", "function GetInnerText (node)\n{\n return (node.textContent || node.innerText || node.text) ;\n}", "function xpath(query, context) {\r\n\tcontext = context ? context : document;\r\n\t\r\n\treturn document.evaluate(query, context, null,\r\n\t\tXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n}", "function $x(xpath, contextNode, resultType) {\r\n var doc = selenium.browserbot.getDocument();\r\n // mozilla-specific, but can return any result type\r\n var result = evaluateXpath(doc, xpath, contextNode, resultType);\r\n // generic, but can only return node results\r\n// var result = selenium.browserbot.xpathEvaluator.selectNodes(doc, xpath, contextNode || doc, selenium.browserbot._namespaceResolver);\r\n switch (result.resultType) {\r\n case result.NUMBER_TYPE: return result.numberValue;\r\n case result.STRING_TYPE: return result.stringValue;\r\n case result.BOOLEAN_TYPE: return result.booleanValue;\r\n }\r\n return result.singleNodeValue;\r\n}", "function tf_GetNodeText(n)\r\n/*====================================================\r\n\t- returns text + text of child nodes of a node\r\n=====================================================*/\r\n{\r\n\tvar s = n.textContent || n.innerText || n.innerHTML.replace(/\\<[^<>]+>/g, '');\r\n\ts = s.replace(/^\\s+/, '').replace(/\\s+$/, '')/*.tf_Trim()*/;\r\n\treturn s.tf_Trim();\r\n}", "function evaluateXPath(aNode, aExpr) {\n var xpe = new xml.XPathEvaluator()\n , nsResolver = xpe.createNSResolver(\n aNode.ownerDocument == null\n ? aNode.documentElement\n : aNode.ownerDocument.documentElement\n )\n , result = xpe.evaluate(aExpr, aNode, nsResolver, 0, null)\n , found = []\n , res\n ;\n while (res = result.iterateNext())\n found.push(res);\n return found;\n }", "function xpEvalFirst(xpathExpr) { return document.evaluate(xpathExpr, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; }", "function ufEvalnode(path,document,node) {\r\n\tvar ret = document.evaluate(path,node,null,\r\n\t\t\tXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\treturn ret;\r\n\r\n}", "function getInnerText(node) {\n if (node==undefined) return \"\";\n var result = '';\n if (Node.TEXT_NODE == node.nodeType)\n\treturn node.nodeValue;\n if (Node.ELEMENT_NODE != node.nodeType)\n\treturn '';\n for (var index = 0; index < node.childNodes.length; ++index)\n\tresult += getInnerText(node.childNodes.item(index));\n return result;\n} // getInnerText", "function getElementByXpath (path) {\r\n return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\r\n}", "function getText(n) {\n switch (n.nodeType) {\n case 1: /* element */\n var s = \"\";\n for (var c = n.firstChild; c != null; c = c.nextSibling) {\n s += getText(c);\n }\n return s;\n case 2: /* attribute*/\n case 3: /* text */\n case 4: /* cdata */\n return n.nodeValue;\n default:\n return \"\";\n }\n }", "function $x(b,c){if(!c)c=document;var d=function(a){var o=document.createNSResolver(c)(a);\r\nreturn o?o:(document.contentType==\"text/html\")?\"\":\"http://www.w3.org/1999/xhtml\"}\r\nvar b=document.createExpression(b,d);var e=b.evaluate(c,XPathResult.ANY_TYPE,null);\r\nswitch(e.resultType){case XPathResult.STRING_TYPE:return e.stringValue;\r\ncase XPathResult.NUMBER_TYPE:return e.numberValue;case XPathResult.BOOLEAN_TYPE:return e.booleanValue;\r\ncase XPathResult.UNORDERED_NODE_ITERATOR_TYPE:{e=b.evaluate(c,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);\r\nvar f=[];for(var i=0,len=e.snapshotLength;i<len;i++){f.push(e.snapshotItem(i))}return f}}return null}", "function xpath(query, elem, returnAll){\n\tif(!elem) elem = document;\n\tif(!isFirefox() && elem!=document && query.charAt(0)!='.')\n\t\tquery = (query.charAt(0)=='/' ? '.' : './') + query;\n\n\tif(typeof(elem)=='string'){\n\t\tvar div = document.createElement('div');\n\t\tdiv.innerHTML = elem;\n\t\telem = div;\n\t}\n\tvar res = document.evaluate(query, elem, null, returnAll ? XPathResult.ORDERED_NODE_SNAPSHOT_TYPE : XPathResult.FIRST_ORDERED_NODE_TYPE, null);\n\tif(returnAll && !res.snapshotLength || !returnAll && !res.singleNodeValue) throw new Error('xpath: '+query);\n\n\tvar es_atributo = query.match(/@[\\w-]+$/);\n\tif(!returnAll){\n\t\tres = res.singleNodeValue;\n\t\t// if it is an attribute return the value, if not return the node\n\t\tif(es_atributo) return res.value;\n\t\treturn res;\n\t}\n\n\tvar arr = [];\n\tfor (var i = 0; i < res.snapshotLength; i++) arr.push(res.snapshotItem(i));\n\treturn arr;\n}", "function getNodeText(nodeElement)\n{\n if(!nodeElement)\n return null;\n if(typeof nodeElement===\"string\" || nodeElement instanceof String\n || typeof nodeElement===\"number\" || nodeElement instanceof Number)\n return nodeElement;\n return nodeElement.$\n}", "function evaluateXPath(aNode, aExpr) {\n var xpe = new XPathEvaluator();\n var nsResolver = xpe.createNSResolver(aNode.ownerDocument == null ?\n aNode.documentElement : aNode.ownerDocument.documentElement);\n var result = xpe.evaluate(aExpr, aNode, nsResolver, 0, null);\n var found = [];\n var res;\n while (res = result.iterateNext())\n found.push(res);\n return found;\n }", "function find(xpath, xpres, startnode)\n{\n\tif (!startnode) {startnode = document;}\n\tvar ret = document.evaluate(xpath, startnode, null, xpres, null);\n\tif (ret == null) return null;\n\treturn xpres == XPFirst ? ret.singleNodeValue : ret;\n}", "function getTextFromXML( oNode, deep ) {\r\n // alert(\"getTextFromXML( oNode, deep )\")\r\n var s = \"\";\r\n var nodes = oNode.childNodes;\r\n\r\n for (var i = 0; i < nodes.length; i++) {\r\n var node = nodes[i];\r\n\r\n if (node.nodeType == Node.TEXT_NODE) {\r\n s += node.data;\r\n } else if (deep == true && (node.nodeType == Node.ELEMENT_NODE || node.nodeType == Node.DOCUMENT_NODE\r\n || node.nodeType == Node.DOCUMENT_FRAGMENT_NODE)) {\r\n s += getTextFromXML(node, true);\r\n };\r\n }\r\n\r\n ;\r\n return s;\r\n}", "function x(path, d){\r\n\t\tif(!d) d=unsafeWindow;//document; // document is self.\r\n\t\treturn document.evaluate(path, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\t}", "function nodeVal(x) { if (x) {norm(x);} return x && x.firstChild && x.firstChild.nodeValue; }", "function getNodeText(node: Node) {\n let textContent = '';\n node.descendants(function (child: Node, pos: number, parent: Node) {\n if ('text' === child.type.name) {\n textContent = `${textContent}${child.text}`;\n }\n });\n return textContent;\n}", "function _getText(node) {\n\n if (node.nodeType === 3) {\n return node.data;\n }\n\n var txt = '';\n\n if (!!(node = node.firstChild)) do {\n txt += _getText(node);\n } while (!!(node = node.nextSibling));\n\n return txt;\n\n }", "function xpath(node, expr) {\r\n\tvar resultSet = document.evaluate(expr, node, null,\r\n\tXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\tvar found = [];\r\n\tvar res;\r\n\tfor (var i = 0; i < resultSet.snapshotLength; i++) {\r\n\t\tfound.push(resultSet.snapshotItem(i));\r\n\t}\r\n\treturn found;\r\n}", "function xmlNodeValue(domNode) {\n \n if (domNode.nodeType === 1) {\n return xmlInnerText(domNode);\n }\n return domNode.nodeValue;\n}", "function $g(xpath, xpres, startnode)\n{\n\tif (!startnode) {startnode = document;}\n\tvar ret = document.evaluate(xpath, startnode, null, xpres, null);\n\tif (ret == null) return null;\n\treturn xpres == XPFirst ? ret.singleNodeValue : ret;\n}", "function getElementByXPath(xpath)\n{\n var snapshotResults = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\n\n if (snapshotResults.snapshotLength != 1) {\n if (DEBUG) { \n GM_log(\"xpath=\" + xpath + \"; snapshotResults.snapshotLength=\" + snapshotResults.snapshotLength);\n }\n return undefined;\n }\n return snapshotResults.snapshotItem(0);\n}", "function getText$1(node) {\n if (Array.isArray(node))\n return node.map(getText$1).join(\"\");\n if (domhandler_1$5.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText$1(node.children);\n if (domhandler_1$5.isCDATA(node))\n return getText$1(node.children);\n if (domhandler_1$5.isText(node))\n return node.data;\n return \"\";\n}", "function getElementsByXpath(xPath) {\r\n\tvar elm = document.evaluate(xPath, document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);\r\n\treturn elm;\r\n}", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function getTextValue(el) {\n\ttry {\n\t\tvar i;\n\t\tvar s;\n\t\t\n\t\t// Find and concatenate the values of all text nodes contained within the element.\n\t\ts = \"\";\n\t\tfor (i = 0; i < el.childNodes.length; i++) \n\t\t\tif (el.childNodes[i].nodeType == 3) \n\t\t\t\ts += el.childNodes[i].nodeValue;\n\t\t\telse \n\t\t\t\tif (el.childNodes[i].nodeType == 1 &&\n\t\t\t\tel.childNodes[i].tagName == \"BR\") \n\t\t\t\t\ts += \" \";\n\t\t\t\telse \n\t\t\t\t\t// Use recursion to get text within sub-elements.\n\t\t\t\t\ts += getTextValue(el.childNodes[i]);\n//\t\talert(\"getTextValue(\"+el+\")...s = \"+ s);\n\t\treturn normalizeString(s);\n\t}\n\tcatch (error){\n\t\tshowErrorMessage(error.message, \"getTextValue(\"+el+\")\");\n\t}\n}", "function getByXPath (xp, par, singlenode, value, ordered) {\r\n if(!par) par = document;\r\n if(!singlenode) singlenode = 'array';\r\n ordered = (!ordered ? XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE : XPathResult.ORDERED_NODE_SNAPSHOT_TYPE); \r\n var ev = document.evaluate(xp, par, null, ordered, null);\r\n if(ev.snapshotLength) {\r\n if(singlenode=='singlenode'){\r\n ev = ev.snapshotItem(0);\r\n if(!value) return ev; // if value is not defined/requested then return as object/node\r\n var fret=null;\r\n switch(ev.nodeName.toLowerCase()){\r\n case 'a': \r\n fret= ev.href;\r\n break;\r\n case 'input': \r\n fret= ev.value;\r\n break;\r\n default: \r\n fret= (gvar.isBuggedChrome ? ev.value : ev.innerHTML);\r\n break;\r\n }\r\n return fret;\r\n }else{\r\n return ev; // this is set of snapshotItem\r\n }\r\n }else{\r\n return null;\r\n }\r\n}", "function $x(p, context) {\r\n if (!context) context = document;\r\n var i, arr = [], xpr = document.evaluate(p, context, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (i = 0; item = xpr.snapshotItem(i); i++) arr.push(item);\r\n return arr[0];\r\n}", "function lookup(str) {\n return document.evaluate(str,\n\t document,\n\t null,\n XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,\n\t null);\n}", "function getCourseName(path){\r\n var cc = document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.innerText;\r\n return cc.trim();\r\n\r\n}", "function $X (exp, context) {\r\n\t\tif (!context) context = document;\r\n\t\tvar resolver = function(prefix){\r\n\t\t\tvar o = document.createNSResolver(context)(prefix);\r\n\t\t\treturn o ? o : (document.contentType == \"text/html\") ? \"\" : \"http://www.w3.org/1999/xhtml\";\r\n\t\t}\r\n\t\tvar exp = document.createExpression(exp, resolver);\r\n\t\t\r\n\t\tvar result = exp.evaluate(context, XPathResult.ANY_TYPE, null);\r\n\t\tswitch(result.resultType){\r\n\t\t\tcase XPathResult.STRING_TYPE : return result.stringValue;\r\n\t\t\tcase XPathResult.NUMBER_TYPE : return result.numberValue;\r\n\t\t\tcase XPathResult.BOOLEAN_TYPE: return result.booleanValue;\r\n\t\t\tcase XPathResult.UNORDERED_NODE_ITERATOR_TYPE: {\r\n\t\t\t\tresult = exp.evaluate(context, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\t\t\t\tvar ret = [];\r\n\t\t\t\tfor(var i = 0, len = result.snapshotLength; i < len ; i++){\r\n\t\t\t\t\tret.push(result.snapshotItem(i));\r\n\t\t\t\t}\r\n\t\t\t\treturn ret;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "function getText(t) {\n if (t._children.length === 0)\n return undefined;\n var n = t._children[0];\n if (n._fTextNode)\n return n._text;\n throw new Error(\"Not a text node\");\n }", "function _x(str_Xpath) {\n var xresult = document.evaluate(str_Xpath, document, null, XPathResult.ANY_TYPE, null);\n var xnodes = [];\n var xres;\n while (xres = xresult.iterateNext()) {\n xnodes.push(xres);\n }\n\n return xnodes;\n}", "function get_text(elemento){\n\treturn elemento.textContent\n}", "function eval_xpath(xpath, inDocument, opts)\n{\n if (!opts) {\n var opts = {};\n }\n var contextNode = opts.contextNode\n ? opts.contextNode : inDocument;\n var namespaceResolver = opts.namespaceResolver\n ? opts.namespaceResolver : null;\n var xpathLibrary = opts.xpathLibrary\n ? opts.xpathLibrary : null;\n var allowNativeXpath = (opts.allowNativeXpath != undefined)\n ? opts.allowNativeXpath : true;\n var ignoreAttributesWithoutValue = (opts.ignoreAttributesWithoutValue != undefined)\n ? opts.ignoreAttributesWithoutValue : true;\n var returnOnFirstMatch = (opts.returnOnFirstMatch != undefined)\n ? opts.returnOnFirstMatch : false;\n\n // Trim any trailing \"/\": not valid xpath, and remains from attribute\n // locator.\n if (xpath.charAt(xpath.length - 1) == '/') {\n xpath = xpath.slice(0, -1);\n }\n // HUGE hack - remove namespace from xpath for IE\n if (browserVersion && browserVersion.isIE) {\n xpath = xpath.replace(/x:/g, '')\n }\n \n var nativeXpathAvailable = inDocument.evaluate;\n var useNativeXpath = allowNativeXpath && nativeXpathAvailable;\n var useDocumentEvaluate = useNativeXpath;\n\n // When using the new and faster javascript-xpath library,\n // we'll use the TestRunner's document object, not the App-Under-Test's document.\n // The new library only modifies the TestRunner document with the new \n // functionality.\n if (xpathLibrary == 'javascript-xpath' && !useNativeXpath) {\n documentForXpath = document;\n useDocumentEvaluate = true;\n } else {\n documentForXpath = inDocument;\n }\n var results = [];\n \n // this is either native xpath or javascript-xpath via TestRunner.evaluate \n if (useDocumentEvaluate) {\n try {\n // Regarding use of the second argument to document.evaluate():\n // http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/a59ce20639c74ba1/a9d9f53e88e5ebb5\n var xpathResult = documentForXpath\n .evaluate((contextNode == inDocument ? xpath : '.' + xpath),\n contextNode, namespaceResolver, 0, null);\n }\n catch (e) {\n throw new SeleniumError(\"Invalid xpath [1]: \" + extractExceptionMessage(e));\n }\n finally{\n if (xpathResult == null) {\n // If the result is null, we should still throw an Error.\n throw new SeleniumError(\"Invalid xpath [2]: \" + xpath); \n }\n }\n var result = xpathResult.iterateNext();\n while (result) {\n results.push(result);\n result = xpathResult.iterateNext();\n }\n return results;\n }\n\n // If not, fall back to slower JavaScript implementation\n // DGF set xpathdebug = true (using getEval, if you like) to turn on JS XPath debugging\n //xpathdebug = true;\n var context;\n if (contextNode == inDocument) {\n context = new ExprContext(inDocument);\n }\n else {\n // provide false values to get the default constructor values\n context = new ExprContext(contextNode, false, false,\n contextNode.parentNode);\n }\n context.setCaseInsensitive(true);\n context.setIgnoreAttributesWithoutValue(ignoreAttributesWithoutValue);\n context.setReturnOnFirstMatch(returnOnFirstMatch);\n var xpathObj;\n try {\n xpathObj = xpathParse(xpath);\n }\n catch (e) {\n throw new SeleniumError(\"Invalid xpath [3]: \" + extractExceptionMessage(e));\n }\n var xpathResult = xpathObj.evaluate(context);\n if (xpathResult && xpathResult.value) {\n for (var i = 0; i < xpathResult.value.length; ++i) {\n results.push(xpathResult.value[i]);\n }\n }\n return results;\n}", "function nodeText(node){\n\t\tvar str = node.textContent || node.innerHTML || node.innerText || '';\n\t\t\n\t\treturn str.trim();\n\t}", "function getText( elems ) {\n\tvar ret = \"\", elem;\n\n\tfor ( var i = 0; elems[i]; i++ ) {\n\t\telem = elems[i];\n\n\t\t// Get the text from text nodes and CDATA nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 4 ) {\n\t\t\tret += elem.nodeValue;\n\n\t\t// Traverse everything else, except comment nodes\n\t\t} else if ( elem.nodeType !== 8 ) {\n\t\t\tret += getText( elem.childNodes );\n\t\t}\n\t}\n\n\treturn ret;\n}", "function getText(node) {\n if (Array.isArray(node)) return node.map(getText).join(\"\");\n if (domhandler_1.isTag(node)) return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (domhandler_1.isCDATA(node)) return getText(node.children);\n if (domhandler_1.isText(node)) return node.data;\n return \"\";\n}", "static getTextFromNode(node){\n var out = \"\";\n if (node.type === \"tag\"){\n for (child of node.children){\n out += Article.getTextFromNode(child);\n }\n } else if (node.type === \"text\"){\n out += node.data;\n } else {\n console.warn(node);\n }\n\n return out;\n }", "function nodeVal(x) {\n if (x) { norm(x); }\n return (x && x.firstChild && x.firstChild.nodeValue) || '';\n }", "function x(path, d) {\r\n\t\tif (!d)\r\n\t\t\td = unsafeWindow;// document; // document is self.\r\n\t\treturn document.evaluate(path, document, null,\r\n\t\t\t\tXPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\t}", "function zXPath() {\n\n}", "function xpath_single_node(context_node, xpath) {\n return document.evaluate( \n xpath + '[1]', \n context_node, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null\n ).singleNodeValue;\n }", "function getCalculation() {\n return calculation.innerText;\n}", "function getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join(\"\");\n if (domhandler_1.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (domhandler_1.isCDATA(node))\n return getText(node.children);\n if (domhandler_1.isText(node))\n return node.data;\n return \"\";\n}", "function getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join(\"\");\n if (domhandler_1.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (domhandler_1.isCDATA(node))\n return getText(node.children);\n if (domhandler_1.isText(node))\n return node.data;\n return \"\";\n}", "function getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join(\"\");\n if (domhandler_1.isTag(node))\n return node.name === \"br\" ? \"\\n\" : getText(node.children);\n if (domhandler_1.isCDATA(node))\n return getText(node.children);\n if (domhandler_1.isText(node))\n return node.data;\n return \"\";\n}", "function $x( xpath, root ) {\r\n var doc = root ? root.evaluate ? root : root.ownerDocument : document, next;\r\n var got = doc.evaluate( xpath, root||doc, null, 0, null ), result = [];\r\n switch (got.resultType) {\r\n case got.STRING_TYPE:\r\n return got.stringValue;\r\n case got.NUMBER_TYPE:\r\n return got.numberValue;\r\n case got.BOOLEAN_TYPE:\r\n return got.booleanValue;\r\n default:\r\n while (next = got.iterateNext())\r\n\t\t\t\tresult.push(next);\r\n return result;\r\n }\r\n}", "function text(x) {\n return document.createTextNode(x);\n }", "getElementsByXPath(expression, scope) {\n scope = scope || document;\n let nodes = [];\n let a = document.evaluate(expression, scope, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n for (let i = 0; i < a.snapshotLength; i++) {\n nodes.push(a.snapshotItem(i));\n }\n return nodes;\n }", "getElementsByXPath(expression, scope) {\n scope = scope || document;\n let nodes = [];\n let a = document.evaluate(expression, scope, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n for (let i = 0; i < a.snapshotLength; i++) {\n nodes.push(a.snapshotItem(i));\n }\n return nodes;\n }", "function $X (exp, context) {\n context || (context = document);\n var expr = (context.ownerDocument || context).createExpression(exp, function (prefix) {\n return document.createNSResolver(context.documentElement || context).lookupNamespaceURI(prefix) ||\n context.namespaceURI || document.documentElement.namespaceURI || \"\";\n });\n \n var result = expr.evaluate(context, XPathResult.ANY_TYPE, null);\n switch (result.resultType) {\n case XPathResult.STRING_TYPE : return result.stringValue;\n case XPathResult.NUMBER_TYPE : return result.numberValue;\n case XPathResult.BOOLEAN_TYPE: return result.booleanValue;\n case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:\n // not ensure the order.\n var ret = [], i = null;\n while (i = result.iterateNext()) ret.push(i);\n return ret;\n }\n return null;\n}", "function extractText(node) {\n let text = '';\n\n if (node.type == 'tag') {\n for (var c = 0; c < node.children.length; c++) {\n text += extractText(node.children[c]);\n }\n }\n\n if (node.type == 'text') {\n text = node.data;\n }\n\n // Decode HTML\n text = entities.decode(text);\n // Strip HTML tags\n return text.replace(/(<([^>]+)>)/ig, '')\n .replace(/\\n/g, ' ')\n .replace(/\\r/g, ' ')\n .replace(/\\s+/g, ' ');\n}", "text(node) {\n let oldValue;\n const textContent = value => {\n if (oldValue !== value) {\n oldValue = value;\n const type = typeof value;\n if (type === 'object' && value) {\n if ('text' in value) {\n textContent(String(value.text));\n } else if ('any' in value) {\n textContent(value.any);\n } else if ('html' in value) {\n textContent([].concat(value.html).join(''));\n } else if ('length' in value) {\n textContent(slice.call(value).join(''));\n }\n } else if (type === 'function') {\n textContent(value(node));\n } else {\n node.textContent = value == null ? '' : value;\n }\n }\n };\n return textContent;\n }", "retriveText() {\n let exactText;\n let currentElement;\n if (!isNullOrUndefined(this.currentContextInfo) && this.currentContextInfo.element) {\n currentElement = this.currentContextInfo.element;\n exactText = this.currentContextInfo.element.text;\n this.viewer.selection.start = currentElement.start;\n this.viewer.selection.end = currentElement.end;\n }\n else {\n let startPosition = this.viewer.selection.start;\n let offset = startPosition.offset;\n let startIndex = 0;\n let startInlineObj = startPosition.currentWidget.getInline(offset, startIndex);\n currentElement = startInlineObj.element;\n exactText = startInlineObj.element.text;\n }\n return { 'text': exactText, 'element': currentElement };\n }", "function $x( xpath, root, type ) {\r\n var doc = root ? root.evaluate ? root : root.ownerDocument : document, next;\r\n var got = doc.evaluate( xpath, root||doc, null, type, null ), result = [];\r\n switch( got.resultType ) {\r\n case got.STRING_TYPE:\r\n return got.stringValue;\r\n case got.NUMBER_TYPE:\r\n return got.numberValue;\r\n case got.BOOLEAN_TYPE:\r\n return got.booleanValue;\r\n default:\r\n while( next = got.iterateNext() )\r\n\tresult.push( next );\r\n return result;\r\n }\r\n}", "function getFirstXPath(expr, node) {\r\n if (!node) node = document;\r\n var res = document.evaluate(expr, node, null,\r\n XPathResult.FIRST_ORDERED_NODE_TYPE, null);\r\n return res.singleNodeValue;\r\n}", "function getElementText (parent, localName, ns) {\n var el = _getFirstChildNS(parent, localName, ns);\n if (el === undefined) return undefined;\n return el.textContent;\n }", "getDirectText() {\n const html = this.getHTML();\n if (html.length === 0) {\n return '';\n }\n let text = '';\n const constructorName = this._node.constructor.name;\n const handler = new htmlParser.DomHandler(function (error, dom) {\n if (error) {\n throw new Error(`Error creating dom for direct text in ${constructorName}: ${error}\\n( ${this._pageElement.getSelector()} )`);\n }\n else {\n dom.forEach(node => {\n if (node.type === 'text') {\n text += node.data;\n }\n });\n }\n });\n const parser = new htmlParser.Parser(handler);\n parser.write(html);\n parser.end();\n return text;\n }", "getResult() {\n return document.getElementById(\"result\").innerText;\n }", "function $X (exp, context, resolver, result_type) {\n context || (context = document);\n var Doc = context.ownerDocument || context;\n var result = Doc.evaluate(exp, context, resolver, result_type || XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n if (result_type) return result;\n for (var i = 0, len = result.snapshotLength, res = new Array(len); i < len; i++) {\n res[i] = result.snapshotItem(i);\n }\n return res;\n }", "function getElementTextNS(prefix, local, parentElem, index) {\r\n// alert('entro');\r\n var result = \"\";\r\n if (prefix && isIE) {\r\n // IE/Windows way of handling namespaces\r\n result = parentElem.getElementsByTagName(prefix + \":\" + local)[index];\r\n } else {\r\n // the namespace versions of this method \r\n // (getElementsByTagNameNS()) operate\r\n // differently in Safari and Mozilla, but both\r\n // return value with just local name, provided \r\n // there aren't conflicts with non-namespace element\r\n // names\r\n// alert(' antes de result entro');\r\n result = parentElem.getElementsByTagName(local)[index];\r\n }\r\n if (result) {\r\n // get text, accounting for possible\r\n // whitespace (carriage return) text nodes \r\n if (result.childNodes.length > 1) {\r\n return result.childNodes[1].nodeValue;\r\n } else {\r\n return result.firstChild.nodeValue; \r\n }\r\n } else {\r\n return \"n/a\";\r\n }\r\n}", "function xpath(query, element) {\n var element = (element == null) ? document : element;\n return document.evaluate(query, element, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n}", "function getTextValueOfChild (node) {\n var str\n visitChildren ( \n node,\n function (x){str=x.nodeValue},\n Node.TEXT_NODE\n )\n if (!str){\n str = \"\" \n }\n str = str.replace(/^\\s+/,\"\") \n return str.replace(/\\s+$/, \"\")\n}" ]
[ "0.7010888", "0.700598", "0.67159176", "0.667676", "0.6470711", "0.6457767", "0.6457767", "0.63161707", "0.62877893", "0.6223623", "0.6192896", "0.61636144", "0.61089784", "0.60836095", "0.60622966", "0.6021758", "0.60201186", "0.60201186", "0.5997133", "0.5987372", "0.59843713", "0.59723026", "0.5967792", "0.59507304", "0.59489137", "0.59360856", "0.5923477", "0.592096", "0.591742", "0.5865358", "0.583678", "0.5821009", "0.58074963", "0.5778002", "0.5776621", "0.57478845", "0.57134026", "0.57088274", "0.57004136", "0.56942326", "0.5681116", "0.5666642", "0.56314105", "0.56249046", "0.56230867", "0.56139576", "0.5611835", "0.5609313", "0.5604179", "0.5588344", "0.5573706", "0.55710334", "0.5563349", "0.55322284", "0.5527522", "0.5479075", "0.5479075", "0.5479075", "0.5479075", "0.5479075", "0.5479075", "0.54739094", "0.5469725", "0.5469179", "0.54662627", "0.54609704", "0.54331774", "0.5432896", "0.54295516", "0.54241914", "0.5408596", "0.5403586", "0.5394276", "0.5383057", "0.5380397", "0.5370357", "0.53694963", "0.53582", "0.53499144", "0.5326425", "0.53214806", "0.53214806", "0.53214806", "0.53166074", "0.53160965", "0.53105795", "0.53105795", "0.5299569", "0.529521", "0.527949", "0.52727723", "0.5268386", "0.5264298", "0.52531713", "0.5252643", "0.5247651", "0.5240783", "0.52342606", "0.5233172", "0.52310205" ]
0.65196395
4
creates variable d, and queries the text box with id "totalDueBox"
function changeTitle(){ a.textContent = 'Order North Georgia Coffee';// runs the method "textContent" on variable a, setting the header to "Order North Georgia Coffee" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function totalnoinhousehold () {\n var totalno =\n parseInt($(editemployer + '#adult').val(), 10) +\n parseInt($(editemployer + '#teenager').val(), 10) +\n parseInt($(editemployer + '#children').val(), 10) +\n parseInt($(editemployer + '#infant').val(), 10) +\n parseInt($(editemployer + '#elderly').val(), 10) +\n parseInt($(editemployer + '#disabled').val(), 10)\n $('.totalnoinhousehold').text(totalno)\n }", "function calc_dl() {\r\n var one = Number(document.getElementById(\"dl_revenue_dl8\").value);\r\n var two = Number(document.getElementById(\"dl_revenue_dl9\").value); \r\n var three = Number(document.getElementById(\"dl_revenue_dl10\").value);\r\n var four = Number(document.getElementById(\"dl_revenue_dl11\").value); \r\n \r\n\r\n document.getElementById(\"dl_revenue\").value = one + two + three + four;\r\n}", "function updateTotalField(totalFieldId, inputAmount) {\n // debugger;\n //get current deposite\n const totalField = document.getElementById(totalFieldId);\n const pretotal = parseFloat(totalField.innerText);\n //get updated deposite\n totalField.innerText = pretotal + inputAmount;\n}", "function upDataAmount(currentAmountId, enteredAmountNumber) {\n const currentAmount = document.getElementById(currentAmountId).innerText;\n const currentAmountNumber = parseFloat(currentAmount);\n const total = enteredAmountNumber + currentAmountNumber;\n document.getElementById(currentAmountId).innerText = total;\n}", "function dosageCalc(){\n let duration = $('.duration').val()\n let frequency = $('.frequency').val()\n let time = $('.time').val()\n\n let dosage = duration * frequency * time\n $('.quantity').val(dosage)\n $('.iquantity').val(dosage)\n}", "function collectAnswer(){\n var onesD = Number($(\"td#onesD > span\").text());\n var tensD = Number($(\"td#tensD > span\").text()) *10;\n var hndsD = Number($(\"td#hndsD > span\").text()) *100;\n var thdsD = Number($(\"td#thdsD > span\").text()) *1000;\n var tthdsD = Number($(\"td#tthdsD > span\").text()) *10000;\n var hthdsD = Number($(\"td#hthdsD > span\").text()) *100000;\n var totalD = onesD+tensD+hndsD+thdsD+tthdsD+hthdsD;\n return{\n totalD: totalD\n };\n}", "function totalDonation(){\n\tdocument.frmMembRegi.totDonaAmt.value=0;\n\tsum=0;\n\t//sum=Number(document.frmMembRegi.amount_txt.value)+sum;\n\tfinalVal = 0;\n\tchbxnum2=document.frmMembRegi.donCbxCt.value;\n //alert(chbxnum2);\n\tfor(i=0;i<chbxnum2;i++)\n\t{ chbxname = \"donCb\"+i;\n\t txtname=\"donTb\"+i;\n\t //alert(chbxname); \n\t if(document.getElementById(''+chbxname).checked)\n\t { \t \t \n\t var txtval= document.getElementById(''+txtname).value;\n\t\t if(isnotIntegerDecimal(txtval) == false)\n\t\t {\n\t \tsum= Number(txtval) +sum;\n\t\t\tfinalVal = sum;\n\t\t }\n\t\t else\n\t\t {\n\t\t\talert(\"Enter a valid Donation Amount\");\n\t\t\tdocument.getElementById(''+txtname).focus();\n\t\t\treturn false;\n\t\t }\n\t }\n\t}\n\t//alert(\"finalVal :\"+finalVal);\n\tdocument.frmMembRegi.totDonaAmt.value=finalVal;\n}", "function totalCalculate(){\n const firstClassCount = getInput('firstClassTicket');\n const economyClassCount = getInput('economyClassTicket');\n var totalTicket = firstClassCount + economyClassCount;\n const totalPrice = firstClassCount * 150 + economyClassCount * 100;\n document.getElementById('subTotal').innerText = '$' + totalPrice;\n const tax = Math.round(totalPrice * 0.1);\n document.getElementById('tax-amount').innerText = '$' + tax;\n const grandTotal = totalPrice + tax;\n document.getElementById('grand-total').innerText = '$' + grandTotal;\n document.getElementById('firstClassQuantity').innerText = firstClassCount;\n document.getElementById('firstClassPrice').innerText ='$' + firstClassCount * 150;\n document.getElementById('economyClassQuantity').innerText = economyClassCount;\n document.getElementById('economyClassPrice').innerText ='$' + economyClassCount * 100;\n document.getElementById('totalTicket').innerText = totalTicket;\n document.getElementById('totalTicketPrice').innerText ='$' + totalPrice;\n}", "function calculatTotal(){\n const ticketCount = getInputValue(\"first-class-count\");\n const economyCount = getInputValue(\"economy-count\");\n const totalPrice = ticketCount * 150 + economyCount * 100;\n elementId(\"total-price\").innerText = '$' + totalPrice;\n const vat = totalPrice * .1;\n elementId(\"vat\").innerText = \"$\" + vat;\n const grandTotal = totalPrice + vat;\n elementId(\"grandTotal\").innerText = \"$\" + grandTotal;\n}", "function Installment(){\n var terms=parseInt($(\"#terms\").val());\n var Amount=parseFloat($(\"#total_amount\").val());\n var InstalAmnt= Amount/terms;\n var objPrefix=\"RDates\";\n \n $(\"#instal_amnt\").val(InstalAmnt.toFixed(2));\n \n if(!$.isNumeric($(\"#instal_amnt\").val())){$(\"#instal_amnt\").val('0.00')\n }else{\n //create object on demand\n $(\"#CreateObj\").html(ObjOnReq('text',objPrefix,terms));\n //process the reading date of the concessionair specified\n var form_values=$(\"#form1\").serialize();\n //alert(\"form_values=\"+form_values);\n $.ajax({\n type: \"POST\",\n url: \"ajax-actions.php\",\n data: form_values + \"&misc=\" + \"getlastreadingdates\"\n }).done(function( result ) {\n var iterate,arrData,arrLen,arrSplit;\n arrData=$.parseJSON( result )\n iterate=0;\n //enter the reading dates to each text box created\n $.each(arrData,function(index,values){\n $(\"#\" + objPrefix + iterate).attr('value',values);\n iterate=iterate + 1;\n })\n });\n } \n //FillValues('text','sample',terms);\n}", "function updateTotalField(total, todayDeposit){\n const balancdText = document.getElementById(total);\n const balanceReceived = balancdText.innerText;\n const balanceAmount = parseFloat(balanceReceived);\n const totalBalance = balanceAmount + todayDeposit;\n balancdText.innerText = totalBalance;\n // const totalDepost = depostBalance +\n // return totalBalance;\n}", "function sumarCantidad(){\n\t\tvar cantidadActual;\n\t\tvar cantidadIngresada;\n\t\tif($('#cantidad').val() == ''){\n\t\t\tcantidadIngresada=0;\n\t\t}else{\n\t\t\tcantidadIngresada = parseInt($('#cantidad').val());\n\t\t}\n\t\tif($('#cantidadActual').val()==''){\n\t\t\tcantidadActual = 0;\n\t\t}else{\n\t\t\tcantidadActual = parseInt($('#cantidadActual').val());\n\t\t}\n\t\tvar total = $('#cantidadTotal').val((cantidadActual + cantidadIngresada));\n }", "function calculateFairTotal(){\r\n\tvar box_1 = 0.00;\r\n\tvar box_2 = 0.00;\r\n\tvar box_3 = 0.00;\r\n\tvar box_4 = 0.00;\r\n\tvar box_5 = 0.00;\r\n\tvar box_6 = 0.00;\r\n\tvar box_7 = 0.00;\r\n\tif($(\"#txtRent\").val() != ''){\r\n\t\tbox_1 = parseFloat($(\"#txtRent\").val());\r\n\t}\r\n\tif($(\"#txtWaterBill\").val() != ''){\r\n\t\tbox_2 = parseFloat($(\"#txtWaterBill\").val());\r\n\t}\r\n\tif($(\"#txtElectricBill\").val() != ''){\r\n\t\tbox_3 = parseFloat($(\"#txtElectricBill\").val());\r\n\t}\r\n\tif($(\"#txtGasBill\").val() != ''){\r\n\t\tbox_4 = parseFloat($(\"#txtGasBill\").val());\r\n\t}\r\n\tif($(\"#txtSecurityBill\").val() != ''){\r\n\t\tbox_5 = parseFloat($(\"#txtSecurityBill\").val());\r\n\t}\r\n\tif($(\"#txtUtilityBill\").val() != ''){\r\n\t\tbox_6 = parseFloat($(\"#txtUtilityBill\").val());\r\n\t}\r\n\tif($(\"#txtOtherBill\").val() != ''){\r\n\t\tbox_7 = parseFloat($(\"#txtOtherBill\").val());\r\n\t}\r\n\tvar total = parseFloat(box_1 + box_2 + box_3 + box_4 + box_5 + box_6 + box_7);\r\n\ttotal = total.toFixed(2);\r\n\t$(\"#txtTotalRent\").val(total);\r\n\t$(\"#hdnTotal\").val(total);\r\n}", "function calculateFairTotal1(){\r\n\tvar box_2 = 0.00;\r\n\tvar box_3 = 0.00;\r\n\tvar box_4 = 0.00;\r\n\tvar box_5 = 0.00;\r\n\tvar box_6 = 0.00;\r\n\tvar box_7 = 0.00;\r\n\tif($(\"#txtWaterBill\").val() != ''){\r\n\t\tbox_2 = parseFloat($(\"#txtWaterBill\").val());\r\n\t}\r\n\tif($(\"#txtElectricBill\").val() != ''){\r\n\t\tbox_3 = parseFloat($(\"#txtElectricBill\").val());\r\n\t}\r\n\tif($(\"#txtGasBill\").val() != ''){\r\n\t\tbox_4 = parseFloat($(\"#txtGasBill\").val());\r\n\t}\r\n\tif($(\"#txtSecurityBill\").val() != ''){\r\n\t\tbox_5 = parseFloat($(\"#txtSecurityBill\").val());\r\n\t}\r\n\tif($(\"#txtUtilityBill\").val() != ''){\r\n\t\tbox_6 = parseFloat($(\"#txtUtilityBill\").val());\r\n\t}\r\n\tif($(\"#txtOtherBill\").val() != ''){\r\n\t\tbox_7 = parseFloat($(\"#txtOtherBill\").val());\r\n\t}\r\n\tvar total = parseFloat(box_2 + box_3 + box_4 + box_5 + box_6 + box_7);\r\n\ttotal = total.toFixed(2);\r\n\t$(\"#txtTotalRent\").val(total);\r\n\t$(\"#hdnTotal\").val(total);\r\n}", "function actualizoTotales() {\r\n var costoDeEnvio = 0;\r\n importeTotal = 0;\r\n costoDeEnvio = $(\"input[name='opcion']:checked\").val() * $(\"#productCostText\").text();\r\n importeTotal = costoDeEnvio + parseFloat($(\"#productCostText\").text());\r\n document.getElementById(\"comissionText\").innerHTML = costoDeEnvio.toFixed(0);\r\n document.getElementById(\"totalCostText\").innerHTML = importeTotal.toFixed(0);\r\n }", "function makeDebitDialog(id){\n\t$(\"body\").append(\"<div id='debitForm\"+id+\"' class='debitDiv'><h2>Debit</h2><form id='debit-form-form'><label>Total:</label>\"+currencyStmbol+\"<input id='debitTotalDollarsEntered' type='number' step='1' value='0' min='0'/>.<input id='debitTotalCentsEntered' type='number' step='1' value='0' min='0' max='99'/><label>Debit To:</label><input type='text' id='debitFromEntered'/><label>Notes:</label><textarea rows='4' cols='20' id='debitNotesEntered'/><label>Date:</label><input type='date' id='debitDateEntered'/></form></div>\");\n}", "function getUserBudgetInput(){\n // Checking to see if function is being called\n console.log( 'in getUserBudgetInput function' );\n // targeting user's inputs with the DOM and creating a variable\n payrollBudget = $( '#payrollBudgetInput' ).val();\n // making the user's inputs a rounded number\n payrollBudget = Math.round(payrollBudget)\n console.log(payrollBudget);\n // clear the input fields\n $( '#payrollBudgetInput' ).val('');\n // // appending the DOM with the user's input\n // // empty what is there\n $( '.budgetOutput' ).empty();\n $( '.budgetOutput' ).append(`\n <h3>Monthly Payroll Budget: ${payrollBudget.toLocaleString('en-EN', {style: 'currency', currency: 'USD'})}</h3>\n `)\n hightlightRed();\n console.log(payrollBudget)\n console.log(totalSpend);\n}", "function totalDue() {\n\tconsole.log(\"Adding Bills\");\n\n\t$.get(\"/totalPayments\", function(data) {\n\t\tconsole.log(\"Back from the server with: \" );\n\t\tconsole.log(data);\n\n var total = data.results.sum[0].sum;\n \n \n $(\"#tableTotalDue\").append(\"<tr><th>Total Monthly Payments</th></tr>\");\n\n\t\t$(\"#tableTotalDue\").append(\"<tr><td>\" + total + \"</td></tr>\");\n });\n \n }", "function planPrem(){\n console.log('standard plan')\n var $prem = $('#Recommended').val();\n console.log($prem)\n var $premElevCost = 12345;\n console.log($premElevCost)\n//showing the $std to the 'Cost by elevators' case plus $\n$('#elevatorCost').val($premElevCost.toFixed(2));\ndocument.getElementById('elevatorCost').value = document.getElementById('elevatorCost').value + '$';\n\nvar $premInstall = parseInt($prem * 12345);\nconsole.log($premInstall)\n $premFee = ($premInstall * 0.13);\n $premTotal = ($premInstall + $premFee);\n\n//showing the $premInstall to the 'Total cost for elevators' case plus $\n$('#totalElevators').val($premInstall.toFixed(2));\ndocument.getElementById('totalElevators').innerHtml = $premInstall + '$';\n\n\n//showing the $premFee to the 'Install Fee' case plus $\n$('#installFee').val($premFee.toFixed(2));\ndocument.getElementById('installFee').innerHTML = $premFee + '$';\n\n//showing the $premTotal to the 'Total ' case plus $\n$('#total').val($premTotal.toFixed(2));\ndocument.getElementById('total').innerHTML = $premTotal + '$';\n\n\n}", "function totalCalculation() {\n const firstClassTicketCount = getTicketInput('firstClass');\n const economyTicketCount = getTicketInput('economy');\n const subTotal = firstClassTicketCount * 150 + economyTicketCount * 100;\n document.getElementById('subTotal').innerText = subTotal;\n const vat = subTotal / 10;\n document.getElementById('vat').innerText = vat;\n const total = subTotal + vat;\n document.getElementById('total').innerText = total;\n document.getElementById('confirmAmount').innerText = total;\n}", "function planEx(){\n console.log('excelium plan')\n var $ex = $('#Recommended').val();\n console.log($ex)\n var $exElevCost = 15400;\n console.log($exElevCost)\n//showing the $std to the 'Cost by elevators' case plus $\n$('#elevatorCost').val($exElevCost.toFixed(2));\ndocument.getElementById('elevatorCost').value = document.getElementById('elevatorCost').value;\n\nvar $exInstall = parseInt($ex * 15400);\nconsole.log($exInstall)\n $exFee = ($exInstall * 0.16);\n $exTotal = ($exInstall + $exFee);\n\n//showing the $premInstall to the 'Total cost for elevators' case \n$('#totalElevators').val($exInstall.toFixed(2));\ndocument.getElementById('totalElevators').innerHtml = $exInstall;\n\n\n//showing the $premFee to the 'Install Fee' case plus $\n$('#installFee').val($exFee.toFixed(2));\ndocument.getElementById('installFee').innerHTML = $exFee + '$';\n\n//showing the $premTotal to the 'Total ' case plus $\n$('#total').val($exTotal.toFixed(2));\ndocument.getElementById('total').innerHTML = $exTotal + '$';\n\n\n\n\n}", "function incTotal(total) {\n var t = document.getElementById(\"total\").innerHTML;\n t = parseFloat(t) + parseFloat(total);\n document.getElementById(\"total\").innerHTML = parseFloat(t).toFixed(2);\n document.getElementById(\"totalWindow\").innerHTML = parseFloat(t).toFixed(2);\n\n var paid = $('#paidInput').val() == '' ? '___' : $('#paidInput').val();\n var total = document.getElementById(\"total\").innerHTML;\n var required = total - paid;\n $('#required').html(parseFloat(required).toFixed(2));\n $('#requiredWindow').html(parseFloat(required).toFixed(2));\n}", "function getTotal() {\n const firstClassCount = getInputValue('firstClass');\n const economyCount = getInputValue('economy');\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('subTotalAmount').innerText = subTotal;\n\n const vat = subTotal * 0.1;\n const total = subTotal + vat;\n document.getElementById('vatAmount').innerText = vat;\n document.getElementById('totalAmount').innerText = total;\n}", "static displayBudget() {\n const calced = Store.getBudget();\n document.getElementById(\"budgetDisplay\").innerHTML = \"$\" + calced;\n }", "function submitBudget() {\n //get previous budget \n let previous_budget = document.querySelector(\"#total-budget span\").innerHTML;\n //get entered budget\n let budget = document.querySelector(\".budget\").value;\n if (budget == \"\" || budget == 0) {\n alert(\"Please enter your budget!!\")\n } else {\n //get total budget\n let total_budget = document.querySelector(\"#total-budget span\");\n //set total budget\n total_budget.innerHTML = parseInt(budget);\n //set remaining budget\n document.querySelector(\"#remaining-budget span\").innerHTML = parseInt(budget) - parseInt(previous_budget);\n }\n}", "function calcBudget() {\n inputStatusCheck();\n const persons = Number(inputPerson.value);\n const budgetPerPerson = Number(inputBudget.value);\n budgetTotal.innerHTML = multiply(persons, budgetPerPerson);\n}", "function textField(textFieldId, parsingNewDepositAmountValue){\n const currentDepositText = document.getElementById(textFieldId)\n const currentDepositTextValue = currentDepositText.innerText\n const parsingCurrentDepositTextValue = parseFloat(currentDepositTextValue)\n\n // Adding the current deposit amount with the update deposit amount\n const newUpdatedDepositText = parsingNewDepositAmountValue + parsingCurrentDepositTextValue\n\n // Assigning the new value of total deposit\n currentDepositText.innerText = newUpdatedDepositText\n}", "function Puntaje(combos,de_donde){\r\n if(combos==\"reset\"){\r\n $(de_donde).text(\"0\")\r\n }\r\n else{\r\n var Puntaje_actual = $(de_donde).text()\r\n var Total = Number(Puntaje_actual)+combos;\r\n $(de_donde).text(Total.toString())\r\n }\r\n}", "function planStd(){\n console.log('standard plan')\n var $std = $('#Recommended').val();\n console.log($std)\n var $stdElevCost = 7565;\n console.log($stdElevCost)\n//showing the $std to the 'Cost by elevators' case plus $\n$('#elevatorCost').val($stdElevCost.toFixed(2));\ndocument.getElementById('elevatorCost').value = document.getElementById('elevatorCost').value + '$';\n\nvar $stdInstall = parseInt($std * 7565);\nconsole.log($stdInstall)\n $stdFee = ($stdInstall * 0.1);\n $stdTotal = ($stdInstall + $stdFee);\n\n//showing the $stdInstall to the 'Total cost for elevators' case plus $\n$('#totalElevators').val($stdInstall.toFixed(2));\ndocument.getElementById('totalElevators').innerHtml = $stdInstall + '$';\n\n\n//showing the $stdFee to the 'Install Fee' case plus $\n$('#installFee').val($stdFee.toFixed(2));\ndocument.getElementById('installFee').innerHTML = $stdFee + '$';\n\n//showing the $stdTotal to the 'Total ' case plus $\n$('#total').val($stdTotal.toFixed(2));\ndocument.getElementById('total').innerHTML = $stdTotal + '$';\n\n\n}", "function computeb() {\n \n// stores the expenditure input labels to variables ie span text \n let text1 = $('span#first').text();\n let text2 = $('span#second').text();\n let text3 = $('span#third').text();\n let text4 = $('span#fourth').text();\n let text5 = $('span#fifth').text();\n let text6 = $('span#sixth').text();\n let text7 = $('span#seventh').text();\n \n// text8 is the label for the added custom budget \n if($('span#added').length == 0 && $('#expInput0').length == 0){\n text8 = \"Custom budget item not added\";\n expInput2num0 = 0;\n\n }else {\n expInput0 = $('.expInput0').val();\n // the below converts expenditure value to number\n expInput2num0 = Number(expInput0);\n text8 = $('span#added').text(); \n } \n \n \n \n const date = new Date();\n // gets value of total income input\n var income = document.getElementById(\"incomeinput\").value;\n\n // the below converts income value to number\n income2num = Number(income);\n\n\n // gets the value of savings input field\n savings = document.getElementById(\"savings\").value;\n\n // the below converts savings value to number\n savings2num = Number(savings);\n\n\n // selects individual expenditure input tags and gets their value\n\n // food\n expInput = document.getElementById(\"food\").value;\n\n // converts expInput to number\n expInput2num = Number(expInput);\n\n // clothing\n expInput2 = document.getElementById(\"clothing\").value;\n\n // converts expInput2 to number\n expInput2num2 = Number(expInput2);\n\n // shelter\n expInput3 = document.getElementById(\"shelter\").value;\n\n // converts expInput3 to number \n expInput2num3 = Number(expInput3);\n\n // transportation\n expInput4 = document.getElementById(\"transportation\").value;\n\n // converts expInput4 to number\n expInput2num4 = Number(expInput4);\n\n // electricity\n expInput5 = document.getElementById(\"electricity\").value;\n\n // converts expInput5 to number\n expInput2num5 = Number(expInput5);\n\n // water\n expInput6 = document.getElementById(\"water\").value;\n\n // converts expInput6 to number\n expInput2num6 = Number(expInput6);\n\n\n // miscellaneous\n expInput7 = document.getElementById(\"miscellaneous\").value;\n\n // converts expInput7 to number\n expInput2num7 = Number(expInput7);\n\n // END OF VALUE COLLECTION AND CONVERSION\n\n\n\n // CALCULATIONS\n\n // sum of all expenses\n let totalExpenses = expInput2num + expInput2num2 + expInput2num3 + expInput2num4 + expInput2num5 + expInput2num6 + expInput2num7 + expInput2num0;\n\n // sum of expenses and savings to give overall expenses\n let totalExpenses2 = totalExpenses + savings2num;\n // end of sum\n\n\n // differences\n\n // difference between income, savings and total expenses to get leftover income\n let leftOver = income2num - savings2num - totalExpenses;\n // end of differences\n\n // converts leftOver to positive number to be used for the 'additional sum' needed in an error report if income is not enough\n let leftOver2positive = Math.abs(leftOver);\n\n\n //Calculate percentage \n\n // percentage of savings\n let savingsPercentage = savings2num / income2num * 100;\n // converting the value to string and removing excess decimals\n savingsPercentage = String(savingsPercentage);\n savingsPercentage = savingsPercentage.slice(0, 5);\n // formular: expenditure amt/income * 100\n let percentage = expInput2num / income2num * 100;\n // converting the value to string and removing excess decimals\n percentage = String(percentage);\n percentage = percentage.slice(0, 5);\n\n let percentage2 = expInput2num2 / income2num * 100;\n // converting the value to string and removing excess decimals\n percentage2 = String(percentage2);\n percentage2 = percentage2.slice(0, 5);\n\n let percentage3 = expInput2num3 / income2num * 100;\n // converting the value to string and removing excess decimals\n percentage3 = String(percentage3);\n percentage3 = percentage3.slice(0, 5);\n\n let percentage4 = expInput2num4 / income2num * 100;\n // converting the value to string and removing excess decimals\n percentage4 = String(percentage4);\n percentage4 = percentage4.slice(0, 5);\n\n let percentage5 = expInput2num5 / income2num * 100;\n // converting the value to string and removing excess decimals\n percentage5 = String(percentage5);\n percentage5 = percentage5.slice(0, 5);\n\n let percentage6 = expInput2num6 / income2num * 100;\n // converting the value to string and removing excess decimals\n percentage6 = String(percentage6);\n percentage6 = percentage6.slice(0, 5);\n\n let percentage7 = expInput2num7 / income2num * 100;\n // converting the value to string and removing excess decimals\n percentage7 = String(percentage7);\n percentage7 = percentage7.slice(0, 5);\n \n// percentage8 refers to the added custom budget item's percentage\n let percentage8 = expInput2num0 / income2num * 100;\n // converting the value to string and removing excess decimals\n percentage8 = String(percentage8);\n percentage8 = percentage2.slice(0, 5);\n\n let totalPercentage = Number(percentage) + Number(percentage2) + Number(percentage3) + Number(percentage4) + Number(percentage5) + Number(percentage6) + Number(percentage7) + Number(percentage8);\n // converting the value to string and removing excess decimals\n totalPercentage = String(totalPercentage);\n totalPercentage = totalPercentage.slice(0, 5);\n\n // percentage of overall expenses\n let overallPercentage = totalExpenses2 / income2num * 100;\n // converting the value to string and removing excess decimals\n overallPercentage = String(overallPercentage);\n overallPercentage = overallPercentage.slice(0, 5);\n\n let leftOverPercentage = leftOver / income2num * 100;\n // converting the value to string and removing excess decimals\n leftOverPercentage = String(leftOverPercentage);\n leftOverPercentage = leftOverPercentage.slice(0, 5);\n\n // end of percentage calculation\n\n // END OF CALCULATIONS\n\n\n if (income2num == 0 || savings2num == 0) {\n\n\n errorstyle = document.getElementById(\"modal-bod\");\n errorstyle.style.color = \"red\";\n\n document.getElementById(\"modal-bod\").innerHTML = \"Error: 'Total Income' or 'Savings' field cannot be empty!\";\n\n // below hides share button on popup modal\n var hideb = document.getElementById(\"shareb\");\n hideb.classList.add(\"sharebut\");\n\n } else if (expInput2num == 0 && expInput2num2 == 0 && expInput2num3 == 0 && expInput2num4 == 0 && expInput2num5 == 0 && expInput2num6 == 0 && expInput2num7 == 0) {\n\n errorstyle = document.getElementById(\"modal-bod\");\n errorstyle.style.color = \"red\";\n\n document.getElementById(\"modal-bod\").innerHTML = \"Error: Expenditure data not given!\";\n\n //below hides share button if expenditure data not given\n document.getElementById(\"shareb\").classList.add(\"sharebut\");\n\n } else if (leftOver < 0) {\n\n //sets red color for error message text\n errorstyle = document.getElementById(\"modal-bod\");\n errorstyle.style.color = \"red\";\n\n // error message for when income is too low for budget\n document.getElementById(\"modal-bod\").innerHTML = \"Error: Not enough income to finance Budget!\" + \"<br>\" + \"An additional sum of #\" + leftOver2positive + \" or more is required.\";\n\n //below hides share button if income is too low for budget\n document.getElementById(\"shareb\").classList.add(\"sharebut\");\n\n\n } else {\n\n let xx = \" of total income\";\n\n //changes the modal body text color from red back to default\n modalBodyStyle = document.getElementById(\"modal-bod\");\n modalBodyStyle.style.color = \"grey\";\n\n //below makes share button visible again\n document.getElementById(\"shareb\").classList.remove(\"sharebut\");\n\n\n //stores the modal heading object in a variable\n budgetHeading = document.getElementById(\"exampleModalLongTitle\");\n\n //Updates and adds date to budget report heading \n budgetHeading.innerHTML = \"<b>\" + \"Current Budget:\" + \" \" + date;\n\n //stores modal body object in a variable\n budgetBody = document.getElementById(\"modal-bod\");\n\n //updates and posts budget report to modal body\n budgetBody.innerHTML = \"<b>\" + \"TOTAL INCOME: \" + \"#\" + income2num + \"<br>\" + \"Savings: \" + \"#\" + savings2num + \" \" + \"(\" + savingsPercentage + \"%\" + xx + \")\" + \"<br>\" + \"<br>\" + \"EXPENDITURES\" + \"<br>\" + \"<br>\" + text1 +\" \" + \"#\" + expInput2num + \" \" + \"(\" + percentage + \"%\" + xx + \")\" + \"<br>\" + text2 + \" \" + \"#\" + expInput2num2 + \" \" + \"(\" + percentage2 + \"%\" + xx + \")\" + \"<br>\" + text3 + \" \" + \"#\" + expInput2num3 + \" \" + \"(\" + percentage3 + \"%\" + xx + \")\" + \"<br>\" + text4 + \" \" + \"#\" + expInput2num4 + \" \" + \"(\" + percentage4 + \"%\" + xx + \")\" + \"<br>\" + text5 + \" \" + \"#\" + expInput2num5 + \" \" + \"(\" + percentage5 + \"%\" + xx + \")\" + \"<br>\" + text6 + \" \" + \"#\" + expInput2num6 + \" \" + \"(\" + percentage6 + \"%\" + xx + \")\" + \"<br>\" + text7 + \" \" + \"#\" + expInput2num7 + \" \" + \"(\" + percentage7 + \"%\" + xx + \")\" + \"<br>\" + text8 + \" \" + \"#\" + expInput2num0 + \" \" + \"(\" + percentage8 + \"%\" + xx + \")\" + \"<br>\" + \"Total Expenditure: \" + \"#\" + totalExpenses + \" \" + \"(\" + totalPercentage + \"%\" + xx + \")\" + \"<br>\" + \"Overall Total(including savings): \" + \"#\" + totalExpenses2 + \" \" + \"(\" + overallPercentage + \"%\" + xx + \")\" + \"<br>\" + \"<br>\" + \"Leftover Income: \" + \"#\" + leftOver + \" \" + \"(\" + leftOverPercentage + \"%\" + xx + \")\";\n\n //below stores budget history\n let historyContent = document.getElementById(\"modalId\");\n let storeHistory = [];\n historyContent.innerHTML += \"Date: \" + date + \"\\n\" + document.getElementById(\"modal-bod\").innerText + \"\\n\" + \"\\n\";\n storeHistory.push(historyContent.innerText);\n localStorage.setItem(\"storeHistory\", storeHistory);\n\n }\n\n}", "function update_total(amnt, summary_total) {\n var amount = document.getElementById(amnt).value\n var total = document.getElementById(summary_total)\n total.setAttribute('value', amount);\n}", "function make() {\n fourth = first + second + third;\n document.getElementById(\"demo\").innerHTML = (\"The Total is: \" + fourth);\n\n}", "function calcTotal(){\n var amount = document.querySelectorAll('#amount');\n var total_amount = 0;\n $(amount).each(function (key, value) {\n total_amount +=parseFloat($(value).val())\n });\n $('#total').val(total_amount);\n }", "function setAmount(){\r\n amountOfDie = inNumberOfDie.value;\r\n}", "function setAllInputAndTextAfterAllFinalCalculation()\n {\n $('.cr_totalAmount').text(getTotalAmount());\n $('.cr_subtotal_amount').text(\"(\"+getSubTotalByProductAmountAndQuantity()+\")\");\n $('.cr_discount_amount').text(\"(\"+getTotalDiscountAmount()+\")\");\n $('.cr_netTotalAmount').val(getTotalAmount());\n\n /* Selected Unit Name*/\n selectedUnitName();\n }", "function calculatePrice(){\r\n//\ttotalDueBox.value = numberOfBags*pricePerBag+salesTax+shipping;\r\nvar amount;\r\n\r\n\r\n//if the user selects 3 bags or more, take the shipping price off\r\nif (numberOfBags.value >=3){\r\n\tamount = numberOfBags.value *pricePerBag +numberOfBags.value *pricePerBag * salesTax;\r\n\r\n\r\n}\r\n//else keep the shipping price on\r\nelse {\r\n\tamount = numberOfBags.value *pricePerBag +numberOfBags.value *pricePerBag * salesTax +shipping;\r\n\r\n}\r\n\t\r\n\ttotalDueBox.value = amount;\r\n//\ttotalDueBox.value = (numberOfBags.val)*pricePerBag+salesTax+shipping;\r\n}", "function v(val) {\n\tdocument.getElementById(\"d\").value += val;\n}", "function getBudget()\n{\n\tbudget = parseInt(Math.floor(Math.random() * 15)+15);\n\tdocument.getElementById(\"budget\").disabled = true;\n\tdocument.getElementById(\"curBudget\").innerHTML = \"$\"+ budget;\n\t//document.getElementById(\"rollBudget\").disabled = true;\n}", "function getInput(){\n\n investmentValue = document.getElementById(\"number-1\").value;\n percentage = document.getElementById(\"number-2\").value;\n years = document.getElementById(\"number-3\").value;\n\t compound = document.getElementById(\"number-4\").value;\n\t additionalInvestment= document.getElementById(\"number-5\").value;\n }", "function updateExpectedCost() {\n\n var cost = Number(totalInvoicedBox.innerHTML || 0);\n\n // for any LI's that are not yet billed (i.e. filled in)\n // use the total expected cost for that lineitem.\n for(var id in widgetRegistry.acqie) {\n var entry = widgetRegistry.acqie[id]._object;\n if(!entry.isdeleted()) {\n if (Number(widgetRegistry.acqie[id].cost_billed.getFormattedValue()) == 0) {\n var li = entry.lineitem();\n cost += \n Number(li.order_summary().estimated_amount()) - \n Number(li.order_summary().paid_amount());\n }\n }\n }\n\n dojo.byId('acq-invoice-summary-cost').innerHTML = cost.toFixed(2);\n}", "function depositChecking(){\n console.log(\"deposit cliked\");\n console.log(checkingInput.val());\n var input = checkingInput.val();\n var amountForDeposit = parseInt(input);\n checkingBalance = checkingBalance + amountForDeposit;\n console.log(checkingBalance);\n checkingBalanceDiv.html(\"$\" + checkingBalance);\n }", "function displayTotal(inputed){\n document.getElementById(\"display\").value = inputed;\n}", "function adicionarItem(item) {\r\n\tvar quantidade = document.getElementById('quantidade' + item);\r\n\tvar total = document.getElementById('total' + item);\r\n\tqtd[item] += 1;\r\n\tvalorTotal[item] = valorProduto[item] * qtd[item];\r\n\tquantidade.innerHTML = qtd[item];\r\n\ttotal.innerHTML = valorTotal[item];\r\n\tconsole.log(quantidade);\r\n\tvalorCompra();\r\n}", "function addAmount(id, inputAmount) {\r\n\r\n let updateField = document.getElementById(id);\r\n let updateFieldValueStr = updateField.innerText;\r\n let updateFieldValue = parseInt(updateFieldValueStr);\r\n // sum of deposite\r\n let total = updateFieldValue + inputAmount;\r\n\r\n // update deposite\r\n updateField.innerText = total;\r\n}", "function dependentsDeduc(){\r\n \r\n var dep0 = document.getElementById('0'); // gets user input from form in html\r\n var dep1 = document.getElementById('1');\r\n var dep2 = document.getElementById('2');\r\n var dep3 = document.getElementById('3');\r\n var dep4 = document.getElementById('4');\r\n var total;\r\n\r\n if(dep0.checked==true){ // checks what choice has been selected by user\r\n total = 0;\r\n }\r\n else if(dep1.checked==true){\r\n total = 50000;\r\n }\r\n else if(dep2.checked==true){\r\n total = 2*50000;\r\n }\r\n else if(dep3.checked==true){\r\n total = 3*50000;\r\n }\r\n else if(dep4.checked==true){\r\n total = 4*50000;\r\n }\r\n \r\n return total; // returns value for dependents\r\n}", "function calculateTotalAndFinalTotal(initialTot, newMemCostNum, newStorageCostNum, newDeliveryCostNum) {\n\n let totalPrice = document.getElementById(\"total-price\");\n\n let finalTotalPrice = document.getElementById(\"final-total\");\n\n let newTotalPriceCostNumber = initialTot + newMemCostNum + newStorageCostNum + newDeliveryCostNum;\n totalPrice.innerText = newTotalPriceCostNumber;\n finalTotalPrice.innerText = newTotalPriceCostNumber;\n}", "function updateTotal(){\n const bestDaam = parseInt(bestPrice.innerText);\n const memoryDaam = parseInt(memoryCost.innerText);\n const storageDaam = parseInt(storageCost.innerText);\n const deliveryDaam = parseInt(deliveryCost.innerText);\n \n const grandTotal = bestDaam + memoryDaam + storageDaam + deliveryDaam ;\n\n totalPrice.innerText = grandTotal;\n\n newtotal.innerText = grandTotal;\n}", "function calcHireCost(){\n daysString = days.value;\n numDays = parseInt(daysString);\n hireCost = (selectedVehicle.cost) * numDays;\n }", "function CalItemTotal(){\r\n var qty = document.getElementById('txt_item_qty').value;\r\n var price = document.getElementById('txt_item_price').value;\r\n var disc = document.getElementById('txt_item_disc').value;\r\n var tax = document.getElementById('txt_item_tax').value;\r\n if(qty == 0 || qty == '' || isNaN(qty) == true || qty == null) {\r\n qty = 1;\r\n }\r\n price = CheckNumeric(price);\r\n disc = CheckNumeric(disc);\r\n if(eval(disc) > eval(price)) {\r\n document.getElementById('txt_item_disc').value = price;\r\n disc = price;\r\n }\r\n document.getElementById(\"item_tax\").innerHTML = parseFloat(((eval(price)-eval(disc))*tax/100)).toFixed(2);\r\n document.getElementById(\"item_total\").innerHTML = parseFloat(((eval(price)-eval(disc))*qty*tax/100)+((eval(price)-eval(disc))*qty)).toFixed(2);\r\n document.getElementById(\"txt_item_total\").value = parseFloat(((eval(price)-eval(disc))*qty*tax/100)+((eval(price)-eval(disc))*qty)).toFixed(2);\r\n}", "function CalItemTotal(){\r\n var qty = document.getElementById('txt_item_qty').value;\r\n var price = document.getElementById('txt_item_price').value;\r\n var disc = document.getElementById('txt_item_disc').value;\r\n var tax = document.getElementById('txt_item_tax').value;\r\n if(qty == 0 || qty == '' || isNaN(qty) == true || qty == null) {\r\n qty = 1;\r\n }\r\n price = CheckNumeric(price);\r\n disc = CheckNumeric(disc);\r\n if(eval(disc) > eval(price)) {\r\n document.getElementById('txt_item_disc').value = price;\r\n disc = price;\r\n }\r\n document.getElementById(\"item_tax\").innerHTML = parseFloat(((eval(price)-eval(disc))*tax/100)).toFixed(2);\r\n document.getElementById(\"item_total\").innerHTML = parseFloat(((eval(price)-eval(disc))*qty*tax/100)+((eval(price)-eval(disc))*qty)).toFixed(2);\r\n document.getElementById(\"txt_item_total\").value = parseFloat(((eval(price)-eval(disc))*qty*tax/100)+((eval(price)-eval(disc))*qty)).toFixed(2);\r\n}", "function updateUI(planet,total){\r\n const journeyCostInput = document.getElementById(planet + '-total')\r\n journeyCostInput.innerText = total\r\n}", "function sumTotal(){\r\n var sumTotal = 0;\r\n //On fait la somme\r\n $('#yes_facture').find('.input_payer').each(function(){\r\n sumTotal+= parseInt($(this).val());\r\n });\r\n //On modifie l'input somme\r\n $('.input_somme').val(sumTotal);\r\n }", "function calculateTotal() {\n const firstCount = getInputValue('first');\n const economyCount = getInputValue('economy');\n\n const totalPrice = firstCount * 150 + economyCount * 100;\n document.getElementById('total-price').innerText = totalPrice;\n\n const tax = totalPrice * 0.1;\n document.getElementById('tax-amount').innerText = tax;\n\n const finalTotal = totalPrice + tax;\n document.getElementById('final-total').innerText = finalTotal\n}", "function cal() {\n $(\"#tf\").empty();\n var ts = $(\"#ts\").val();\n var bt = $(\"#bt\").val();\n var sb = $(\"#sb\").val();\n var tip=(bt/sb) *ts;\n\n //if left blank or text entered then will send alert\n if (bt== \"\" || bt == null) {\n alert(\"Enter bill total!\");\n return false;}\n if (sb >=2){\n tip = (tip+(bt/sb));\n } \n //tip field \n$(\"#tf\").append(\"$\"+tip.toFixed(2)); \n}", "function updateTitalPrice(){\n const bestPrice=document.getElementById(\"best-price\");\n const bestPriceInner=parseInt(bestPrice.innerText);\n\n const memoryPrice=document.getElementById(\"memory-cost\");\n const memoryPriceInner=parseInt(memoryPrice.innerText);\n\n const storagePrice=document.getElementById(\"storage-cost\");\n const storagePriceInner=parseInt(storagePrice.innerText);\n\n const delivaryCost=document.getElementById(\"Delivery-charge\");\n const delivaryCostInner=parseInt(delivaryCost.innerText);\n\n const totalPrice=document.getElementById(\"total\");\n totalPrice.innerText=bestPriceInner+memoryPriceInner+storagePriceInner+delivaryCostInner;\n \n}", "function calculateTotal(){\n const phoneTotal=getInputValue('phone')*1219;\n const caseTotal=getInputValue('case')*59;\n const subTotal=phoneTotal+caseTotal;\n const tax=subTotal/10;\n const netTotal=subTotal+tax;\n //update on the html\n document.getElementById('sub-total').innerText=subTotal;\n document.getElementById('tax-amount').innerText=tax;\n document.getElementById('total-price').innerText=netTotal;\n}", "insertBudget(amt){\r\n\t\t// Insert into innerHTML\r\n\t\tbudgetTotal.innerHTML = `${amt}`;\r\n\t\tbudgetLeft.innerHTML = `${amt}`;\r\n\t}", "function finalTotalAmount() {\n //total cost\n totalCost.innerText = parseFloat(macCost.innerText) + parseFloat(memoryCost.innerText) + parseFloat(storageCost.innerText) + parseFloat(deliveryCost.innerText);\n //final amount\n finalAmount.innerText = parseFloat(totalCost.innerText);\n}", "function updateTotalField(totalFieldId, amount) {\n const totalElement = document.getElementById(totalFieldId);\n const prevTotal = parseFloat(totalElement.innerText);\n totalElement.innerText = prevTotal + amount;\n // console.log(depositTotalText);\n}", "function updateTotalValue() {\r\n\r\n const ramPrice = parseInt(document.getElementById('extra-memory-price').innerText);\r\n\r\n const storagePrice = parseInt(document.getElementById('extra-storage-price').innerText);\r\n\r\n const deliveryCharge = parseInt(document.getElementById('delivery=charge').innerText);\r\n\r\n const bestPrice = parseInt(document.getElementById('best-price').innerText);\r\n\r\n\r\n\r\n ////////////////////// Final Calculation ////////////////////////\r\n\r\n const totalValue = document.getElementById('total-price');\r\n totalValue.innerText = bestPrice + ramPrice + storagePrice + deliveryCharge;\r\n const finalPrice = document.getElementById('final-price');\r\n finalPrice.innerText = totalValue.innerText;\r\n\r\n\r\n}", "function callItem() {\n var miniCal = amountInput.value * qtyInput.value; \n subTotal.innerHTML = miniCal;\n}", "function init() {\r\n\tdocument.querySelector( \"#idCoupSum\" ).value = coupSum \t+ \" \" + mLang.get(\"savingqty\");\t\t// 장 적립\r\n\tdocument.querySelector( \"#idPointSum\" ).value = pointSum\t+ \" \" + mLang.get(\"savingpoint\");\t// 점 적립\r\n}", "function calculateTotal() {\n const firstClassCount = getInputValue('first-class');\n const economyCount = getInputValue('economy');\n\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('sub-total').innerText = '$' + subTotal;\n\n const vat = subTotal * 0.1;\n document.getElementById('vat').innerText = '$' + vat;\n\n const total = subTotal + vat;\n document.getElementById('total').innerText = '$' + total;\n}", "function frmFieldFillPer(){\n\tvar pers=0;\n\tif(totalReqFields>0){\n\t\tpers = ((totalEntered/totalReqFields)*100);\n\t}\n\telse{\n\t\tif(totalReqFields==totalReqFields){\n\t\t\tpers=100;\n\t\t}\n\t}\n\t\n\t$(\"#completed_per\").val(pers);\n\t//return pers;\n}", "function prepareFields(){\r\n var elems = getInputElementsToSumUp();\r\n for(var i=0; i<elems.length; i++){\r\n elems[i].onchange = function(){ return updateSumField(); }\r\n }\r\n updateSumField(); // initialize the text showing the sum\r\n}", "function purchaseFormFill(ordersValue, amountValue, period) {\n let descriptionVal = document.getElementsByClassName('total-val')[0];\n descriptionVal.innerHTML = period;\n let ordersAmount = document.getElementsByClassName('orders-val')[0];\n ordersAmount.innerHTML = ordersValue;\n ;\n let ordersText = document.getElementsByClassName('orders-text')[0];\n ordersText.innerHTML = 'Orders';\n let amount = document.getElementsByClassName('amount-val')[0];\n amount.innerHTML = '$' + amountValue.toFixed(2);\n let amountText = document.getElementsByClassName('amount-text')[0];\n amountText.innerHTML = 'Amount';\n}", "function updateTotal(value) {\n // Get the runningTotal from the DOM\n var totalLineItem = document.getElementById('total-line-item');\n\n // update the runningTotal value by adding our new value to it\n runningTotal += value;\n // Update the DOM with our new runningTotal to two decimal points\n totalLineItem.innerHTML = runningTotal.toFixed(2)+\"€\";\n\n // We're done now so clear the value from the input box\n clearForm();\n}", "afficherTotalPayer() {\r\n\r\n let elmH4 = document.createElement('h4');\r\n let elmH3 = document.createElement('h3');\r\n\r\n let texteContenu = this.total ;\r\n let titreTextContenu = \" Total : \" \r\n\r\n let texte = document.createTextNode(texteContenu);\r\n let titreTexte = document.createTextNode(titreTextContenu);\r\n\r\n elmH4.appendChild(texte);\r\n elmH3.appendChild(titreTexte);\r\n\r\n document.getElementById('iTotal').appendChild(elmH3);\r\n document.getElementById('iTotal').appendChild(elmH4);\r\n }", "calculateForm(){\n\t\tlet instance = this;\n\n\t\tif(instance.hasErrorInTheForm()) return;\n\t\t\n\t\tinstance.debt = instance.calculateDebt({\n\t\t\tamount: instance.calculatorData,\n\t\t\tinterest: instance.dropdownData.interest,\n\t\t\tmonths: instance.dropdownData.months\n\t\t});\n\n\t\tinstance.element.querySelector('#input-total').placeholder = `R$: ${instance.debt}`;\n\t\tinstance.element.querySelector('.get-quot').removeAttribute('disabled');\n\t}", "function GHOB_calculate_total(bedtype){\n\tvar present_val = document.getElementById(bedtype+\"_roomcount\").value;\n\tvar label_id = document.getElementById(bedtype+\"_total\");\n\tif((present_val!='')&&(GHOB_inst.isNumeric(present_val))){\n\t\tswitch(bedtype){\n\t\t\tcase 'singlebed':{ label_id.innerHTML = 'Total Beds:'+parseInt(present_val)*1; break; }\n\t\t\tcase 'doublebed':{ label_id.innerHTML = 'Total Beds:'+parseInt(present_val)*2; break; }\n\t\t\tcase 'triplebed':{ label_id.innerHTML = 'Total Beds:'+parseInt(present_val)*3; break; }\n\t\t}\n\t}else{\n\t\tif(present_val!=''){\n\t\t\talert('Please enter a numeric value in Number of room field');\n\t\t\tlabel_id.innerHTML = '';\n\t\t}\n\t}\n}", "function calculateTotal() {\n const fisrtClassTotalQuantity = document.getElementById('firstClass-ticket-quantity').value;\n const ecoClassTotalQuantity = document.getElementById('ecoClass-ticket-quantity').value;\n const totalPrice = fisrtClassTotalQuantity * 150 + ecoClassTotalQuantity * 100;\n\n document.getElementById('sub-total').innerText = ('$' + totalPrice);\n const vat = Math.round(totalPrice * .10);\n document.getElementById('vat').innerText = ('$' + vat);\n const grandTotal = totalPrice + vat;\n document.getElementById('grand-total').innerText = '$' + grandTotal;\n}", "function submitTotalTable(total = 0, burnedCalories = 0) {\n\t var goalRow = document.createElement('tr');\n\t goalRow.id = \"goal-calories\";\n\n\t var goalTd = document.createElement('td');\n\t goalTd.innerHTML = \"<strong>Goal Calories</strong>\";\n\n\t var goalTd2 = document.createElement('td');\n\t goalTd2.innerHTML = \"<strong>2000</strong>\";\n\n\t goalRow.appendChild(goalTd);\n\t goalRow.appendChild(goalTd2);\n\n\t var totalsTable = document.getElementById('totals');\n\t totalsTable.appendChild(goalRow);\n\t // calories consumed\n\t var consumedRow = document.createElement('tr');\n\t consumedRow.id = \"consumed-calories\";\n\n\t var consumeTd = document.createElement('td');\n\t consumeTd.innerHTML = \"<span><strong>Calories Consumed</strong>\";\n\n\t var consumeTd2 = document.createElement('td');\n\t consumeTd2.innerHTML = total;\n\t consumeTd2.id = \"cal-consumed\";\n\t consumedRow.appendChild(consumeTd);\n\t consumedRow.appendChild(consumeTd2);\n\n\t totalsTable.appendChild(consumedRow);\n\t // calories burned\n\t var burnedRow = document.createElement('tr');\n\t burnedRow.id = \"burned-calories\";\n\n\t var burnedTd = document.createElement('td');\n\t burnedTd.innerHTML = \"<strong>Calories Burned</strong>\";\n\n\t var burnedTd2 = document.createElement('td');\n\n\t if (burnedCalories > 0) {\n\t burnedTd2.innerHTML = \"<span id='remaining-green'>\" + burnedCalories + \"</span>\";\n\t } else {\n\t burnedTd2.innerHTML = \"<span id='remaining-black'>\" + burnedCalories + \"</span>\";\n\t }\n\n\t // burnedTd2.innerHTML = burnedCalories\n\n\t burnedRow.appendChild(burnedTd);\n\t burnedRow.appendChild(burnedTd2);\n\n\t totalsTable.appendChild(burnedRow);\n\t // remaining calories\n\t var remainingRow = document.createElement('tr');\n\t remainingRow.id = \"remaining-calories\";\n\n\t var remainingTd = document.createElement('td');\n\t remainingTd.innerHTML = \"<strong>Remaining Calories</strong>\";\n\n\t var remainingTd2 = document.createElement('td');\n\n\t var remainingCalories = 2000 - total + burnedCalories;\n\n\t if (remainingCalories < 0) {\n\t remainingTd2.innerHTML = \"<span id='remaining-red'>\" + remainingCalories + \"</span>\";\n\t } else {\n\t remainingTd2.innerHTML = \"<span id='remaining-green'>\" + remainingCalories + \"</span>\";\n\t }\n\n\t remainingRow.appendChild(remainingTd);\n\t remainingRow.appendChild(remainingTd2);\n\n\t totalsTable.appendChild(remainingRow);\n\t}", "function loadtotal() {\r\n\r\n\r\n $(\"#Subtotal\").val(Subtotal.toFixed(2));\r\n $(\"#Shipping\").val(Shipping.toFixed(2));\r\n $(\"#Tax\").val(Tax.toFixed(2));\r\n $(\"#Total\").val(Total.toFixed(2));\r\n\r\n\r\n }", "function makeUpdateDialog(name,total,type,notes,id){\n\n\tvar moneyDisplay1 = total.toString().slice(0,-2);\n \tvar moneyDisplay2 = total.toString().slice(-2);\n\n\t$(\"body\").append(\"<div id='updateForm\"+id+\"' class='updateDialogContainDiv'><form id='update-form-form\"+id+\"'><fieldset><label>Name:</label><input type='text' id='accountNameEntered' name='accountNameEntered' value='\"+name+\"'/><label>Total:</label>\"+currencyStmbol+\"<input type='number' step='1' id='accountTotalDollarsEntered' name='Total' value='\"+moneyDisplay1+\"' min='0'/>.<input type='number' step='1' id='accountTotalCentsEntered' name='Total' value='\"+moneyDisplay2+\"' min='0' max='99'/><label>Type:</label><input type='text' id='accountTypeEntered' name='accountTypeEntered' value='\"+type+\"'/><label>Notes:</label><textarea rows='4' cols='20' id='accountNotesEntered' name='accountNotesEntered' value='\"+notes+\"'>\"+notes+\"</textarea></fieldset></form></div>\");\n}", "function fnCantidadArticulo(orden) {\n var a = $(\"#addedCantidadArticulo\" + orden).val();\n var b = $(\"#addedPEArticulo\" + orden).val();\n var e = $(\"#contDispArt\" + orden).val();\n //alert(e);\n var t = a * b;\n var p = $(\"#addPresupuestoH\"+orden).val();\n var d = p - t;\n var s = e - a;\n var noReq = $(\"#idtxtRequisicion\").val();\n //alert(s);\n //alert(\"disponibilidad: \"+ p);\n $(\"#addedCantidadTotalArticulo\" + orden).val(\"\"+t);\n\n if(d >= 0){\n $(\"#idCvePresupuestal\" + orden).removeClass(\"hide\");\n $(\"#addPresupuestoH\"+orden).val(\"\"+p);\n $(\"#validaPresupuesto\" + orden).val(\"Ppto Suficiente\");\n $(\"#validaPresupuesto\" + orden).css('border','solid 1px #1B693F');\n $(\"#validaPresupuesto\" + orden).css('color','#1B693F');\n $(\"#validaPresupuesto\" + orden).prop(\"readonly\", true);\n $(\"#validaPresupuesto\" + orden).attr('disabled', 'disabled');\n iCntPI = 0;\n\n }else{\n $(\"#idCvePresupuestal\" + orden).removeClass(\"hide\");\n $(\"#addPresupuestoH\"+orden).val(\"\"+p);\n $(\"#validaPresupuesto\" + orden).val(\"Ppto Insuficiente\");\n $(\"#validaPresupuesto\" + orden).css('border','solid 1px #ff0000');\n $(\"#validaPresupuesto\" + orden).css('color','#ff0000');\n $(\"#validaPresupuesto\" + orden).prop(\"readonly\", true);\n $(\"#validaPresupuesto\" + orden).attr('disabled', 'disabled');\n iCntPI = iCntPI +1;\n }\n if( s >= 0){\n //alert(\"> 0 :\"+ s);\n $(\"#addDispArticulo\" + orden).val(\"\");\n $(\"#addDispArticulo\" + orden).html(\"Disponible\");\n $(\"#addDispArticulo\" + orden).prop(\"readonly\", true);\n $(\"#addDispArticulo\" + orden).attr('disabled', 'disabled');\n iCntND = iCntND + 1;\n }else{\n //alert(\"< 0 :\"+ s);\n $(\"#addDispArticulo\" + orden).val(\"\");\n $(\"#addDispArticulo\" + orden).html(\"No Disponible\");\n $(\"#addDispArticulo\" + orden).prop(\"readonly\", true);\n $(\"#addDispArticulo\" + orden).attr('disabled', 'disabled');\n iCntND = 0;\n }\n //fnModificarArticulo(noReq,orden);\n}", "function onLoadAmount(){\r\n var total_bill=document.getElementById('txt_bill_grandtotal').value;\r\n var cash = document.getElementById('txt_cash1').value;\r\n var card1 = document.getElementById('txt_card1').value;\r\n var card2 = document.getElementById('txt_card2').value;\r\n var cheque = document.getElementById('txt_cheque').value;\r\n var credit = document.getElementById('txt_credit').value;\r\n var status = document.getElementById('txt_status').value;\r\n total_bill = CheckNumeric(total_bill);\r\n if(cash==\"1\" && status=='Add'){\r\n document.getElementById('txt_cash1_amount').value=Math.ceil(total_bill);\r\n }\r\n setTimeout('onkeyupAmount('+Math.ceil(total_bill)+', \"txt_cash1_amount\")',500);\r\n var total_payment=0;\r\n if(cash==\"1\"){\r\n var cash_amt = document.getElementById('cash_amt').innerHTML;\r\n cash_amt = CheckNumeric(cash_amt);\r\n total_payment = total_payment + parseFloat(cash_amt);\r\n }\r\n if(card1==\"1\"){\r\n var card1_amt = document.getElementById('card1_amt').innerHTML;\r\n card1_amt = CheckNumeric(card1_amt);\r\n total_payment = total_payment + parseFloat(card1_amt);\r\n }\r\n if(card2==\"1\"){\r\n var card2_amt = document.getElementById('card2_amt').innerHTML;\r\n card2_amt = CheckNumeric(card2_amt);\r\n total_payment = total_payment + parseFloat(card2_amt);\r\n }\r\n if(cheque==\"1\"){\r\n var cheque_amt = document.getElementById('cheque_amt').innerHTML;\r\n cheque_amt = CheckNumeric(cheque_amt);\r\n total_payment = total_payment + parseFloat(cheque_amt);\r\n }\r\n if(credit==\"1\"){\r\n var credit_amt = document.getElementById('credit_amt').innerHTML;\r\n credit_amt = CheckNumeric(credit_amt);\r\n total_payment = total_payment + parseFloat(credit_amt);\r\n }\r\n document.getElementById('total_payment').innerHTML=total_payment;\r\n var balance=Math.ceil(parseFloat(total_bill)-parseFloat(total_payment));\r\n document.getElementById('balance').innerHTML=balance;\r\n \r\n}", "function displayTotal(){\n\n $('#main-service').html( service + ': <span> $' + cost + '</span>' );\n\n //checking if valid because keep null from displaying\n if(extra_selected == true){\n\n $('#display').html('');\n $('#head').html('<h1>Services Selected</h1>');\n $('#info').html('Here is an estimate for your next appointment. Click on Book-It to schedule it.');\n\n //step through extras and display total\n for (var i=0; i<extras.length; i++){\n\n $('#extras').append( '<p>' + extras_name[Math.floor(extras[i])] + ':<span> $' + extras_cost[Math.floor(extras[i])] + '</span></p>');\n time = time + extras_time[Math.floor(extras[i])];\n cost = cost + extras_cost[Math.floor(extras[i])];\n extraCost = extraCost + extras_cost[Math.floor(extras[i])];\n }\n\n $('#sub-total').html( 'Service + Extras: ' + ' <span> $' + cost + '</span>' +'<br>');\n $('#sub-total').append('<br>');\n\n //adding control to keep users from entering submit twice\n $('#select-service').prop(\"disabled\", true);\n $('#book-it').prop(\"disabled\", false);\n }\n\n $('#time').html('Time needed ' + ' <span> ' + time + ' minutes' + '</span>' );\n}", "function updatetotalField(totalFieldId, Amount){\n const totalElement = document.getElementById(totalFieldId);\n const TotalText = totalElement.innerText;\n const previousTotal = parseFloat(TotalText);\n totalElement.innerText = previousTotal + Amount;\n}", "function makeCreditDialog(id){\n\t$(\"body\").append(\"<div id='creditForm\"+id+\"' class='creditDiv'><h2>Credit</h2><form id='credit-form-form'><label>Total:</label>\"+currencyStmbol+\"<input id='creditTotalDollarsEntered' type='number' step='1' value='0' min='0'/>.<input id='creditTotalCentsEntered' type='number' step='1' value='0' min='0' max='99'/><label>Credit From:</label><input type='text' id='creditFromEntered'/><label>Notes:</label><textarea rows='4' cols='20' id='creditNotesEntered'/><label>Date:</label><input type='date' id='creditDateEntered'/></form></div>\");\n}", "function quantitySelected(){\n\t\t\n\t\tvar arr = document.getElementsByName(\"wine\");\n\t\tvar total = 0;\n\t\tfor(var i = 0; i < arr.length; i++){\n\t\t if(parseInt(arr[i].value))\n\t\t\t total += parseInt(arr[i].value);\n\t\t}\n\t\treturn total;\t\n\t} // End quantitySelected", "function UpdateTotal(){\n\tlet l_TotalElement = document.getElementById(\"show_total\");\n\tlet l_P = l_TotalElement.attributes[\"price\"].value;\n\tlet l_Q = Validator.CheckInteger(document.getElementById(\"quantity_selector\").value);\n\t\n\tl_TotalElement.innerHTML = `${Validator.ComputePrice( l_P * l_Q)}€`;\n\t\n\tdocument.getElementById(\"modal_quantity\").innerHTML = `Quantité : ${l_Q}`;\n\tdocument.getElementById(\"modal_price\").innerHTML = `Prix : ${Validator.ComputePrice(l_P)}€`;\n\tdocument.getElementById(\"modal_total\").innerHTML = `Total : ${Validator.ComputePrice(l_Q*l_P)}€`;\n}", "function updateTotal(){\n let unitCosts = document.querySelectorAll('input.unitCost');\n let quantities = document.querySelectorAll('input.quantity');\n let grandTotalGauge = document.querySelector('#invoice-items-total span');\n let grandTotal = 0;\n for (var i = 0; i < unitCosts.length; i++) {\n itemCost = unitCosts[i].value * quantities[i].value;\n grandTotal += itemCost;\n }\n grandTotalGauge.innerHTML = grandTotal;\n}", "function priceCalculator() {\n const firstClassTicketQuantity = getInputNumber('first-class-input');\n const firstClassTicketCost = firstClassTicketQuantity *150;\n const economyTicketQuantity = getInputNumber('economy-input');\n const economyTicketCost = economyTicketQuantity *100;\n const subtotal = firstClassTicketCost + economyTicketCost;\n document.getElementById('subtotal').innerText = '$' + subtotal;\n const vat = Math.round((subtotal *10)/100);\n document.getElementById('vat').innerText = '$' + vat;\n const total = subtotal + vat;\n document.getElementById('total').innerText = '$' + total;\n}", "function totaled()\n{\n\tconsole.log(\"totaled() begin\");\n\tvar rad = document.mainForm.hotcoldradio;\n\tvar rad2 = document.mainForm.radiobuttons;\n\t\n\tconsole.log(getOrderString());\n\t\n\trad[0].checked = true;\n\trad2[0].checked = true;\n\t\n\ttotal = 0.00;\n\tsubtotal = 0.00;\n\tgrandTotal = 0.00;\n\t\n\t$(\"nameInput\").value = \"John Doe\";\n\t$(\"nameInput\").focus();\n\t\n\t$(\"gTotalOutput\").value = \"0\";\n\t$(\"totalOutput\").value = \"0\";\n\t$(\"subTotalInput\").value = \"0\";\n\t$(\"id_product\").selectedIndex = 0;\n\t\n\t$(\"id_tax\").selectedIndex = 0;\n\t$(\"id_product\").selectedIndex = 2;\n\ttax = taxCode($(\"id_tax\").value);\t\n\t$(\"myTextArea\").value = dateString() + \"Cart:\";\t\n\tediting = false;\t\n\t$(\"id_tax\").disabled = false;\n\t$(\"nameInput\").disabled = false;\n\t\n\tconsole.log(\"totaled() end\");\n\ttotaler(false);\n}", "function dd(){\n\n// Getting the values of Dropdown Menu ID'd\n\n\t\tvar c = document.getElementById(\"itemlist\").value;\n\t\tvar q = document.getElementById(\"count\").value;\n\t\tvar a = document.getElementById(\"itemlist\").selectedIndex;\n\t\tvar b = document.getElementById(\"count\").selectedIndex;\n\n// Condition for printing Price and Total Price in the Table\n\n\t\tif(a != 0 && b != 0)\n\t\t{\n\t\t\tif(c == \"Idli Sambar\")\n\t\t\t{\t\n\t\t\t\tdocument.getElementById(\"Price\").value = \"Rs \" + 30;\n\t\t\t\tt = 30 * b;\n\t\t\t\tdocument.getElementById(\"Total_Price\").value = \"Rs \" + (30 * b);\n\t\t\t}\n\t\t\telse if(c == \"Masala Dosa\")\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"Price\").value = \"Rs \" + 60;\n\t\t\t\tt = 60 * b;\n\t\t\t\tdocument.getElementById(\"Total_Price\").value = \"Rs \" + (60 * b);\n\t\t\t}\n\t\t\telse if(c == \"Rava Dosa\")\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"Price\").value = \"Rs \" + 70;\n\t\t\t\tt = 70 * b;\n\t\t\t\tdocument.getElementById(\"Total_Price\").value = \"Rs \" + (70 * b);\n\t\t\t}\n\t\t\telse if(c == \"Pulao\")\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"Price\").value = \"Rs \" + 80;\n\t\t\t\tt = 80 * b;\n\t\t\t\tdocument.getElementById(\"Total_Price\").value = \"Rs \" + (80 * b);\n\t\t\t}\n\t\t\telse if(c == \"Vada\")\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"Price\").value = \"Rs \" + 20;\n\t\t\t\tt = 20 * b;\n\t\t\t\tdocument.getElementById(\"Total_Price\").value = \"Rs \" + (20 * b);\n\t\t\t}\n\n\n// Getting Values in the Table and inserting new rows with data in the Table\n\n\t\t\tvar display = document.getElementById(\"display\");\n\n\t\t\tvar newRow = display.insertRow(row);\n\n\n\t\t\tvar cell1 = newRow.insertCell(0);\n\t\t\tvar cell2 = newRow.insertCell(1);\n\t\t\tvar cell3 = newRow.insertCell(2);\n\t\t\tvar cell4 = newRow.insertCell(3);\n\t\t\tvar cell5 = newRow.insertCell(4);\n\n\t\t\tcell1.innerHTML = row;\n\t\t\tcell2.innerHTML = c;\n\t\t\tcell3.innerHTML = document.getElementById(\"Price\").value;\n\t\t\tcell4.innerHTML = q;\n\t\t\tcell5.innerHTML = document.getElementById(\"Total_Price\").value\n\n// Calculating Grand Total and getting the same in the Table\n\n\t\t\tT = T + t;\n\n\t\t\tvar lastRow = display.rows[ display.rows.length - 1 ];\n\t\t\t\n\t\t\tvar lastCell = lastRow.cells[lastRow.cells.length-1];\n\n\t\t\tlastCell.innerHTML = \"Rs \" + T;\n\n\t\t\trow++;\n\n// Condition for displaying window alert in case of a non acceptable values from dropdown menu\n\n\t\t}else{\n\t\t\tif(a == 0 && b != 0) \n\t\t\t{\n\t\t\t\twindow.alert(\"Please select one of the cusine\");\n\t\t\t} else if(b == 0 && a != 0)\n\t\t\t{\n\t\t\t\twindow.alert(\"Please select the quantity of cusine you want\");\n\t\t\t}else{\n\t\t\t\twindow.alert(\"Please select the cusine along with the qunatity\");\n\t\t\t}\n\t\t}\n\n}", "function calcularTotal(){\n \n //variables a utilizar\n var servicio = $('#servicio');\n var cantidad = parseInt($('#cantidad').val());\n var valor = parseInt(servicio.attr('valor'));\n\n //Verificamos si los campos Valor y cantidad existen\n if (isNaN(valor)||isNaN(cantidad)) {\n //si no estan definidos el total va a ser cero\n $('#total').val(0);\n } else{\n //si estan definidos el total se calcula normalmente\n $('#total').val(cantidad*valor);\n }\n\n }", "function calmonto(valor) {\n setTimeout(function () {\n monto = 0;\n acumu = 0;\n\n $('#mitablaOrdendetalle').find('tbody').find('tr').each(function () {\n monto = parseInt($(this).find(\"td\").eq(valor).html());\n acumu = acumu + monto;\n });\n $('#totalorden').val(acumu);\n numeroDecimal('totalorden');\n $('#montoOrdentotal').val($('#totalorden').val());\n numeroDecimal('montoOrdentotal');\n\n }, 1200);\n\n}", "function sumarTotal(){\n\tcant = $(\"#cant\").val();\n\tprecio = $(\"#precio\").val();\n\tresultado = parseFloat(cant) * parseFloat(precio);\n\t$('#total').val(resultado);\n }", "function submit() {\n/*\nconst SALES_TAX = 0.835;\nconst TOTAL_SPENDING_LIMIT = 0.0;\n\n// store the total spending budget in relevent variable\nvar budget = document.getElementById(\"budget\");\nTOTAL_SPENDING_LIMIT = budget;\n// output to console to verify functionality\nconsole.log(TOTAL_SPENDING_LIMIT); \n*/\nconsole.log(\"log\");\n}", "function mostrarTotal (){\n $(\"#total\").html(`Total: $${total}`);\n}", "function dispatchpartydetails_CalculateAmount()\r\n{\r\n\tvar tons = $(\"#dispatchpartydetails_tons\").val();\r\n\tvar rate = $(\"#dispatchpartydetails_rate\").val();\r\n\t/**\r\n\t * if any of one tons or rate will epty then set ammount as empty\r\n\t */\r\n\tif(common_isEmpty(tons) || common_isEmpty(rate))\r\n\t{\r\n\t\t$(\"#dispatchpartydetails_amount\").val(\"\");\r\n\t\treturn;\r\n\t}\r\n\r\n\t$(\"#dispatchpartydetails_amount\").val(parseInt(tons) * parseInt(rate));\r\n\t\r\n}", "function expBudget(){\n var expSum = 0;\n for (i=0;i<expInput.length;i++){\n expSum += parseInt(expInput[i].value);\n }\n document.querySelector('#expense-budget').innerHTML = 'Expense Budget:<br>'+ expSum + ' $';\n return expSum\n }", "function addMoney(a) {\n //call resetFields to reset inputs if a purchase has just been made\n resetFields();\n //parse the inputted new amount and the current total into floats, add them, and then round to 2 decimal places\n var inVal = parseFloat(a);\n var current = parseFloat($('#totalMoney').val());\n var updated = (current + inVal).toFixed(2);\n //load the new value into the html\n $('#moneyBox').text(\"$\" + updated);\n $('#totalMoney').val(updated);\n}", "function calcularTotal(){\n \n //variables a utilizar\n var articulo = $('#articulo');\n var cantidad = parseInt($('#cantidad').val());\n var valor = parseInt(articulo.attr('valor'));\n\n //Verificamos si los campos Valor y cantidad existen\n if (isNaN(valor)||isNaN(cantidad)) {\n //si no estan definidos el total va a ser cero\n $('#total').val(0);\n } else{\n //si estan definidos el total se calcula normalmente\n $('#total').val(cantidad*valor);\n }\n\n }", "function doneTyping() {\n var qty = parseInt($('#order_qty').val());\n calculateCost(qty);\n calculated();\n $('#order_qty').blur();\n if($('.resize_select').length == 1){\n $('.resize_select').removeClass('resize_select').addClass('size_options');\n }\n if(name != meshShorts) {\n buildRows(qty);\n }\n else {\n buildRows(1);\n };\n //populates the qty input in the submit form\n $('#step_1_print_qty').val(qty);\n}", "function calcularPuntos(){\n ganados = Number($(\"#txtGanados\").val());\n empatados = Number($(\"#txtEmpatados\").val());\n\n puntos = ganados * 3 + empatados;\n\n $(\"#pResultado\").html(\"Puntos totales: \" + (puntos));\n}", "function display() {\r\n \r\n var monthlyIncome = document.getElementById(\"incomePerMonth\").value;\r\n var insurance = insuranceDeduc(monthlyIncome);\r\n var dependents = dependentsDeduc();\r\n var deductions = totalDeduc(monthlyIncome, insurance, dependents);\r\n var payables = totalTax(monthlyIncome, deductions);\r\n var finaltotal = thousands_separators(payables);\r\n \r\n document.getElementById(\"demo\").innerHTML = \"₱ \" + finaltotal; // displays the final output to the site\r\n }", "function CalculateDrk() {\n var total = 0;\n\n for (let i = 9; i <= 11; i++) {\n itemID = document.getElementById(\"itm_\" + i);\n total = total + parseInt(itemID.value) * parseInt(itemID.getAttribute(\"data-price\"));\n\n }\n\n document.getElementById('DrkTotal').innerHTML = \"£ \" + total;\n document.getElementById('TotalValue').innerHTML = \"£ \" + total;\n\n\n}", "function CalItemTotal(para) {\r\n\tvar disctemp = 0;\r\n\tvar total_price = 0;\r\n\tvar group_value = 0;\r\n\tvar tax_rate1 = 0;\r\n\tvar tax_rate2 = 0;\r\n\tvar tax_rate3 = 0;\r\n\tvar tax_value1 = 0.0;\r\n\tvar tax_value2 = 0.0;\r\n\tvar tax_value3 = 0.0;\r\n\tvar disc = 0.00;\r\n\tvar discpercent = 0.00;\r\n\tvar uom_id = 0;\r\n\tvar qty = 0.00;\r\n\tvar disc_per = 0.00, disc_amt = 0.00;\r\n\r\n\tvar alt_qty = CheckNumeric(document.getElementById('txt_item_qty').value);\r\n\tif (alt_qty == 0) {\r\n\t\talt_qty = 1.00;\r\n\t\t// document.getElementById('txt_item_qty').value = alt_qty;\r\n\t}\r\n\t// alert(\"alt_qty===\"+alt_qty);\r\n\r\n\tvar emp_disc_update = parseInt(document.getElementById('txt_emp_invoice_discountupdate').value);\r\n\tvar uom_id = document.getElementById('dr_alt_uom_id').value;\r\n\tvar uom_idarr = uom_id.split(\"-\");\r\n\tvar uom_id = uom_idarr[0];\r\n\tdocument.getElementById('uom_id').value = uom_id;\r\n\tvar uom_ratio = uom_idarr[1];\r\n\t// alert(\"uom_ratio===\"+uom_ratio);\r\n\tdocument.getElementById('uom_ratio').value = uom_ratio;\r\n\r\n\tif (uom_ratio == 0 || uom_ratio == '' || isNaN(uom_ratio) == true || uom_ratio == null) {\r\n\t\tuom_ratio = 1.00;\r\n\t\tqty = alt_qty * uom_ratio;\r\n\t} else {\r\n\t\tqty = alt_qty * uom_ratio;\r\n\t}\r\n\r\n\tvar price = parseFloat(CheckNumeric(document.getElementById('txt_item_price').value));\r\n\tvar unit_price = parseFloat(CheckNumeric(document.getElementById('txt_item_baseprice').value));\r\n\tdisc_amt = parseFloat(CheckNumeric(document.getElementById('txt_item_price_dic').value));\r\n\tdisc_per = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc_percent_add').value));\r\n\t// alert(\"unit_price===\"+unit_price);\r\n\t// 1. Code for onchange of uom ---cal\r\n\tif (uom_ratio == 1.00 && alt_qty == 1.00) {\r\n\t\tdocument.getElementById('txt_item_price').value = unit_price * uom_ratio;\r\n\t\tdiscpercent = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc_percent_add').value));\r\n\t\tif (emp_disc_update == 0) {\r\n\t\t\tif (discpercent <= disc_per) {\r\n\t\t\t\tdisc = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc').value));\r\n\t\t\t\tdisc = ((unit_price * uom_ratio) * (discpercent / 100));\r\n\t\t\t\tdocument.getElementById('txt_item_price_disc').value = disc.toFixed(2);\r\n\t\t\t} else {\r\n\t\t\t\t\tdocument.getElementById('txt_item_price_disc_percent_add').value = disc_per.toFixed(2);\r\n\t\t\t\t\tdocument.getElementById('txt_item_price_disc').value = disc_amt.toFixed(2);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (eval(discpercent) <= eval(100.00)) {\r\n\t\t\t\tdisc = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc').value));\r\n\t\t\t\tdisc = ((unit_price * uom_ratio) * (discpercent / 100));\r\n\t\t\t\tdocument.getElementById('txt_item_price_disc').value = disc.toFixed(2);\r\n\t\t\t} else {\r\n\t\t\t\t\tdocument.getElementById('txt_item_price_disc_percent_add').value = \"0.00\";\r\n\t\t\t\t\tdocument.getElementById('txt_item_price_disc').value = \"0.00\";\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (uom_ratio != 1.00 && alt_qty == 1.00) {\r\n\t\tdocument.getElementById('txt_item_price').value = unit_price * uom_ratio;\r\n\t\tdiscpercent = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc_percent_add').value));\r\n\t\tif (discpercent <= disc_per) {\r\n\t\t\t// discpercent = parseFloat(CheckNumeric(document\r\n\t\t\t// .getElementById('txt_item_price_disc_percent_add').value));\r\n\t\t\tdisc = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc').value));\r\n\t\t\tdisc = ((unit_price * uom_ratio) * (discpercent / 100));\r\n\t\t\tdocument.getElementById('txt_item_price_disc').value = disc.toFixed(2);\r\n\t\t} else {\r\n\t\t\tdocument.getElementById('txt_item_price_disc_percent_add').value = disc_per.toFixed(2);\r\n\t\t\tdocument.getElementById('txt_item_price_disc').value = disc_amt.toFixed(2);\r\n\t\t}\r\n\t} else if (uom_ratio == 1.00 && alt_qty != 1.00) {\r\n\t\tdocument.getElementById('txt_item_price').value = unit_price * uom_ratio;\r\n\t\tdiscpercent = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc_percent_add').value));\r\n\t\tif (discpercent <= disc_per) {\r\n\t\t\t// discpercent = parseFloat(document\r\n\t\t\t// .getElementById('txt_item_price_disc_percent_add').value);\r\n\t\t\tdisc = ((unit_price * uom_ratio) * (discpercent / 100));\r\n\t\t\tdocument.getElementById('txt_item_price_disc').value = disc.toFixed(2);\r\n\t\t} else {\r\n\t\t\tdocument.getElementById('txt_item_price_disc_percent_add').value = disc_per.toFixed(2);\r\n\t\t\tdocument.getElementById('txt_item_price_disc').value = disc_amt.toFixed(2);\r\n\t\t}\r\n\t} else if ((uom_ratio != 1.00) && (alt_qty != 1.00)) {\r\n\t\tdocument.getElementById('txt_item_price').value = unit_price * uom_ratio;\r\n\t\tdiscpercent = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc_percent_add').value));\r\n\t\tif (discpercent <= disc_per) {\r\n\t\t\t// discpercent = parseFloat(CheckNumeric(document\r\n\t\t\t// .getElementById('txt_item_price_disc_percent_add').value));\r\n\t\t\t// alert(\"discpercent===\"+discpercent);\r\n\t\t\tdisc = ((unit_price * uom_ratio) * (discpercent / 100));\r\n\t\t\t// alert(\"disc===\"+disc);\r\n\t\t\tdocument.getElementById('txt_item_price_disc').value = disc.toFixed(2);\r\n\t\t} else {\r\n\t\t\tdocument.getElementById('txt_item_price_disc_percent_add').value = disc_per.toFixed(2);\r\n\t\t\tdocument.getElementById('txt_item_price_disc').value = disc_amt.toFixed(2);\r\n\t\t}\r\n\t}\r\n\t\r\n\t// /1. Logic of UOM ends ---and related code continued....\r\n\tprice = parseFloat(CheckNumeric(document.getElementById('txt_item_price').value));\r\n\t// alert(\"price=111=\"+price);\r\n\tdisc = parseFloat(CheckNumeric(document .getElementById('txt_item_price_disc').value));\r\n\tdiscpercent = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc_percent_add').value));\r\n\tvar optioncount = parseFloat(CheckNumeric(document.getElementById(\"txt_optioncount\").value));\r\n\tif (para == 1) {\r\n\t\ttotal_price = parseFloat(CheckNumeric(document.getElementById('txt_item_baseprice').value));\r\n\t\tif (total_price == '' || total_price == null) {\r\n\t\t\ttotal_price = 0;\r\n\t\t}\r\n\t} else {\r\n\t\tif (optioncount == 1) {\r\n\t\t\ttotal_price = parseFloat(CheckNumeric(document\r\n\t\t\t\t\t.getElementById('txt_defaultselected_total').value));\r\n\t\t\tif (total_price == '' || total_price == null) {\r\n\t\t\t\ttotal_price = 0;\r\n\t\t\t}\r\n\t\t\tgroup_value = document.getElementById('txt_new_value').value;\r\n\t\t\tif (group_value == '' || group_value == null) {\r\n\t\t\t\tgroup_value = 0;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\ttotal_price = 0;\r\n\t\t\tgroup_value = 0;\r\n\t\t}\r\n\t\ttotal_price = eval(total_price) + eval(group_value);\r\n\t}\r\n\r\n\tvar disc_type = parseFloat(CheckNumeric(document.getElementById('txt_item_price_disc_type').value));\r\n\tdisctemp = (eval(price) + eval(total_price));\r\n\ttemptotal = disctemp;\r\n\r\n\tprice = CheckNumeric(unit_price);\r\n\tdisc = (price * (discpercent / 100));\r\n\r\n\tif (eval(disc) > eval(disctemp)) {\r\n\t\talert(\"Discount can't be greater than price\");\r\n\t\t// setTimeout(CalItemTotal(1),3000);\r\n\t\t// document.getElementById('txt_item_price_disc').value = disctemp;\r\n\t\t// document.getElementById('txt_item_price_disc_percent_add').value =\r\n\t\t// 100;\r\n\t\tdocument.getElementById('txt_item_price_disc').value = 0;\r\n\t\tdocument.getElementById('txt_item_price_disc_percent_add').value = 0;\r\n\t\tdisc = 0;\r\n\t\tdiscpercent = 0;\r\n\t}\r\n\r\n\tif (eval(discpercent) > 100) {\r\n\t\talert(\"Discount can't be greater than 100%\");\r\n\t\t// setTimeout(CalItemTotal(1),3000);\r\n\t\t// document.getElementById('txt_item_price_disc_percent_add').value =\r\n\t\t// 100;\r\n\t\t// document.getElementById('txt_item_price_disc').value = disctemp;\r\n\t\tdocument.getElementById('txt_item_price_disc_percent_add').value = 0;\r\n\t\tdocument.getElementById('txt_item_price_disc').value = 0;\r\n\t\tdisc = 0;\r\n\t\tdiscpercent = 0;\r\n\t}\r\n\r\n\t// For Taxes cal (without tax amt including for cal 2nd ,3rd tax amts)\r\n\t// and (with tax amt including for cal 2nd ,3rd tax amts if\r\n\t// price_tax2_after_tax1 or price_tax3_after_tax2 = 1)\r\n\ttax_rate1 = CheckNumeric(document.getElementById('txt_item_price_tax_rate1').value);\r\n\ttax_rate2 = CheckNumeric(document.getElementById('txt_item_price_tax_rate2').value);\r\n\ttax_rate3 = CheckNumeric(document.getElementById('txt_item_price_tax_rate3').value);\r\n\tvar price_tax2_after_tax1 = CheckNumeric(document.getElementById('txt_price_tax2_after_tax1').value);\r\n\tvar price_tax3_after_tax2 = CheckNumeric(document.getElementById('txt_price_tax3_after_tax2').value);\r\n\t// alert(\"price_tax2_after_tax1===\"+price_tax2_after_tax1);\r\n\r\n\tif (tax_rate1 != 0) {\r\n\t\tdocument.getElementById('txt_item_tax1').value = parseFloat(\r\n\t\t\t\t((eval(unit_price) + eval(total_price) - eval(disc))\r\n\t\t\t\t\t\t* eval(uom_ratio) * eval(tax_rate1 / 100))).toFixed(2);\r\n\t\ttax_value1 = CheckNumeric(document.getElementById('txt_item_tax1').value);\r\n\t\t// alert(\"tax_value1===\"+tax_value1);\r\n\t}\r\n\tif (tax_rate2 != 0) {\r\n\t\tif ((price_tax2_after_tax1 == 1) && (tax_rate1 != 0)) {\r\n\t\t\tdocument.getElementById('txt_item_tax2').value = parseFloat(\r\n\t\t\t\t\t(((eval(unit_price) + eval(total_price) - eval(disc)) * eval(uom_ratio)) + eval(tax_value1))\r\n\t\t\t\t\t\t\t* eval(tax_rate2 / 100)).toFixed(2);\r\n\t\t\ttax_value2 = CheckNumeric(document.getElementById('txt_item_tax2').value);\r\n\t\t\t// alert(\"tax_value2==if=\"+tax_value2);\r\n\t\t} else {\r\n\t\t\tdocument.getElementById('txt_item_tax2').value = parseFloat(\r\n\t\t\t\t\t((eval(unit_price) + eval(total_price) - eval(disc))\r\n\t\t\t\t\t\t\t* eval(uom_ratio) * eval(tax_rate2 / 100))) .toFixed(2);\r\n\t\t\ttax_value2 = CheckNumeric(document.getElementById('txt_item_tax2').value);\r\n\t\t\t// alert(\"tax_value2=else==\"+tax_value2);\r\n\t\t}\r\n\t}\r\n\r\n\tif (tax_rate3 != 0) {\r\n\t\tif ((price_tax3_after_tax2 == 1) && (tax_rate1 != 0) && (tax_rate2 != 0)) {\r\n\t\t\tdocument.getElementById('txt_item_tax3').value = parseFloat(\r\n\t\t\t\t\t(((eval(unit_price) + eval(total_price) - eval(disc)) * eval(uom_ratio))\r\n\t\t\t\t\t\t\t+ eval(tax_value1) + eval(tax_value2))\r\n\t\t\t\t\t\t\t* eval(tax_rate3 / 100)).toFixed(2);\r\n\t\t\ttax_value3 = CheckNumeric(document.getElementById('txt_item_tax3').value);\r\n\t\t\t// alert(\"tax_value3===\"+tax_value3);\r\n\t\t} else {\r\n\t\t\tdocument.getElementById('txt_item_tax3').value = parseFloat(\r\n\t\t\t\t\t((eval(unit_price) + eval(total_price) - eval(disc))\r\n\t\t\t\t\t\t\t* eval(uom_ratio) * eval(tax_rate3 / 100))) .toFixed(2);\r\n\t\t\ttax_value3 = CheckNumeric(document.getElementById('txt_item_tax3').value);\r\n\t\t\t// alert(\"tax_value3===\"+tax_value3);\r\n\t\t}\r\n\t}\r\n\r\n\t//\r\n\t// alert(\"price===\"+price);\r\n\t// alert(\"total_price===\"+total_price);\r\n\t// alert(\"disc===\"+disc);\r\n\t// alert(\"qty===\"+qty);\r\n\t// alert(\"total==\"+);\r\n\t// alert(\"cart_total=amt==\"+((((eval(price)+eval(total_price)-eval(disc))*uom_ratio)\r\n\t// + (eval(tax_value1)+eval(tax_value2)+eval(tax_value3)))) * alt_qty);\r\n\t// Final Result\r\n\tdocument.getElementById(\"item_total\").innerHTML = parseFloat(\r\n\t\t\t((((eval(price) - eval(disc)) * uom_ratio) + (eval(tax_value1)\r\n\t\t\t\t\t+ eval(tax_value2) + eval(tax_value3))))\r\n\t\t\t\t\t* alt_qty).toFixed(2);\r\n\t// document.getElementById(\"txt_item_total\").value =\r\n\t// ((((eval(price) + eval(total_price) - eval(disc)) * uom_ratio) +\r\n\t// (eval(tax_value1)\r\n\t// + eval(tax_value2) + eval(tax_value3))))\r\n\t// * eval(alt_qty);\r\n\r\n}", "function basic_total() {\r\n\t\tvar basic_no = document.getElementById(\"basic\").value;\t\t\r\n\t\tbNumber = parseInt(basic_no);\t\r\n\t\tvar bas_text = document.getElementById(\"basic_label\").textContent;\r\n\t\tupdateBasicBasket(bNumber, bas_text);\r\n\t\t//updateDisplayTickets();\r\n\t\tsetCookie(\"basic_total\", bNumber,1);\r\n\t\t\t\t//alert(\"go to updateBasicBasket\");\r\n\t}", "function updatePrice() {\n var getCost=document.getElementById(\"costTag\");\n var dollarSymbol=getCost.innerHTML.indexOf(\"$\");\n \n var modifiedString=getCost.innerHTML.slice(dollarSymbol+1);\n \n var actualCost=modifiedString.slice(0,modifiedString.indexOf(\" \"))\n\t\n\tvar dt1= new Date(document.getElementById(\"fromDate\").value); \n\tvar dt2= new Date(document.getElementById(\"toDate\").value.split(\"-\")); \n\n var numdays=daysBetween(dt1, dt2);\n \n if(isNaN(numdays)){\n \tnumdays=0;\n }\n \n getCost.innerHTML=\"Cost: \"+numdays+\" days x $\"+actualCost + \" = $\"+ (actualCost*numdays).toFixed(2);\n document.getElementById(\"costVal\").value=(actualCost*numdays).toFixed(2);\n}" ]
[ "0.6048572", "0.6040015", "0.5895402", "0.58916736", "0.5862499", "0.5861643", "0.5794149", "0.57729965", "0.57136565", "0.56961095", "0.56767774", "0.5670846", "0.56694615", "0.56501114", "0.564967", "0.56434727", "0.5632902", "0.562941", "0.5587745", "0.55869925", "0.5583276", "0.55659544", "0.5539965", "0.5530779", "0.5528257", "0.5509482", "0.5498415", "0.5487765", "0.5484912", "0.54598963", "0.54324085", "0.5431335", "0.5431232", "0.54256636", "0.5424668", "0.5423354", "0.5421338", "0.5419027", "0.54094857", "0.54065925", "0.54050606", "0.5400534", "0.5399013", "0.5393005", "0.53660476", "0.5365939", "0.53645897", "0.53618723", "0.5350177", "0.5350177", "0.5338241", "0.53349966", "0.5334054", "0.5331822", "0.532327", "0.5322693", "0.53154224", "0.5304809", "0.52950263", "0.52932477", "0.5290247", "0.5288671", "0.52790505", "0.5277331", "0.5269451", "0.5267632", "0.5261206", "0.52611554", "0.52541363", "0.52515274", "0.5237923", "0.52347046", "0.5228148", "0.5227786", "0.522127", "0.521782", "0.5217033", "0.5216617", "0.52146643", "0.52021146", "0.5202033", "0.5200463", "0.5197798", "0.5197527", "0.5196162", "0.5195882", "0.5192859", "0.5187545", "0.51869977", "0.51859593", "0.5180159", "0.517868", "0.5174522", "0.516825", "0.5167366", "0.5165074", "0.5163446", "0.5157981", "0.51555306", "0.51546717", "0.51467586" ]
0.0
-1
on click, the function changeTitle will be called
function calculatePrice(){ // totalDueBox.value = numberOfBags*pricePerBag+salesTax+shipping; var amount; //if the user selects 3 bags or more, take the shipping price off if (numberOfBags.value >=3){ amount = numberOfBags.value *pricePerBag +numberOfBags.value *pricePerBag * salesTax; } //else keep the shipping price on else { amount = numberOfBags.value *pricePerBag +numberOfBags.value *pricePerBag * salesTax +shipping; } totalDueBox.value = amount; // totalDueBox.value = (numberOfBags.val)*pricePerBag+salesTax+shipping; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeTitle( layout, newTitle ){\n\t\tif( layout.title.text ){\n\t\t\tlayout.title.text = newTitle;\n\t\t}\t\n\t}", "function changeTitle(title) {\n document.getElementById (\"quest_title\").innerHTML = title;\n}", "function updateTitle(newTitle) {\r\n $(\"#foodTitle\").text(newTitle.name);\r\n}", "function changeTitle() {\n document.title = 'Star Wars';\n }", "function titleChangeOne(){\n pTag.textContent = \"1\"\n}", "function handleChangeTitle(event) {\n setTitle(event.target.value);\n }", "function changeHeaderTitle(newTitle){\n headerTitleDiv.innerHTML = newTitle;\n }", "function HeadingChange(){\n cl(document.title = \"This is new title\")\n}", "setTitle(title) {\n this._title = title;\n this.emit('titleChanged', title);\n this.emit('stateChanged');\n }", "function changeTitle(){\n\t\t\n\t// CHOOSE ONE OF THE STATIONS RANDOMLY\n\tvar i = Math.floor((Math.random()*titleArray.length)+1); \n\t\n\t// SET ARTIST TEXT WITH THE RANDOM VALUE\n\t$('.songName').text(titleArray[i]);\t\n}", "function changeTitle(){\r\n\ta.textContent = 'Order North Georgia Coffee';//\truns the method \"textContent\" on variable a, setting the header to \"Order North Georgia Coffee\" \r\n\r\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 updateTitle(text) {\n $('title').html(\"Blacksmith - \" + text);\n}", "function title_view(title) {\n var titleInput = gId(\"title\");\n gId('story_title').innerHTML = title;\n gId('story_title').style.display = \"block\";\n titleInput.style.display = \"none\";\n gId('add_title').style.display = \"none\";\n}", "function changeTitle(genere) {\r\n var titolo = $(\".titolo h1\");\r\n return titolo.text(genere);\r\n}", "function changeTitle(){\n\tvar title = document.getElementById('title');\n\ttitle.innerHTML = 'New Title';\n\ttitle.style.color = 'red';\n}", "function titleChangeTwo(){\n pTag.textContent = \"2\"\n}", "async changeTitle( title )\n {\n \tawait this.setState( pre => {\n \t\tpre.title = title\n \t\treturn pre\n \t})\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 }", "async setTitle(_) {\n this.titleView = _;\n this._top.attr(\"title\", this.titleView);\n select(this.element).attr(\"titleView\", this.titleView);\n select(this.element.shadowRoot.querySelector(\".title\")).text(_);\n }", "_updateTitle() {\n if (this._changeGuard || !this.content) {\n return;\n }\n this._changeGuard = true;\n const content = this.content;\n this.title.label = content.title.label;\n this.title.mnemonic = content.title.mnemonic;\n this.title.icon = content.title.icon;\n this.title.iconClass = content.title.iconClass;\n this.title.iconLabel = content.title.iconLabel;\n this.title.caption = content.title.caption;\n this.title.className = content.title.className;\n this.title.dataset = content.title.dataset;\n this._changeGuard = false;\n }", "function onTitleClick(e) {\n var $item = $(this).closest(_C_ITEM);\n debug(\"onTitleClick: \" + $item.attr('id'));\n\n toggleItemFolded($item, true);\n //e.stopImmediatePropagation();\n}", "function handTitleClick() {\n console.log('title was clicked!');\n}", "setTitle(title) {\r\n this.title = title;\r\n if (this.isActive) {\r\n this.router.updateTitle();\r\n }\r\n }", "function setPageTitle (newTitle) {\n title = newTitle;\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "titleChanged(title) {\n this.setState({\n title // ala title: 'value'\n })\n }", "function set_title(title){\n\t\t\tdocument.querySelector(\"#footertitle span\").innerText = title;\n\t\t}", "handleChangeTitle(e) {\n this.props.dispatch(updatePresentationContent(e.target.value, this.props.description));\n }", "function changeHeadline ( title ) {\r\n __TITLE = title;\r\n document.getElementsByClassName('stroka')[0].innerHTML = '<div id=\"langv\"> <a href=\"http://reallifecam.com/\" title=\"English\"><img src=\"http://reallifecam.com/design/flag_eng.gif\" alt=\"English\" width=\"18\" height=\"12\" border=\"0\"></a> <a href=\"http://de.reallifecam.com/\" title=\"Deutsch\"><img src=\"http://reallifecam.com/design/flag_germ.gif\" alt=\"Deutsch\" width=\"18\" height=\"12\" border=\"0\"></a> <a href=\"http://it.reallifecam.com/\" title=\"Italiano\"><img src=\"http://reallifecam.com/design/flag_italy.gif\" alt=\"Italiano\" width=\"18\" height=\"12\" border=\"0\"></a> </div>' + __TITLE;\r\n}", "function setTitle(title) {\n\t$( \"title\" ).html( title )\n}", "function setTitle() {\n let niveau = getUrlParameter('level');\n $('#title').text(\"Niveau \" + niveau);\n}", "function displayTitle (event) {\n $display.textContent = listoftitles[event.target.getAttribute('id')-1]\n }", "static setTitle(title) {\n $(\"#main_title\").text(title);\n $(\".active\").removeClass(\"active\")\n if (title == \"Add/Edit a character\") {\n $(\"#nav-\" + \"editCharacter\").addClass(\"active\")\n } else\n $(\"#nav-\" + title).addClass(\"active\")\n }", "function change_title(){\n\tvar isOldTitle = true;\n\tvar oldTitle = \"Draft\";\n\tvar newTitle = \"Your turn!\";\n\tvar interval = null;\n\tclearInterval(interval);\n\tfunction changeTitle() {\n\t\tif (is_turn){\n \tdocument.title = isOldTitle ? oldTitle : newTitle;\n \tisOldTitle = !isOldTitle;\n\t}\n\telse{\n\tdocument.title = 'Draft'\n\t}}\n\tinterval = setInterval(changeTitle, 1000);\n\t$(window).focus(function () {\n \tclearInterval(interval);\n \t\t$(\"title\").text('Draft');\n\t});\n\t$('body').click(function () {\n\t\tclearInterval(interval);\n\t\t$('title').text('Draft');\n\t});\n\t}", "function updateTitle(currentChapter) {\n var title = 'Breaking faith';\n if (currentChapter == 0) {\n title = 'Breaking faith';\n } else {\n title = 'Chapter ' + currentChapter ;\n }\n $(\".title\").html(title);\n }", "function changeTitle() {\n let inputSelector = document.querySelector(\".inputSelector\");\n document.addEventListener(\"submit\", e => {\n e.preventDefault();\n document.title = inputSelector.value;\n document.querySelector(\".pageTitle\").innerHTML =\n \"Current page title is: \" +\n \"'\" +\n document.title +\n \"'\" +\n \" ,would you like to customize it?\";\n });\n}", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "function changeDocumentTitle( title )\n{\n document.title = title;\n}", "function updateProductTitle(title) {\r\n\t $('#buy-button-1 .product-header').text(title);\r\n\t }", "function titlePage(){\n\t\t$('.title-page').html('<h2 class=\"text-center\">'+objet_concours[last_concours]+'</h2>');\n\t}", "function changeTitle() { //function is named what i want to do\n _$(h1) //i want to use this shortcut to select the main title (h1)\n = ''//do i have to empty it between selecting it and changing it? \n //here i want to change that title\n _$(h1).innerHTML = ('Hey, I'm a new title') \n}", "function addTitleEvent(button, title) {\n button.addEventListener('click', () => {\n setProjectActive(title);\n console.log(`selected project: ${title}`);\n });\n}", "function editTitle() {\n\tvar article = $(this).closest('article');\n\t$('h2', article).replaceWith(`<textarea class=\"idea-title edit-title\">${$(this).text()}</textarea>`);\n\t$('.edit-title').focus();\n}", "_updateContentTitle() {\n if (this._changeGuard || !this.content) {\n return;\n }\n this._changeGuard = true;\n const content = this.content;\n content.title.label = this.title.label;\n content.title.mnemonic = this.title.mnemonic;\n content.title.icon = this.title.icon;\n content.title.iconClass = this.title.iconClass;\n content.title.iconLabel = this.title.iconLabel;\n content.title.caption = this.title.caption;\n content.title.className = this.title.className;\n content.title.dataset = this.title.dataset;\n this._changeGuard = false;\n }", "function setTitle() {\r\n\t\tvar title = $('h1#nyroModalTitle', modal.contentWrapper);\r\n\t\tif (title.length)\r\n\t\t\ttitle.text(currentSettings.title);\r\n\t\telse\r\n\t\t\tmodal.contentWrapper.prepend('<h1 id=\"nyroModalTitle\">'+currentSettings.title+'</h1>');\r\n\t}", "function updateTitle(page) {\n $('#page-title').html(titles[page]);\n}", "function titleChanged(e) {\n var id = e.target.id;\n var val = e.target.value;\n var def;\n\n if (id === 'mainInput') {\n def = settings.main.title;\n } else {\n def = settings.other.title;\n }\n\n if (val === '') return e.target.value = def;\n\n if (val !== def) {\n if (id === 'mainInput') {\n settings.main.title = val\n setupTitles('main', val);\n } else {\n settings.other.title = val;\n setupTitles('other', val);\n }\n\n saveSettings();\n }\n }", "function setPageTitle() {\nconst title = document.querySelector('#title');\n\ntitle.innerText = pageTitle;\n\n}", "changeTitle(v) {\n this.setState({titleText: v.target.value})\n }", "function setPageTitle() {\n const page = document.getElementById('title');\n page.innerHTML = pageTitle;\n}", "set title( val ) {\n this.title_bar_text.innerText = val;\n }", "function setMovieTitle(){\n\tvar title = $('#title').attr('value');\n\t$('#headerText').text('Watching: ' + title);\n}", "function setPanelDocumentTitle(newTitle)\n{\n setElementTitle(svgDocument.getElementById(\"title1\"), newTitle);\n}", "_updateTitlePanelTitle() {\n let current = this.currentWidget;\n const inputElement = this._titleHandler.inputElement;\n inputElement.value = current ? current.title.label : '';\n inputElement.title = current ? current.title.caption : '';\n }", "function setTitle() {\n var title = $('h1#nyroModalTitle', modal.contentWrapper);\n if (title.length)\n title.text(currentSettings.title);\n else\n modal.contentWrapper.prepend('<h1 id=\"nyroModalTitle\">'+currentSettings.title+'</h1>');\n }", "function title(){\n\n}", "setTitle(title) {\n this.get('headData').set('title', title);\n }", "function setTitle(title) {\n document.getElementById(gs_title_id).innerHTML = title;\n document.getElementById(gs_nav_title_id).innerHTML = title;\n\n if (title == 'GitStrap') {\n document.getElementById(gs_ribbon_id).style.display = 'block';\n }\n}", "function setTitle(title) {\r\n\t\t var show = false;\r\n\t\t\tif (self.options.overrideTitle != null) {\r\n\t\t\t show = true;\r\n\t\t\t\tself.bbgCss.jq.title.html(self.options.overrideTitle);\r\n\t\t\t} else if (typeof(title) != 'undefined') {\r\n\t\t\t\tself.bbgCss.jq.title.html(title);\r\n\t\t\t\tshow = true;\r\n\t\t\t} else {\r\n\t\t\t\tself.bbgCss.jq.title.html('');\r\n\t\t\t}\r\n\t\t\tif (show) {\r\n\t\t\t\tself.bbgCss.jq.title.show();\r\n\t\t\t} else {\r\n\t\t\t\tself.bbgCss.jq.title.hide();\r\n\t\t\t}\r\n\t\t}", "function changeTitle($arr) {\n window.parent.document.title = $arr; // on change l'attribut <title>\n}", "function titleText(title) {\n pageTitle.textContent = title;\n}", "function changePageTitle(){\n /*Change the page title*/\n var title = document.getElementById(\"floorTitle\");\n var name = \"\";\n switch(FLOOR){\n case 1: name = \"First\"; break;\n case 2: name = \"Second\"; break;\n case 3: name = \"Third\"; break;\n case 4: name = \"Fourth\"; break;\n case 5: name = \"Fifth\"; break;\n case 6: name = \"Sixth\"; break;\n case 7: name = \"Seventh\"; break;\n }\n name += \" Floor\";\n title.innerHTML = name;\n}", "function changeTitle(){\r\n $(\"h1\").css({\r\n \"color\":\"white\",\r\n \"font-size\":\"8rem\",\r\n \"font-family\":\"Edwardian Script ITC\"\r\n });\r\n $(\"h2\").css({\r\n \"color\":\"yellow\",\r\n \"font-size\":\"6rem\",\r\n \"font-family\":\"Edwardian Script ITC\"\r\n });\r\n}", "function setPageTitle() {\n\n let h1 = document.getElementById('title');\n h1.innerText = pageTitle;\n}", "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "handleSectionTitleChange(id, title) {\n this.setState(prevState => {\n prevState.assignment.sections.custom.find(section => section.id == id).title = title;\n return prevState;\n })\n }", "function changeTitles(page,type,hasResults) {\n var filmTitle=$(\"#film-title\");\n var seriesTitle=$(\"#series-title\");\n //Se ci sono risultati...\n if (hasResults) {\n //Se è un film...\n if (type==\"tv\") {\n //Se ha più di una pagina aggiungo il valore della pagina, altrimenti no.\n if (page>1) {\n seriesTitle.text(\"Serie TV - Più Popolari - Pagina \" + page);\n } else {\n seriesTitle.text(\"Serie TV - Più Popolari\");\n }\n }\n //Se è una serie tv, faccio altrettanto.\n else {\n if (page>1) {\n filmTitle.text(\"Film - Più Popolari - Pagina \" + page);\n } else {\n filmTitle.text(\"Film - Più Popolari\");\n }\n }\n }\n //Se non ci sono risultati, scrivo solamente il titolo.\n else {\n if (type==\"tv\") {\n seriesTitle.text(\"Serie TV\");\n } else {\n filmTitle.text(\"Film\");\n }\n }\n}", "function addTitle(e) {\n var titleInput = gId(\"title\");\n gId('story_title').innerHTML = titleInput.value\n gId('story_title').style.display = \"block\"\n titleInput.style.display = \"none\"\n gId('add_title').style.display = \"none\"\n e.stopPropagation()\n savePage();\n}", "function refresh(title,description) {\n setText(description);\n setTitle(title);\n }", "show() {\n this.switchToTitlePage();\n }", "function title(newtitle){\n\tdpost(\"set new title \" + newtitle + \" -> nodeid = \" + myNodeID + \"\\n\");\n\tmyExpandedMode = 0;\n\texpand();\n\tmyNodeTitle = newtitle;\n\tmyNodeOssiaModel = \"node/\" + newtitle;\n myNodeAddress = \"sparck:/\" + myNodeOssiaModel;\n\tstoreKeyValueInDB(myNodeName, \"_title\", newtitle);\n\tmyNodeVarName = newtitle;\n // the sequence of the following messages matter:\n // we first need to set the title\n // used by: vpl.node.property.logic\n messnamed(myNodeID + \"::props\", \"title\", myNodeTitle);\n messnamed(myNodeID + \"::props\", \"address\", myNodeAddress);\n messnamed(myNodeID + \"::pbody\", \"address\", myNodeTitle, myNodeAddress);\n\toutlet(OUTLET_DUMP, \"setmsgtitle\", newtitle);\n\toutlet(OUTLET_DUMP, \"title\", newtitle);\n\toutlet(OUTLET_DUMP, \"address\", myNodeAddress);\n}", "function setCVCategoryVaardighedenTitle() {\n $('#title').html('Cattegorie instellingen voor Vaardigheden')\n $('#subtitle').html('Stel hier de Categorie voor de vaardigheden die u heeft')\n}", "handleClick(i) {\n const name = document.getElementById(\"title-\"+ this.props.category + i).innerHTML; \n document.getElementById(\"titleChange-\" + this.props.category + i).className = \"displayed titleChangeBox\";\n document.getElementById(\"dimmer\").className=\"displayed\";\n this.selectText(i); \n this.setState({ taskTitle: name}); \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 setPageTitle() {\n const titleHTML = document.getElementById('title');\n titleHTML.innerText = pageTitle;\n}", "function setPageTitle() {\n const titleElement = document.getElementById('title');\n titleElement.innerText = pageTitle;\n}", "function nameChange() {\n $('h2').text('Andrew');\n }", "function onClick(target){\n updateTitle(target);\n updatePage(target);\n}", "function changeTrainerTitle(message) {\r\n //document.getElementById(\"trainerTitle\").innerHTML = \"Ear Trainer - \" + message;\r\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 giveTitle(name) {\n document.getElementsByTagName(\"title\")[0].innerHTML = name;\n}", "function companyPageTitleChangeInit() {\n $('.left-column-menu--company a[data-toggle=\"tab\"]').on('shown.bs.tab', function (e) {\n $('.company__title h1').text($(this).text());\n });\n}", "set title(title) {\n this.setAttribute(\"title\", title);\n }", "changeTitle(event) {\n const generatedQuiz = this.state.submitedQuestions;\n generatedQuiz.quiz.title = event.target.value;\n this.setState({ submitedQuestions: generatedQuiz });\n this.checkCorectnessTitle(generatedQuiz);\n }", "function handleClick() {\n setHeadingText(name);\n }", "function changeTitle(color) {\n _$('h1').style.color = color\n}", "setTitle(data) {\n this._windowTitle = data;\n this._onTitleChange.fire(data);\n return true;\n }", "function changeData(){\n\tcurYear = sel.value();\n\tmyTitle.html(curYear + \": \" + lev);\n}", "function setModalTitle(title, artist, album) {\n document.getElementById('modal-header-title').innerHTML = title + ' - '\n + artist + ' - ' + album;\n}", "function setTitle(_title) {\n chrome.browserAction.setTitle({title:_title});\n}", "updatePageTitle (state, title) {\n state.pageTitle = title\n }", "_updateTitle() {\n if (this.$title) {\n const escapedTitle = escapeHtml(this.state.title);\n if (this.$title.innerHTML !== escapedTitle) {\n this.$title.innerHTML = escapedTitle;\n }\n }\n }", "function handleTitleClick(){\n h1.className = \"active\";\n}", "function setTitle(title) {\n\tdocument.title = title;\n}", "function setPageTitle() {\n // First, get a reference to the DOM element\n let titleElement = document.querySelector(\"#page-title > span.name\");\n // Now set the inner text property so the content changes\n titleElement.innerText = name;\n}" ]
[ "0.7772806", "0.7590927", "0.7411962", "0.74035287", "0.73989564", "0.73970413", "0.73121536", "0.731", "0.7236662", "0.7232997", "0.7229214", "0.7203418", "0.7201802", "0.7189623", "0.7187209", "0.71486753", "0.7044686", "0.7025807", "0.70059663", "0.70036805", "0.69991136", "0.6995354", "0.69914114", "0.6978703", "0.69621074", "0.6958724", "0.6958724", "0.6958724", "0.6958724", "0.6958724", "0.6929659", "0.6916937", "0.6914798", "0.6912196", "0.68984556", "0.68862057", "0.68613875", "0.6860582", "0.6842239", "0.6824887", "0.68239063", "0.68150765", "0.6790819", "0.67734957", "0.67665136", "0.6766021", "0.67645216", "0.6755506", "0.67554647", "0.6754124", "0.6752963", "0.6751902", "0.67470086", "0.67436135", "0.6743406", "0.67431283", "0.67396176", "0.6739442", "0.67351204", "0.6731407", "0.6730327", "0.67138714", "0.67053217", "0.67003524", "0.6697946", "0.669116", "0.6687595", "0.6685531", "0.66719735", "0.66705996", "0.66705996", "0.6654994", "0.664681", "0.6627901", "0.6626933", "0.66246986", "0.6623521", "0.66100675", "0.66075826", "0.6603827", "0.6595068", "0.65933836", "0.65858006", "0.657291", "0.6569259", "0.6564678", "0.6559544", "0.65589863", "0.65544826", "0.65537107", "0.65407884", "0.6534102", "0.6533256", "0.6518761", "0.6509358", "0.6508788", "0.650219", "0.6501623", "0.6500129", "0.64991397", "0.6493141" ]
0.0
-1
gestisce la sessione guest dell'utente
async function handleSession() { // ottiene il dato da localStorage const sessionData = localStorage.getItem('mdb_session'); // se sessionData è undefined if (!sessionData) { // crea una nuova sessione const newSessionData = await getGuestSession(); console.log(newSessionData, 'newSessionData'); // se la chiamata getGuestSession ritorna un valore if (newSessionData) { // trasforma in stringa l'oggetto (localStorage può avere solo stringhe) const sessionDataString = JSON.stringify(newSessionData); // aggiunge il valore nel localStorage localStorage.setItem('mdb_session', sessionDataString); // mostra il toastBaner per dare un feedback alll'utente showToast('Hey! Adesso sei registrato come guest'); return true; } return false; } else { // se sessionData ha un valore // trasforma la stringa ottenuta da localSotarge in oggetto o variabile primitiva const parsedSessionData = JSON.parse(sessionData); /** * controlliamo che la sessione non sia scacduta * * la data di scadenza della sessione è contenuta * nell'oggetta della sessione sotto il nome "expires_at" * * utilizziamo Date per verificare se la data di scadenza è inferiore * alla data attuale nel momento in cui sta eseguendo questo codice. * * trasformiamo le due date con getTime() in un numero che corrisponde * ai millisecondi compresi tra la data usata e il 1 gennaio 1970 * (è uno standard per avere una costante di riferimento) * */ const expiresDate = new Date(parsedSessionData.expires_at).getTime(); const nowDate = new Date().getTime(); // se expiresDate in millisecondi è inferiore // a nowDate in millisecondi allora la sessione è scaduta if (expiresDate < nowDate) { // rimuoviamo i dati della sessione del localStorage localStorage.removeItem('mdb_session'); // chiamiamo la funzione stessa per gestire la // creazione di una nuova sessione e l'inserimento nel localStorage await handleSession(); return true; } return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function guestLogin()\n{\n localStorage.usr = \"Guest001\";\n localStorage.played = 0;\n localStorage.won = 0;\n localStorage.lost = 0;\n window.location.href = \"lobby.html\";\n}", "allowGuestSignin(allowed) {\n this.guestSessionAllowed_ = allowed;\n }", "function getGuestSession() {\n return new Promise((resolve, reject) => {\n getSession()\n .then((tokens) => {\n // If existing tokens are bad or there are no tokens, get tokens\n if (\n !tokens ||\n !tokens.username ||\n passedExpiration(tokens.Expiration)\n ) {\n getGuestCredentials(tokens.GuestId) // Get creds\n .then((tokens) => {\n setSession(tokens) // Set session\n .then(() => {\n resolve(tokens); // Return Tokens\n })\n .catch((e) => {\n reject(e);\n });\n })\n .catch((e) => {\n reject(e);\n });\n } else {\n resolve(tokens);\n }\n })\n .catch((e) => {\n reject(e);\n });\n });\n}", "function requestAccess(){\n if (!sessionStorage.getItem(\"auth_token\")){\n const tokenUrl = generateApiUrl('authentication/guest_session/new');\n axios.get(tokenUrl)\n .then((response) => {\n let auth_token = response.data.guest_session_id;\n sessionStorage.setItem(\"auth_token\", auth_token);\n })\n .catch((err)=> {\n console.error(err);\n });\n }\n}", "launchGuestSession_() {\n this.userActed(USER_ACTION_LAUNCH_OOBE_GUEST);\n }", "function startRemoteGame() {\n let userName = document.getElementById('newGameUser');\n sessionStorage.setItem('userName', userName);\n if (userName === '' || userName === '') {\n name = 'Anonymous';\n }\n}", "function setLoggedInGuest(user_response){\n\n\t//set vairables\n\tcurrentUserID = user_response.id;\n\tcurrentUserFirstName = user_response.firstName;\n\tcurrentUserLastName = user_response.lastName;\n\tcurrentUserFullName = user_response.firstName + \" \" + user_response.lastName;\n\tcurrentUserPictureURL = user_response.pictureURL;\n\n\t//echo to console\n\tconsole.log(\"currentUserID: \" + currentUserID);\n\tconsole.log(\"currentUserFirstName: \" + currentUserFirstName);\n\tconsole.log(\"currentUserLastName: \" + currentUserLastName);\n\tconsole.log(\"currentUserFullName: \" + currentUserFullName);\n\tconsole.log(\"currentUserPictureURL: \" + currentUserPictureURL);\n\t\n\t//setup global vars with new user\n\tsetCurrentUserInfo();\n\tuser_list.push(user_response);\n\tuser_id_list.push(user_response.id);\n\t\n\t//enable chat window adn connec to drums\n\t$(\"#drumkit\").show();\n\t$(\"#chat-main-div\").show();\n\trealignSVG();\n\t\n\t$('#login-modal').modal('toggle');\t\n\tstompClient = null;\n\tdrumsConnect();\n\t\n\t//connect to default room\n\tvar defaultRoom = room_list[0];\n\t$(\"#chat-rooms-list\").append(createRoomElement(defaultRoom).attr(\"default_room\",\"true\"));\n\t\n\tjoinRoom(default_room_id, false);\n}", "function createSessionLinkClicked() {\n m_AgentModel.createAgentSessionAndInvite(\"Guest\" + Date.now()).then(createAgentSessionAndInviteSuccess, createAgentSessionAndInviteFailure);\n }", "function createSession() {}", "storeGuests() {\n localStorage.setItem('guests', JSON.stringify(this.guests));\n }", "get isGuest() {\n return this.use().isGuest;\n }", "function newSession(){\n\tvar userid = document.getElementById(\"userelement\").innerText;\n\t//console.log(session_name, userid, start, end);\n\tpostReq(session_name, userid, start, end);\n}", "function isGuestUser() {\n\t\tvar isGuest = false;\n\t\tif (isFeatureSwitchEnabled(GUESTLIST_ENABLED)) {\n\t\t\tif (!cookieUtils.readCookie(COOKIE_GUESTLIST)) {\n\t\t\t\tsessionStorage.removeItem(GUEST_MEMBER_ID);\n\t\t\t}\n\t\t\tisGuest = !cookieUtils.readCookie(COOKIE_USER) && !cookieUtils.readCookie(COOKIE_USER_SESSION);\n\t\t}\n\n\t\treturn isGuest;\n\t}", "function sessie (req, res) {\n\tif (req.session.userName) {\n\t\tres.send({\n\t\t\tingelogd : true\n\t\t});\n\t} else {\n\t\tres.send({\n\t\t\tingelogd : false\n\t\t});\n\t}\n}", "async session(session, user) {\n //setting id on session\n session.id = user.sub;\n\n return session;\n }", "function load_guest_user_info(N) {\n return N.models.users.UserGroup.findIdByName('guests')\n .then(guestsId => ({\n user_id: '000000000000000000000000',\n user_hid: 0,\n usergroups: [ guestsId ],\n hb: false,\n user_name: '',\n user_nick: '',\n user_avatar: null,\n is_member: false,\n active: false,\n // Will be overwritten by session value in request\n locale: null\n }));\n}", "async guestParticipant(parent, args, ctx, info) {\n if (!ctx.request.userId) {\n throw new Error(\"You must be logged in to do that!\");\n }\n\n const participant = await ctx.db.query.guest(\n {\n where: {\n id: args.participantId,\n },\n },\n info\n );\n\n return participant;\n }", "constructor() {\n super();\n this.state = {\n error: null,\n isLoaded: false,\n items: []\n };\n if (window.sessionStorage.getItem('username') === null){\n window.sessionStorage.setItem('username', 'guest');\n }\n }", "loadGuests() {\n this.guests = JSON.parse(localStorage.getItem('guests') || '[]');\n ui.displayGuests();\n }", "function login(user){\n if(user == \"login\")\n {\n var username = document.getElementById(\"loginEmail\").value;\n var password = document.getElementById(\"loginPassword\").innerHTML;\n sessionStorage.setItem(\"loginUser\", username);\n $(\"#login-signup\").removeClass(\"showBlock\").addClass(\"showNone\");\n document.getElementById(\"loggedIn\").innerHTML = \"Hi \"+ sessionStorage.getItem(\"loginUser\");\n $(\"#loggedIn\").removeClass(\"showNone\").addClass(\"showBlock\");\n document.getElementById(\"loginEmail\").value =\"\";\n document.getElementById(\"loginPassword\").value = \"\";\n }\n else\n {\n $(\"#login-signup\").removeClass(\"showBlock\").addClass(\"showNone\");\n document.getElementById(\"loggedIn\").innerHTML = \"Hi Guest\";\n $(\"#loggedIn\").removeClass(\"showNone\").addClass(\"showBlock\");\n sessionStorage.setItem(\"loginUser\", \"Guest\");\n }\n\n}", "function getFrontendUser(session) {\n if (!session.identity) return false;\n const {id, login} = session.identity;\n let grants = [];\n if (session.grants) {\n grants = getFrontEndGrants(session.grants);\n }\n\n return {id, login, grants};\n }", "function start() {\n if (sessionStorage.getItem(\"usuarioSessionStore\") === null) {\n datos.innerHTML = `Participante no registrado... tenga en cuenta`;\n }else{\n createNombre();\n }\n}", "function confirmSystemHaker(){\n if (sessionStorage.getItem(\"loggedUserId\")==null) {\n location.href = '/HTML/loginAndSigup.html'\n }\n}", "function buscarSessionUser() {\r\n return JSON.parse(sessionStorage.getItem('login'))\r\n}", "function forsideStart() {\n console.log(sessionStorage); \n let data = sessionStorage.getItem(\"logind\")\n console.log(data); \n if (sessionStorage.logind == \"yes\") {\nconsole.log(\"yesyes\")\n} else {\nlocation.href = \"index.html\"\n}\n}", "function SessionStartup() {\n}", "async function setSession(request,reply){\n request.session.set('user',{username:'alireza',password:'58300'})\n return \"User Session Is Set\"\n}", "function getGuestMemeberID(requestParams) {\n\n\t\tvar guestMemberId = sessionStorage.getItem(GUEST_MEMBER_ID);\n\n\t\t// Make the call only if, guest member ID is not there in the\n\t\t// session store\n\t\tif (!guestMemberId || !cookieUtils.readCookie(COOKIE_GUESTLIST)) {\n\t\t\t$.support.cors = true; //Fix for IE8\n\t\t\tvar $promise = $.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: secureHostName + '/customer/list/v1/guestlistid',\n\t\t\t\txhrFields: {\n\t\t\t\t\twithCredentials: true\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t$promise.then(function (response) {\n\t\t\t\tif (response && response.String) {\n\t\t\t\t\tsessionStorage.setItem(GUEST_MEMBER_ID, response.String);\n\t\t\t\t\trequestParams && showList(requestParams);\n\t\t\t\t}\n\t\t\t}, function (error) {\n\t\t\t\t//TODO:Need to decide on the failure scenario\n\t\t\t\t//Consider no guest user and do the normal auth flow\n\t\t\t\trequestParams && executeAuthFlow(requestParams)\n\t\t\t});\n\t\t} else {\n\t\t\t//Already have member ID, show the overlay\n\t\t\trequestParams && showList(requestParams);\n\t\t}\n\t}", "function paivitaKayttajaElementit(kayttajaElementti){\r\n kayttajaElementti.innerHTML = sessionStorage.getItem(\"currentLoginUser\");\r\n alert(sessionStorage.getItem(\"currentLoginUser\"));\r\n \r\n}", "async function handleSession() {\n const sessionData = localStorage.getItem(\"mdb_session\");\n\n if (!sessionData) {\n const newSessionData = await getGuestSession();\n\n if (newSessionData) {\n const sessionDataString = JSON.stringify(newSessionData);\n\n localStorage.setItem(\"mdb_session\", sessionDataString);\n showToastBanner();\n return true;\n }\n\n return false;\n } else {\n const parsedSessionData = JSON.parse(sessionData);\n\n if (isSessionExpired(parsedSessionData.expires_at)) {\n localStorage.removeItem(\"mdb_session\");\n await handleSession();\n return true;\n }\n }\n}", "function inloggen(req, res) {\n Gebruikers\n .findOne({\n email: req.body.email\n })\n .then(data => {\n if (data) {\n if (data.wachtwoord === req.body.wachtwoord) {\n req.session.loggedIN = true;\n req.session.userId = data.email;\n req.session.userName = data.voornaam;\n req.flash('succes', 'Hoi ' + req.session.userName);\n res.render('readytostart');\n console.log('ingelogd als ' + req.session.userId);\n } else {\n req.flash('error', 'Wachtwoord is incorrect');\n res.render('index');\n console.log('Wachtwoord is incorrect');\n }\n } else {\n req.flash('error', 'Account is niet gevonden');\n res.render('index');\n console.log('Account is niet gevonden');\n }\n })\n .catch(err => {\n console.log(err);\n });\n}", "async getSession(){\n await auth.trackSession((session) => {\n if (!session){\n return;\n } else {\n this.session = session;\n }\n });\n this.getSessionId(this.session);\n }", "async function createGuest(guestInfo){\n await guest.create(guestInfo)\n}", "commitHome() {\n session.outletSelected = true;\n const sessionPayload = session;\n sessionPayload.outlet = {\n outletId: session.outlet.outletId\n };\n return this.Http.sendRequest('/users/current/session', 'POST', { session: sessionPayload });\n }", "function loginGuest(){\n\t\n\tvar username_input = $(\"#guest-username-input\").val();\n\tif(username_input != \"\"){\n\t\tvar posting = $.post(usersURI + \"/add_guest\", {\n\t\t\tname : username_input\n\t\t});\n\t\tposting.done(function(data){\n\t\t\t//alert(JSON.stringify(data));\n\t\t\tsetLoggedInGuest(JSON.parse(JSON.stringify(data)));\n\t\t});\n\t} else {\n\t\t//Prompt to entere a name\n\t\t$(\"#guest-username-submit-button\").attr(\"data-content\",\"Enter a name\").popover(\"toggle\");\n\t\tsetTimeout(function(){\n\t\t\t$(\"#guest-username-submit-button\").popover(\"toggle\");\n\t\t}, 1000);\n\t}\n}", "function checkForGuest(toGuest) {\r\n\ttempRe = false;\r\n\tfor (i = 0; i < gameRoom.length; i++) {\r\n\t\tif (gameRoom[i].roomGuest != null) {\r\n\t\t\tif (gameRoom[i].roomGuest.guestId == toGuest) tempRe = true;\r\n\t\t}\r\n\t}\r\n\treturn(tempRe);\r\n}", "manager(context) {\n axios.get('/api/manager/login/session/check')\n .then(resp => {\n //when session running\n if (resp.data.session == \"running\") {\n context.commit('manager', resp.data.manager);\n }\n\n //when session expired\n if (resp.data.session == 'expired') {\n localStorage.removeItem('manager_token');\n router.push({ name: 'manager_login' });\n }\n\n\n\n })\n }", "function confirmSystemHaker() {\n if (sessionStorage.getItem(\"loggedUserId\") == null) {\n location.href = '/HTML/loginAndSigup.html'\n } else {\n let users = JSON.parse(localStorage.getItem(\"users\"))\n let id = JSON.parse(sessionStorage.getItem(\"loggedUserId\"))\n for (const user of users) {\n\n if(user._id==id){\n if(user._accountType==2){\n localStorage.removeItem('loggedUserId');\n location.href = '/HTML/loginAndSigup.html'\n }\n }\n }\n }\n}", "mySession(){\n var session_login = Session.get(\"mySession\");\n // var session_signup = Session.get('mySession_signup');\n return session_login;\n }", "getSession() {\n return global.fetch(`${this.url}sessions?email=${this.email}&token=${this.token}`, { method: 'POST' }).then(data => data.text());\n }", "function session()\n{\nif (!localStorage.adminUser)\n{\n//default to empty array\nlocalStorage.adminUser = JSON.stringify([]);\n}\nreturn JSON.parse(localStorage.adminUser);\n}", "function guardarSesion(nombre,contraseña,id){\n sessionStorage.setItem('nombre',nombre);\n sessionStorage.setItem('contraseña',contraseña);\n sessionStorage.setItem('id',id);\n\n}", "function loginSiteMudancas() {\n imagensPaginaInicio();\n let saberAverdade = sessionStorage.getItem('Usuario');\n if (saberAverdade == \"Usuario\") {\n return \"Usuario\";\n } else if (saberAverdade == \"Empresa\") {\n return \"Empresa\";\n } else {\n return \"nao\";\n }\n}", "function startIndhold() {\n\n let data = sessionStorage.getItem(\"logind\")\n console.log(data); \n if (sessionStorage.logind == \"yes\") {\nconsole.log(\"yesyes\")\nhentData(indholdData, indholdHentet); \n} else {\nlocation.href = \"index.html\"\n}\n \n}", "function detectLogin(){\n /*obtengo los valores*/\n var email_user_=$.session.get(\"EmailUser\");\n var password_user_=$.session.get(\"PasswordUser\");\n var Object_user_=JSON.parse($.session.get(\"ObjectUser\"));\n if(typeof(email_user_)=='string' && typeof(password_user_)==\"string\")\n {\n $(\".email-user\").text(Object_user_.Name)\n\n }else{\n window.location=\"chat-login.html\";\n }\n }", "function callGuestOrAccCreationOrLogged() {\n\tif(intervalForServiceFee){\n\t\tclearIntervalApp(intervalForServiceFee);\n\t}\n\tdeActivateCheckoutPayButton(); \n var registerUser = parseBoolean(localStorage.getItem(\"registerUser\"));\n if (!registerUser) {\n if (!isGrtr) {\n updateUserProfileCheckout();\n } \n } else {\n \tif(isPromocodeJsonTypeAvailable()){\n \t\tif(!verifyPromocode()){\n \t \treturn;\n \t }\n \t}\n \tclearIntervalApp(timeIntevalOfAddCard);\n \tcallAddCardOrSubmitCard();\n }\n}", "function onHotmailLogin() {\r\n\t\tvar session = WL.getSession();\r\n\t\tif (session) {\r\n\t\t\tgetHotmailUser(session);\r\n\t\t}\r\n\t}", "function load() {\n var d = new Date().getTime();\n var uuid = 'xxxxxx'.replace(/[x]/g, function(c) {\n var r = (d + Math.random()*16)%16 | 0;\n d = Math.floor(d/16);\n return (c=='x' ? r : (r&0x3|0x8)).toString(16);\n });\n var guest = \"Guest \" + uuid.toUpperCase();\n //$(\"#name\").val(guest);\n $(\"#name\").val(\"sjoeke\");\n\n //check if localstorage exists\n if(localStorage.getItem(\"sessionID\")){\n sessionID = localStorage.getItem(\"sessionID\");\n localStorage.removeItem(\"sessionID\")\n $(\"#gamePlays\").hide();\n $(\"#statusWindow\").show();\n $(\"#gameClientWrapperSetup\").hide();\n $(\"#gameClientWrapperGame\").show();\n unPauzeGame();\n }\n}", "function RegisteredUser2(ipAddress,bal,name,email,passwd)\r\n{\r\n GuestUser.call(this,ipAddress);\r\n Account.call(this,bal);\r\n this.userName=name;\r\n this.email=email;\r\n this.password=passwd;\r\n}", "async function storeSessionIdOnSmoochUser(visitorId, sessionId) {\n\tawait smooch.appUsers.update(SMOOCH_APP_ID, visitorId, {\n\t\tproperties: { lastSessionId: sessionId }\n\t});\n\n\tconsole.info('Called storeSessionIdOnSmoochUser for', visitorId);\n}", "function pegarNome(e){\n e.preventDefault();\n sessionStorage.clear()\n if (nomeVisita.length > 0) {\n sessionStorage.setItem(\"nomeVisitante\",nomeVisita);\n sessionStorage.setItem(\"idVisitante\",0);\n\n return history.push(\"/home\");\n\n }else{\n toast.error('Por favor nos diga seu nome!!!', {\n position: \"top-right\",\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n progress: undefined,\n });\n }\n\n }", "async init() {\n try {\n const url_params = Object.fromEntries(new URLSearchParams(document.location.search)); \n const session = await fetch(\n \"session\",\n {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(url_params),\n });\n this.session = await session.json();\n } catch(e) {\n throw new Error(\"Unable to fetch session\", e);\n }\n // splice session into metadata (overriding existing values)\n this.metadata = {\n ...this.metadata,\n ...this.session\n };\n\n // set up unload handler\n window.addEventListener('unload', () => {\n const status = this.session.status;\n if (status != \"submitted\" && status != \"assigned\") {\n this.updateStatus(\"abandoned\");\n }\n });\n\n \n }", "_sendSessionUpdate() {\n const { scope, client } = this.getStackTop();\n if (!scope) return;\n\n const session = scope.getSession();\n if (session) {\n if (client && client.captureSession) {\n client.captureSession(session);\n }\n }\n }", "createSession({commit,state})\n {\n // TODO Stop all sessions and reset sessions data\n return new Promise((resolve, reject)=>{\n let payload = {hostID:state.user.id} // Data to create a session \n Axios.post( `${SERVER_URL}/api/sessions/create`, payload) // Make request to create a new session\n .then(sessionResp => { resolve(sessionResp) }) // Session creation response \n });\n }", "function login() {\n\n const userName = $('#user-name').val();\n const password = $('#user-password').val();\n\n $.ajax({\n\n method: 'GET',\n url: 'http://instankwick.com/Signin/' + userName + '/' + password,\n dataType: \"json\",\n\n success: function(data){\n\n if (data.status == \"ok\" || data.status == 'allready connected'){\n \n let id = data.id;\n let token = data.token;\n\n window.sessionStorage.setItem('token',token);\n window.sessionStorage.setItem('id', id);\n window.sessionStorage.setItem('username', userName);\n \n document.location.href=\"accueil.html\";\n\n }\n else\n document.location.href=\"register.html\";\n }\n\n });\n\n }", "function createSession(entities, { id, startTime, gigId }) {\n // TODO: existing active session check\n return {\n ...entities,\n [id]: {\n id,\n startTime,\n gigId,\n isActive: true,\n isPaused: false,\n pauseDuration: 0,\n }\n };\n}", "function checksession() {\n $.get(\"/checksession\", (session) => {\n if(session) {\n user_id = session.uid;\n actionWithSession();\n } else {\n user_id = \"\";\n actionWithoutSession();\n }\n });\n }", "onSessionInterupted() {\n this.emit('sessionInterupted');\n }", "async createSession (caps) {\n log.info('creating session');\n // TODO add validation on caps\n // TODO handle otherSessionData for multiple sessions\n let sessionId;\n [sessionId] = await super.createSession(caps);\n\n this.remote = new RemoteDebugger({\n bundleId: this.opts.bundleId,\n platformVersion: this.opts.platformVersion\n });\n\n log.info('creating connection to remote debugger');\n await this.remote.connect();\n log.info('connected to remote debugger, getting pages');\n let pages = await retryInterval(100, 200, async () => {\n let pages = await this.remote.selectApp();\n if (!pages.length) {\n throw new Error('no app connected');\n }\n return pages;\n });\n if (!pages.length) {\n throw new Error('Could not find Safari or an app with webviews running');\n }\n log.info('Selecting first page');\n await this.remote.selectPage(pages[0].id);\n log.info('Safari session ready to receive commands');\n\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}", "function randomizeRoomGuest (){\n\troomGuest = guestList[Math.floor(Math.random() * 10)];\n\tif (roomGuest === undefined){\n\t\troomGuest = \"no one\";\n\t}\n}", "function deconnexion() {\n let data = {\"type\": \"deconnexion\",\n \"username\": sessionStorage.username};\n socket.emit('gestion',JSON.stringify(data));\n sessionStorage.removeItem(\"username\");\n}", "function getPageSession() {\n return `${customerName}${new Date().getTime()} \" \" ${Math.floor((Math.random() * 998) + 1)}`;\n }", "function Session(channel, liveSwitchClient, notifyLeave, videoContainer, invitation) {\n var _this = this;\n this.state = ISession_js_1.SessionState.New;\n this.sendMessage = function (args) {\n var _a;\n if (_this.canSendMessages) {\n var sendStatus = new SendStatus_js_1.SendStatus(); // need to get the whole participants things sorted out.\n var future = (_a = _this.messageDataChannel) === null || _a === void 0 ? void 0 : _a.sendDataString(args.stringMessage);\n future === null || future === void 0 ? void 0 : future.then(function (result) {\n if (args === null || args === void 0 ? void 0 : args.onSent) {\n args === null || args === void 0 ? void 0 : args.onSent(args);\n }\n }).fail(function (ex) {\n if (args === null || args === void 0 ? void 0 : args.onFailed) {\n args === null || args === void 0 ? void 0 : args.onFailed(args, new Error(ex.name + \": \" + ex.message));\n }\n });\n return sendStatus;\n }\n return new SendStatus_js_1.SendStatus();\n };\n this.autoplayDeviceCameraStreams = true;\n this.autoplayDeviceMicrophoneStreams = true;\n this.autoplayStreams = true;\n // Need to do\n this.participants = new Array(); // in Progress\n this.autoplayScreenDisplayStreams = true;\n this.defaultConfig = DefaultConfig_js_1.DefaultConfig.Instance();\n this.gotInvitation = false;\n this.sfuUpstreamConnection = {};\n //private sfuUpstreamConnectionsForCamera: { [id: string]: fm.liveswitch.SfuUpstreamConnection } = {};\n //private sfuUpstreamConnectionsForScreen: { [id: string]: fm.liveswitch.SfuUpstreamConnection } = {};\n this.sfuDownstreamConnections = {};\n this.dataChannelConnection = null;\n this.canSendMessages = false;\n //invite(peerId: string): IInvite {\n // let responseFuture = this.liveSwitchChannel.invite(peerId, \"\");\n // var invite = new Invite();\n // responseFuture.then((invitation) => {\n // invite.addInvitation(invitation);\n // }).fail((ex) => {\n // console.log(ex.name + \": \" + ex.message);\n // });\n // return invite;\n //}\n //accept(arg?: any): any {\n // if (arguments.length == 0) {\n // return this.acceptWithAll();\n // }\n // else if (arguments.length == 1) { //Device ID\n // return this.acceptWithSpecifc(arguments[0])\n // }\n // else if (arguments.length > 2) {\n // let sourceTypes = new Array<SourceType>();\n // //let sourceTypes: Array<SourceType> = Array.prototype.slice.call(arguments);\n // for (let i = 0; i < arguments.length; i++) {\n // if (arguments[i] instanceof Array) {\n // for (let j = 0; j < arguments[i].length; j++) {\n // sourceTypes.push(arguments[i][j]);\n // }\n // }\n // else {\n // sourceTypes.push(arguments[i]);\n // }\n // }\n // return this.acceptionWithMultiple(sourceTypes);\n // }\n //};\n //private acceptWithAll = (): IStream[] => {\n // throw new Error(\"Hi\");\n //};\n //private acceptWithSpecifc = (sourceType: SourceType): IStream => {\n // throw new Error(\"Hi\");\n //};\n //private acceptionWithMultiple = (sourceTypes: SourceType[]): IStream[] => {\n // throw new Error(\"Hi\");\n //};\n //reject(arg?: any): any {\n // if (arguments.length == 0) {\n // return this.rejectWithNoReason();\n // } else if (arguments.length == 1) {\n // return this.rejectWithReason(arguments[0]);\n // }\n //};\n //private rejectWithNoReason() {}\n //private rejectWithReason(reason: SessionInviteRejectReason) {}\n this.upstreamState = ISession_js_1.SessionState.New;\n this.downstreamState = ISession_js_1.SessionState.New;\n // Not doing\n this.autoplayScreenSystemAudioStreams = true;\n this.notifyLeave = notifyLeave;\n this.participants.push(new Participant_js_1.Participant(liveSwitchClient.getId(), true));\n EntryPoint_js_2.LogDebug(\"Session constructor was called\");\n var me = this;\n this._LiveSwitchClient = liveSwitchClient;\n if (videoContainer) {\n this._videoContainer = videoContainer;\n }\n //if (invitation) {\n // me._invitation = invitation;\n // me.gotInvitation = true;\n // me.needLocalVideo = false;\n // me.needLocalAudio = false;\n // me.acceptWithSpecifc = (sourceType: SourceType) => {\n // let remoteStream!: Stream;// = new RemoteStream();\n // if (sourceType == SourceType.Microphone) {\n // remoteStream = (new Stream(DeviceType.Microphone, \"\"));\n // me.needLocalAudio = true;\n // }\n // else if (sourceType == SourceType.Camera || sourceType == SourceType.Screen) {\n // remoteStream = (new Stream(DeviceType.Camera, \"\"));\n // me.needLocalVideo = true;\n // }\n // me.OnClientJoinInAChannel(me._invitation?.accept().getResult());\n // return remoteStream;\n // };\n // me.acceptWithAll = () => {\n // let remoteStreams = new Array<Stream>();\n // remoteStreams.push(new Stream(DeviceType.Camera, \"\"));\n // remoteStreams.push(new Stream(DeviceType.Microphone, \"\"));\n // me.needLocalAudio = true; me.enableRemoteAudio = true;\n // me.OnClientJoinInAChannel(me._invitation?.accept().getResult());\n // return remoteStreams;\n // };\n // me.acceptionWithMultiple = (SourceTypes: SourceType[]) => {\n // let remoteStreams = new Array<Stream>();\n // SourceTypes.forEach((source) => {\n // if (source == SourceType.Microphone) {\n // remoteStreams.push(new Stream(DeviceType.Microphone, \"\"));\n // me.needLocalVideo = true;\n // }\n // else if (source == SourceType.Camera || source == SourceType.Screen) {\n // remoteStreams.push(new Stream(DeviceType.Camera, \"\"));\n // me.needLocalVideo = true;\n // }\n // });\n // me.OnClientJoinInAChannel(me._invitation?.accept().getResult());\n // return remoteStreams;\n // }\n // me.rejectWithNoReason = () => {\n // me._invitation?.reject(); // this ojbect now does nothing\n // }\n // me.rejectWithReason = (reason: SessionInviteRejectReason) => {\n // me._invitation?.reject(reason.toString()); // this ojbect now does nothing\n // }\n //}\n //else {\n /// join a channel\n var channelClaim = new fm.liveswitch.ChannelClaim(channel);\n //channelClaim.setAction(fm.liveswitch.ClaimAction.Claim);\n var token = fm.liveswitch.Token.generateClientJoinToken(this.defaultConfig.DefaultAppId, this.defaultConfig.DefaultUserId, this.defaultConfig.DefaultDevice, this.defaultConfig.ClientId, channelClaim, this.defaultConfig.DefaultSharedSecret);\n this._LiveSwitchClient.join(channel, token).then(function (channel) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n me.OnClientJoinInAChannel(channel);\n return [2 /*return*/];\n });\n }); }).fail(function (ex) {\n throw ex;\n });\n //}\n }", "function identifyLoginState() {\n\tif (window.sessionStorage.getItem(\"loginUser\") != \"\") {\n\t\t$(\".publish-area\").removeClass(\"hidden-window\", 700);\n\t\t$(\"#shadow\").fadeIn(700);\n\t} else {\n\t\talert(\"請先登入 !\");\n\t\t$(\".login-area\").removeClass(\"hidden-window\", 700);\n\t\t$(\"#shadow\").fadeIn(700);\n\t}\n}", "_sendSessionUpdate() {\n const { scope, client } = this.getStackTop();\n if (!scope) return;\n\n const session = scope.getSession();\n if (session) {\n if (client && client.captureSession) {\n client.captureSession(session);\n }\n }\n }", "function loginauthor () {\n var xhr = httpIo.httpGet(\"/api/guest\", function (data, object) {\n console.log(\"game connect suLayaess!!\");\n // console.log(data);\n Laya.beimi.user.id = JSON.parse(data).token.userid;\n connectService();\n }, function () {\n console.log(\"game connect fail !!\");\n });\n\n}", "function logoutUser() {\n\n usuarioCorrente = {};\n sessionStorage.setItem('usuarioCorrente', JSON.stringify(usuarioCorrente));\n window.location = 'index.html';\n }", "function alreadyLoggedIn() {\n if(sessionStorage.getItem(\"session\")) {\n const session = JSON.parse(sessionStorage.getItem(\"session\"));\n updateLoggedIn(session.username);\n authToken = session._kmd.authtoken;\n createdRecipes()\n }\n \n}", "activate() {\n if (!loginStat()) {\n this.username = ''\n // var status = window.sessionStorage.getItem('rotate')\n // console.log('rotate ' ,status);\n // window.sessionStorage.setItem('rotate', 'true')\n // console.log('rotate ' ,status);\n\n if (window.localStorage.getItem('rotate') === 'true') {\n this.picture = 'http://tse1.mm.bing.net/th?id=OIP.Me6a9845f4c2e2f7f2c43c833bbcec9ddo0&w=203&h=142&c=7&rs=1&qlt=90&o=4&pid=1.1'\n window.localStorage.setItem('rotate', 'false');\n } else {\n this.picture = 'http://tse1.mm.bing.net/th?&id=OIP.Mccf9777d953a5488e46b20840f6069f3o0&w=198&h=198&c=0&pid=1.9&rs=0&p=0'\n window.localStorage.setItem('rotate', 'true');\n }\n\n // this.username = JSON.parse(window.localStorage.getItem('profile')).nickname\n } else {\n // this.time = new Date(JSON.parse(window.localStorage.getItem('profile')).updated_at)\n this.picture = JSON.parse(window.localStorage.getItem('profile')).picture\n this.username = JSON.parse(window.localStorage.getItem('profile')).nickname\n this.logOut = !this.logOut\n }\n }", "_enrichSession(session) {\n let userStore = this.userStore\n return new Promise(function(resolve, reject) {\n userStore.getUser(session.userId).then(function(user) {\n session.user = user\n resolve(session)\n }).catch(function(err) {\n reject(new Err('AuthenticationError', {\n cause: err\n }))\n })\n })\n }", "function logUd() {\n location.href = \"index.html\"; \n sessionStorage.setItem(\"logind\", \"no\");\n sessionStorage.setItem(\"harsetintro\", \"no\"); \n}", "actionAutoLoginUser ({ data }) {\n var fechaDay = new Date(sessionStorage.getItem('validDate'))\n var fechaActual = new Date()\n var diasdif= fechaActual.getTime()-fechaDay.getTime();\n var contdias = Math.round(diasdif/(1000*60*60*24)); \n if (contdias >= 1) {\n store.dispatch('actionCloseSesion')\n } else {\n let user = sessionStorage.getItem('data')\n store.commit('setUser', JSON.parse(user))\n store.dispatch('actionGetPionero', JSON.parse(user))\n router.push('/inicio')\n }\n }", "function escucha_users(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByTagName(\"article\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z<x.length; z++){/*recorro el total de elemtos que se dara la capacidad de resaltar al\n\t\tser seleccionados mediante un click*/\n\t\tx[z].onclick=function(){//activo el evento del click\n\t\t\t/*La funcion siguiente desmarca todo los articles antes de seleccionar nuevamente a un elemento*/\n\t\t\tlimpiar(\"article\");\n\t\t\t$(this).css({'border':'3px solid #f39c12'});\n\t\t\tvar y=$(this).find(\"input\");\n\t\t\tconfUsers[indice]=y.val();\n\t\t\tconsole.log(confUsers[indice]);\n\t\t\t/* indice++; Comento esta linea dado que solo se puede modificar un usuario, y se deja para \n\t\t\tun uso posterior, cuando se requiera modificar o seleccionar a mas de un elemento, que se\n\t\t\talmacene en el arreglo de confUser los id que identifican al elemento*/\n\t\t\tsessionStorage.setItem(\"conf\", confUsers[indice]);\n\t\t};\n\t}\n}", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "static generateSession(router) {\n\n\t\tconst hash = crypto.Hash('sha1');\n\t\tconst sessionHashLength = 32; // Length of session hash buffer\n\t\tconst sessionIdLength = 16; // Length of session id buffer\n\n\t\treturn new Promise((resolve, reject) => {\n\n\t\t\t// Generate random session id\n\t\t\tcrypto.randomBytes(sessionHashLength, (error, id) => {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n\t\t\t\t\tresolve({\n\t\t\t\t\t\tcontainer: {},\n\t\t\t\t\t\thash: hash.update(id).digest('hex'),\n\t\t\t\t\t\tid: id.slice(sessionIdLength).toString('hex'),\n\t\t\t\t\t\ttimeout: router._options.session.timeout\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function createSession(){\t\t\t\n\t\t\tif(lc.user != null){\n\t\t\t\tsessionService.createSession(JSON.stringify(lc.user));\n\t\t\t\t$location.url(\"/dashboard\");\n\t\t\t}\n\t\t\t\n\t\t}", "function appIsGuest() {\n if (location.pathname.match(/guest/) !== null) {\n return true; //guest\n }\n return false; //not guest\n }", "sessionForModal() {\n let token = []\n let tokenArray =\n \"qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890\"\n tokenArray = tokenArray.split(\"\")\n let tokn = \"\"\n for (let i = 0; i < 30; i++) {\n let letter = tokenArray[Math.floor(Math.random() * tokenArray.length)]\n tokn = tokn + letter\n }\n token.push(tokn)\n token = token.join(\"\")\n localStorage.setItem('gdpr', token)\n }", "function getelementSessionbyname(nombre) {\n var ID = code(Context, Context);\n var item = localStorage.getItem(ID + nombre + ID);\n return decode('SCT-' + Psw, item);\n}", "function esci_account(){\r\n sessionStorage.removeItem(\"user\");\r\n document.write(\" \");\r\n window.location.href = \"index.html\";\r\n}", "render() {\n //false => menu guest(sem registo);\n //true => menu loggedIn(com registo e logIn feito)\n const isLoggedIn = sessionStorage.getItem(\"id\") !== null;\n return (\n <div>\n { isLoggedIn &&\n this.loggedInMenu()\n }\n\n { !isLoggedIn &&\n this.guestMenu()\n }\n </div>\n );\n }", "function checkOpSessie (req, res, next) {\n\tif (req.session.userName) {\n\t\tnext();\n\t} else {\n\t\tres.send({\n\t\t\tingelogd : false\n\t\t});\n\t}\n}", "_addSessionToStorage() {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(this._session));\n }", "function loggedIn(res, immediate) {\n console.log(\"RES\", res);\n var email = res.email;\n setSessions([ { email: email } ]);\n\n var unlogged = $(\".unlogged\").hide();\n var loggedin = $(\".loggedin\").show();\n $(\"#new\").show();\n // set the user visible display\n var l = $(\"#you\").removeClass('clickable');;\n l.empty();\n l.css('opacity', '1');\n console.log(\"email: \", email);\n l.append($(\"<span>\").text(email).addClass(\"username\"))\n l.append($('<a id=\"logout\" href=\"#\" >(logout)</a>'));\n l.unbind('click');\n\n $(\"#logout\").bind('click', logout);\n\n if (immediate) {\n $(\"#content .intro\").hide();\n $(\"#content .business\").fadeIn(300);\n }\n else {\n $(\"#content .intro\").fadeOut(700, function() {\n $(\"#content .business\").fadeIn(300);\n });\n }\n\n // get a gravatar cause it's pretty\n var iurl = 'http://www.gravatar.com/avatar/' +\n Crypto.MD5($.trim(email).toLowerCase()) +\n \"?s=16\";\n $(\"<img>\").attr('src', iurl).appendTo($(\"#picture\"));\n\n tellbrowser({email: email, avatar: iurl});\n}", "function lsVideo () {\n\tsessionStorage.setItem('tipusM', \"video\");\n}", "getSession(){\n\t\tvar self = this;\n\n\t\tUserHttpService.getSession().then(function (response) {\n\t\t\tself.setState({\n\t\t\t\tloading: false,\n\t\t\t\tuserSession: response.data.user || null\n\t\t\t})\n\t\t});\t\n\t}", "userRegistration() {\n let regUserName = document.querySelector(\"#regUserName\").value;\n let regEmail = document.querySelector(\"#regEmail\").value;\n let regPassword = document.querySelector(\"#regPassword\").value; // let regConfirmPassword = document.querySelector(\"#regUserName\").value\n\n _nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"POST\",\n \"dataBaseObject\": {\n \"userName\": regUserName,\n \"email\": regEmail,\n \"password\": regPassword\n }\n }).then(_nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"GET\",\n \"embedItem\": `?userName=${regUserName}`\n }).then(user => {\n console.log(user);\n user.forEach(x => {\n sessionStorage.setItem(\"userId\", x.id); //hides NOMAD heading\n\n $(\".t-border\").hide(); //hides the form\n\n $(\".form\").hide(); //displays navigatin bar\n\n _dashboard.default.createNavBar();\n\n let userId = sessionStorage.getItem(\"userId\"); //console.log verifying that credentials match and user is logged in\n\n console.log(\"logged in as\" + \" \" + x.userName);\n console.log(\"your user ID is: \" + userId);\n });\n }));\n }", "function saveSession(session) {\n $window.sessionStorage['user'] = JSON.stringify(session);\n }", "function registerCallbackSession() {\n\t console.log(\"username is \"+ $(\"#username\").html());\n\t sendMessage( $(\"#username\").html() );\n\t\n\n\t}", "newSession() {}", "function startSession(id, r) {\n\tsessions[id] = 0;\n\tremotes[id] = r;\n\tsendHello(id)\n\tresetTimer(id);\n}", "function setjourney(evt) {\n sessionStorage.setItem(0, \"set\");\n}", "async function start_session (req, res, next) {\n const gameObj = { gameId: uuid() };\n const accessToken = genJWT(gameObj);\n await db.new_game(gameObj.gameId);\n return res.json({ accessToken: accessToken })\n}", "function openOldChats() {\n let roomArray = JSON.parse(sessionStorage.getItem(\"rommies\"));\n\n let room = '';\n let destino = '';\n for (j = 0; j < roomArray.length; j++) {\n room = roomArray[j][0];\n destino = roomArray[j][1];\n agregarPestana(room, destino);\n document.querySelector('#ch' + room).classList.add(\"hiddenChat\");\n socket.emit('unir a room', room);\n //otro for para ir llenando con el n==contenido de su session.storage.\n if (sessionStorage.getItem(room)) {\n console.log('la vara esta ahi de nuevo');\n let conversacion = JSON.parse(sessionStorage.getItem(room));\n console.log(conversacion.length);\n for (n = 0; n < conversacion.length; n++) {\n console.log(conversacion[n][1])\n socket.emit('mensajeViejo', conversacion[n][1], conversacion[n][2], conversacion[n][0], room);\n }\n }\n $('#chatin' + room).scrollTop($('#chatin' + room)[0].scrollHeight);\n }\n addListerPestana();\n //mandar a agregar a este socket\n }", "_sendSessionUpdate() {\n\t const { scope, client } = this.getStackTop();\n\t if (!scope) return;\n\n\t const session = scope.getSession();\n\t if (session) {\n\t if (client && client.captureSession) {\n\t client.captureSession(session);\n\t }\n\t }\n\t }", "function UserLogin(res){\n sessionStorage.setItem('id', res.id);\n sessionStorage.setItem('user_type', res.attributes.user_type);\n sessionStorage.setItem('school', res.attributes.school);\n sessionStorage.setItem('username', res.attributes.name);\n sessionStorage.setItem('token', res.getSessionToken());\n window.location = '/';\n}", "function checkLogin(){\n\t\t\t\t\n if(sessionStorage.loggedInUsrEmail !== undefined){\n\n\t\t//Extract details of logged in user\n\t\tlet usrObj = JSON.parse(localStorage[sessionStorage.loggedInUsrEmail]);\n\t\t\n\t\t//Say hello to logged in user\n document.getElementById(\"loginPara\").innerHTML = usrObj.email + \" logged in.\";\n\t\t\t\t\t\n\t\t//creation of log out button\n\t\tlet logoutButton = document.createElement(\"button\");\n\t\tlogoutButton.innerHTML = \"Log out\";\n\t\t\n\t\tlet body = document.getElementsByTagName(\"loginPara\")[0];\n\t\tloginPara.appendChild(logoutButton);\n\t\t\n\t\t//adding an event for a button\n\t\tlogoutButton.addEventListener(\"click\", function(){\n\t\t\t\n\t\t\tsessionStorage.clear(); //clearing session storage\n\t\t\tlocation.reload();\t//reloading page \n\t\t\t\n \t});\n\t }\n}", "function iniciarSesion(dataUsuario) {\n usuarioLogueado = new Usuario(dataUsuario.data._id, dataUsuario.data.nombre, dataUsuario.data.apellido, dataUsuario.data.email, dataUsuario.data.direccion, null);\n tokenGuardado = dataUsuario.data.token;\n localStorage.setItem(\"AppUsuarioToken\", tokenGuardado);\n navegar('home', true, dataUsuario);\n}" ]
[ "0.6464526", "0.6443274", "0.6389303", "0.63694483", "0.6360792", "0.61481714", "0.6103504", "0.6067208", "0.5895888", "0.5894719", "0.5887396", "0.58808404", "0.5871832", "0.5835247", "0.5812096", "0.5811367", "0.5803319", "0.5785709", "0.5777818", "0.57561356", "0.5731551", "0.5644264", "0.56211007", "0.56209964", "0.55864084", "0.55814624", "0.556977", "0.55486333", "0.55470055", "0.55375475", "0.5535669", "0.5532179", "0.5527559", "0.5509831", "0.55044985", "0.5502249", "0.54937303", "0.5476072", "0.54628974", "0.545712", "0.5455129", "0.54543346", "0.5452938", "0.54513353", "0.54374886", "0.5432002", "0.5426013", "0.54117614", "0.5390494", "0.5374864", "0.5372799", "0.5369801", "0.5366632", "0.53632694", "0.53591263", "0.53579265", "0.53537834", "0.5352469", "0.53366107", "0.5332505", "0.5330543", "0.53140783", "0.5297062", "0.5294401", "0.52907115", "0.5287595", "0.52819645", "0.52775735", "0.52769715", "0.5275236", "0.527199", "0.5271277", "0.52687657", "0.5266482", "0.525967", "0.525967", "0.5246963", "0.52451676", "0.52441466", "0.5238223", "0.52357566", "0.5234518", "0.52316225", "0.52309114", "0.5224531", "0.5216731", "0.5215738", "0.52143633", "0.52118754", "0.5210057", "0.52038264", "0.51908845", "0.5190449", "0.5182133", "0.51770145", "0.51759446", "0.51744235", "0.5173272", "0.51696867", "0.5167797" ]
0.65069497
0
Mostra il toast banner per 4s con il messaggio che gli viene passato come parametro
function showToast(text) { TOAST.textContent = text; TOAST.classList.toggle('toast__is-hidden'); setTimeout(() => { TOAST.classList.toggle('toast__is-hidden'); }, 4000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mensagemDeAviso(mensagem) {\r\n document.getElementById('mensagemDeErro').innerHTML = `<div class=\"toast shadow-lg mb-5 bg-white rounded\" role=\"alert\" data-delay=\"5000\" aria-atomic=\"true\" style=\"opacity:0.9;\">\r\n <div class=\"toast-header bg-success text-light\">\r\n <span class=\"fas fa-check-double\" style=\"margin-right:5px;\"></span>\r\n <strong class=\"mr-auto\">Informação</strong>\r\n <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div class=\"toast-body\">\r\n <strong>${mensagem}</strong>\r\n </div>\r\n </div>`\r\n\r\n $('.toast').toast('show')\r\n}", "function mensagemDeErro(mensagem) {\r\n document.getElementById('mensagemDeErro').innerHTML = `<div class=\"toast shadow-lg mb-5 bg-white rounded\" role=\"alert\" data-delay=\"5000\" aria-atomic=\"true\" style=\"opacity:0.9;\">\r\n <div class=\"toast-header bg-danger text-light\">\r\n <span class=\"fas fa-exclamation-triangle\" style=\"margin-right:5px;\"></span>\r\n <strong class=\"mr-auto\">Atenção</strong>\r\n <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div class=\"toast-body\">\r\n <strong>${mensagem}</strong>\r\n </div>\r\n </div>`\r\n\r\n $('.toast').toast('show')\r\n}", "async function toastMessage (message,type,title){\n\n if( Array.isArray(message) || typeof message === 'object' ){\n message = convertToListHtml(message);\n }\n\n if(isEmpty(type)){\n type = \"info\";\n }\n\n if(type==\"danger\"){\n type = \"error\";\n }\n\n if(isEmpty(title)){\n if(type == \"error\"){\n title = \"Error\";\n }else if(type == \"warning\"){\n title = \"Advertencia\";\n }else if(type == \"Info\"){\n title = \"Información\";\n }else{\n title = \"Mensaje\";\n }\n }\n\n const Toast = Swal.mixin({\n toast: true,\n position: 'top-end',\n showConfirmButton: false,\n timer: 5000,\n timerProgressBar: true,\n onOpen: (toast) => {\n toast.addEventListener('mouseenter', Swal.stopTimer)\n toast.addEventListener('mouseleave', Swal.resumeTimer)\n }\n })\n\n Toast.fire({\n icon: type,\n title: message\n })\n\n }", "function warning(tipe, judul, pesan)\n{\n var shortCutFunction = tipe;\n var msg = pesan;\n var title = judul || '';\n var showDuration = \"1000\";\n var hideDuration = \"1000\";\n var timeOut = \"5000\";\n var extendedTimeOut = \"1000\";\n var showEasing = \"swing\";\n var hideEasing = \"linear\";\n var showMethod = \"slideDown\";\n var hideMethod = \"slideUp\";\n\n toastr.options = {\n closeButton: false,\n debug: false,\n positionClass: 'toast-top-right',\n onclick: null\n };\n\n if (showDuration.length) {\n toastr.options.showDuration = showDuration;\n }\n\n if (hideDuration.length) {\n toastr.options.hideDuration = hideDuration;\n }\n\n if (timeOut.length) {\n toastr.options.timeOut = timeOut;\n }\n\n if (extendedTimeOut.length) {\n toastr.options.extendedTimeOut = extendedTimeOut;\n }\n\n if (showEasing.length) {\n toastr.options.showEasing = showEasing;\n }\n\n if (hideEasing.length) {\n toastr.options.hideEasing = hideEasing;\n }\n\n if (showMethod.length) {\n toastr.options.showMethod = showMethod;\n }\n\n if (hideMethod.length) {\n toastr.options.hideMethod = hideMethod;\n }\n\n if (!msg) {\n msg = getMessage();\n }\n\n $(\"#toastrOptions\").text(\"Command: toastr[\" + shortCutFunction + \"](\\\"\" + msg + (title ? \"\\\", \\\"\" + title : '') + \"\\\")\\n\\ntoastr.options = \" + JSON.stringify(toastr.options, null, 2));\n\n var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists\n $toastlast = $toast;\n}", "function PesanNotif(tipe, judul, pesan)\n{\n var shortCutFunction = tipe;\n var msg = pesan;\n var title = judul || '';\n var showDuration = \"1000\";\n var hideDuration = \"1000\";\n var timeOut = \"5000\";\n var extendedTimeOut = \"1000\";\n var showEasing = \"swing\";\n var hideEasing = \"linear\";\n var showMethod = \"slideDown\";\n var hideMethod = \"slideUp\";\n\n toastr.options = {\n closeButton: false,\n debug: false,\n positionClass: 'toast-bottom-right' || 'toast-top-right',\n onclick: null\n };\n\n if (showDuration.length) {\n toastr.options.showDuration = showDuration;\n }\n\n if (hideDuration.length) {\n toastr.options.hideDuration = hideDuration;\n }\n\n if (timeOut.length) {\n toastr.options.timeOut = timeOut;\n }\n\n if (extendedTimeOut.length) {\n toastr.options.extendedTimeOut = extendedTimeOut;\n }\n\n if (showEasing.length) {\n toastr.options.showEasing = showEasing;\n }\n\n if (hideEasing.length) {\n toastr.options.hideEasing = hideEasing;\n }\n\n if (showMethod.length) {\n toastr.options.showMethod = showMethod;\n }\n\n if (hideMethod.length) {\n toastr.options.hideMethod = hideMethod;\n }\n\n if (!msg) {\n msg = getMessage();\n }\n\n $(\"#toastrOptions\").text(\"Command: toastr[\" + shortCutFunction + \"](\\\"\" + msg + (title ? \"\\\", \\\"\" + title : '') + \"\\\")\\n\\ntoastr.options = \" + JSON.stringify(toastr.options, null, 2));\n\n var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists\n $toastlast = $toast;\n}", "function MuestraToast(tipoNotificacion, mensaje) {\n\n switch (tipoNotificacion) {\n\n case \"success\":\n iziToast.success({\n title: mensaje,\n message: '',\n position: 'topRight'\n });\n break;\n case \"info\":\n iziToast.info({\n title: mensaje,\n message: '',\n position: 'topRight'\n });\n break;\n case \"warning\":\n iziToast.warning({\n title: mensaje,\n message: '',\n position: 'topRight'\n });\n break;\n case \"error\":\n iziToast.error({\n title: mensaje,\n message: '',\n position: 'topRight'\n });\n break;\n\n }\n\n}", "function mensagemEstoque(mensagem) {\r\n document.getElementById('alertStock').innerHTML = `<div class=\"toast shadow-lg mb-5 bg-white rounded\" role=\"alert\" data-delay=\"5000\" aria-atomic=\"true\" style=\"opacity:0.9;\">\r\n <div class=\"toast-header bg-warning text-light\">\r\n <span class=\"fas fa-exclamation-triangle\" style=\"margin-right:5px;\"></span>\r\n <strong class=\"mr-auto\">Estoque</strong>\r\n <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div class=\"toast-body\">\r\n <strong>${mensagem}</strong>\r\n </div>\r\n </div>`\r\n\r\n $('.toast').toast('show')\r\n setTimeout(function () { document.getElementById('alertStock').innerHTML = '' }, 5300)\r\n}", "function toast(message) {\n if (!message) {\n message = 'Relax! More points in ' + (minutesTillNextFunds - minutesfromStart()) + ' minutes.';\n }\n var toastLength = 3000;\n if (!toastRunning) {\n toastRunning = true;\n setTimeout(function () {\n toastRunning = false;\n\n }, toastLength + 300);\n\n Materialize.toast(message, toastLength, accentColor + ' flow-text');\n }\n}", "function congratulate_win() {\n $.toast({ \n heading: 'You Won',\n icon: 'success',\n text: 'Congratulations. You won. Good job',\n textAlign : 'center',\n textColor : '#fff',\n bgColor : '#0da114',\n hideAfter : false,\n stack : false,\n position : 'mid-center',\n allowToastClose : true,\n showHideTransition : 'fade',\n loader: false,\n });\n}", "function show_message(message, category) {\n\n load('ui.toastr', function(){\n category = category || \"success\"\n\n var config = {\n \"closeButton\": true,\n \"positionClass\": \"toast-top-full-width\",\n \"timeOut\": \"5000\",\n \"newestOnTop\": true,\n \"progressBar\": true\n }\n var title = \"\"\n\n if (category == \"success\") {\n toastr.success(message, title, config)\n } else if (category == \"error\") {\n toastr.error(message, title, config)\n } else if (category == \"info\") {\n toastr.info(message, title, config)\n } else if (category == \"warning\") {\n toastr.warning(message, title, config)\n } else {\n toastr.info(message, title, config)\n }\n });\n\n return;\n\n}", "function toastBorrarProducto(id_producto){\n var toastHTML = '<span>¿Borrar producto?</span><button class=\"btn-flat toast-action\" onclick=\"borrarProducto('+id_producto+')\">ok</button>';\n M.toast({html: toastHTML});\n}", "function congratulate_draw() {\n $.toast({ \n heading: \"It's a DRAW\",\n icon: 'info',\n text: \"Thank you for this tough game. It was fun to watch\",\n textAlign : 'center',\n textColor : '#fff',\n bgColor : '#ffba18',\n hideAfter : false,\n stack : false,\n position : 'mid-center',\n allowToastClose : true,\n showHideTransition : 'fade',\n loader: false,\n });\n}", "function toastBorrarCliente(id_cliente){\n var toastHTML = '<span>¿Borrar este cliente?</span><button class=\"btn-flat toast-action\" onclick=\"borrarCliente('+id_cliente+')\">ok</button>';\n M.toast({html: toastHTML});\n}", "function toastMsg(message) {\n var $toast = $('<div class=\"toastMsg\">' + message + '</div>');\n $toast.on('animationend', function() { $toast.remove(); });\n $('body').append($toast);\n}", "showToast(msg,btn){\n Toast.show({\n text: msg,\n position: 'bottom',\n buttonText: btn,\n duration: 5000,\n style: {\n backgroundColor: \"#212121\",\n opacity:0.76\n }\n })\n }", "function toast(msg) {\n if (typeof window.plugins.toast != 'undefined')\n {\n window.plugins.toast.showShortBottom(msg,\n function (a) {\n console.log('toast success: ' + a)\n },\n function (b) {\n console.log('toast error: ' + b)\n })\n }\n}", "function success(tipe, judul, pesan)\n{\n var shortCutFunction = tipe;\n var msg = pesan;\n var title = judul || '';\n var showDuration = \"1000\";\n var hideDuration = \"1000\";\n var timeOut = \"5000\";\n var extendedTimeOut = \"1000\";\n var showEasing = \"swing\";\n var hideEasing = \"linear\";\n var showMethod = \"fadeIn\";\n var hideMethod = \"fadeOut\";\n\n toastr.options = {\n closeButton: false,\n debug: false,\n positionClass: 'toast-bottom-right',\n onclick: null\n };\n\n if (showDuration.length) {\n toastr.options.showDuration = showDuration;\n }\n\n if (hideDuration.length) {\n toastr.options.hideDuration = hideDuration;\n }\n\n if (timeOut.length) {\n toastr.options.timeOut = timeOut;\n }\n\n if (extendedTimeOut.length) {\n toastr.options.extendedTimeOut = extendedTimeOut;\n }\n\n if (showEasing.length) {\n toastr.options.showEasing = showEasing;\n }\n\n if (hideEasing.length) {\n toastr.options.hideEasing = hideEasing;\n }\n\n if (showMethod.length) {\n toastr.options.showMethod = showMethod;\n }\n\n if (hideMethod.length) {\n toastr.options.hideMethod = hideMethod;\n }\n\n if (!msg) {\n msg = getMessage();\n }\n\n $(\"#toastrOptions\").text(\"Command: toastr[\" + shortCutFunction + \"](\\\"\" + msg + (title ? \"\\\", \\\"\" + title : '') + \"\\\")\\n\\ntoastr.options = \" + JSON.stringify(toastr.options, null, 2));\n\n var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists\n $toastlast = $toast;\n}", "function message(ar) {\n\tif(ar==1){\n\t document.getElementById('successMsg').innerHTML +=\n\t \"<div id='snackbar' class=''>Projekt wurde genehmigt!</div>\";\n\t}\n\telse{\n\t\tdocument.getElementById('successMsg').innerHTML +=\n\t\t\t \"<div id='snackbar' class=''>Projekt wurde abgelehnt!</div>\";\n\t}\n\t var element = 'snackbar';\n\t $(function(){\n\t\t\t$(function(){\n\t\t\t\t$('#'+element).addClass('animated slideInUp');\n\t document.getElementById(\"snackbar\").style.visibility = \"visible\";\n\t\t\t\t$('#'+element).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t$('#'+element).removeClass('animated slideInUp');\n\t\t\t\t\t$(function(){\n\t\t\t\t\t\t$('#'+element).addClass('animated slideOutDown delay-3s');\n\t\t\t\t\t\t$('#'+element).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t\t\t$('#'+element).removeClass('animated slideOutDown delay-3s');\n\t\t\t\t\t\t\t$('#'+element).remove();\t\n\t\t\t\t\t\t});\n\t\t\t\t\t});\t\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "function createToast(msg){\n var sec = '<section class=\"comToast\"><i><em class=\"rotate\"></em>'+msg+'</i></section>'\n $(\"body\").append(sec)\n}", "function msgPerdeu() {\n swal({\n title: \"Perdeste!\",\n type: \"error\",\n timer: 3000,\n showConfirmButton: false\n });\n bloqueioBoneco();\n }", "function toast(txt, html, time)\r\n{\r\n txt += '';\r\n if (!txt || txt.length == 0) return;\r\n \r\n time = time || txt.length * 200;\r\n \r\n var toastHolderId = 'toast_holder';\r\n \r\n var toastHolder = document.getElementById(toastHolderId);\r\n \r\n if (!toastHolder) \r\n {\r\n toastHolder = document.body.appendChild(document.createElement('div'));\r\n toastHolder.id = toastHolderId;\r\n toastHolder.style.height = '';\r\n toastHolder.dataset.height = toastHolder.clientHeight;\r\n }\r\n \r\n toastHolder.style.height = toastHolder.clientHeight + 'px';\r\n \r\n var el = document.createElement('div');\r\n el.style.display = 'none';\r\n \r\n var toast = toastHolder.insertBefore(el, toastHolder.firstChild);\r\n \r\n if (html) $(toast).html(txt);\r\n else $(toast).text(txt);\r\n \r\n setTimeout( function(toastHolder, toast)\r\n {\r\n toast.style.display = '';\r\n \r\n var style = toast.currentStyle || window.getComputedStyle(toast);\r\n var marginTop = style.marginTop;\r\n if (marginTop.substr(-1) == '%')\r\n marginTop = document.body.clientHeight * .015 + 'px';\r\n \r\n toast.dataset.height = toast.clientHeight + parseInt(marginTop);\r\n var newHeight = (parseInt(toastHolder.dataset.height) + parseInt(toast.dataset.height) + (toastHolder.children.length == 1 ? parseInt(marginTop) : 0));\r\n \r\n toastHolder.dataset.height = newHeight;\r\n toastHolder.style.height = newHeight + 'px';\r\n $(toast).addClass('show');\r\n $(toastHolder).addClass('show');\r\n }, 50, toastHolder, toast);\r\n \r\n setTimeout( function(toastHolder, toast)\r\n {\r\n var newHeight = (parseInt(toastHolder.dataset.height) - parseInt(toast.dataset.height));\r\n \r\n toastHolder.dataset.height = newHeight;\r\n toastHolder.style.height = newHeight + 'px';\r\n if (toastHolder.children.length == 1)\r\n {\r\n toastHolder.dataset.height = '0';\r\n toastHolder.style.height = '0px';\r\n }\r\n \r\n toast.style.marginTop = '-' + toast.dataset.height + 'px';\r\n $(toast).removeClass('show');\r\n $(toastHolder).removeClass('show');\r\n }, Math.max(1000, time), toastHolder, toast);\r\n \r\n setTimeout( function(toastHolder, toast)\r\n {\r\n removeElement(toast);\r\n if (toastHolder.children.length == 0) removeElement(toastHolder);\r\n }, Math.max(1000, time) + 400, toastHolder, toast);\r\n}", "function mostrarAyuda(msg) {\n $.notify({\n message: msg\n }, {\n type: 'info',\n delay: 3000,\n placement: {\n align: 'center'\n },\n z_index: 99999,\n });\n}", "function loadingMessage() {\n swal({\n title: 'Espere un momento porfavor',\n buttons: false,\n closeOnEsc: false,\n closeOnClickOutside: false,\n content: {\n element: \"div\",\n attributes: {\n innerHTML:\"<i class='fa fa-circle-o-notch fa-spin fa-3x fa-fw'></i>\"\n },\n }\n }).catch(swal.noop);\n }", "function emitirAviso(mensagem, id, tempo){\n let snackbar = document.getElementById(id);\n snackbar.innerHTML = mensagem;\n snackbar.className = \"show\";\n setTimeout(function(){snackbar.className = snackbar.className.replace(\"show\", \"\"); }, tempo);\n}", "function Slide(Title_, Messages, time) {//Hien thị goc phai bên duoi man minh trong time giay .\n $.messager.show({\n title: Title_,\n msg: Messages,\n timeout: time,\n showType: 'slide'\n });\n}", "function toast ({title, message, type, timeout, cb}) {\n // var res = miniToastr[type](message, title, timeout, cb)\n // console.log(res)\n return null\n}", "static get tag(){return\"simple-toast\"}", "function toast({text, duration, type}) {\n ipc.send(\"addToast\", {text: text, duration: duration, type: type});\n}", "function toast({text, duration, type}) {\n ipc.send(\"addToast\", {text: text, duration: duration, type: type});\n}", "function SnackAlerta(inf = {}){\n\n switch(inf[\"aviso\"]){\n case \"errorServidor\":\n Snackbar.show({text: 'No se pudo realizar la petición. Verifique su conexión a internet e inténtelo nuevamente.',pos: 'bottom-left',showAction: false});\n break;\n \n case \"olvido\":\n Snackbar.show({text: inf[\"mensaje\"],pos: 'bottom-left',showAction: false});\n break;\n \n case \"ok\":\n Snackbar.show({text: inf[\"mensaje\"],pos: 'bottom-left',showAction: false});\n \n break;\n\n default:\n Snackbar.show({text: 'Algo no va bien.',pos: 'bottom-left',showAction: false});\n break \n \n }\n \n}", "function cerrarCaja(){\n var toastHTML = '<span>¿Cerrar caja actual?</span><button class=\"btn-flat toast-action\" onclick=\"location.href = \\'cerrar_caja.html\\';\">Sí</button>';\n M.toast({html: toastHTML});\n}", "function info(kind, msg){\n toastr.options.timeOut = 1500; // 3秒\n toastr.options = {\n \"closeButton\": true,\n \"debug\": false,\n \"newestOnTop\": false,\n \"progressBar\": false,\n \"positionClass\":'',// \"toast-top-right\",\n \"preventDuplicates\": false,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": \"3000\",\n \"extendedTimeOut\": \"1000\",\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\"\n }\n Command: toastr[\"info\"](\"\", msg);\n $('#linkButton').click(function() {\n toastr.success('click');\n });\n}", "function toast(msg) {\n blackberry.ui.toast.show(msg);\t\n}", "function toast(message) {\n var x = document.getElementById(\"snackbar\");\n x.className = \"show\";\n x.innerHTML = message;\n setTimeout(function () { x.className = x.className.replace(\"show\", \"\"); }, 3000);\n}", "function toaster(msg, title, time) {\n msg = (msg === undefined ? \"\" : msg);\n title = (title === undefined ? \"\" : title);\n time = (time === undefined ? 20 : time);\n SpreadsheetApp.getActiveSpreadsheet().toast(msg, title, time);\n}", "function error(tipe, judul, pesan)\n{\n var shortCutFunction = tipe;\n var msg = pesan;\n var title = judul || '';\n var showDuration = \"1000\";\n var hideDuration = \"1000\";\n var timeOut = \"5000\";\n var extendedTimeOut = \"1000\";\n var showEasing = \"swing\";\n var hideEasing = \"linear\";\n var showMethod = \"slideDown\";\n var hideMethod = \"slideUp\";\n\n toastr.options = {\n closeButton: false,\n debug: false,\n positionClass: 'toast-top-right',\n onclick: null\n };\n\n if (showDuration.length) {\n toastr.options.showDuration = showDuration;\n }\n\n if (hideDuration.length) {\n toastr.options.hideDuration = hideDuration;\n }\n\n if (timeOut.length) {\n toastr.options.timeOut = timeOut;\n }\n\n if (extendedTimeOut.length) {\n toastr.options.extendedTimeOut = extendedTimeOut;\n }\n\n if (showEasing.length) {\n toastr.options.showEasing = showEasing;\n }\n\n if (hideEasing.length) {\n toastr.options.hideEasing = hideEasing;\n }\n\n if (showMethod.length) {\n toastr.options.showMethod = showMethod;\n }\n\n if (hideMethod.length) {\n toastr.options.hideMethod = hideMethod;\n }\n\n if (!msg) {\n msg = getMessage();\n }\n\n $(\"#toastrOptions\").text(\"Command: toastr[\" + shortCutFunction + \"](\\\"\" + msg + (title ? \"\\\", \\\"\" + title : '') + \"\\\")\\n\\ntoastr.options = \" + JSON.stringify(toastr.options, null, 2));\n\n var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists\n $toastlast = $toast;\n}", "function successToast(c) {\n const { msg = \"\", icon = \"success\" } = c;\n\n const Toast = Swal.mixin({\n toast: true,\n position: \"top-end\",\n showConfirmButton: false,\n timer: 3000,\n timerProgressBar: true,\n didOpen: (toast) => {\n toast.addEventListener(\"mouseenter\", Swal.stopTimer);\n toast.addEventListener(\"mouseleave\", Swal.resumeTimer);\n },\n });\n\n Toast.fire({\n icon: icon,\n title: msg,\n });\n }", "function notifSuccess(text) {\n const Toast = Swal.mixin({\n toast: true,\n position: \"top-end\",\n showConfirmButton: false,\n timer: 3000,\n timerProgressBar: true,\n didOpen: (toast) => {\n toast.addEventListener(\"mouseenter\", Swal.stopTimer);\n toast.addEventListener(\"mouseleave\", Swal.resumeTimer);\n },\n });\n\n Toast.fire({\n icon: \"success\",\n title: `${text} is successfully`,\n });\n}", "static show(type, message) {\n let divAlert = document.getElementById('alertMessage');\n divAlert.innerHTML = ` <div class=\"alert alert-${type} alert-dismissible fade show\" role=\"alert\">\n <strong>Message !</strong> ${message}.\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>\n </div>`;\n\n\n //fade away message from 2 sec\n setTimeout(() => {\n divAlert.innerHTML = ``;\n }, 2000);\n\n }", "function createToastMessage( message, type ){\n let toastItem = document.createElement('div')\n \n //not scalable\n /*if ( type == \"success\" ) {\n toastItem.className = \"toast-item success\"\n }\n else {\n toastItem.className = \"toast-item error\"\n }*/\n\n let typeClassList = [\"success\", \"error\"]\n let typeClass = typeClassList.includes(type) ? type : \"default\"\n \n toastItem.className = `toast-item ${typeClass}`\n\n toastItem.innerText = message // setting toastItem content, if no parameter is passed it will return \"\" (blank).\n \n return toastItem\n}", "function errorLoadedImg(heroe){\n new Toast({message: 'Error al Cargar Imagen del Héroe '+heroe,type: 'danger'});\n\n}", "setMessage(info) {\n this.showRestartTip = info.showRestartTip;\n this.header.setText(info.header);\n this.message.setText(info.message);\n\n let headerWidth = this.header.getWidth();\n let messageWidth = this.message.getWidth();\n let longer = Math.max(headerWidth, messageWidth);\n let margin = 15;\n this.box.x = ((SCREEN.WIDTH - longer) / 2) - margin;\n this.box.width = longer + margin * 2;\n }", "function showInfo(message)\n{\n newmessage(\"bg-info\", \"<span class='glyphicon glyphicon-exclamation-sign'></span> \"+message, 4000);\n}", "makeToast(variant = null) {\n if (this.x < 18.5) { this.estado = \"Peso inferior al normal\"; }\n else if (this.x >= 18.5 && this.x <= 24.9) { this.estado = \"Peso normal\"; }\n else if (this.x >= 25 && this.x <= 29.9) { this.estado = \"Peso superior al normal\"; }\n else if (this.x > 30) { this.estado = \"Obesidad\"; }\n else {\n alert(\"No ingresaste el peso y estatura\")\n }\n this.$bvToast.toast('Su estado medido desde el IMC ES : ' + this.estado, {\n title: `Notificación de su condición Física a partir del IMC`,\n variant: variant,\n solid: true\n })\n this.estado = \"\"\n }", "function makeToast(data)\n{\n var x = document.getElementById(\"snackbar\");\n \n x.className = \"show\";\n x.innerHTML = data;\n\n // After 1.5 seconds, remove the show class\n setTimeout(function(){ x.className = x.className.replace(\"show\", \"\"); }, 1500);\n}", "function toast() {\n\tM.toast({html: 'Eventual link to Github'})\n}", "function message(retorno){\n\n if(retorno[0] == 'msg'){\n let msg = $('<div/>').addClass('alert alert-'+retorno[1]+' alert-dismissible fadeshow col-md-12');\n msg.append($('<button/>').addClass('close').attr('data-dismiss', 'alert').html('&times'))\n msg.attr('align', 'center').append('<h3>'+retorno[2]+'</h3>');\n msg.css('box-shadow', '2px 2px 3px #000');\n\n $('#dinamic').find('div #msg').remove();\n $('#cadastrarProduto, #estoque, #editEstoque, #editarProduto, #cadastrarMarca, #cadastrarCategoria, #vendaPainelTable').\n parent().prepend($('<div/>').attr('id', 'msg').addClass('row mb-5').html(msg));\n }\n}", "function sendToast(message) {\n console.log(message);\n var toast = document.getElementById('toast');\n toast.innerHTML = message;\n toast.className = 'show';\n setTimeout(function () {\n toast.className = toast.className.replace('show', '');\n }, 3000);\n}", "function alert_message(type, message) {\n Swal.fire({\n title: message,\n \n type: type,\n showCancelButton: false,\n confirmButtonColor: 'red',\n confirmButtonText: 'متابعة التسوق'\n });\n // $.notify(message,type); \n // $.notify({\n // icon: 'fa fa-check',\n // title: type + '!',\n // message: message\n // }, {\n // element: 'body',\n // position: null,\n // type: type,\n // allow_dismiss: true,\n // newest_on_top: false,\n // showProgressbar: true,\n // placement: {\n // from: \"top\",\n // align: \"right\"\n // },\n // offset: 20,\n // spacing: 10,\n // z_index: 1101,\n // delay: 200,\n // animate: {\n // enter: 'animated fadeInDown',\n // exit: 'animated fadeOutUp'\n // },\n // icon_type: 'class',\n // template: '<div data-notify=\"container\" class=\"col-xs-11 col-sm-3 alert alert-{0}\" role=\"alert\">' +\n // '<button type=\"button\" aria-hidden=\"true\" class=\"close\" data-notify=\"dismiss\">×</button>' +\n // '<span data-notify=\"icon\"></span> ' +\n // '<span data-notify=\"title\">{1}</span> ' +\n // '<span data-notify=\"message\">{2}</span>' +\n // '</div>'\n // });\n }", "function Mensajes(mensaje) {\n if (mensaje == 'Transaccion realizada correctamente')\n $().toastmessage('showSuccessToast', mensaje);\n else\n $().toastmessage('showErrorToast', mensaje);\n}", "function displayConfirmation() {\n Toast.show({\n style: { backgroundColor: \"green\", justifyContent: \"center\" },\n position: \"top\",\n text: \"Meal(s) successfully recorded.\",\n textStyle: {\n textAlign: 'center',\n },\n duration: 1500\n });\n }", "function mensajemodal(mensaje, titulo = \"ATENCIÓN\") {\r\n swal({\r\n title: titulo,\r\n text: mensaje\r\n },\r\n function () {\r\n swal.close();\r\n $interval.cancel(interval);\r\n });\r\n var interval = $interval(function () {\r\n swal.close();\r\n $interval.cancel(interval);\r\n }, 3000);\r\n }", "function mensajemodal(mensaje, titulo = \"ATENCIÓN\") {\r\n swal({\r\n title: titulo,\r\n text: mensaje\r\n },\r\n function () {\r\n swal.close();\r\n $interval.cancel(interval);\r\n });\r\n var interval = $interval(function () {\r\n swal.close();\r\n $interval.cancel(interval);\r\n }, 3000);\r\n }", "function success_message(message, title) {\n if (!title) title = \"Success!\";\n toastr.remove();\n toastr.success(message, title, {\n closeButton: true,\n timeOut: 5000,\n progressBar: true,\n newestOnTop: true\n });\n}", "function createToast(message) {\n 'use strict';\n var snackbar = document.createElement('div'),\n text = document.createElement('div');\n snackbar.classList.add('mdl-snackbar');\n text.classList.add('mdl-snackbar__text');\n text.innerText = message;\n snackbar.appendChild(text);\n document.body.appendChild(snackbar);\n // Remove after 10 seconds\n setTimeout(function(){\n snackbar.remove();\n }, 5000);\n}", "function toast(message) {\n var elem = document.createElement(\"div\");\n\n elem.innerHTML = message;\n var notificationContainer = document.getElementById(\"notification-container\");\n notificationContainer.appendChild(elem);\n\n elem.className = \"message messageIn\";\n\n\tfunction hideNotification() {\n\t elem.className = \"message messageOut\";\n\t animationEndCallback = (e) => {\n\t elem.removeEventListener('animationend', animationEndCallback);\n\t elem.outerHTML = \"\";\n\t }\n\t elem.addEventListener('animationend', animationEndCallback);\n\t}\n\n\tsetTimeout(hideNotification,3000);\n\n elem.addEventListener('click',hideNotification);\n}", "toggleSuccessMessage(title, message) {\n setTimeout(() => {\n toast(\n {\n title: title,\n description: <p>{message}</p>,\n type: \"success\",\n color: \"green\",\n size: \"mini\",\n animation: \"fly left\"\n },\n () => console.log(\"toast closed\"),\n () => console.log(\"toast clicked\")\n );\n }, 1000);\n }", "toggleSuccessMessage(title, message) {\n setTimeout(() => {\n toast(\n {\n title: title,\n description: <p>{message}</p>,\n type: \"success\",\n color: \"green\",\n size: \"mini\",\n animation: \"fly left\"\n },\n () => console.log(\"toast closed\"),\n () => console.log(\"toast clicked\")\n );\n }, 1000);\n }", "function show_message(msg, t) {\n if ( _via_message_clear_timer ) {\n clearTimeout(_via_message_clear_timer); // stop any previous timeouts\n }\n var timeout = t;\n if ( typeof t === 'undefined' ) {\n timeout = VIA_THEME_MESSAGE_TIMEOUT_MS;\n }\n document.getElementById('message_panel').innerHTML = msg;\n _via_message_clear_timer = setTimeout( function() {\n document.getElementById('message_panel').innerHTML = ' ';\n }, timeout);\n}", "function mostrarAyudaIva() {\n $.notify({\n message: 'Ingrese el valor del Iva sin el signo de porcentaje (%).'\n }, {\n type: 'info',\n delay: 3000,\n placement: {\n align: 'center'\n },\n z_index: 99999,\n });\n}", "function showToast(message) {\n $mdToast.show(\n $mdToast.simple()\n .textContent(message) \n .hideDelay(3000)\n .position('top right')\n ); \n }", "function toast_notif(e){\n if( $('#toast-notif').length == 0 ){\n $('body').append('<div id=\"toast-notif\"></div>');\n }\n $('#toast-notif').html(e);\n\n // center taost\n $('#toast-notif').css(\"left\", ( $(window).width() - $('#toast-notif').width() ) / 2 + \"px\");\n\n var $timer = setTimeout(function(){\n if( !$('#toast-notif').hasClass('.active')){\n $('#toast-notif').removeClass('active').hide();\n }\n \n }, 5000);\n\n if( !$('#toast-notif').is(':visible') ){\n $('#toast-notif').show();\n }else{\n $('#toast-notif').addClass('active');\n clearTimeout($timer);\n }\n }", "showMessage(mensaje, cssclase){\n const div = document.createElement('div');\n div.className = `alert alert-${cssclase} mt-3`;//concatenamos con el parametro clase\n div.appendChild(document.createTextNode(mensaje));\n // mostrando en el DOM\n const container = document.querySelector('.container');\n const app = document.querySelector('#app');\n \n\n container.insertBefore(div,app);\n\n setTimeout(function(){\n document.querySelector('.alert').remove();\n }, 3000);\n }", "function showToastSuccessMessage(message){\r\n\tconsole.log('...show message...');\r\n\t $().toastmessage('showToast', {\r\n text : message,\r\n sticky : false,\r\n position : 'middle-center',\r\n type : 'success',\r\n closeText: '',\r\n close : function () {\r\n console.log(\"toast is closed ...\");\r\n }\r\n });\r\n}", "function mensaje(mje){\n //creo un div para contener el mensaje\n const div = document.createElement('div');\n //le asigno una clase para su visualizacion\n div.className = `alerta alert alert-warning mensaje`;\n //le agrego un mensaje\n div.appendChild(document.createTextNode(mje));\n //identifico y asigno el objeto contenenedor del div\n const contenedor = document.querySelector('.contenedor');\n //identifico y asigno el objeto para posicionar el mensaje encima del mismo\n const areaSig = document.querySelector('#card'); \n //\n //agregar el div creado al elemento contenedor\n contenedor.insertBefore(div, areaSig);\n // Remover el mensaje de alerta\n //quitar el elemento despues de 2 segundos\n setTimeout(function() {\n document.querySelector('.alerta').remove();\n }, 2000);\n \n}", "function showToast(text) {\n // Get the snackbar DIV\n var x = document.getElementById(\"snackbar\")\n if(text)x.innerHTML=text; // only change innhtml if text is not empty.\n\n // Add the \"show\" class to DIV\n x.className = \"show\";\n\n // After 3 seconds, remove the show class from DIV\n setTimeout(function(){ x.className = x.className.replace(\"show\", \"\"); }, 3000);\n}", "function toastAlert(msg) {\n var toastMsg = document.getElementById(\"popupToastMsg\");\n toastMsg.innerHTML = msg;\n tau.openPopup('#popupToast');\n console.log(msg);\n}", "function shortTimeMesg(msg, cls) {\n\tvar c = $('#container'), msg;\n\tmsg = '<div class=\"'+cls+' user-msg-cont\"><h2 id=\"user-msg\">'+msg+'</h2></div>';\n\tc.prepend(msg);\n\tmsg = $('.user-msg-cont');\n\tsetTimeout(function() {\n\t\tmsg.css({'height':'50px', 'top':'0'});\n\t\tsetTimeout(function() {\n\t\t\tmsg.css('height', '0px');\n\t\t\tsetTimeout(function() {\n\t\t\t\tmsg.remove();\n\t\t\t}, 500);\n\t\t}, 3000);\n\t}, 500); \n\t\n}", "function showWarning(message)\n{\n newmessage(\"bg-info\", message, 4000);\n}", "function showMessage(type, message)\r\n {\r\n $('.warning-screen-cover').fadeIn(500);\r\n $('.warning-heading-type').html(type);\r\n $('.warning-heading-message').html(message);\r\n $('.warning-confirm-container').fadeIn(1000);\r\n }", "showToastMsg(title, message, variant) {\n this.dispatchEvent(\n new ShowToastEvent({\n title: title,\n message: message,\n variant: variant || 'success'\n })\n )\n }", "function BasariMesaj( text){\n\t text = jQuery.trim(text); \n\t var dil = \"Tebrikler !\";\n\t if( strcmp( er.lang, \"en\" ) == 0 )\n\t dil = \"Congratulations !\";\n\t if( $(\".msgGrowl-container\").find(\".msgGrowl\").length <= 1 ){ \n\t $.msgGrowl ({\n\t element: $('body').parent(),\n\t type: 'success', //$(this).attr ('data-type') // info success warning error\n\t title: dil,\n\t text: text.charAt(0).toUpperCase() + text.slice(1) // capitialize first character\n\t });\n\t }\n\t }", "function show_message(type, heading, message) {\n\t\t$(\".message\").html('<div class=\"alert alert-'+type+'\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" style=\"top: 3px;\"><i class=\"icon-remove-sign\"></i></button><strong>'+heading+'</strong> '+message+'</div>').hide().fadeIn('fast');\n\t}", "function showMessage(type, message)\r\n{\r\n $('.warning-screen-cover').fadeIn(500);\r\n $('.warning-heading-type').html(type);\r\n $('.warning-heading-message').html(message);\r\n $('.warning-confirm-container').fadeIn(1000);\r\n}", "function ShowMessage(title, description, status) {\n debugger\n if (status==1) {\n\n toastr.error(description, title);\n } else {\n\n toastr.success(description, title);\n\n }\n\n}", "async function modalMessage (mensaje,type,title){\n if(Array.isArray(mensaje) || typeof mensaje === 'object'){\n mensaje = convertToListHtml(mensaje);\n }\n\n if(isEmpty(type)){\n type = \"info\";\n }\n\n if(type==\"danger\"){\n type = \"error\";\n }\n\n if(isEmpty(title)){\n if(type == \"error\"){\n title = \"Error\";\n }else if(type == \"warning\"){\n title = \"Advertencia\";\n }else if(type == \"Info\"){\n title = \"Información\";\n }else{\n title = \"Mensaje\";\n }\n }\n\n await Swal.fire({\n title: title,\n html: mensaje,\n icon: type,\n })\n return true;\n }", "function showToast(message) {\n $mdToast.show(\n $mdToast.simple()\n .content(message)\n .position('top right')\n .hideDelay(2000)\n );\n }", "function Notificacion(icon, title, text){\n swal({\n icon,\n title,\n text\n });\n }", "createAlert(variant, title, text, autoHideDelay=2000) {\n this.$bvToast.toast(text, {\n autoHideDelay,\n title,\n toaster: 'b-toaster-bottom-center',\n variant,\n })\n }", "notify(text,title,type='success') {\n toastr.options.timeOut = 4500;\n toastr.options.hideDuration = 250;\n toastr.options.showDuration = 250;\n toastr.options.onShown = () => { this.getTemplateRanking(); };\n if (type === 'success') {\n toastr.success(text, title);\n }else {\n toastr.error(text, title);\n }\n }", "function showWarningToast(title, body, code = 'warning') {\n showToast(title, body, 'warning', code);\n}", "function show(msg, type, time) {\r\n var toast = angular.element(\"#toast_cont\");\r\n var content = angular.element(\"#toast_content\");\r\n var duration = time || 5000;\r\n\r\n if ((toast.attr('class') == null) || toast.attr('class').indexOf('visible') < 0) {\r\n content.html(msg);\r\n if (type != null) {\r\n removeAttr(content, 'class');\r\n addClass(content, type);\r\n } else {\r\n removeAttr(content, 'class');\r\n addClass(content, 'info');\r\n }\r\n addClass(toast, \"visible\");\r\n\r\n // when a boolean is provided\r\n if (typeof duration === 'boolean' && duration) {\r\n $timeout(function () {\r\n removeClass(toast, \"visible\");\r\n if (type != null)\r\n removeClass(toast, type);\r\n }, 5000);\r\n }\r\n\r\n // when the time to live is set\r\n if (typeof duration === 'number') {\r\n $timeout(function () {\r\n removeClass(toast, \"visible\");\r\n if (type != null)\r\n removeClass(toast, type);\r\n }, duration);\r\n }\r\n\r\n }\r\n }", "showAlert(message, className){\n this.clearAlert();\n\n // cria div de alerta\n const div = document.createElement('div');\n // adiciona classes\n div.className = className;\n // adiciona texto da mensagem\n div.appendChild(document.createTextNode(message));\n // pega elemento-pai\n const container = document.querySelector('.postsContainer');\n // retorna posts \n const posts = document.querySelector('#posts');\n // insere div de alerta\n container.insertBefore(div, posts);\n\n // contagem regressiva\n setTimeout(() => {\n this.clearAlert();\n }, 3000);\n }", "function showAlert(msg, type = 'success') {\n M.toast( {html: msg, classes: type })\n}", "function showToastr(strMsg) {\n\tvar x = document.getElementById(\"toastr-penumpang\");\n\tx.innerHTML = strMsg;\n\tx.className = \"show\";\n\tsetTimeout(function(){ x.className = x.className.replace(\"show\", \"\"); }, 3000);\n}", "function showToastSuccessMessage(message){\n\tconsole.log('...show message...');\n\t $().toastmessage('showToast', {\n text : message,\n sticky : false,\n position : 'middle-center',\n type : 'success',\n closeText: '',\n close : function () {\n console.log(\"toast is closed ...\");\n }\n });\n}", "function showMsg(status, msg) {\n if (status === 1) {\n Swal.fire({\n title: 'Success!',\n icon: 'success',\n text: msg,\n showConfirmButton: false,\n timer: 1500\n });\n } else {\n Swal.fire({\n title: 'Error!',\n text: msg,\n icon: 'error',\n confirmButtonText: 'ok'\n });\n }\n }", "function showMsg(status, msg) {\n if (status === 1) {\n Swal.fire({\n title: 'Success!',\n icon: 'success',\n text: msg,\n showConfirmButton: false,\n timer: 1500\n });\n } else {\n Swal.fire({\n title: 'Error!',\n text: msg,\n icon: 'error',\n confirmButtonText: 'ok'\n });\n }\n }", "toastNotification() {\n setTimeout(() => {\n ToastAndroid.showWithGravityAndOffset (\n 'Signed in Successfully',\n ToastAndroid.LONG,\n ToastAndroid.BOTTOM,\n 25,\n 50\n );\n }, 1500);\n }", "like(){\n swal('Thanks for Liking', \"Sorry the feature isn't ready yet but we are working on it :)\", \"success\");\n }", "function simpleToastBase(message, position, delay, action) {\n /*$mdToast.show(\n $mdToast.simple()\n .content(message)\n .position(position)\n .hideDelay(delay)\n .action(action)\n );*/\n }", "function App() {\n const mostrarAlerta = () => {\n\n swal({\n title: \"Lo Sentimos :(\",\n text: \"Página en mantenimiento\",\n icon: \"error\",\n buttons: false,\n timer: \"3800\"\n\n });\n\n\n }\n\n return (\n <div className=\"App container\">\n <header id=\"menu\" className=\"App-header\">\n\n <ul className=\"nav justify-content-center\">\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#curso\">Nuestros Cursos</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link\" href=\"#galeria\">Galería</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link\" href=\"#contacto\">Contacto</a>\n </li>\n </ul>\n </header>\n\n <img src={imageMax} alt=\"...\" class=\"img-thumbnail\" />\n\n <div class=\"jumbotron\">\n <h1 class=\"display-4\">Hola, Bienvenido</h1>\n <p class=\"lead\">\n Max Music por más de 2 años, ha sido el lugar donde nuestros alumnos,\n han desarrollado sus habilidades para sobresalir en la industria del entretenimiento.\n Esto ha hecho de esta institución la cuna líder de una de las industrias mas grandes del estado.\n Entre otros reconocimientos, los egresados de nuestra institución han acumulado más de un centenar de premios.\n </p>\n <hr class=\"my-4\" />\n <p>\n Los cursos de Max Music han sido diseñados por líderes de la industria para formar graduados que posean el conocimiento teórico/práctico y las habilidades que se requieren en el competitivo mundo musical actual.\n\n </p>\n\n </div>\n <center><h1>Nuestros Cursos<span id=\"curso\" class=\"badge badge-secondary\">Explora</span></h1></center>\n\n\n\n <Tarjetas />\n\n <ul className=\"nav justify-content-center\">\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#menu\">Ir al menú</a>\n </li>\n </ul>\n <hr class=\"my-4\" />\n\n <center><h1>Nuestra Galería<span id=\"galeria\" class=\"badge badge-secondary\">Observa</span></h1></center>\n\n\n {/*<Galeria/> */}\n <div>\n\n <div class=\"row\">\n <div class=\"col-lg-4 col-md-12 mb-4 mb-lg-0\">\n <img\n src={car1}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n\n <img\n src=\"https://wallpapercave.com/wp/wp5781687.jpg\"\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n </div>\n\n <div class=\"col-lg-4 mb-4 mb-lg-0\">\n <img\n src={img4}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n\n <img\n src={img3}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n </div>\n\n <div class=\"col-lg-4 mb-4 mb-lg-0\">\n <img\n src={img5}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n\n <img\n src={img6}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n </div>\n </div>\n\n\n\n <div class=\"row\">\n <div class=\"col-lg-4 col-md-12 mb-4 mb-lg-0\">\n <img\n src={car2}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n\n <img\n src={img7}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n </div>\n\n <div class=\"col-lg-4 mb-4 mb-lg-0\">\n <img\n src={img8}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n\n <img\n src={car3}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n </div>\n\n <div class=\"col-lg-4 mb-4 mb-lg-0\">\n <img\n src={img9}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n\n <img\n src={img10}\n class=\"w-100 shadow-1-strong rounded mb-4\"\n alt=\"\"\n />\n </div>\n </div>\n </div>\n\n <ul className=\"nav justify-content-center\">\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#menu\">Ir al menú</a>\n </li>\n </ul>\n <hr class=\"my-4\" />\n\n\n\n\n <Contacto />\n <ul className=\"nav justify-content-center\">\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#menu\">Ir al menú</a>\n </li>\n </ul>\n\n {/* footer*/}\n <div>\n\n <footer class=\"text-center text-lg-start bg-light text-muted\">\n\n <section\n class=\"d-flex justify-content-center justify-content-lg-between p-4 border-bottom\"\n >\n\n <div class=\"me-5 d-none d-lg-block\">\n <span>Gracias por visitar nuestra página web.</span>\n </div>\n\n </section>\n\n <section class=\"\">\n <div class=\"container text-center text-md-start mt-5\">\n\n <div class=\"row mt-3\">\n\n <div class=\"col-md-3 col-lg-4 col-xl-3 mx-auto mb-4\">\n\n <h6 class=\"text-uppercase fw-bold mb-4\">\n <i class=\"fas fa-gem me-3\"></i>Privacidad\n </h6>\n <p>\n Preservar tu privacidad y la seguridad de tu información personal es importante para nosotros.\n </p>\n </div>\n\n <div class=\"col-md-2 col-lg-2 col-xl-2 mx-auto mb-4\">\n\n <h6 class=\"text-uppercase fw-bold mb-4\">\n CRUD\n </h6>\n <p>\n <a onClick={() => mostrarAlerta()} href=\"#!\" class=\"text-reset\">Registrar Alumnos o Profesores</a>\n </p>\n <p>\n <a onClick={() => mostrarAlerta()} href=\"#!\" class=\"text-reset\">Modificar Alumnos o Profesores</a>\n </p>\n <p>\n <a onClick={() => mostrarAlerta()} href=\"#!\" class=\"text-reset\">Mostrar Alumnos o Profesores</a>\n </p>\n <p>\n <a onClick={() => mostrarAlerta()} href=\"#!\" class=\"text-reset\">Eliminar Alumnos o Profesores</a>\n </p>\n </div>\n\n <div class=\"col-md-3 col-lg-2 col-xl-2 mx-auto mb-4\">\n\n <h6 class=\"text-uppercase fw-bold mb-4\">\n Actividades\n </h6>\n <p>\n <a onClick={() => mostrarAlerta()} href=\"#!\" class=\"text-reset\">Asignar clases</a>\n </p>\n <p>\n <a onClick={() => mostrarAlerta()} href=\"#!\" class=\"text-reset\">Asignar Profesores</a>\n </p>\n <p>\n <a onClick={() => mostrarAlerta()} href=\"#!\" class=\"text-reset\">Asignar Horarios</a>\n </p>\n </div>\n\n <div class=\"col-md-4 col-lg-3 col-xl-3 mx-auto mb-md-0 mb-4\">\n\n <h6 class=\"text-uppercase fw-bold mb-4\">\n Contacto\n </h6>\n <p><i class=\"fas fa-home me-3\"></i> Av. de la República 01, Tabacalera, Cuauhtémoc, 06030 Ciudad de México, CDMX</p>\n <p>\n <i class=\"fas fa-envelope me-3\"></i>\n [email protected]\n </p>\n <p><i class=\"fas fa-phone me-3\"></i> + 55 78 50 36 10</p>\n <p><i class=\"fas fa-print me-3\"></i> + 69 47 52 10 30</p>\n </div>\n\n </div>\n\n </div>\n </section>\n\n <div class=\"text-center p-3\">\n © 2021 Copyright:\n <a class=\"text-dark\" href=\"#!\">maxmusic.com.mx</a>\n </div>\n\n </footer>\n\n </div>\n\n\n\n\n\n\n </div>\n\n\n\n );\n}", "showNotif(text=notif_text) {\r\n Webtwic.adjustSiteContent();\r\n $( 'body' ).prepend(\r\n\t\t\t`<div class=\"notif_vis\" id=\"notifBanner\">${text}${close_button}</div>`\r\n\t\t);\r\n\r\n $( '.close-button' ).on( 'click', e => {\r\n\t\t\te.preventDefault();\r\n\t\t\tWebtwic.undoReset();\r\n\t\t});\r\n }", "function UserAlert({flag,setFlag,message}){\n return(\n <StyledToast show={flag} onClose={()=>setFlag(false)} autohide>\n <StyledToast.Body className=\"d-flex\"><img src={CheckIcon} alt=\"checkicon\" style={{width:22}} /> {message} </StyledToast.Body>\n </StyledToast>);\n}", "notice(msg, color = '007eff', time = 3000) {\r\n return new Promise((resolve, reject) => {\r\n let wrap = $('<div style=\"box-sizing:border-box; position:fixed; left:calc(50% - 160px); box-shadow:0 5px 25px rgba(0,0,0,0.2); width:320px; top:40px; background:#' + (color ? color : '007eff') + '; border-radius:10px; color:#fff; padding:20px 20px; text-transform:none; font:16px/1.2 Tahoma, sans-serif; cursor:pointer; z-index:999999; text-align:center;\">' + msg + '</div>')\r\n .on('click', () => { wrap.remove(); resolve(); })\r\n .appendTo('body');\r\n if(time > 0) setTimeout(() => { wrap.remove(); }, time);\r\n });\r\n }", "function showMsg(id,title,text,type)\n { \n $('#alert_content').html('<div class=\"alert alert-'+type+'\" role=\"alert\">'+text+\"</div>\");\n $('#alert_title').html(title);\n $('#'+id).modal('show');\n if (type=='info') {\n AlertSound();\n }; \n }", "function showMessageTimer(title, text, type, timer){\n swal({\n title: title,\n text: text,\n type: type,\n timer: timer\n }).then(\n function () {},\n // handling the promise rejection\n function (dismiss) {\n\n }\n )\n}", "function toastbox(target, time) {\n var a = \"#\" + target;\n $(\".toast-box\").removeClass(\"show\");\n setTimeout(() => {\n $(a).addClass(\"show\");\n }, 100);\n if (time) {\n time = time + 100;\n setTimeout(() => {\n $(\".toast-box\").removeClass(\"show\");\n }, time);\n }\n}", "function waitToast(){\n toast.info(\"Wait seconds!!!\", {\n position: toast.POSITION.TOP_RIGHT,\n autoClose:2000\n });\n }", "function AddToast(_title, _class, _message, _icon) {\n $('body')\n .toast({\n title: _title,\n showIcon: _icon ? _icon : true,\n class: _class,\n position: 'top right',\n displayTime: 0,\n closeIcon: true,\n message: _message,\n transition: {\n showMethod: 'zoom',\n showDuration: 100,\n hideMethod: 'fade',\n hideDuration: 500\n }\n });\n}", "async onMessageTip(messageID) {\n const messages = {\n ...this.state.messages.recent,\n ...this.state.messages.featured\n };\n\n if(!messages.hasOwnProperty(messageID))\n return;\n\n if(!this.state.tronWeb.loggedIn)\n return;\n\n if(messages[messageID].owner === Utils.tronWeb.defaultAddress.base58)\n return;\n\n const { value } = await Swal({\n title: '打赏',\n text: '输入trx个数',\n confirmButtonText: '赏',\n input: 'text',\n showCancelButton: true,\n showLoaderOnConfirm: true,\n reverseButtons: true,\n allowOutsideClick: () => !Swal.isLoading(),\n allowEscapeKey: () => !Swal.isLoading(),\n preConfirm: amount => {\n if(isNaN(amount) || amount <= 0) {\n Swal.showValidationMessage('金额格式不对');\n return false;\n }\n\n return Utils.contract.tipMessage(+messageID).send({\n callValue: Number(amount) * 1000000\n }).then(() => true).catch(err => {\n Swal.showValidationMessage(err);\n });\n }\n });\n\n value && Swal({\n title: '谢爷赏!',\n type: 'success'\n });\n }" ]
[ "0.7387079", "0.7109056", "0.71022546", "0.70682776", "0.705161", "0.6938772", "0.6925991", "0.6844643", "0.68359923", "0.6807083", "0.6743999", "0.6735134", "0.67110586", "0.670838", "0.6705457", "0.669472", "0.6675874", "0.6656092", "0.66064614", "0.6575781", "0.6560569", "0.65141743", "0.64713436", "0.64625734", "0.64607066", "0.64490306", "0.64322215", "0.64315635", "0.64315635", "0.64309627", "0.64308465", "0.6430427", "0.6405118", "0.6395282", "0.63946897", "0.6391834", "0.6390102", "0.6389644", "0.6385451", "0.63848484", "0.6377725", "0.6373244", "0.63653606", "0.6332026", "0.63240695", "0.6320989", "0.6317209", "0.6315556", "0.6314851", "0.63107705", "0.62965024", "0.6292162", "0.6292162", "0.62911963", "0.6288935", "0.6278757", "0.6268341", "0.6268341", "0.6264358", "0.6258371", "0.62565565", "0.6254988", "0.62423384", "0.6228504", "0.6224249", "0.6222803", "0.6222115", "0.6219138", "0.6218311", "0.6209476", "0.6206934", "0.6205566", "0.62034", "0.62008405", "0.6198963", "0.6189128", "0.61852056", "0.61766094", "0.6170008", "0.6169155", "0.61680144", "0.6163131", "0.6158683", "0.6147492", "0.61425143", "0.6141478", "0.61373734", "0.61373734", "0.6137217", "0.6136566", "0.61312234", "0.612193", "0.6120022", "0.6117866", "0.61099833", "0.61070746", "0.6105878", "0.60956955", "0.6091281", "0.60894215", "0.6085669" ]
0.0
-1
Crea una card per i film / serie tv
function createCard(movie, mediaType) { const carWrapCard = document.createElement('div'); carWrapCard.classList.add('carousel__wrapper-card'); // const flipCardContainer = document.createElement('div'); // flipCardContainer.classList.add('flip-card-container'); // const flipCard = document.createElement('div'); // flipCard.classList.add('flip-card'); // flipCard.dataset.movieId = movie.id; // flipCard.onclick = (evt) => { // evt.preventDefault(); // onClickRenderOnJumbotron(movie.id); // }; // onclick // addToWatchlist.dataset.movieId = movie.id; // addToWatchlist.dataset.movieTitle = movie.original_title; // const carImgInBg = document.createElement('div'); // carImgInBg.style.backgroundImage = `url(${POSTER_BASE_URL}/w185${movie.poster_path})`; // carImgInBg.classList.add('card-img'); // const flipCardFront = document.createElement('div'); // flipCardFront.classList.add('flip-card-front'); // const flipCardBack = document.createElement('div'); // flipCardBack.classList.add('flip-card-back'); // const description = document.createElement('p'); // description.textContent = movie.overview; // const title = document.createElement('h6'); // title.textContent = movie.title || movie.name || movie.original_title || movie.original_name; // console.log(movie.vote_count, movie.vote_average, movie.popularity, movie.genre_ids, movie.original_language, movie.backdrop_path, movie.video); // let genresId = 0; // movie.genre_ids.forEach((genre_id) => { // genresId = genre_id; // }); // for (const genresId of tvGenres) { // console.log(genresId.name); // } // let actionWrapper = createActionBar(movie); // console.log(movie); // flipCardBack.append(title, description); // flipCardFront.appendChild(carImgInBg); // flipCard.appendChild(flipCardFront); // flipCard.appendChild(flipCardBack); // flipCardContainer.appendChild(flipCard); // carWrapCard.appendChild(flipCardContainer); // carWrapCard.appendChild(actionWrapper); // let posCarWrapCard = flipCard.getClientRects(); // console.log(posCarWrapCard); return carWrapCard; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cardMovieGenerator(movie) {\n const card = document.createElement(\"article\");\n card.classList.add(\"carousel-item\");\n setAttributes(card, {\n onclick: `showModal(${movie.id})`,\n \"data-id\": `${movie.id}`,\n });\n\n card.innerHTML = `\n <img class=\"carousel-item-img\" src=\"${movie.medium_cover_image}\" alt=\"Poster de ${movie.title}\" />\n <div class=\"carousel-details\">\n <div class=\"buttons-contact\">\n <a href=\"${movie.torrents[0].url}\">\n <img src=\"./src/img/icons8-play-64.png\" alt=\"Ver pelicula\" srcset=\"\">\n </a>\n <img src=\"./src/img/icons8-plus-64.png\" alt=\"Agregar\" srcset=\"\">\n </div>\n <p class=\"carousel-item-title ellipsis\">${movie.title}</p>\n <p class=\"carousel-item-subtitle\">${movie.year} ${movie.language} ${movie.runtime} min</p>\n </div>`;\n\n return card;\n}", "function createCards() {\n cardsData.forEach((data, index) => createCard(data, index));\n }", "function criarCard() {\n\n let strCard = \"\"\n\n for (var i = 0; i < docentes.length; i++) {\n if (i % 3 == 0) {\n strCard += `<div class=\"row\">`\n }\n // Cria o card\n strCard += `<div class=\"col-sm-4\">\n <div class=\"card\" onclick=\"\" style=\"width: 18rem;\">\n <img class=\"card-img-top\" src=\"${docentes[i]._imagem}\" alt=\"Card image cap\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${docentes[i]._nome}</h5>`\n\n strCard += `</div></div></div>`\n\n if (i % 3 == 2) {\n strCard += `</div>`\n }\n }\n let catalogoProfs = document.getElementById(\"card\")\n catalogoProfs.innerHTML = strCard\n\n}", "function createCard(sel, translation, context, color){\r\n var newCardObject = {\r\n id: id,\r\n term: sel,\r\n translation: translation,\r\n context: context\r\n }\r\n var newCardElement = '<div id=\"card-'+ id +'\" class=\"term-card card\" style=\"width: 100%; background-color: '+ color +';\"> \\\r\n <i id=\"' +id+ '\" class=\"delete-flashcard fas fa-trash-alt\"></i>\\\r\n <div class=\"card-body\">\\\r\n <h5 class=\"card-title\">Term</h5>\\\r\n <p class=\"card-subtitle term mb-2 text-muted\">' + sel + \r\n '<h5 class=\"card-title\">Translation</h5> \\\r\n <p class=\"card-subtitle translation mb-2 text-muted\">'+ newCardObject.translation +'</p>\\\r\n <button type=\"submit\" id=\"create-card-'+ id +'\" class=\"make-flashcard btn btn-secondary mb-2\">Make Flashcard</button></div></div>'; \r\n cards.push(newCardObject)\r\n id += 1;\r\n $(newCardElement).appendTo(\"#terms\");\r\n }", "function generate_card(curr_movie) {\n // curr_movie is an object which property will helps to make card\n let card = document.createElement(\"div\")\n card.className = \"col-lg-4 col-md-6 col-12 p-2 bg-light\"\n card.innerHTML = `<div class=\"card p-1 \" >\n <img id=\"movie_picture\" src=${curr_movie.img} class=\"card-img-top\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-info\">${curr_movie.name}</h5>\n <p class=\"card-text\">${curr_movie.desc}</p>\n <ul class=\"list-group\"> \n <h3> Locations: </h3>\n <li class=\"list-group-item\">\n ${curr_movie.locations.map(e => { return e })}\n </li>\n </ul> \n <h5 class=\"m-1\">Show Time : ${curr_movie.timing.from}-${curr_movie.timing.to} </h5>\n <button onclick=\"book_ticket()\" class=\"btn btn-success my-3\" id=${curr_movie.id}>Select</button>\n </div>\n </div>`\n return card\n}", "function createCardsView(selector, data) {\n var card = $(\"<div/>\").addClass(\"card mb-3\"),\n body = $(\"<div/>\").addClass(\"card-body\"),\n footer,\n title;\n\n if (data.tipo == \"training\") { \n title = $(\"<h5/>\").addClass(\"card-title\");\n title.append($(\"<span/>\").addClass(\"badge\").append($(\"<i/>\").addClass(\"fas \" + data.icone)));\n title.append(data.titulo); \n\n body.append(title);\n body.append($(\"<h6/>\").addClass(\"card-subtitle mb-2 text-muted\").text(data.instituicao));\n } else {\n body.append($(\"<h5/>\").addClass(\"card-title\").text(data.titulo));\n body.append($(\"<h6/>\").addClass(\"card-subtitle mb-2 text-muted\").text(data.instituicao));\n body.append($(\"<p/>\").addClass(\"card-text\").text(data.descricao));\n }\n \n if (data.tipo == \"exp\") {\n card.append($(\"<div/>\").addClass(\"card-header\").text(data.duracao));\n card.append(body); \n } else if (data.tipo == \"course\") {\n footer = $(\"<div/>\").addClass(\"card-footer text-center\");\n\n footer.append($(\"<a/>\").addClass(\"btn btn-primary\").attr({href: data.link, target: \"_blank\"}).text(\"Certificado\"));\n card.append(body);\n card.append(footer); \n } else {\n card.append(body);\n };\n\n card.appendTo(selector);\n }", "function createMovie(movie) {\n let elMovie = movieTemplate.cloneNode(true);\n\n elMovie.querySelector(\".movie-img\").src = movie.poster;\n elMovie.querySelector(\".movie-img\").width = \"300\";\n elMovie.querySelector(\".movie-title\").textContent = movie.title;\n\n movie.genres.forEach((genre) => {\n let newGenreLi = makeElement(\"li\");\n\n newGenreLi.textContent = genre;\n elMovie.querySelector(\".genre-list\").appendChild(newGenreLi);\n\n getMovieGenre(genre);\n });\n\n elMovie.querySelector(\".movie-year\").textContent = date(movie.release_date);\n elMovie.querySelector(\".item-btn\").dataset.id = movie.id;\n elMovie.querySelector(\".bookmark-btn\").dataset.id = movie.id;\n\n movieList.appendChild(elMovie);\n}", "function addCard(movie) {\n // there go searchResults, later\n\n let new_card = card_template.clone(); // makes a copy of card template, puts in new_card\n\n // change movie-img, different to others cause we change attributes, not the content of the div\n let movie_img = new_card.find(\".movie-img\");\n movie_img.attr(\"src\", `https://image.tmdb.org/t/p/w500${movie.poster_path}`);\n\n // change movie-title\n let movie_title = new_card.find(\".movie-title\");\n movie_title.html(movie.title);\n\n // change movie-description\n // let movie_description = new_card.find(\".movie-description\")\n // movie_description.html(movie.overview)\n\n // change movie-rate-link\n let movie_rate_link = new_card.find(\".movie-rate-link\");\n movie_rate_link.attr(\"href\", `/details/${movie.id}`);\n\n // let new_card = $(`<div>Name: ${movie.title} (${movie.release_date})</div>`)\n results_container.append(new_card);\n}", "function CreateHeroCard(session, builder, title, subtitle, text, url, buttons) {\n var card = new builder.HeroCard(session).title(title).subtitle(subtitle).text(text).buttons(buttons);\n return card;\n}", "function createCards(photographer){\n const sectionCard = elmtFactory(\n \"section\",\n {class:'card'},\n )\n\n const head = elmtFactory('a',\n { href:'photographer-page.html?id='+photographer.id},\n elmtFactory('img',{class:'card_picture', src:'./public/'+photographer.portrait, alt:''},),\n elmtFactory('h2',{class:'card_name'},photographer.name),\n elmtFactory('p',{class:'card_location'}, photographer.city+', '+photographer.country),\n elmtFactory('p',{class:'card_slogan'},photographer.tagline),\n elmtFactory('p',{class:'card_price'},photographer.price+'€'),\n )\n \n let ul = elmtFactory(\n 'ul',\n {class:'card_ul'},\n )\n\n let li = photographer.tags.map( (value) => {\n return (\"<a href='index.html?tag=\"+value+\"' class='card_ul_li'>#<span>\"\n +value+\"</span></a>\")});\n\n li = li.toString().replace(/[, ]+/g, \" \").trim();\n\n main.appendChild(sectionCard);\n sectionCard.appendChild(head);\n sectionCard.appendChild(ul);\n ul.innerHTML += (li);\n \n}", "function createCard() {\n let icebox = document.getElementById('icebox');\n let cardContent = new Assignment(getValue('#assignment'), getValue('#description'));\n let card = document.createElement('div');\n let cardTitle = document.createElement('h2');\n let cardDescription = document.createElement('p');\n\n icebox.appendChild(card);\n\n card.appendChild(cardTitle);\n card.appendChild(cardDescription);\n\n cardTitle.innerHTML = cardContent.title;\n cardDescription.innerHTML = cardContent.description;\n}", "function viewRecipeCardMaker(text){\n if(ver_tarjeta_receta){\n let card = document.createElement('div');\n card.className = 'big-card';\n card.innerHTML = '<div class=\"big-image\" style=\"background-image: url('+text.img+');\"></div>' +\n '<div class=\"name\">' +\n '<h1>'+text.name+'</h1>' +\n '</div>' +\n '<div class=\"view-other\">' +\n '<p><span>Description: </span><br>'+text.description+'</p>' +\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\n '</div>';\n ver_tarjeta_receta.appendChild(card);\n } \n}", "function createCard(title, text, link, image = \"\", position = \"left\") {\n\tlet card = new Card(title, text, link, image, position);\n\tcard.add();\n\treturn card;\n}", "function create_tab_nation(nb_card)\n{\n\tvar tab_card = [nb_card];\n\tvar id = [\"vatican\", \"liban\", \"dubai\", \"kosovo\"];\n\tvar img = [\"image1\", \"image2\", \"image3\", \"image4\"];\n\tvar text = [\"JE SAIS PAS\", \"JE SAIS PAS\", \"JE SAIS PAS\", \"JE SAIS PAS\"];\n\tvar prob = [1, 1, 1, 1];\n\tfor (let i = 0; i < nb_card; i++)\n\t{\n\t\tvar card = new Object();\n\t\tcard.id = id[i];\n\t\tcard.img = img[i];\n\t\tcard.text = text[i];\n\t\tcard.prob = prob[i];\n\t\ttab_card[i] = card;\n\t}\n\treturn (tab_card);\n}", "function makeCard(movie) {\n const movieHTML = $('<div class=\"movie-div\">')\n .append(\n `<span class=\"movie-title-tooltip\" id=\"${movie.id}\">${movie.title}</span>`\n )\n .append(\n `<a href=\"/movies/${movie.id}\"><img src=\"${image_URL}${movie.poster_path}\" alt=\"${movie.title} poster \"onerror=\"this.onerror=''; this.src='./assets/blank.jpg'\"></a>`\n ); // If poster load error: load blank.jpg\n $.get(`http://localhost:3000/rating/${movie.id}/user`, function (data) {\n if (data.length === 1 ) {\n // Convert score to out of 5\n let score = data[0].rating\n score%2==0 ? stars = '★'.repeat(score / 2) : stars = '★'.repeat((score / 2)) + '½'\n $(movieHTML).append(`<div id=\"star\" class=\"rating\">${stars}</div>`);\n }\n })\n // Get community score by fetching route with SQL for average, convert to percentage and add if community rating exists add badge to poster\n $.get(`http://localhost:3000/rating/`, function (data) {\n let find = data.find(item => {return item.movie_id == movie.id})\n if (find) {\n let score = find.avg * 10;\n let votes = find.count\n $(movieHTML).prepend(`<div id=\"score\" class=\"score\">${score}%</div>`);\n $(movieHTML).prepend(`<div class=\"score-count score\">${votes} vote/s</div>`);\n }\n })\n $('#api-content').append(movieHTML);\n}", "function generateCard(post) {\n let card = gen(\"article\");\n card.classList.add(\"card\");\n card.id = post[\"id\"];\n let image = postProfilePic(post);\n let contents = postContent(post);\n let info = postInformation(post);\n card.appendChild(image);\n card.appendChild(contents);\n card.appendChild(info);\n return card;\n }", "function makeCard(TargatElement, i, classindex) {\n try {\n const card = ce(\"div\", TargatElement, [\n \"card\",\n \"card\" + classindex,\n \"projects\" + i,\n ]); // ----------card-----------\n card.style.height = d1 * 4 + \"px\"; // ------card height : this; css---------//\n if (bodyWidth >= 750) {\n card.style.height = \"100%\";\n }\n card.style.backgroundImage = `url(\"resource/imgs/projects/p${i}.jpg\")`;\n const blur_box = ce(\"div\", card, [\"blur_box\"]);\n const card_dtls = ce(\"div\", card, [\"card_dtls\"]); // ------------card dtls------------\n const card_name = ce(\"div\", card_dtls, [\"card_name\"]);\n const nameP = ce(\n \"p\",\n card_name,\n [],\n project_data.my_creation[`p${i}`].name\n );\n const language = ce(\"div\", card_dtls, [\"language\"]);\n for (\n let j = 0;\n j <= project_data.my_creation[`p${i}`].languases.length;\n j++\n ) {\n if (parseInt(project_data.my_creation[`p${i}`].languases[j])) {\n const img = ce(\"img\", language);\n img.src = `resource/svgs/language/${j + 1}.svg`;\n }\n }\n for (let btnx = 0; btnx < 2; btnx++) {\n let current =\n btnx == 0\n ? [\"card_view\", \"fas\", \"fa-street-view\", \"View\"]\n : [\"project_download\", \"fas\", \"fa-file-download\", \"Source\"];\n const card_view = ce(\"button\", card_dtls, [current[0], \"cmone\"]);\n const btnI = ce(\"i\", card_view, [current[1], current[2]]);\n const btnP = ce(\"p\", card_view, [], current[3]);\n }\n } catch (err) {\n console.log(err);\n }\n }", "function addCard(obj) {\n const card = document.createElement('div');\n document.getElementById('toy-collection').appendChild(card);\n card.classList.add(\"card\");\n\n const h2 = document.createElement('h2');\n h2.innerText = obj.name;\n card.appendChild(h2);\n\n const imgCard = document.createElement('img');\n imgCard.className += 'toy-avatar';\n imgCard.src = obj.image;\n card.appendChild(imgCard);\n\n const p = document.createElement('p');\n p.innerText = obj.likes;\n card.appendChild(p);\n\n const button = document.createElement('button');\n button.className += 'like-btn';\n button.className += 'btn';\n card.appendChild(button);\n}", "function createCard(id, bookName, authorName, pages, read) {\n const cardsSection = document.querySelector('#cards');\n\n const card = document.createElement('div');\n card.classList.add('card');\n card.setAttribute('id', id);\n\n const title = document.createElement('div');\n title.classList.add('heading');\n title.textContent = bookName;\n\n const content = document.createElement('div');\n content.classList.add('content');\n\n const author = document.createElement('p');\n author.innerHTML = `Author: ${authorName}`;\n\n const numPages = document.createElement('p');\n numPages.innerHTML = `Number of pages: ${pages}`;\n\n const readStatus = document.createElement('p');\n readStatus.innerHTML = `Read: ${read}`;\n\n const removeButton = document.createElement('div');\n removeButton.classList.add('delete-btn');\n removeButton.setAttribute('data-index', id);\n removeButton.setAttribute('href', '#');\n removeButton.innerHTML = '<i class=\"far fa-trash-alt fa-lg\"></i>';\n\n card.appendChild(title);\n content.appendChild(author);\n content.appendChild(numPages);\n content.appendChild(readStatus);\n card.appendChild(content);\n card.appendChild(removeButton);\n cardsSection.appendChild(card);\n}", "function crearCard(file, index) {\n let nombre = file.name.slice(0, file.name.indexOf('-')).replaceAll('_', ' ');\n let nombreTemp = nombre.replaceAll(\" \", \"_\").replaceAll(\".\", \"\");\n let rating = encontrarRating(nombreTemp);\n let key = file.name.split('-')[2];\n let costo = switchPrecios(key);\n let card = document.createElement('div');\n card.className = 'card mt-3 ml-5 mr-5';\n card.id = 'resultado-' + index;\n card.dataset.sort = rating;\n\n let cardHeader = document.createElement('h5');\n cardHeader.className = 'card-header';\n cardHeader.innerHTML = nombre + \" <span class=\\\"badge badge-secondary\\\">\" + key + \"</span>\";\n\n let cardBody = document.createElement('div');\n cardBody.className = 'card-body';\n\n let title = document.createElement('h5');\n title.innerText = file.name;\n title.className = 'card-title';\n\n let divRow = document.createElement('div');\n divRow.className = 'row justify-content-around';\n\n let colBoton = document.createElement('div');\n colBoton.className = 'col';\n\n let colAgregarCarrito = document.createElement('div');\n colAgregarCarrito.className = 'col';\n let botonAgregar = document.createElement('button');\n botonAgregar.onclick = function () {\n agregarAlCarrito(nombreTemp, costo, key);\n };\n botonAgregar.innerText = \"Agregar al carrito\";\n botonAgregar.classList.add(\"btn\");\n botonAgregar.classList.add(\"btn-outline-info\");\n colAgregarCarrito.appendChild(botonAgregar);\n let colRating = document.createElement('div');\n colRating.className = 'col';\n for (let i = 0; i < 5; i++) {\n let estrella = document.createElement('span');\n estrella.className = rating > i ? 'fa fa-star checked' : 'fa fa-star';\n estrella.id = \"rating-\" + nombreTemp + i;\n estrella.onclick = function () {\n listenerRating(i, nombreTemp);\n escribirRating(i, nombreTemp);\n };\n colRating.appendChild(estrella);\n }\n\n\n let enlace = document.createElement('a');\n enlace.className = \"btn btn-outline-success\";\n enlace.href = \"http://drive.google.com/a/extrategia.com.mx/uc?id=\" + file.id;\n enlace.innerText = 'Descargar';\n divRow.appendChild(colBoton);\n divRow.appendChild(colRating);\n divRow.appendChild(colAgregarCarrito);\n colBoton.appendChild(enlace);\n card.appendChild(cardHeader);\n card.appendChild(cardBody);\n cardBody.appendChild(title);\n cardBody.appendChild(divRow);\n divCards.appendChild(card);\n}", "function MakeCard(firstName, lastName, pan, expDate, cvv) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.pan = pan;\n this.expDate = expDate;\n this.cvv = cvv;\n}", "function showCardDetails (index) {\n // var movies = retrieveMovies()\n hideAllForms()\n\n if (movieDetailsEnabled) {\n hideMovieDetails()\n }\n\n movieDetailsEnabled = true\n\n document.getElementById('mainRight').style.display = 'block'\n\n // main div\n var mainCard = document.createElement('div')\n mainCard.setAttribute('class', 'showMovieDetails')\n mainCard.setAttribute('id', 'showMovieDetails')\n\n // sub div1\n var div1 = document.createElement('div')\n var div1Image = document.createElement('img')\n div1Image.setAttribute('src', movies[index].image)\n div1.appendChild(div1Image)\n\n // sub div2\n var div2 = document.createElement('div')\n // console.log(movies[index].title)\n div2.innerHTML = movies[index].title\n\n // sub div3\n var div3 = document.createElement('div')\n div3.innerHTML = movies[index].description\n\n // sub div4\n var div4 = document.createElement('div')\n div4.innerHTML = movies[index].rating\n\n // sub div5\n var div5 = document.createElement('div')\n div5.innerHTML = movies[index].year\n\n // sub div6\n var div6 = document.createElement('div')\n div6.innerHTML = movies[index].trailer\n\n // sub div7\n var div7 = document.createElement('div')\n div7.innerHTML = movies[index].download\n\n // add to card\n mainCard.appendChild(div1)\n mainCard.appendChild(div2)\n mainCard.appendChild(div3)\n mainCard.appendChild(div4)\n mainCard.appendChild(div5)\n mainCard.appendChild(div6)\n mainCard.appendChild(div7)\n\n // add to super card\n document.getElementById('mainRight').appendChild(mainCard)\n\n if (fullView) {\n fullToHalf()\n }\n}", "function createCards(cards) {\n let type;\n return cards.map((cardConfig) => {\n const tempCards = [];\n if (cardConfig[2]) {\n type = cardConfig[2];\n }\n for (let i = 0; i < cardConfig[0]; i++) {\n tempCards.push({text: cardConfig[1], type})\n }\n return tempCards;\n }).flat().map( function(item, index){\n const el = document.createElement('div');\n el.setAttribute('text', item.text);\n el.setAttribute('type', item.type);\n el.innerHTML = `\n<p>\n ${item.type}\n</p>\n<p>\n ${item.text}\n</p>\n`;\n el.classList.add('card');\n document.body.appendChild(el);\n addListeners(el);\n el.setAttribute('deck', 'origin');\n return el;\n });\n}", "function createMovieBox(movieObj) {\n const movieItem = document.createElement(\"div\");\n movieItem.id = movieObj.id;\n movieItem.classList.add(\"movie-card\");\n renderMovieText(movieItem, movieObj);\n movieBox.appendChild(movieItem);\n console.log(movieItem);\n //call\n}", "function createCard(pokemonName) {\n const card = document.createElement('div');\n card.id = pokemonName;\n card.classList.add('card');\n card.classList.add(pokemonName);\n // card.addEventListener('click', clickCard);\n return card\n}", "function create_card(headline)\n {\n // create the HTML for the card using jQuery\n var card = $(\n [\n \"<div class='card w-100'>\",\n \"<div class='card-body'>\",\n \"<div class='card-title row'>\",\n \"<h5 class='float-left'>\",\n \"<a class='headline-link' target='_blank' href='\" + headline.link + \"'>\",\n headline.title,\n \"</a>\",\n \"</h5>\",\n \"</div>\",\n \"<div class='row justify-content-end'>\",\n \"<a class='float-right btn btn-info notes col-sm-auto'>\",\n \"Headline Notes\",\n \"</a>\",\n \"<a class='float-right btn btn-danger delete col-sm-auto'>\",\n \"Delete From Saved\",\n \"</a>\",\n \"</div>\",\n \"</div>\",\n \"</div>\"\n ].join(\"\")\n );\n card.data(\"_id\", headline._id);\n return card;\n }", "function createCardElements() {\n var wikiLink = d.createElement(\"a\"); // creates link tag\n var card = d.createElement(\"div\"); // creates div tag\n var cardTitle = d.createElement(\"p\"); // creates title \n var cardDescription = d.createElement(\"p\"); // creates description\n setAttributes(card, cardTitle, cardDescription, wikiLink);\n generateCard(card, cardTitle, cardDescription, wikiLink);\n }", "function generateCard(toyId, toyName, toyImageUrl, toyLikeCount){\n\t\t// generate the header\n\t\tconst h2 = document.createElement('h2');\n\t\th2.append(toyName);\n\n\t\t// generate the image\n\t\tconst img = document.createElement('img');\n\t\timg.src = toyImageUrl;\n\t\timg.classList.add('toy-avatar');\n\n\t\t// generate the like count\n\t\tconst p = document.createElement('p');\n\t\tp.append(toyLikeCount + ' ' + likeVsLikes(toyLikeCount));\n\n\t\t// generate the like button\n\t\tconst button = document.createElement('button');\n\t\tbutton.classList.add('like-btn');\n\t\tbutton.append('Like 🖤');\n\n\t\t// generate the final toy card\n\t\tconst toyCard = document.createElement('div');\n\t\ttoyCard.dataset.id = toyId;\n\t\ttoyCard.classList.add('card');\n\t\ttoyCard.append(h2, img, p, button);\n\n\t\t// append it to the page\n\t\ttoyCollection.append(toyCard);\n\t}", "function newCard(json){\n\t// Insert Card\n\tdocument.getElementById(\"frame\").innerHTML += json.body;\n\t\n\t// Init drawer if the canvas is present\n\tif (document.getElementById(\"canvas\") != null)\n\t\tinitDrawer();\n\t\t\n\tif (document.getElementsByClassName(\"jscolor\") != null)\n\t\tinitJSColor();\n\t\n\t// Theme and animate if we need to swap cards\n\tlet cards = document.getElementsByClassName(\"card\");\n\tif (cards.length == 2){\n\t\tpopulatePage(json, cards[1]);\n\t\ttheme(cards[1]);\n\t\t\n\t\tif ($(cards[1]).find(\"#timer\")[0] != null)\n\t\t\tstartTimer(60, null);\n\t\t\n\t\ttransitionCards(cards);\n\t} else {\n\t\tpopulatePage(json, cards[0]);\n\t\t\n\t\tif ($(cards[0]).find(\"#timer\")[0] != null)\n\t\t\tcontinueTimer();\n\t\t\n\t\ttheme(cards[0]);\n\t}\n}", "function createCard(index) {\n var cardHtml = '<div class=\"card\">\\\n <img id=\"img'\n + index\n + '\" class=\"card-img-top\" src=\"img/cat.png\" alt=\"Card image cap\"\\\n onload=\"\">\\\n <div class=\"card-body d-flex flex-column\">\\\n <h4 id=\"title'\n + index\n + '\" class=\"card-title\">Card title\\\n </h4>\\\n <p id=\"text'\n + index\n + '\" class=\"card-text\">Some quick example text</p>\\\n <a id=\"url'\n + index\n + '\" href=\"#\" class=\"btn btn-primary btn-lg btn-block text-truncate mt-auto\">Visit page</a>\\\n </div>\\\n </div>';\n\n return cardHtml;\n}", "function createCards() {\n\ttitles_flipped = 0; \n\tvar card = '';\n\tmemorCards.shuffle(); \n\tfor(var i = 0 ; i < memorCards.length; i++){\n\tcard = card + '<div id=\"title_' + i + '\" class=\"'+memorCards[i]+'\"onclick=\"cardSwitch(\\''+i+'\\',\\''\n\t+memorCards[i]+'\\')\"></div>';\n\tmemoryValues = [];\n\tmemoryTitleIds = []; \n\n\t}\t\n\t\tdocument.getElementById('playground').innerHTML = card; \n}", "function makeCard(title, description, img, link, logo) {\r\n\r\n if (!img) {\r\n img = \"assets/images/noImage.jpg\";\r\n };\r\n\r\n var one = $(\"<div>\").addClass(\"col s12 m4\").attr(\"id\", \"columnOne\")\r\n var two = $(\"<img>\").attr(\"src\", \"assets/images/\" + logo);\r\n let thumbnail = $(\"<img>\").attr(\"src\", img);\r\n var three = $('<div class=\"card\">'\r\n + '<div class=\"card-image crop-height\">'\r\n + '</div>'\r\n + '<div class=\"titleMargin\">'\r\n + '<span class=\"card-title\">' + title + '</span>'\r\n + '<a href= \"' + link + '\" target=\"_blank\" class=\"btn-floating halfway-fab waves-effect waves-light red\"><i class=\"material-icons\">arrow_forward</i></a>'\r\n + '</div>'\r\n + '<div class=\"card-content\">'\r\n + '<p>' + description + '</p>'\r\n + '<button id=\"sentimentButton\" data-name = \"' + link +'\"> Analyze Sentiment </button>'\r\n + '</div>'\r\n + '</div>')\r\n\r\n // Respond to errors when no image is present by displaying a placeholder image \r\n $(thumbnail).on('error', function (err) {\r\n this.onerror = null;\r\n $(this).attr('src', 'assets/images/noImage.jpg');\r\n });\r\n\r\n // Append the proper information to the card\r\n three.children('.card-image').prepend(thumbnail);\r\n one.append(two, three);\r\n $(\"#newsRow\").prepend(one);\r\n }", "function newCardElement(name, themes, picture, url, id){\n //PARTE de crear los elementos html\n\n var bodycontainer = document.createElement(\"div\");\n bodycontainer.className = \"card\";\n\n var container = document.createElement(\"div\");\n container.className = \"card-body\";\n\n //imagen\n var img = document.createElement(\"img\");\n img.src = picture;\n img.className = \"card-img-top\";\n\n //name del autor\n var nameH = document.createElement(\"h3\");\n nameH.className=\"card-title\"; \n var nameText = document.createTextNode(name);\n nameH.appendChild(nameText); \n //data\n if(themes != null){\n var dataP = document.createElement(\"p\");\n dataP.className = \"card-text\";\n var dataText = document.createTextNode(themes);\n dataP.appendChild(dataText);\n }\n\n //link a la página del autor/a\n var aBook = document.createElement(\"a\");\n var aText = document.createTextNode(\"Go to this book\");\n aBook.className = \"btn btn-primary\"\n aBook.href = url;\n aBook.appendChild(aText);\n\n\n container.appendChild(nameH);\n if(themes != null){\n container.appendChild(dataP);\n }\n container.appendChild(aBook);\n bodycontainer.appendChild(img);\n bodycontainer.appendChild(container);\n //bodycontainer.getElementById(id).appendChild(nameHBook);\n //supercontainer.appendChild(bodycontainer);\n document.getElementById(id).appendChild(bodycontainer);\n}", "function createCard(image, title) {\n\n // area for the general card\n var area = document.createElement(\"div\");\n $(area).addClass(\"col s12 m6 l3\");\n\n // the card itself\n var card = document.createElement(\"div\");\n $(card).addClass(\"card\");\n\n // add an image to the card\n $(card).append();\n\n var imageDiv = document.createElement(\"div\");\n $(imageDiv).addClass(\"card-image\");\n $(imageDiv).append(\"<img class='responsive-img' src='\" + image +\"'>\");\n $(imageDiv).append(\"<span class='card-title col s12'>\" + title + \"</span>\");\n $(card).append(imageDiv);\n\n // the contents that are displayed normally\n // var content = document.createElement(\"div\");\n // $(content).addClass(\"card-content\");\n // $(content).append(\"<div class='row'>\");\n // $(content).append();\n // $(content).append(\"</div>\");\n // $(card).append(content);\n\n\n $(area).append(card);\n $(\"#bestImage\").append(area);\n}", "function renderCafe(doc){\n let li = document.createElement('div');\n li.classList ='row card';\n let vname = document.createElement('h4');\n \n let line = document.createElement('hr');\n\n let link = document.createElement('embed');\n let mycontainer = document.createElement('div');\n mycontainer.className='mycontainer';\n mycontainer.id ='videodis';\n \n li.setAttribute('data-id', doc.id);\n vname.textContent = doc.data().vname;\n link.src = doc.data().link;\n \n cafeList.appendChild(li);\n li.appendChild(vname);\n vname.appendChild(line);\n li.appendChild(mycontainer);\n mycontainer.appendChild(link);\n }", "static createCard(){\n let card = document.createElement('section');\n card.className = \"card\";\n card.style.width = \"18rem\";\n let cardBody = document.createElement('div');\n cardBody.className = \"card-body\";\n card.appendChild(cardBody);\n return card;\n }", "function showMovies(movies) {\n //loop through the data and for each movie we create a new div\n movies.forEach((movie)=> {\n //destructure the object\n const {poster_path, title, overview } = movie\n\n //create a div\n const movieCard = document.createElement(\"div\");\n movieCard.classList.add(\"card\");\n \n movieCard.innerHTML= `\n <img src=${IMGPATH + poster_path } alt=${title} />\n <h1>${title}</h1>\n <p>${overview}</p>\n `;\n //implement movie properties into the inner HTML of movieCard\n main.appendChild(movieCard);\n });\n \n}", "function createCards() {\n for (let i = 0; i < imgList.length; i += 1) {\n const cards = document.createElement('div');\n cards.classList.add('card');\n cards.innerHTML = `<div class='back'>${imgList[i]}</div>\n <div class='front'><i class=\"fa fa-line-chart\" style=\"font-size:2em;color:#ffffff;\"></i></div>`;\n cardArray.push(cards);\n }\n // Loops and Shuffles Card Array\n for (let i = cardArray.length - 1; i >= 0; i -= 1) {\n const randomIndex = Math.floor(Math.random() * (i + 1));\n const itemAtIndex = cardArray[randomIndex];\n cardArray[randomIndex] = cardArray[i];\n cardArray[i] = itemAtIndex;\n }\n }", "function renderMovies(title, desc, year, id, pic, movieSection) {\n let movieCard = `<div class=\"row justify-content-center\">`;\n\n for (let i = 0; i < id.length; i++) {\n movieCard += `<div class=\"card movie_card\">\n <img src=\"${pic[i]}\" class=\"card-img-top\" alt=\"${title[i]}\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${title[i]}</h5>\n <p class=\"card-text\">${desc[i]}</p>\n \n </div>\n <div class=\"card-footer\">\n <span class=\"movie_info\">${year[i]}</span><span class=\"movie_info float-end\">&#9733 9 / 10</span>\n </div>\n </div>`;\n }\n movieCard += \"</div>\";\n movieSection.innerHTML = movieCard;\n}", "function createCard(index) {\n var node = document.createElement(\"div\");\n node.className = \"box\";\n node.style.backgroundColor = colorOfCards[index];\n var boxNode = document.createElement(\"div\");\n boxNode.className = \"box-text\";\n node.appendChild(boxNode);\n var boxtext = document.createTextNode(index + 1);\n boxNode.appendChild(boxtext);\n document.getElementsByClassName(\"cards-container\")[0].appendChild(node);\n}", "function createCard(cards, card, variant) {\n return {\n matchingId: cards.indexOf(card) + 1,\n uniqueId: `${cards.indexOf(card) + 1}${variant}`,\n imgFilename: card,\n randomFactor: Math.floor(Math.random() * 100) + 1, //To make sure cards are located at different positions. Based on the random factor they get ordered in the grid\n matched: false,\n flipped: false,\n };\n}", "function movieDomCreator(movie) {\n movie.forEach(elem => {\n var div = document.createElement(\"div\");\n\n div.classList.add(\"box\");\n div.id = `${id}`;\n var img = document.createElement(\"img\");\n var p = document.createElement(\"p\");\n var heart = document.createElement(\"i\");\n heart.classList.add(\"heart\");\n\n var moreInfo = document.createElement(\"btn\");\n moreInfo.classList.add(\"button\");\n moreInfo.classList.add(\"is-primary\");\n moreInfo.textContent = \"More Info\";\n\n heart.classList.add(\"far\");\n heart.classList.add(\"fa-heart\");\n\n p.textContent = elem.title;\n\n if (elem.poster_path != undefined) {\n img.src = `${imageTemplate}${elem.poster_path}`;\n } else {\n img.src = \"not found\";\n }\n div.appendChild(img);\n div.appendChild(p);\n div.appendChild(moreInfo);\n div.appendChild(heart);\n contain.appendChild(div);\n id++;\n\n moreInfo.addEventListener(\"click\", function() {\n movieId = elem.id;\n getMoreDetails();\n console.log(\"card\");\n });\n });\n\n // Corner hearts inside box\n var hearts = document.querySelectorAll(\".heart\");\n\n hearts.forEach(function(heart) {\n heart.addEventListener(\"click\", function(e) {\n if (!heart.classList.contains(\"fontScale\")) {\n heart.classList.add(\"fontScale\");\n clonedTag = heart.parentNode.cloneNode(true);\n\n // appending each liked movie to watchlistBody\n clonedTag.removeChild(clonedTag.childNodes[3]);\n clonedTag.removeChild(clonedTag.childNodes[2]);\n\n var bigDiv = document.createElement(\"div\");\n bigDiv.appendChild(clonedTag);\n console.log(clonedTag);\n\n watchListInner.appendChild(bigDiv);\n allClones.push(clonedTag);\n }\n });\n });\n}", "function createCard(i) {\n var cardCreate = document.querySelector('#cardCreation');\n var card = document.createElement('div');\n card.className = 'card';\n var imgDiv = document.createElement('div');\n imgDiv.className = 'imgCreate';\n var img = document.createElement('img');\n imgDiv.appendChild(img);\n /*Create the header for the car part */\n var p = document.createElement('p');\n var h3 = document.createElement('h3');\n var button = document.createElement('BUTTON');\n button.className = 'add';\n button.innerHTML = 'Add to Cart';\n cardCreate.appendChild(card);\n img.src = products[i].image;\n /*Create the image for the car part*/\n img.className = 'product-image';\n card.appendChild(imgDiv);\n var name = document.createTextNode(products[i].name);\n h3.appendChild(name);\n card.appendChild(h3);\n p.className = 'price';\n /*Create the price for the car part*/\n var price = document.createTextNode('$' + products[i].price + ' CAD');\n p.appendChild(price);\n card.appendChild(p);\n var desc = document.createTextNode(products[i].description);\n card.appendChild(p);\n card.appendChild(desc);\n card.appendChild(button);\n}", "function cardConstructor(data, skeleton) {\n const newArray = splicer(data, skeleton);\n newArray.forEach((element, index) => {\n newArray[index] = creator(element);\n });\n document.querySelector(\".cards-container\").append(stitcher(newArray));\n}", "function createCards(cardType) {\n let i = createNewElement('i', cardType);\n let li = createNewElement('li', 'card');\n li.appendChild(i);\n li.addEventListener('click', listener, false);\n document.getElementsByClassName('deck')[0].appendChild(li);\n}", "function createCards(x) {\n let cards = [];\n for(i=1; i<=x; i++) {\n let obj = new Object();\n if(i%2===0) {\n obj.id=i;\n obj.content = i-1;\n } else {\n obj.id=i;\n obj.content = i;\n \n }\n \n cards.push(obj);\n\n }\n return cards\n}", "function createCard(face, suite, value) {\n var card = {\n // Props\n \"face\": face,\n \"suite\": suite,\n \"value\": value,\n \n // Behaviors\n \"getFace\": function() {\n return this.face;\n },\n \"getSuite\": function() {\n return this.suite;\n },\n \"getValue\": function() {\n return this.value;\n }\n };\n\n // Return the new Card\n return card;\n}", "function createCard() {\n\n $(\"#card-div\").empty();\n\n $(\"#card-div\").html(\n \"<div class='card'>\" +\n \"<h5 class='card-header' id='event'></h5>\" +\n \"<div class='card-body'>\" +\n \"<h5 class='card-title' id='venue'></h5>\" +\n \"<p class='card-text' id='description'></p>\" +\n \"<a href='#' class='btn btn-primary' id='external-link'>\" + \"Find Out More\" + \"</a>\" +\n \"</div>\" +\n \"</div>\"\n )\n\n }", "function createCard(player) {\n // create first div\n let colDiv = document.createElement('div');\n colDiv.classList.add('col-sm');\n colDiv.appendChild(createDiv(\"player-name\", player.name));\n colDiv.appendChild(generatePic());\n colDiv.appendChild(createDiv(\"player-bio\", 'From: ' + player.school));\n colDiv.appendChild(detailBtn(player.id));\n\n\n // create second div\n let infoDiv = createDiv('player-info', 'Player Statistics:')\n infoDiv.appendChild(createUlList(player));\n\n let cardBody = document.createElement('div');\n cardBody.classList.add('card-body');\n cardBody.appendChild(colDiv);\n cardBody.appendChild(infoDiv);\n // console.log(cardBody);\n return cardBody;\n }", "function createCard() {\n \tconst shuffleCards = shuffle(cardList);\n \tshuffleCards.forEach(function(card){\n \t\tconst li = document.createElement('li');\n \t\tconst i = document.createElement('i');\n \t\tli.setAttribute('class','card');\n \t\ti.setAttribute('class',card);\n \t\tli.appendChild(i);\n \t\tul.appendChild(li);\n \t});\n \tdeck.appendChild(ul);\n }", "function createAddresCardFromObject(object) {\n\n //Set variables\n let indexCardClass = \"indexKaart\";\n let strFirstLtr = object.lastname.charAt(0);\n \n //Check for class values and set accordingly\n object.gender == \"man\" ? indexCardClass += \" man\": indexCardClass += \" vrouw\";\n if (strFirstLtr.match(/[a-i]/i)){indexCardClass += \" aToti\"};\n if (strFirstLtr.match(/[j-r]/i)){indexCardClass += \" jTotr\"};\n if (strFirstLtr.match(/[s-z]/i)){indexCardClass += \" sTotz\"};\n \n //Create new div and insert into DOM\n $(\"#cards\").append('<div id=\"' + object.id + '\" class=\"' + indexCardClass + '\"><div class=\"persInfo\"><p>ID: '+ object.id + '</br>Naam: ' + object.firstname\n + ' ' + object.lastname + '</br>Woonplaats: ' + object.city + ' </br>Geslacht: ' + object.gender + '</p></div></div>');\n \n }", "function createCard() {\n const card = document.createElement('div')\n\n card.classList.add('card')\n if (idx === 0) {\n card.classList.add('active')\n }\n\n card.innerHTML = `\n <div class=\"inner-card\">\n <div class=\"inner-card-front\">\n <p>\n ${data.question}\n </p>\n </div>\n <div class=\"inner-card-back\">\n <p>\n ${data.answer}\n </p>\n </div>\n </div>`\n\n card.addEventListener('click', () => card.classList.toggle('show-answer'))\n\n // Add to DOM cards\n cardsEl.push(card)\n cardsContainer.appendChild(card)\n updateCurrentText()\n}", "function renderFilmsCard(articles) {\n listElement.innerHTML = filmsCardTpl(articles);\n trailer.createTrailerLink(document.querySelectorAll('.btn-youtube'));\n}", "function viewRecipeCardMaker(text){\r\n if(view_recipe_card){\r\n var card = document.createElement('div');\r\n card.className = 'big-card';\r\n card.innerHTML = '<div class=\"big-image\" style=\"background-image: url('+text.img+');\"></div>' +\r\n '<div class=\"name\">' +\r\n '<h1>'+text.name+'</h1>' +\r\n '</div>' +\r\n '<div class=\"view-other\">' +\r\n '<p><span>Description: </span><br>'+text.description+'</p>' +\r\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\r\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\r\n '</div>';\r\n view_recipe_card.appendChild(card);\r\n } \r\n}", "function newCard(number) {\n //Check for om tallet er et lige eller ulige tal\n if(number%2==0) {\n var cardList = [];\n var cardValue = 0;\n for(var i=1;i<=number;i++) {\n var modola = i%2;\n if(modola == 1) {cardValue++}\n // Variable - Classen der skal indsættes i HTML\n var card = $('<li class=\"card\" data-pair='+cardValue+'><div class=\"cardFace front\">Front</div><div class=\"cardFace back\"><h2>'+cardValue+'</h2></div></li>');\n // Indsæt et kort ind i HTML\n cardList.push(card)\n }\n return cardList;\n }\n else{return false}\n }", "function disegna_card(dati) {\r\n // preparo i dati per il template\r\n var placeholder = {\r\n 'titolo': dati.title,\r\n 'titolo_originale': dati.original_title,\r\n 'lingua': dati.original_language,\r\n 'voto': dati.vote_average\r\n };\r\n var html_card = template(placeholder);\r\n // appendo la card con i dati del risultato corrente\r\n $('#risultati').append(html_card);\r\n }", "function createCard(){\n event.preventDefault();\n\n var newCard = new Card(titleInput.value, urlInput.value);\n addCardToList(newCard);\n increaseCardCounter();\n}", "function makeCards() {\n this.colors = colors;\n this.patterns = patterns;\n this.shapes = shapes;\n this.numbers = numbers); \n }", "function createElementsForCard() {\r var newCard = createElementWithClass('div',['card']);\r\r var cardTitle = createElementWithClass('h2',['cardTitle']);\r var cardDescription = createElementWithClass('p', ['cardDescription']);\r\r return {'domElement' : newCard, 'innerElements' : {'title' : cardTitle, 'description' : cardDescription}};\r}", "function appendCards() {\r\n var lastCat = -1;\r\n for(var i=0;i<portfolio.length;i++){\r\n if(portfolio[i].category != lastCat) {\r\n lastCat = portfolio[i].category;\r\n var cat = document.createElement(\"div\");\r\n cat.className = \"titleBox\";\r\n cat.id = \"cat\"+lastCat;\r\n cat.innerHTML = category[lastCat];\r\n wrapper.appendChild(cat);\r\n }\r\n var node = document.createElement(\"div\");\r\n node.className = \"card\";\r\n node.innerHTML = '<img src=\"' + portfolio[i].image[0] + '\"><p>' + portfolio[i].problem + '</p>';\r\n wrapper.appendChild(node);\r\n }\r\n }", "function displaycard(num){\n for(let i =0; i<num; i++){\n //add details\n let articleEl = document.createElement('article')\n let h2El = document.createElement('h2')\n let imgEl = document.createElement('img')\n let divEl = document.createElement('div')\n let gameEl = document.createElement('span')\n //set class\n articleEl.setAttribute('class', 'card')\n h2El.setAttribute('class', 'card--title')\n imgEl.setAttribute('class', 'card--img')\n divEl.setAttribute('class', 'card--text')\n articleEl.setAttribute('class', 'card')\n h2El.innerText = data[i].name\n // varible\n imgEl.setAttribute('src', data[i].sprites.other[\"official-artwork\"].front_default )\n imgEl.setAttribute('width','256')\n // varible\n const stats = data[i].stats\n for(const item of stats){\n let pEl = document.createElement('p')\n pEl.innerText = `${item.stat.name.toUpperCase()}: ${item.base_stat}`\n divEl.append(pEl)\n }\n // chanllenge1\n const gameIndices = data[i].game_indices\n for(const indice of gameIndices ){\n gameEl.innerText = gameEl.innerText + indice.version.name +'/ '\n divEl.append(\n gameEl\n )\n }\n //chanllenge1\n let sectionEl = document.querySelector('section')\n sectionEl.append(articleEl)\n articleEl.append(h2El, imgEl,divEl)\n } \n}", "function makeCards(data){\n\n let doelgroepen = [];\n let genres = [];\n //loop to make every object in json file into a card\n for (let voorstelling of data){\n \n //creating Category buttons\n if(!doelgroepen.includes(voorstelling.category)){\n //checking if the category already exists, else adding it\n doelgroepen = [...doelgroepen, voorstelling.category]; \n let doelgroepBtn = document.createElement(\"button\");\n doelgroepBtn.className = \"categoryBtn\";\n doelgroepBtn.innerHTML = voorstelling.category;\n document.getElementById(\"doelgroepbtns\").appendChild(doelgroepBtn);\n }\n\n //creating Genre Buttons\n if(!genres.includes(voorstelling['genre-v2'])){\n //checking if the genre already exists, else adding it\n genres = [...genres, voorstelling['genre-v2']]; \n let genreBtn = document.createElement(\"button\");\n genreBtn.className = \"genreBtn\";\n genreBtn.innerHTML = voorstelling['genre-v2'];\n document.getElementById(\"genrebtns\").appendChild(genreBtn);\n }\n\n //creating all elements for a standard card\n let voorstellingCard = document.createElement(\"div\");\n let cardCategory = document.createElement(\"div\");\n let cardImgWrapper = document.createElement(\"div\");\n let cardContent = document.createElement(\"div\");\n let cardImgOverlay = document.createElement(\"div\");\n let cardGenre = document.createElement(\"div\");\n let cardExcerpt = document.createElement(\"div\");\n let cardTitle = document.createElement(\"H3\");\n let cardImg = document.createElement(\"img\");\n let cardRecorded = document.createElement(\"div\");\n\n //creating all elements for a searchbar card\n let horizontalCard = document.createElement(\"div\");\n let horizontalWrapper = document.createElement(\"div\");\n let horizontalTitle = document.createElement(\"H3\");\n let horizontalContent = document.createElement(\"div\");\n let horizontalExcerpt = document.createElement(\"div\");\n let horizontalImg = document.createElement(\"img\");\n let horizontalRecorded = document.createElement(\"div\");\n let horizontalImgOverlay = document.createElement(\"div\");\n\n //adding classes to all the elements of the standard card\n voorstellingCard.className = \"card\";\n cardImgWrapper.className = \"cardImgWrapper\";\n cardContent.className = \"cardContent\";\n cardImg.className = \"cardImg\";\n cardImgOverlay.className = \"cardImgOverlay\";\n cardGenre.className = \"cardGenre\";\n cardExcerpt.className = \"cardExcerpt\";\n cardRecorded.className = \"cardExcerpt\";\n cardCategory.className = \"cardCategory\";\n\n //adding classes to all the elements of the searchbar card\n horizontalCard.className = \"horizontalCard\";\n horizontalWrapper.className = \"horizontalWrapper\";\n horizontalContent.className = \"horizontalContent\";\n horizontalImg.className = \"horizontalImg\";\n horizontalExcerpt.className = \"horizontalExcerpt\";\n horizontalRecorded.className = \"horizontalRecorded\";\n horizontalImgOverlay.className = \"horizontalImgOverlay\";\n\n //adding data from the json object to the standard card elements\n cardTitle.innerHTML = voorstelling.name;\n cardCategory.innerHTML = voorstelling.category;\n cardImg.src = voorstelling.thumbnail.url;\n cardGenre.innerHTML = voorstelling['genre-v2'];\n cardExcerpt.innerHTML = voorstelling.excerpt;\n cardRecorded.innerHTML = voorstelling['recorded-at'];\n\n //adding data from the json object to the searchbar card elements\n horizontalTitle.innerHTML = voorstelling.name;\n horizontalImg.src = voorstelling.thumbnail.url;\n horizontalExcerpt.innerHTML = voorstelling.excerpt;\n horizontalRecorded.innerHTML = voorstelling['recorded-at'];\n\n //Appending all the elements to the searchbar card to build it\n horizontalContent.appendChild(horizontalTitle);\n horizontalContent.appendChild(horizontalExcerpt);\n if(voorstelling['recorded-at'] != undefined){\n horizontalContent.appendChild(horizontalRecorded);\n }\n horizontalWrapper.appendChild(horizontalImg);\n horizontalWrapper.appendChild(horizontalImgOverlay);\n horizontalCard.appendChild(horizontalWrapper);\n horizontalCard.appendChild(horizontalContent);\n horizontalCard.style.display = 'none';\n\n\n //Appending all the elements to the standard card to build it\n cardImgOverlay.appendChild(cardGenre);\n cardContent.appendChild(cardTitle);\n cardImgWrapper.appendChild(cardImg);\n cardImgWrapper.appendChild(cardImgOverlay);\n cardContent.appendChild(cardExcerpt);\n cardContent.appendChild(cardCategory);\n if(voorstelling['recorded-at'] != undefined){\n cardContent.appendChild(cardRecorded);\n }\n voorstellingCard.appendChild(cardImgWrapper);\n voorstellingCard.appendChild(cardContent);\n\n //adding the two cards to the webpage\n document.getElementById(\"results\").appendChild(voorstellingCard);\n document.getElementById(\"searchresults\").appendChild(horizontalCard);\n }\n\n}", "function createCard(detail) {\n return (\n <Cards\n key={detail._id}\n name={detail.name}\n amount={detail.amount}\n location={detail.location}\n address={detail.address}\n img1={detail.img1}\n img2={detail.img2}\n />\n );\n}", "function card_new(name, id, slot) {\n\tlet y = slot.time[0]/60,\n\t\th = slot.time[1]/60;\n\tlet t1 = (\"00\" + Math.trunc(slot.time[0]/60)).slice(-2) + \":\" +\n\t\t(\"00\" + (slot.time[0]%60)).slice(-2),\n\t\ttp1 = \"calc(\" + y*100 + \"% + 10px)\",\n\t\tt2 = (\"00\" + Math.trunc(\n\t\t\t(slot.time[0] + slot.time[1])/60)\n\t\t).slice(-2) + \":\" +\n\t\t(\"00\" + ((slot.time[0] + slot.time[1])%60)).slice(-2),\n\t\ttp2 = \"calc(\" + (y + h)*100 + \"% - 5px)\";\n\tlet seats = slot.cap - slot.enrolled,\n\t\tcap_src = seats ? \"assets/img/open.png\" : \"assets/img/full.png\",\n\t\tcap_tooltip = \"<label>\" +\n\t\t\t(seats ? (seats + (seats > 1 ? \" Seats\" : \" Seat\") +\n\t\t\t\" Remaining\") : \"Full\") +\n\t\t\t\"</label>\";\n\tlet cards = [];\n\tlet t; // Used to check if scroll boundaries should be resized or not.\n\n\tfor (let day in slot.day) {\n\t\t// Make sure that this date can actually be visualized.\n\t\tif (day_pos[slot.day[day]]) {\n\t\t\tt = 1; // Can be visualized. Resize scroll boundaries.\n\t\t\tlet x = day_pos[slot.day[day]];\n\t\t\tlet card = elem(\"card\"),\n\t\t\t\thead = elem(\"label\"),\n\t\t\t\tbody = elem(\"label\"),\n\t\t\t\tcap = elem(\"img\");\n\n\t\t\tcard.appendChild(head);\n\t\t\tcard.appendChild(body);\n\t\t\tcard.appendChild(cap);\n\t\t\tdiv.deck.appendChild(card);\n\n\t\t\t// Setup the card.\n\t\t\thead.innerHTML = name;\n\n\t\t\tbody.class = \"body\";\n\t\t\tbody.innerHTML = id + \"<br>\" +\n\t\t\t\tslot.section + \"<br>\" +\n\t\t\t\tslot.room + \"<br>\" +\n\t\t\t\tt1 + \" - \" + t2;\n\t\t\tbody.setAttribute(\"class\", \"body\");\n\n\t\t\tcap.src = cap_src;\n\t\t\tcap.setAttribute(\"class\", \"cap\");\n\t\t\tcap.setAttribute(\"draggable\", false);\n\n\t\t\tcard.style.left = x*100 + \"%\";\n\t\t\tcard.style.top = y*100 + \"%\";\n\t\t\tcard.style.height = \"calc(\" + h*100 + \"% - 5px)\";\n\n\t\t\ttooltip_new(cap, cap_tooltip);\n\n\t\t\tcard.addEventListener(\n\t\t\t\t\"click\",\n\t\t\t\tevent => info_show(name, id, slot)\n\t\t\t);\n\n\t\t\tcard.addEventListener(\"mouseenter\", event => {\n\t\t\t\tdiv.time.style.opacity = 0.1;\n\t\t\t\tdiv.time.style.top = \"calc(\" + y*100 + \"% + 5px)\";\n\t\t\t\tdiv.time.style.height = \"calc(\" + h*100 + \"% - 5px)\";\n\t\t\t\tdiv.screen_label[0].innerHTML = t1;\n\t\t\t\tdiv.screen_label[0].style.top = tp1;\n\t\t\t\tdiv.screen_label[0].style.opacity = 1;\n\t\t\t\tdiv.screen_label[1].innerHTML = t2;\n\t\t\t\tdiv.screen_label[1].style.top = tp2;\n\t\t\t\tdiv.screen_label[1].style.opacity = 1;\n\n\t\t\t\tfor (let i = 0; i < cards.length; i++)\n\t\t\t\t\tcards[i].setAttribute(\"hover\", 1);\n\t\t\t});\n\n\t\t\tcard.addEventListener(\"mouseleave\", event => {\n\t\t\t\tdiv.time.style.opacity = 0;\n\t\t\t\tdiv.screen_label[0].style.opacity = 0;\n\t\t\t\tdiv.screen_label[1].style.opacity = 0;\n\n\t\t\t\tfor (let i = 0; i < cards.length; i++)\n\t\t\t\t\tcards[i].removeAttribute(\"hover\");\n\t\t\t});\n\n\t\t\tcards.push(card);\n\t\t}\n\t}\n\n\tif (t)\n\t\tif (scroll_min == null) {\n\t\t\tscroll_min = slot.time[0] + slot.time[1];\n\t\t\tscroll_max = slot.time[0];\n\t\t} else {\n\t\t\tscroll_min = Math.min(slot.time[0] + slot.time[1], scroll_min);\n\t\t\tscroll_max = Math.max(slot.time[0], scroll_max);\n\t\t}\n\n\treturn cards;\n}", "function addCard(index, date, temperature, humidity, condition) {\n\n let card = $(\"<div>\");\n card.addClass(\"card bgWhiteTransparent\");\n\n let cardBody = $(\"<div>\");\n cardBody.addClass(\"card-body\");\n\n let title = $(\"<h3>\");\n title.addClass(\"card-title font-weight-bold h4 text-center\");\n date = formatDate(date);\n title.text(`${date} `);\n\n let icon = $(\"<span>\");\n icon.addClass(getIcon(condition));\n title.append(icon);\n\n let t = $(\"<p>\");\n t.addClass(\"card-text pt-2\");\n t.text(\"Temp: \");\n t.append(`${temperature} °F`);\n\n let h = $(\"<p>\");\n h.addClass(\"card-text pt-3\");\n h.text(`Humidity: ${humidity}%`);\n\n cardBody.append(title);\n cardBody.append(t);\n cardBody.append(h);\n\n card.append(cardBody);\n\n $(\"#\" + index).empty().append(card);\n}", "function createBookCard (){ \n newBookCard = document.createElement(\"div\")\n newBookCard.classList.add(\"books\")\n screenContainer.appendChild(newBookCard)\n newBookCard.appendChild(titleName); \n newBookCard.appendChild(authorName); \n newBookCard.appendChild(pageNumber); \n newBookCard.appendChild(readOrNot); \n newBookCard.style.display = \"block\"\n}", "function createCards(options){\n //creatind div element with class \":card\"\n let card = document.createElement(\"div\");\n card.className = \"card\";\n\n let cardImgContainer = document.createElement('div');\n cardImgContainer.className = \"card__img\";\n card.append(cardImgContainer);\n\n //creating img element to append to created element before\n let cardImage = document.createElement(\"img\");\n //creating path for img tag\n cardImage.src = options.path;\n cardImage.width = 200;\n cardImage.height = 200;\n //adding img to the card\n cardImgContainer.append(cardImage);\n\n let cardName = document.createElement('h3');\n cardName.className = \"card__title\"\n cardName.innerText = options.name;\n card.append(cardName);\n\n let cardParagraph = document.createElement('p');\n cardParagraph.className = \"card__info\";\n cardParagraph.innerText = options.description;\n card.append(cardParagraph);\n\n let cardButton = document.createElement('button');\n cardButton.className = \"card__btn\";\n cardButton.type = \"button\";\n cardButton.innerText = \"Click Me!\";\n card.append(cardButton);\n\n return card;\n}", "function createBigCardVideos(youtubeObject) {\n\n const link = `https://www.youtube.com/embed/${youtubeObject.items[0].id.videoId}`;\n const container = document.querySelector('.big-card');\n const el = document.createElement('div');\n el.classList.add('single-video-container');\n\n // console.log(youtubeObject);\n\n const videoTitle = youtubeObject.items[0].snippet.title;\n\n const vTitle = document.createElement('h3');\n vTitle.innerText = videoTitle;\n vTitle.classList.add('video-title');\n el.append(vTitle);\n\n const video = document.createElement('object');\n video.data = link;\n el.append(video);\n \n addNextButton(el, video, youtubeObject, vTitle);\n container.append(el);\n}", "function addCard(data) {\n var time = new Date(data.media.nextAiringEpisode.airingAt * 1000).toLocaleTimeString().replace(\":00\", \"\");\n var title = data.media.title.english != null ? data.media.title.english : data.media.title.romaji\n var anilink = \"https://anilist.co/anime/\" + data.media.id;\n var cardBody = '<div class=\"anime\" id=\"anime-' + data.media.id + '\">\\\n <div class=\"uk-card uk-card-default uk-card-hover\"> \\\n <div class=\"anime-overlay hide-overlay\" id=\"anime-overlay-' + data.media.id + '\"><button id=\"anilist-'+ data.media.id +'\"class=\"uk-button uk-button-default anime-button\">AniList</button><button id=\"kitsu-'+ data.media.id +'\"class=\"uk-button uk-button-default anime-button\" anime-title=\"' + data.media.title.romaji + '\">Kitsu</button><button id=\"mal-'+ data.media.id +'\"class=\"uk-button uk-button-default anime-button\" anime-title=\"' + data.media.title.romaji + '\">MAL</button></div>\\\n <div class=\"uk-card-media-top\" style=\"height: 325px; background: ' + \"url('\" + data.media.coverImage.large + \"');\" + 'background-size: cover; background-position: center center;\"> \\\n </div> \\\n <div class=\"uk-card-body\"> \\\n <h4>' + title + '</h4> \\\n </div> \\\n <div class=\"uk-card-footer\"><span class=\"uk-margin-small-right\" uk-icon=\"icon: clock\"></span>'+ time +'</div> \\\n </div> \\\n </div>';\n\n $(\"#card-holder\").append(cardBody);\n applyCardClickedListener(data.media.id);\n}", "function buildCard(toy){\n const card = document.createElement(\"div\")\n card.setAttribute(\"class\", \"card\");\n card.setAttribute(\"id\", `card-${toy.id}`);\n \n let toyName = document.createElement(\"h2\");\n let toyImage = document.createElement(\"img\");\n let likes = document.createElement(\"p\");\n let likeBtn = document.createElement(\"button\");\n toyName.innerText = toy.name;\n toyImage.setAttribute(\"class\", \"toy-avatar\");\n toyImage.src = toy.image;\n likes.innerText = `${toy.likes} Likes`;\n likeBtn.setAttribute(\"class\", \"like-btn\");\n likeBtn.innerText = `Like ${toy.name}`;\n card.append(toyName, toyImage, likes, likeBtn);\n\n likeBtn.addEventListener(\"click\", function(e) {\n e.preventDefault();\n addLike(e);\n });\n \n toyCollection.appendChild(card);\n}", "function addVideoCard(cardHeading) {\n\n\t//We need an id for the ul so we can add the list items\n\t//for videos and lyrics to the correct card body\n\tcardCount++;\n\n\tvar v = '<div class=\"card\" id=\"c-' + cardCount + '\">';\n\tv += '<div class=\"card-header\">' + cardHeading + '</div>';\n\tv += '<div class=\"card-body\">';\n\tv += '<div class=\"row\">';\n\tv += '<div class=\"col col-lhs\"></div>';\n\tv += '<div class=\"col col-rhs\">';\n\tv += '<ul class=\"card-videos\" id=\"card' + cardCount + '\"></ul>'\n\tv += '</div>';\n\tv += '</div></div><!--card-body--></div><!--card-header-->';\n\n\t$('.main-content').prepend(v);\n\n}", "function createDeck() {\n deck.innerHTML = \"\";\n for (x = 0; x < cards.length; x++) {\n let src = cards[x].src;\n card = document.createElement(\"div\");\n card.className = \"card\";\n card.innerHTML = `<div class=\"card-inner\"><div class=\"card-front\"><img src=\"assets/images/card-front.jpg\" alt=\"card front face\"></div><div class=\"card-back\"><img src=\"${src}\" alt=\"card back face\"></div></div>`;\n deck.appendChild(card);\n }\n}", "function newCard(art, topic) {\n // Create elements\n const card = document.createElement(\"div\");\n const headline = document.createElement(\"div\");\n const author = document.createElement(\"div\");\n const imgContainer = document.createElement(\"div\");\n const image = document.createElement(\"img\");\n const byline = document.createElement(\"span\");\n\n // Add classes\n card.classList.add(\"card\");\n headline.classList.add(\"headline\");\n author.classList.add(\"author\");\n imgContainer.classList.add(\"img-container\");\n\n // Add content\n headline.textContent = art.headline;\n image.src = art.authorPhoto;\n byline.textContent = `By ${art.authorName}`;\n\n // Set topic\n card.setAttribute(\"topic\", topic);\n\n // Append children\n imgContainer.appendChild(image);\n author.appendChild(imgContainer);\n author.appendChild(byline);\n card.appendChild(headline);\n card.append(author);\n\n return card;\n}", "function createCard(data, index) {\n const card = document.createElement('div');\n card.classList.add('card');\n\n if (index === 0) {\n card.classList.add('active');\n }\n\n card.innerHTML = `\n <div class=\"inner-card\">\n <div class=\"inner-card-front\">\n <p>\n ${data.question}\n </p>\n </div>\n <div class=\"inner-card-back\">\n <p>\n ${data.answer}\n </p>\n </div>\n</div>\n `;\n\n card.addEventListener('click', () => card.classList.toggle('show-answer'));\n\n // Add to DOM cards\n cardsEl.push(card);\n\n cardsContainer.appendChild(card);\n\n // реализуем вывод текущей и всего карточек\n}", "function CreateNewCard() {\n var song = songData[Math.floor(Math.random() * songData.length)];\n\n // Panel/Card\n var panel = document.createElement('div');\n panel.style.opacity = 0;\n\n if(togglePanel) {\n panel.setAttribute('class', 'panel panel-left');\n }\n else if(!togglePanel) {\n panel.setAttribute('class', 'panel panel-right');\n }\n\n togglePanel = !togglePanel;\n\n // Album image\n var img = document.createElement('img');\n img.setAttribute('draggable', 'false');\n img.setAttribute('src', song.imgUrl);\n img.setAttribute('alt', song.name);\n\n // The heart icon/button\n var heartIcon = document.createElement('span');\n heartIcon.setAttribute('class', 'icon-heart-empty');\n\n // Track Details\n var details = document.createElement('div');\n var title = document.createElement('div');\n var artist = document.createElement('div');\n\n details.setAttribute('class', 'panel_details');\n title.setAttribute('id', 'panel_details-title');\n artist.setAttribute('id', 'panel_details-artist');\n\n title.innerHTML = song.name;\n artist.innerHTML = song.artist;\n\n details.appendChild(title);\n details.appendChild(artist);\n\n panel.appendChild(img);\n panel.appendChild(heartIcon);\n panel.appendChild(details);\n\n screen.appendChild(panel);\n\n // Show the newly created card/panel\n setTimeout(function() {\n panel.style.opacity = 1;\n }, 100);\n}", "function generateRecepieCard(recepie) {\n \n var divCard0i = $(\"<div>\");\n divCard0i.addClass(\"media searchresults\");\n var img0i = $(\"<img>\");\n //img0i.add\n img0i.attr(\"src\", recepie.image);\n img0i.addClass(\"align-self-start mr-3 recipeimage\");\n img0i.attr(\"imgId\", recepie.id);\n divCard0i.append(img0i);\n\n var divMedia0i = $(\"<div>\");\n divMedia0i.addClass(\"media-body\");\n var h5RecepieTitle0i = $(\"<h5>\");\n h5RecepieTitle0i.addClass(\"mt-0\");\n h5RecepieTitle0i.attr(\"id\", \"recipetitle3\");\n h5RecepieTitle0i.text(recepie.title);\n divMedia0i.append(h5RecepieTitle0i);\n\n var para0i = $(\"<p>\");\n var ingredients = recepie.usedIngredients[0].original;\n para0i.text(ingredients);\n divMedia0i.append(para0i);\n\n var aTag0i = $(\"<a>\");\n aTag0i.attr(\"href\", \"./viewrecepiepage.html?recepie-id=\"+recepie.id);\n aTag0i.attr(\"recepie-id\", recepie.id);\n\n var spanOfATag0i = $(\"<span>\");\n spanOfATag0i.addClass(\"divlink\");\n aTag0i.append(spanOfATag0i);\n divMedia0i.append(aTag0i);\n\n divCard0i.append(divMedia0i);\n return divCard0i;\n}", "function App() {\n const cardArr = [\n {\n \"id\": 1,\n \"nameRU\": \"«Роллинг Стоунз» в изгнании\",\n \"nameEN\": \"Stones in Exile\",\n \"director\": \"Стивен Кайак \",\n \"country\": \"США\", \"year\": \"2010\",\n \"duration\": 61,\n \"description\": \"В конце 1960-х группа «Роллинг Стоунз», несмотря на все свои мегахиты и сверхуспешные концертные туры, была разорена. Виной всему — бездарный менеджмент и драконовское налогообложение в Британии. Тогда музыканты приняли не самое простое для себя решение: летом 1971 года после выхода альбома «Stiсky Fingers» они отправились на юг Франции записывать новую пластинку. Именно там, на Лазурном Берегу, в арендованном Китом Ричардсом подвале виллы Неллькот родился сборник «Exile on Main St.», который стал лучшим альбомом легендарной группы.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=UXcqcdYABFw\",\n \"created_at\": \"2020-11-23T14:12:21.376Z\",\n \"updated_at\": \"2020-11-23T14:12:21.376Z\",\n \"image\": {\n \"id\": 1, \"name\": \"stones-in-exile\",\n \"alternativeText\": \"\",\n \"caption\": \"\",\n \"width\": 512,\n \"height\": 279,\n \"formats\": {\n \"thumbnail\": { \"hash\": \"thumbnail_stones_in_exile_b2f1b8f4b7\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 245, \"height\": 134, \"size\": 8.79, \"path\": null, \"url\": \"/uploads/thumbnail_stones_in_exile_b2f1b8f4b7.jpeg\" },\n \"small\": { \"hash\": \"small_stones_in_exile_b2f1b8f4b7\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 500, \"height\": 272, \"size\": 25.68, \"path\": null, \"url\": \"/uploads/small_stones_in_exile_b2f1b8f4b7.jpeg\" }\n },\n \"hash\": \"stones_in_exile_b2f1b8f4b7\",\n \"ext\": \".jpeg\",\n \"mime\": \"image/jpeg\",\n \"size\": 25.53,\n \"url\": \"/uploads/stones_in_exile_b2f1b8f4b7.jpeg\",\n \"previewUrl\": null,\n \"provider\": \"local\",\n \"provider_metadata\": null,\n \"created_at\": \"2020-11-23T14:11:57.313Z\",\n \"updated_at\": \"2020-11-23T14:11:57.313Z\"\n }\n },\n {\n \"id\": 2,\n \"nameRU\": \"All Tomorrow's Parties\",\n \"nameEN\": \"All Tomorrow's Parties\",\n \"director\": \" Джонатан Кауэтт\",\n \"country\": \"Великобритания\", \"year\": \"2009\",\n \"duration\": 82,\n \"description\": \"Хроники британского фестиваля, который первым нарушил монополию «Гластонбери», «Ридинга» и прочих пивных сборищ в чистом поле — и с тех пор прослыл одним из самых независимых и принципиальных. ATP из года в год проходит на базе отдыха в английской глуши, где артисты и их поклонники живут в одинаковых номерах, не бывает коммерческих спонсоров, программу составляют приглашенные кураторы (в разное время ими были Ник Кейв, Belle & Sebastian, Sonic Youth и даже Мэтт Грейнинг). И, главное, где не любят вздорных людей — основатель фестиваля Барри Хоган однажды сказал, что никогда больше не станет иметь дело с группой Killing Joke, «потому что они му...аки». Эта демократичность сказалась и на фильме: часть съемок сделана адептами фестиваля на мобильный телефон.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=D5fBhbEJxEU\",\n \"created_at\": \"2020-11-23T14:15:19.238Z\",\n \"updated_at\": \"2020-11-23T14:15:19.238Z\",\n \"image\": { \"id\": 2, \"name\": \"all-tommoros-parties\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 699, \"height\": 266, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_all_tommoros_parties_33a125248d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 245, \"height\": 93, \"size\": 10.33, \"path\": null, \"url\": \"/uploads/thumbnail_all_tommoros_parties_33a125248d.jpeg\" }, \"small\": { \"hash\": \"small_all_tommoros_parties_33a125248d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 500, \"height\": 190, \"size\": 35.24, \"path\": null, \"url\": \"/uploads/small_all_tommoros_parties_33a125248d.jpeg\" } }, \"hash\": \"all_tommoros_parties_33a125248d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 67.06, \"url\": \"/uploads/all_tommoros_parties_33a125248d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:14:08.595Z\", \"updated_at\": \"2020-11-23T14:14:08.595Z\" }\n },\n {\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n }];\n\n\n const [savedMoviesArr, setSavedMoviesArr] = React.useState([{\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n },\n {\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n },\n {\n \"id\": 3,\n \"nameRU\": \" Без обратного пути\",\n \"nameEN\": \"No Distance Left to Run\",\n \"director\": \"Уилл Лавлейс, Дилан Сотерн\",\n \"country\": \"Великобритания\",\n \"year\": \"2010\",\n \"duration\": 104,\n \"description\": \"Затеянный по такому подозрительному поводу, как реюнион Blur в 2009-м году фильм начисто лишен присущего моменту пафоса и выхолощенности речей. Вернее, что-то похожее неизбежно возникает, когда ты видишь, как забитый до отказа Гайд-парк как в последний раз ревет «Song 2», но это лишь буквальное свидетельство того, что Blur — великая группа. К счастью, помимо прямых и косвенных свидетельств этого, в «No Distance Left to Run» хватает острых углов, неловких моментов и всего того сора, из которого рождаются по-настоящему отличные группы: помимо важных, но общеизвестных моментов (вроде соперничества с Oasis за первенство в том же бритпопе) визуализируются и те, что всегда оставались за кадром: наркотическая зависимость, неутихающие костры амбиций, ревность, обиды, слава — и все это блестяще снято на фоне истории того, что вообще происходило в Британии времен Блэра.\",\n \"trailerLink\": \"https://www.youtube.com/watch?v=6iYxdghpJZY\",\n \"created_at\": \"2020-11-23T14:17:23.257Z\",\n \"updated_at\": \"2020-11-23T14:17:23.257Z\",\n \"image\": { \"id\": 3, \"name\": \"blur\", \"alternativeText\": \"\", \"caption\": \"\", \"width\": 460, \"height\": 298, \"formats\": { \"thumbnail\": { \"hash\": \"thumbnail_blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"width\": 241, \"height\": 156, \"size\": 8.32, \"path\": null, \"url\": \"/uploads/thumbnail_blur_a43fcf463d.jpeg\" } }, \"hash\": \"blur_a43fcf463d\", \"ext\": \".jpeg\", \"mime\": \"image/jpeg\", \"size\": 21.07, \"url\": \"/uploads/blur_a43fcf463d.jpeg\", \"previewUrl\": null, \"provider\": \"local\", \"provider_metadata\": null, \"created_at\": \"2020-11-23T14:17:01.702Z\", \"updated_at\": \"2020-11-23T14:17:01.702Z\" }\n }])\n\n const history = useHistory();\n\n function handleBack() {\n history.goBack();\n }\n\n function handleCardLike(card) {\n // Проверяем, есть ли уже лайк на этой карточке\n // const isLiked = card.likes.some(i => i._id === currentUser._id);\n\n // // Отправляем запрос в API и получаем обновлённые данные карточки\n // api.changeLikeCardStatus(card._id, isLiked)\n // .then((newCard) => {\n // setCards((cards) =>\n // cards.map((c) =>\n // c._id === card._id ? newCard : c\n // )\n // )\n // })\n setSavedMoviesArr(savedMoviesArr.some(function (el) { return el.id === card.id }) ? [...savedMoviesArr] : [card, ...savedMoviesArr]);\n console.log(savedMoviesArr)\n };\n\n function handleCardDelete(card) {\n setSavedMoviesArr(savedMoviesArr.filter(function (el) { return el.id !== card.id }));\n }\n\n return (\n <>\n {/* <CurrentUserContext.Provider value={currentUser}> */}\n <Switch>\n {/* <ProtectedRoute */}\n <Route\n exact path=\"/\"\n // loggedIn={loggedIn}\n // component={Main}\n >\n <Main />\n <Footer />\n </Route>\n {/* <ProtectedRoute */}\n <Route\n path=\"/movies\"\n // loggedIn={loggedIn}\n // component={Movies}\n >\n <Header />\n <Movies\n isSaved={false}\n cardArr={cardArr}\n onCardLike={handleCardLike}\n savedMovies={savedMoviesArr}\n />\n <Footer />\n </Route>\n {/* <ProtectedRoute */}\n <Route\n path=\"/saved-movies\"\n // loggedIn={loggedIn}\n // component={SavedMovies}\n >\n <Header />\n <SavedMovies\n isSaved={true}\n savedCardArr={savedMoviesArr}\n onCardDelete={handleCardDelete}\n />\n <Footer />\n </Route>\n {/* <ProtectedRoute */}\n {/* <Route\n path=\"/profile\"\n // loggedIn={loggedIn}\n component={Profile}\n /> */}\n <Route path=\"/profile\">\n <Header />\n <Profile\n // onRegister={handleRegister} \n name='Alex'\n email='[email protected]'\n />\n </Route>\n <Route path=\"/signup\">\n <Register\n // onRegister={handleRegister} \n />\n </Route>\n <Route path=\"/signin\">\n <Login\n // onLogin={handleLogin} data={newUserData} \n />\n </Route>\n <Route path=\"/signin\">\n <Login\n // onLogin={handleLogin} data={newUserData} \n />\n </Route>\n <Route path=\"*\">\n <NotFound\n onBack={handleBack}\n />\n </Route>\n <Route>\n {/* {loggedIn ? <Redirect exact to=\"/\" /> : <Redirect to=\"/signin\" />} */}\n </Route>\n </Switch>\n {/* </CurrentUserContext.Provider> */}\n </>\n );\n}", "function makeBookCard(book) {\n const div = document.createElement(\"div\");\n div.className = \"card\";\n\n const img = document.createElement(\"img\");\n img.src = book.img;\n\n const h3 = document.createElement(\"h3\");\n h3.textContent = book.title;\n\n const p = document.createElement(\"p\");\n p.textContent = book.author;\n\n //add all elements to div\n div.appendChild(img);\n div.appendChild(h3);\n div.appendChild(p);\n\n return div;\n}", "function createCard(pokemon) {\n const pokemonEl = document.createElement('div');\n pokemonEl.classList.add('card');\n pokemonEl.classList.add(`${pokemon.types[0].type.name}`)\n const pokeId = (id) => {\n if(id < 10) { return id = \"00\"+id }\n if(id < 100) { return id = \"0\"+id }\n if(id > 100) { return id }\n }\n\n const pokemonCard = `\n \n <img src=\"${pokemon.sprites.other.dream_world.front_default}\" alt=\"${pokemon.name}\" class=\"card-img\">\n <h3 class=\"card-stats-data\"> ${pokemon.name} </h3>\n <div class=\"card-stats\"> \n <div class=\"card-stats-id\"> \n #<span class=\"card-stat-idContent\"> ${pokeId(pokemon.id)} </span>\n </div>\n </div>\n <p class=\"card-stats-data\"> Type: <span> ${pokemon.types[0].type.name} </span> </p>\n `;\n\n pokemonEl.innerHTML = pokemonCard;\n pokemonContainer.appendChild(pokemonEl);\n\n}", "function createCard(article) {\n var card = $(\n [\n \"<div class='card w-75 p-1 m-3 mx-auto'>\",\n \"<div class='card-body'>\",\n \"<div class='card-title'>\",\n \"<h4>\",\n \"<a class='article-link' target='_blank' href='\" + article.url + \"'>\",\n article.headline,\n \"</a>\",\n \"</h4>\",\n \"<a class='btn btn-outline-primary float-right comments m-1'>Comments</a>\",\n \"<a class='btn btn-outline-danger float-right delete m-1'>Delete</a>\",\n \"</div>\",\n article.summary ,\n \"</div>\",\n \"</div>\"\n ].join(\"\")\n );\n card.data(\"_id\", article._id);\n return card;\n }", "function crearItems() {\n for (let info of dbJSON) {\n \n let miObjeto = document.createElement('div');\n miObjeto.classList.add('card', 'col-sm-4');\n // Cuerpo\n let miObjetoCardBody = document.createElement('div');\n miObjetoCardBody.classList.add('card-body');\n // Titulo\n let miObjetoTitle = document.createElement('h5');\n miObjetoTitle.classList.add('card-title', 'titulo-objeto');\n miObjetoTitle.textContent = info['nombre'];\n // Foto\n let miObjetoImagen = document.createElement('img');\n miObjetoImagen.classList.add('img-fluid');\n miObjetoImagen.setAttribute('src', info['imagen']);\n // Precio\n let miObjetoPrecio = document.createElement('p');\n miObjetoPrecio.classList.add('card-text', 'precio');\n miObjetoPrecio.textContent = '$' + info['precio'];\n \n let miObjetoBoton = document.createElement('button');\n miObjetoBoton.classList.add('btn', 'btn-primary', );\n miObjetoBoton.textContent = '+';\n miObjetoBoton.setAttribute('marcador', info['id']);\n miObjetoBoton.addEventListener('click', addCarrito);\n \n miObjetoCardBody.appendChild(miObjetoImagen);\n miObjetoCardBody.appendChild(miObjetoTitle);\n miObjetoCardBody.appendChild(miObjetoPrecio);\n miObjetoCardBody.appendChild(miObjetoBoton);\n miObjeto.appendChild(miObjetoCardBody);\n items.appendChild(miObjeto);\n }\n}", "_creatHACard() {\n if (this.id) return\n\n this.id = \"TC\" + Math.floor(Math.random() * 1000)\n\n // the ha-card --------------------------------\n const card = document.createElement(\"ha-card\")\n card.setAttribute(\"class\", \"graph-card\")\n card.id = this.id + \"-card\"\n card.setAttribute(\"data-graphtype\", this.chart_type)\n if (this.chart_themesettings && this.chart_themesettings.cardbackground) {\n /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */\n card.style.cssText += `background: ${this.chart_themesettings.cardbackground} !important;`\n }\n\n // ha-card content layer ---------------------\n const content = document.createElement(\"div\")\n content.setAttribute(\"class\", \"card-content\")\n content.id = this.id + \"-view\"\n content.style.height = cssAttr(this.card_height)\n\n // ha-card icon and title -------------------\n if (this.card_title || this.card_icon) {\n const cardHeader = document.createElement(\"div\")\n cardHeader.setAttribute(\"class\", \"card-header header flex\")\n cardHeader.id = this.id + \"-header\"\n if (this.card_icon) {\n const iconel = document.createElement(\"ha-icon\")\n iconel.setAttribute(\"class\", \"card-header-icon\")\n iconel.setAttribute(\"icon\", this.card_icon)\n cardHeader.appendChild(iconel)\n }\n if (this.card_title) {\n const cardTitle = document.createElement(\"span\")\n cardTitle.setAttribute(\"class\", \"card-header-title\")\n cardTitle.innerHTML = this.card_title\n cardHeader.appendChild(cardTitle)\n }\n card.append(cardHeader)\n }\n\n // ha-card canavas element --------------------\n this.canvasId = this.id + \"-chart\"\n const canvas = document.createElement(\"canvas\")\n canvas.setAttribute(\"class\", \"card-canvas\")\n this.ctx = canvas.getContext(\"2d\")\n canvas.id = this.canvasId\n canvas.height = this.card_height - 10\n canvas.style.height = cssAttr(this.card_height - 10)\n canvas.style.maxHeight = cssAttr(this.card_height - 10)\n\n // ha-card svg loader element -----------------\n if (this.loaderart) {\n this.loader = document.createElement(\"img\")\n this.loader.setAttribute(\"class\", \"card-loader\")\n this.loader.id = this.id + \"-loader\"\n this.loader.alt = \"loading...\"\n this.loader.style.width = \"60\"\n this.loader.src = appinfo.assets + this.loaderart + \".svg\"\n }\n\n // ha-card state data -----------------\n if (this.chart_showstate) {\n this.currentData = document.createElement(\"div\")\n this.currentData.setAttribute(\"class\", \"card-state-view\")\n this.currentData.id = this.id + \"state-view\"\n }\n\n // ha-card detail data ---------------\n if (this.chart_showdetails) {\n this.detailData = document.createElement(\"div\")\n this.detailData.setAttribute(\"class\", \"card-detail-view\")\n this.detailData.id = this.id + \"detail-info\"\n this.currentData.setAttribute(\"data-view\", this.detailData.id)\n } else {\n content.style.maxHeight = cssAttr(this.card_height)\n }\n\n // add all defined elements to the card --------------------------\n content.appendChild(canvas)\n if (this.loader) content.append(this.loader)\n if (this.chart_showdetails && this.detailData) {\n content.append(this.detailData)\n }\n card.appendChild(content)\n if (this.chart_showstate && this.currentData) {\n card.appendChild(this.currentData)\n }\n if (this.card_timestamp) {\n this.timestampLayer = document.createElement(\"div\")\n this.timestampLayer.setAttribute(\"class\", \"card-timestamp\")\n this.timestampLayer.id = this.id + \"detail-footertext\"\n this.timestampLayer.innerHTML = localDatetime(new Date().toISOString())\n card.appendChild(this.timestampLayer)\n }\n\n // create the ha-card ------\n this.root.appendChild(card)\n }", "function createCard() {\n $(\".deck\").empty();\n let cardList = shuffle(cards);\n for (const card of cardList) {\n $(\".deck\").append('<li class=\"card\"><i class=\"fa fa-' + card + '\"></i></li>');\n };\n }", "function createCard(data, index) {\n const card = document.createElement('div');\n card.classList.add('card');\n if (index === 0) {\n card.classList.add('active');\n }\n card.innerHTML = `\n <div class=\"inner-card\">\n <div class=\"inner-card-front\">\n <p>${data.question}</p>\n </div>\n <div class=\"inner-card-back\">\n <p>${data.answer}</p>\n </div>\n\n </div>\n `;\n\n card.addEventListener('click', () => card.classList.toggle('show-answer'));\n\n // Add to DOM cards\n cardsEl.push(card);\n cardsContainer.appendChild(card);\n updateCurrentText();\n}", "function createCard(data, index) {\n const card = document.createElement('div');\n card.classList.add('card');\n // Add active class to the first card\n if (index === 0) {\n card.classList.add('active');\n }\n card.innerHTML = `\n <div class=\"inner-card\">\n <div class=\"inner-card-front\">\n <p> \n ${data.question}\n </p>\n </div>\n <div class=\"inner-card-back\">\n <p>\n ${data.answer}</p>\n \n </div>\n </div>\n `;\n\n\n // Switch the cards\n card.addEventListener('click', () => card.classList.toggle('show-answer'));\n // Add to DOM cards array\n cardsEl.push(card);\n //Display in DOM \n cardsContainer.appendChild(card);\n\n updateCurrentText();\n }", "function createCards(i) {\n\n let ratings = new Object();\n //add star ratings\n let temp = data[i].title;\n temp = temp.split(\" \").join(\"-\").toLowerCase();;\n\n var card = '<div class=\"card\">' +\n '<img src=\"' + data[i].img + '\" class=\"card-img-top\" alt=\"...\">' +\n '<div class=\"card-body\">' +\n '<h5 class=\"card-title\">' + data[i].title + '</h5>';\n if(data[i].series)\n card+='<p class=\"card-text card-author\" style=\"color: #9e9e9e; text-align: center;\">' + data[i].series + '</p>' ;\n card+='<p class=\"card-text card-author\">by ' + data[i].author + '</p>' +\n\n //star ratings\n '<div class=\"' + temp + ' star-outer\">' +\n '<div class=\"' + temp + ' star-inner\"></div>' +\n '</div>' +\n '<span class=\"number-rating\">' + data[i].rating + '</span><br>' +\n\n //button takes to detailsOfBook and passes bookId which then displays details of the book\n '<button type=\"button\" onclick=\"detailsOfBook(\\'' + data[i]._id + '\\')\" class=\"btn ' + btnClassPrimary + ' btn-sm\">Details</button>' +\n '</div>' +\n '</div>';\n\n main.innerHTML += card;\n return {\n text: temp,\n rating: data[i].rating\n }\n}", "function generateCards(arr) {\n for (let item of arr) {\n // Använda Instans-metod för att skap kort\n let card_element = item.createCard();\n imgWrappers.appendChild(card_element);\n\n }\n}", "function createBoard(){\n for(let i=0; i<carPic.length;i++){\n let card = document.createElement('img')\n // creating an image tage for each item of carpic array\n card.setAttribute('src','img/bbs.png')\n // adding the src of the image associated with each image\n card.setAttribute('data-id',i)\n // giving an ID to each item of the array\n card.addEventListener('click',cardFlip)\n // each card will flip on click\n table.appendChild(card)\n // adding an image associated with the attributes added to each item of the array\n card.classList.add(\"wheel\")\n // adding a css class of wheel to make it spin\n }\n }", "function createCard(frontCover, hidden, listener, id, position)\n {\n var card = new Card(\n {\n back: properties.cardCovers.back,\n front: frontCover,\n hidden: false,\n parent: DOM.cardsContainer,\n gameField: DOM.container,\n size:\n {\n height: sizes.desk.height + \"PX\",\n width: sizes.desk.width + \"PX\"\n }\n });\n\n card.dataset.id = id;\n card.dataset.position = position;\n card.addEventListener(\"click\", listener);\n return card;\n }", "function createCard(comment){\n let article = createEl('article', 'comment');\n\n let avatar = createEl('img','card__photo');\n article.appendChild(avatar)\n \n let heading = createEl('h4','card__name');\n \n heading.innerText = comment.name;\n \n article.appendChild(heading);\n\n let date = createEl('p','card__date'); \n\n let time = new Date (comment.timestamp)\n let day = time.getUTCDate();\n let month = time.getUTCMonth() + 1;\n let year = time.getUTCFullYear();\n let timeStamp = `${day}/${month}/${year}`\n\n date.innerText= timeStamp\n article.appendChild(date);\n\n let text = createEl('p','card__text');\n \n text.innerText = comment.comment;\n article.appendChild(text);\n \n return article; \n}", "function makeDeck() {\n var count = 0;\n var name = ['9', '10', '11', '12', '13', '14'];\n var suit = ['c', 's', 'd', 'h'];\n for (var n = 0; n < name.length; n++) {\n for(var s = 0; s < suit.length; s++) {\n var newCard = new Card(name[n], suit[s], parseInt(name[n], 10), `cardDeck/${name[n]}${suit[s]}.png`); \n if (suit[s] === 'c' || suit[s] === 's') {\n newCard.color = \"black\";\n } else newCard.color = \"red\";\n euchreDeck[count] = newCard;\n count++;\n }\n }\n}", "function createCards(jsonObj){\n var x = 1\n var jsonCards = jsonObj['cards'];\n for(var i = 0; i < jsonCards.length; i++){\n cards[i] = new Card(jsonCards[i].name, jsonCards[i].value, jsonCards[i].id, jsonCards[i].image);\n console.log(cards[i]);\n }\n}", "function makeACard(img, name, id, entry){\n //get some page elements\n let card = document.createElement(\"div\");\n //give it a class of pokemon-card\n card.classList.add(\"pokemon-card\");\n displayCards.prepend(card);\n //picture\n let pokePicture = document.createElement(\"div\");\n pokePicture.classList.add(\"pokemon-card__img\");\n //api will add img here\n pokePicture.innerHTML = `<img class=\"pokemon-card__img__picture\" src=\"${img}\">`;\n\n card.appendChild(pokePicture);\n\n //name\n let pokeName = document.createElement(\"div\");\n pokeName.classList.add(\"pokemon-card__name\");\n card.appendChild(pokeName);\n pokeName.innerHTML = `<p class=\"pokemon-card__name__text\">${name}</p>`;\n //pokedex #\n let pokeID = document.createElement(\"div\");\n pokeID.classList.add(\"pokemon-card__id\");\n card.appendChild(pokeID);\n pokeID.innerHTML = `<p class=\"pokemon-card__id__text\">Pokedex #:<br>${id}</p>`;\n\n //entry\n let pokeEntry = document.createElement(\"div\");\n pokeEntry.classList.add(\"pokemon-card__entry\");\n card.appendChild(pokeEntry);\n pokeEntry.innerHTML = `<p class=\"pokemon-card__entry__text\">${entry}</p>`;\n\n}", "function createHappyCard(session) {\n //session.send(\"Glad to hear that you're feeling good today! :)\");\n //dispSongCard(session);\n var str1 = 'YouTube Link: ';\n var title = str1.concat(link);\n return new builder.HeroCard(session)\n .title(song_title)\n .subtitle('Boost your mood with a song!')\n .text('Click on the link below:')\n .images([\n builder.CardImage.create(session, picURL)\n ])\n .buttons([\n builder.CardAction.openUrl(session, link, title)\n ]);\n}", "function newProduct(camera){\n \n\n //creation de la div produit\n const containerProduct = document.createElement(\"div\");\n containerProduct.classList.add(\"cardsProduct\"); //c'est le container des cartes\n \n //ajout des images\n const image = addImage(camera);\n\n //ajout du texte description\n const description = addDescription(camera);\n\n \n // Montage de la DIV\n image.appendChild(description);\n containerProduct.appendChild(image);\n\n return containerProduct;\n}", "function createCards() {\n // Creates the backs of each card and sets the id of each\n let back = document.createElement('div');\n back.className = 'back';\n backs = [];\n\t\n for (i = 0; i <= 3; i++) {\n backs.push(back.cloneNode());\n backs[i].setAttribute('id', `large${i+1}`);\n }\n for (i = 0; i <= 19; i++) {\n backs.push(back.cloneNode());\n backs[i + 4].setAttribute('id', `small${i+1}`);\n }\n\n // Creates the front face and each card container template\n let front = document.createElement('div');\n front.className = 'front';\n\n card.className = 'card available';\n card.appendChild(front.cloneNode());\n\n // Iterates each card and then appends the appropriate card back\n for (i = 0; i <= 23; i++) {\n cards.push(card.cloneNode());\n cards[i].appendChild(backs[i]);\n }\n\n // Creates the card containers and appends the correct cards to them\n let largeContainer = document.createElement('div');\n largeContainer.setAttribute('id', 'large-cards');\n\n let smallContainer = document.createElement('div');\n smallContainer.setAttribute('id', 'small-cards');\n\n for (i = 0; i <= 3; i++) {\n largeContainer.appendChild(cards[i]);\n }\n\n for (i = 0; i <= 19; i++) {\n smallContainer.appendChild(cards[i + 4]);\n }\n\n inputContainer.appendChild(largeContainer);\n inputContainer.appendChild(smallContainer);\n\n assignLarge();\n assignSmall();\n addCardListeners();\n}", "function createFirstHandCards(spielerIndex) {\n\n for (let j = 0; j < Spielerinnen[spielerIndex].Cards.length; j++) { // die Anzahl der Karten für jede Spielerin kann anders sein (+2 oder +4)\n let kartenFarbe = Spielerinnen[spielerIndex].Cards[j].Color;\n let kartenWert = Spielerinnen[spielerIndex].Cards[j].Value;\n\n createCardImage(spielerIndex, j, kartenFarbe, kartenWert);\n }\n}", "function createCard(product) {\r\n\r\n // Create a card div\r\n let card = document.createElement(\"div\")\r\n card.className = \"card\"\r\n \r\n // Create cardBody to separete cardImg from the rest\r\n card.innerHTML = `\r\n <img class=\"cardImg\" src=http:${product.image}>\r\n \r\n <div class=\"cardBody\">\r\n <div class=\"cardName\">${product.name}</div>\r\n <div class=\"cardDesc\">${product.description}</div>\r\n <div class=\"cardOldPrice\">De: R$${product.oldPrice}</div>\r\n <div class=\"cardPrice\">Por: R$${product.price}</div>\r\n <div class=\"cardInstallment\">ou ${product.installments.count}x de R$${product.installments.value}</div>\r\n <button>Comprar</button>\r\n </div>`\r\n selectedProducts.appendChild(card)\r\n}", "function createPostCard(post) {\n const postCard = document.createElement(\"div\");\n postCard.classList.add(\"card\");\n\n const postImage = document.createElement(\"img\");\n postImage.classList.add(\"card-img-top\");\n postImage.src = post.image ? post.image : \"https://picsum.photos/500/300\";\n postImage.alt = post.title;\n\n const postCardBody = document.createElement(\"div\");\n postCardBody.classList.add(\"card-body\");\n\n const postTitle = document.createElement(\"h5\");\n postTitle.classList.add(\"card-title\");\n postTitle.textContent = post.title;\n\n const postLink = document.createElement(\"a\");\n postLink.classList.add(\"btn\", \"btn-primary\");\n postLink.href = `./posts/${post.file}`;\n postLink.textContent = \"Read More\";\n\n postCardBody.appendChild(postTitle);\n postCardBody.appendChild(postLink);\n\n postCard.appendChild(postImage);\n postCard.appendChild(postCardBody);\n\n return postCard;\n}", "function afficherVedette(film, filmDiv) {\n const section = document.createElement('section');\n\n const Vedette = film['vedette']; //Emmagasiner la valeur de la propriété JSON 'Vedette' dans la varaible tableau heroes \n // Récupérer les éléments du tableau Vedette pour remplir notre page html\n for (var i = 0; i < Vedette.length; i++) {\n const myArticle = document.createElement('article');// Pour chaque vedette, créer un article ('article'), une entête h2 ('h2'), 1 paragraphe ('p')\n const myH2 = document.createElement('h2');\n const myPara1 = document.createElement('p');\n\n myH2.textContent = Vedette[i].Nom; // Utiliser la valeur de la propriété JSON 'Nom' retourné par le serveur pour initialiser le texte de notre entête h2\n myPara1.textContent = 'Personnage: ' + Vedette[i].personnage + '\\n age: ' + Vedette[i].age; // Utiliser la valeur de la propriété JSON 'Personnage' retourné par le serveur pour initialiser le paragraphe\n\n // Assigner(associer) l'entête myH2 et le paragraphes myPara1 à l'article myArticle\n myArticle.appendChild(myH2);\n myArticle.appendChild(myPara1);\n\n filmDiv.appendChild(myArticle); // Associer notre article a notre section de la page HTML\n }\n}" ]
[ "0.68673706", "0.66949195", "0.65294105", "0.65186936", "0.65129286", "0.64891535", "0.6402274", "0.63911545", "0.63787097", "0.63672173", "0.634707", "0.6342534", "0.63131845", "0.6293391", "0.62891006", "0.6288295", "0.625987", "0.6256437", "0.62448025", "0.623835", "0.62340564", "0.6232774", "0.62284404", "0.62151414", "0.6211546", "0.62099373", "0.6200947", "0.6184575", "0.6184099", "0.6179393", "0.6164926", "0.616334", "0.615596", "0.61540794", "0.61522925", "0.6141124", "0.6140896", "0.6133437", "0.6115733", "0.61137694", "0.6109222", "0.6104397", "0.6090005", "0.6067788", "0.6065291", "0.6057551", "0.6056306", "0.6050306", "0.6048845", "0.60303926", "0.6022198", "0.6017434", "0.6014481", "0.6008779", "0.5996955", "0.5994604", "0.59899735", "0.5981245", "0.5979785", "0.597671", "0.59764457", "0.5970211", "0.59643614", "0.5940877", "0.5940868", "0.5938924", "0.5937599", "0.5928148", "0.59261864", "0.5917908", "0.5917575", "0.5914553", "0.59122026", "0.5911901", "0.59004575", "0.58954376", "0.58929217", "0.5890129", "0.5889092", "0.5886637", "0.5879748", "0.5870113", "0.5867216", "0.586259", "0.5862533", "0.5860702", "0.5857065", "0.5856819", "0.58531624", "0.58494866", "0.58476996", "0.5846897", "0.5843999", "0.58427405", "0.58315885", "0.5828255", "0.5819979", "0.58198184", "0.58170474", "0.5811224" ]
0.7277007
0
genera le card per i film presenti nel parametro "list" e li appende dentro il nodo parent passato come secondo parametro "sectionNode"
function renderCarousel(list, sectionNode) { list.forEach((item) => { // ottiene la url dell'immagine completa const imgURL = getImageUrl(item.poster_path); const movieCard = getMovieCard(imgURL, item); sectionNode.appendChild(movieCard); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCards(photographer){\n const sectionCard = elmtFactory(\n \"section\",\n {class:'card'},\n )\n\n const head = elmtFactory('a',\n { href:'photographer-page.html?id='+photographer.id},\n elmtFactory('img',{class:'card_picture', src:'./public/'+photographer.portrait, alt:''},),\n elmtFactory('h2',{class:'card_name'},photographer.name),\n elmtFactory('p',{class:'card_location'}, photographer.city+', '+photographer.country),\n elmtFactory('p',{class:'card_slogan'},photographer.tagline),\n elmtFactory('p',{class:'card_price'},photographer.price+'€'),\n )\n \n let ul = elmtFactory(\n 'ul',\n {class:'card_ul'},\n )\n\n let li = photographer.tags.map( (value) => {\n return (\"<a href='index.html?tag=\"+value+\"' class='card_ul_li'>#<span>\"\n +value+\"</span></a>\")});\n\n li = li.toString().replace(/[, ]+/g, \" \").trim();\n\n main.appendChild(sectionCard);\n sectionCard.appendChild(head);\n sectionCard.appendChild(ul);\n ul.innerHTML += (li);\n \n}", "function load_food_cards_into_sections(food_list, food_categories, food_info_dict) {\n var category_dict = {};\n for (var i in food_categories) {\n var category = food_categories[i];\n\n var cat_id = category[\"id\"];\n var cat_name = category[\"name\"];\n category_dict[cat_id] = cat_name;\n }\n\n for (var i in food_list) {\n var food = food_list[i];\n\n var card = add_card(food, food_info_dict);\n var category_id = food[\"category\"];\n\n document.getElementById(category_dict[category_id]).appendChild(card);\n }\n\n}", "function renderCafe(doc){\n let li = document.createElement('div');\n li.classList ='row card';\n let vname = document.createElement('h4');\n \n let line = document.createElement('hr');\n\n let link = document.createElement('embed');\n let mycontainer = document.createElement('div');\n mycontainer.className='mycontainer';\n mycontainer.id ='videodis';\n \n li.setAttribute('data-id', doc.id);\n vname.textContent = doc.data().vname;\n link.src = doc.data().link;\n \n cafeList.appendChild(li);\n li.appendChild(vname);\n vname.appendChild(line);\n li.appendChild(mycontainer);\n mycontainer.appendChild(link);\n }", "function createCard(section) {\n for (let item of recipesObject[section]) { //here we are iterating through each key value pair in our object\n let card = document.createElement(\"div\");\n if (section === \"cakes\") { //section name needs to be individually appended as it is a string value\n cakes.appendChild(card)\n } else if (section === \"bread\") {\n bread.appendChild(card)\n } else {\n biscuits.appendChild(card)\n }\n card.classList.add(\"card\");\n card.style = (\"width: 18rem; margin: 20px;\");\n card.innerHTML = \n `<img src=${item.image} class=\"card-img-top\" alt=\"...\" style=\"height: 24vh\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${item.title}</h5>\n <h6 class=\"card-subtitle mb-2 text-muted\">${item.author}</h6>\n <p class=\"card-text\"><b>Ingredients:</b> ${item.ingredients}</p>\n </div>`\n }\n}", "function createCards(list, isTop, el) {\n if(!isTop) {\n for(let i = 0; i < list.length; i++) {\n let cardCol = document.createElement('div');\n let animeCard = document.createElement('div');\n let animeImg = document.createElement('img');\n let animeTitle = document.createElement('h4');\n let animeInfo = document.createElement('div');\n let animeBody = document.createElement('p');\n let addBtn = document.createElement('button');\n let moreInfoBtn = document.createElement('button');\n let malURL = document.createElement('a');\n let animeBodyInfo = '<ul><li> Rated: '+ list[i].rated + '</li> <li> Episodes: '+list[i].episodes.toString() + '</li> <li>Score: '+list[i].score.toString() +'</li></ul>';\n $(cardCol).addClass('column my-4');\n $(animeImg).attr('src', list[i].image_url);\n $(animeImg).addClass('anime-img');\n $(malURL).attr('href', list[i].url);\n $(malURL).addClass('mal-url');\n $(malURL).text(list[i].url);\n $(malURL).hide();\n $(animeTitle).text(list[i].title);\n $(animeTitle).addClass('panel-title');\n $(animeCard).addClass('panel id-'+i.toString());\n $(animeCard).css('background-image', 'url('+list[i].image_url+')');\n $(animeCard).append(animeImg);\n $(animeImg).hide();\n //$(animeImg.).addClass('card-img');\n $(animeInfo).addClass('panel-content');\n $(animeBody).addClass('panel-body');\n $(addBtn).addClass('panel-btn');\n $(moreInfoBtn).addClass('panel-btn-info');\n $(addBtn).text('Add to List');\n $(moreInfoBtn).text('More Info');\n $(animeBody).html(animeBodyInfo);\n $(animeInfo).append(animeTitle);\n $(animeInfo).append(animeBody);\n $(animeInfo).append(addBtn);\n $(animeInfo).append(moreInfoBtn);\n $(animeCard).append(animeImg);\n $(animeCard).append(malURL);\n //$(animeCard).append(animeTitle);\n $(animeCard).append(animeInfo);\n $(cardCol).append(animeCard);\n $(el).append(cardCol);\n \n }\n }else {\n for(let i = 0; i < list.length; i++) {\n let cardCol = document.createElement('div');\n let animeCard = document.createElement('div');\n let animeImg = document.createElement('img');\n let animeTitle = document.createElement('h4');\n let animeInfo = document.createElement('div');\n let animeBody = document.createElement('p');\n let addBtn = document.createElement('button');\n let moreInfoBtn = document.createElement('button');\n let malURL = document.createElement('a');\n let animeBodyInfo = '<ul> <li>Episodes: '+list[i].episodes+\n '</li> <li>Rank: '+list[i].rank.toString()+'</li> <li>Score: '+list[i].score.toString()+\n '</li></ul>';\n $(cardCol).addClass('column my-4');\n $(animeImg).attr('src', list[i].image_url);\n $(animeImg).addClass('anime-img');\n $(malURL).attr('href', list[i].url);\n $(malURL).addClass('mal-url');\n $(malURL).text(list[i].url);\n $(malURL).hide();\n $(animeTitle).text(list[i].title);\n $(animeTitle).addClass('panel-title');\n $(animeCard).addClass('panel id-'+i.toString());\n $(animeCard).css('background-image', 'url('+list[i].image_url+')')\n $(animeCard).append(animeImg);\n $(animeImg).hide();\n //$(animeImg).addClass('card-img');\n $(animeInfo).addClass('panel-content');\n $(animeBody).addClass('panel-body');\n $(addBtn).addClass('panel-btn');\n $(moreInfoBtn).addClass('panel-btn-info');\n $(addBtn).text('Add to List');\n $(moreInfoBtn).text('More Info');\n $(animeBody).html(animeBodyInfo);\n $(animeInfo).append(animeTitle);\n $(animeInfo).append(animeBody);\n $(animeInfo).append(addBtn);\n $(animeInfo).append(moreInfoBtn);\n $(animeCard).append(animeImg);\n $(animeCard).append(malURL);\n //$(animeCard).append(animeTitle);\n $(animeCard).append(animeInfo);\n $(cardCol).append(animeCard);\n $(el).append(cardCol);\n }\n }\n}", "render1(lectLst) {\n var rootNode = this.rootNode;\n document.getElementById(rootNode.id + \"_childs\").innerHTML = \"\";\n rootNode.visible = true;\n\n for (var i in lectLst) {\n this.addLectItem(rootNode, lectLst[i]);\n }\n }", "function add_section_for_each_food_category(categories) {\n for (var i in categories) { //for each food category there will be an allocated space that will contain cards.\n var cat = categories[i];\n var food_section = document.createElement(\"SECTION\");\n food_section.className = \"food_card_container\";\n\n var separator = document.createElement(\"div\");\n separator.className = \"food_card_separator\";\n separator.innerText = cat[\"name\"].toUpperCase(); //each different section will be for an allocated category.\n food_section.id = cat[\"name\"]; //each\n\n document.getElementById(\"categories\").appendChild(separator);\n\n document.getElementById(\"categories\").appendChild(food_section);\n }\n}", "function createListNode(obj, path) {\n if (\"maneuvers\" in obj) {\n return null;\n }\n \n var $ul = $(\"<ul>\");\n\n for (var x in obj) {\n var child = obj[x];\n if (child === null || typeof child !== 'object') continue;\n \n var name = x;\n if (\"description\" in child) {\n name = child.description;\n }\n\n var childpath = (path == \"\"? x : path + \"_\" + x);\n var $a = $(\"<a>\").attr(\"href\", \"cube.html?case=\" + childpath).text(name);\n\n var $cul = createListNode(child, childpath);\n var count = getManeuverCount(child);\n\n var $li = $(\"<li>\");\n $li.append($a);\n if (count > 0) {\n $li.append($(\"<span>\").addClass(\"note\").text(\"(\" + count + \")\"));\n }\n if ($cul) {\n $li.append($cul);\n }\n $ul.append($li);\n }\n \n return $ul;\n}", "function addCardsToDisplaySection(data){\n displaySection.innerHTML = \"\";\n\n for(const item of data.Search){\n // console.log(item);\n // console.log(item.Title);\n // console.log(item.Poster);\n makeCards(item.Poster, item.Title, item.imdbID);\n }\n }", "function createProductCards(cardData, sectionID){\n for (var i = 0; i < cardData.length; i++) {\n var card = cardData[i]\n var tmpl = document.getElementById('card-template').content.cloneNode(true);\n tmpl.querySelector('.name').innerText = card.name;\n tmpl.querySelector('.price').innerText = \"$\" + card.price.toString();\n tmpl.querySelector('.custom-card-img').src = \"./assets/images/product_images/\" + card.imgName;\n tmpl.querySelector('.product-link').href = \"./product_pages/\" + detail_page + \"#\" + card.id.toString();\n\n var cardList = document.getElementById(sectionID);\n\n cardList.appendChild(tmpl);\n }\n}", "function createBioSection(title, biolist){\n //create a new section\n var tmpl = document.getElementById('biosection-template').content.cloneNode(true);\n \n tmpl.querySelector('.people').id = \"section-\" + String(title);\n \n tmpl.querySelector('.title').innerHTML = title;\n \n document.getElementById(\"bio_container\").appendChild(tmpl);\n \n for (var i = 0; i < biolist.length-1; i++){\n createBioCol(String(title), i, biolist[i].split('##'));\n }\n}", "function buildSectionList(media) {\n\n var list = document.getElementById('scroller');\n var item;\n var activeKey = '';\n var activeBg = '';\n\n var activeHeight = 0;\n\n // clear old content\n list.innerHTML = '';\n\n var i = 0;\n var n = media.length;\n var selectedIndex = Math.floor(n/2);\n for (i = 0; i < n; i++) {\n var section = media[i];\n\n item = document.createElement('li');\n item.setAttribute('data-key', section.key);\n item.setAttribute('data-bg', section.art);\n item.setAttribute('data-type', (section.container) ? 'container' : 'video');\n\n item.appendChild(document.createTextNode(section.title));\n list.appendChild(item);\n\n if (i === selectedIndex) {\n item.setAttribute('id','current');\n activeKey = section.key;\n activeBg = section.art;\n activeHeight = list.offsetHeight;\n }\n }\n // calculate if the menu needs padding\n if(!(n % 2 === 0)) \n {\n document.getElementById(\"home-menu-inner\").style.paddingTop = \"87px\"; \n }\n \n item = document.createElement('li');\n item.setAttribute('data-key', '');\n item.setAttribute('data-bg', '');\n item.setAttribute('data-type', 'pref');\n\n item.appendChild(document.createTextNode('Preferences'));\n list.appendChild(item); \n \n\n if (n === 0) {\n item.setAttribute('id','current');\n activeHeight = list.offsetHeight;\n }\n\n // 360 = mid height, move half the count of elements down\n var midElementIdx = Math.floor(i/2);\n if (midElementIdx < 1) {\n midElementIdx = 1;\n }\n //list.style.top = (360-(midElementIdx*activeHeight)+8)+'px';\n \n backgroundLoader.load(activeBg);\n loadPreviewMenu(activeKey);\n }", "function appendCard(list_id, title, content) {\n\n\n var h = '<div class=\"card myList\" id=\"' + listId + '\">';\n h += '<div class=\"card-header\">' + title + '</div>';\n h += '<div class=\"card-block\">'\n h += '<div class=\"card-text\">';\n h += '<div class=\"panel-body\">';\n h += content;\n h += '</div>';\n h += '</div>';\n h += '</div>';\n $(\"#lists\").append(h);\n \n} // end function appendCard", "function constructCardList(cards) {\n if (cards.length !== 0) {\n let ul = document.createElement(\"ul\");\n cards.forEach(function(card) {\n // add the plus icon\n let image = document.createElement(\"img\");\n image.src = \"images/plus.png\";\n image.alt = \"Add \" + card.name + \" to current deck\";\n let figure = document.createElement(\"figure\");\n figure.appendChild(image);\n\n let info = card.name + \" [\" + card.set + \"]\"\n let para = document.createElement(\"p\");\n para.appendChild(document.createTextNode(info));\n\n let li = document.createElement(\"li\");\n li.id = card.id;\n li.appendChild(para);\n li.appendChild(figure);\n ul.appendChild(li);\n });\n\n // EVENT DELEGATION\n // display detailed information about a card when the user clicks on a list item\n ul.addEventListener(\"click\", (event) => {\n // if the add button is clicked, we perform a different action\n let closestListItem = event.target.closest(\"#pokemon-list li\");\n fetchCardDataById(closestListItem.id)\n .then(cardData => {\n if (event.target.tagName === \"IMG\") {\n addToDeckView(cardData);\n } else {\n loadModal(cardData);\n }\n })\n .catch(error => console.error(\"Failure to fetch card data with error=\" + error));\n });\n document.getElementById(\"pokemon-list\").appendChild(ul);\n } else {\n let ul = document.createElement(\"ul\");\n let li = document.createElement(\"li\");\n li.appendChild(document.createTextNode(\"No results found. Try a different search term?\"));\n ul.appendChild(li);\n document.getElementById(\"pokemon-list\").appendChild(ul);\n }\n }", "function MostrarCarrito() {\n\n\n\tvar div = document.getElementById(\"mostrarcarrito\");\n\tdiv.innerHTML = \"\";\n\n\tvar Title = document.createElement(\"h2\");\n\tTitle.appendChild(document.createTextNode(\"Listado:\"));\n\tvar Articlelist = document.createElement(\"ul\");\n\n\tvar cont = 0;\n\n\tcarritocompra.items.forEach(element => {\n\n\t\tvar Article = document.createElement(\"li\");\n\t\tArticle.appendChild(document.createTextNode(element.num_serie + \" - \" + element.nombre + \" - \" + element.precio + \"€ -- \" + carritocompra.cantidades[cont] + \" Unidades\"));\n\t\tArticlelist.appendChild(Article);\n\t\tcont++;\n\t});\n\n\tdiv.appendChild(Title);\n\tdiv.appendChild(Articlelist);\n\n}", "function buildListItem(){\r\n for (section of secs){\r\n secLink = section.getAttribute(\"id\")\r\n secName = section.getAttribute(\"data-nav\");\r\n\r\n // create an item for eah one\r\n listItem = document.createElement(\"li\");\r\n\r\n // add text to the item\r\n listItem.innerHTML = `<a class = 'menu-link' href= '#${secLink}' > ${secName} </a>`;\r\n\r\n // add list item to the menu\r\n menu.appendChild(listItem);\r\n }\r\n}", "function createAndAppend(cardsList, parent) {\n let fragment = document.createDocumentFragment();\n cardsList.forEach(function(card) {\n fragment.appendChild(card);\n });\n parent.appendChild(fragment);\n}", "function createDocumentSection(e) {\n /*====== (1) Select the target button ======*/\n // Iterate through the array\n for(let i=0; i<sectionElementArray.length; i++) {\n // Select only the childArray that belongs to the button clicked\n if(sectionElementArray[i].id === Number(e.target.dataset.btn)) {\n // Create a new section [Remember: createSection (className_1, className_2, commentTitle)]\n // To number it we save the index of our selected array\n const internalChapterIndex = (sectionElementArray.indexOf(sectionElementArray[i]) + 1);\n console.log(internalChapterIndex);\n const pageSection = createSection('chapter', 'chapter-new', `Chapter 0${internalChapterIndex}`);\n // Save the corresponding ElementList in a new variable\n const sectionElementList = sectionElementArray[i].array;\n // Create the video button\n createSectionVideoBtn(sectionElementList, pageSection);\n // Check this variable against the possible cases\n sectionElementList.forEach(item => {\n let inputField;\n let inputField_array;\n let inputField_subsectionNr;\n switch(item.type) {\n case \"p\":\n inputField = document.querySelector(`[data-input=\"${item.id}\"]`);\n createSingleElement('p', 'main-text', inputField);\n break;\n case \"img\":\n inputField = document.querySelector(`[data-input=\"${item.id}\"]`);\n inputField_Alt = document.querySelector(`[data-input=\"${item.id_2}\"]`);\n createImage(inputField, 'img-diagram', inputField_Alt);\n break;\n // case \"ul\":\n // inputField = document.querySelector(`[data-input=\"${item.id}\"]`);\n // createSingleElement('ul', 'main-list', inputField, item.array);\n // console.log(item.id);\n // console.log(item.array);\n // break;\n case \"ul\":\n // <!--=======List=======-->\n // <ul class=\"main-text main-list\">\n // <li class=\"list-dot\">tustro colegio?</li>\n // <li class=\"list-dot\">lancos tiene la caja?</li>\n // </ul><!--=======/List=======-->\n inputField = document.querySelector(`[data-input=\"${item.id}\"]`);\n createSingleElement('ul', 'main-list', inputField, item.array);\n console.log(item.id);\n console.log(item.array);\n break;\n case \"learnbox\":\n inputField = document.querySelector(`[data-input=\"${item.id}\"]`);\n createSingleElement('div', 'chapter-box', inputField);\n break;\n case \"observa\":\n inputField = document.querySelector(`[data-input=\"${item.id}\"]`);\n createSingleElement('p', 'example', inputField);\n break;\n // Create the subsections\n case \"subsection\":\n /* \n <!--***********Subsection 01 (Flex with Video)***********-->\n <div>\n <!--=======Section-Title & Video Button=======-->\n <div class=\"flex-video\">\n <div class=\"flex-video-title\">\n <p class=\"main-text section-nr\">A. Primer tipo de problema:</p>\n </div>\n <div class=\"flex-video-btn\">\n <a class=\"test-button shadow-btn\" href=\"https://www.youtube.com/watch?v=07Ul-mr4UCM\" target=\"_blank\">Vídeo 03</a>\n </div>\n </div> <!--=======/Section-Title & Video Button=======--></div> \n */\n inputField_array = item.array;\n console.log(inputField_array)\n // Now loop again through the subsection array\n inputField_array.forEach(itemOfSubsection => {\n switch(itemOfSubsection.type) {\n case \"subchapter-nr\":\n switch(`${itemOfSubsection.id}`) {\n case \"1\":\n inputField_subsectionNr = 'A';\n break;\n case \"2\":\n inputField_subsectionNr = 'B';\n break;\n case \"3\":\n inputField_subsectionNr = 'C';\n break;\n case \"4\":\n inputField_subsectionNr = 'D';\n break;\n case \"5\":\n inputField_subsectionNr = 'E';\n break;\n case \"6\":\n inputField_subsectionNr = 'F';\n break;\n case \"7\":\n inputField_subsectionNr = 'G';\n break;\n case \"8\":\n inputField_subsectionNr = 'H';\n break;\n case \"9\":\n inputField_subsectionNr = 'I';\n break;\n case \"10\":\n inputField_subsectionNr = 'J';\n break;\n };\n console.log(inputField_subsectionNr);\n break;\n case \"has-video\":\n const createSubSectionVideoBtn_hasVideo = document.querySelector(`[data-input=\"${itemOfSubsection.id}\"]`).value;\n console.log(createSubSectionVideoBtn_hasVideo);\n createSubSectionVideoBtn(createSubSectionVideoBtn_hasVideo, inputField_subsectionNr, inputField_array, pageSection);\n }\n })\n // inputField = document.querySelector(`[data-input=\"${item.id}\"]`);\n // createSingleElement('p', 'example', inputField);\n break;\n }\n \n })\n // Create the subsections\n console.log(sectionElementList);\n // Create the html closing\n createSectionHtmlEnd();\n }\n }\n}", "function createCardList1() {\r\n if (pokemon == \"\")\r\n {\r\n card = `<div><h3> Pokemon nao encontrado </h3></div>`;\r\n }else{\r\n card = `\r\n <table id=\"tabelaPokemons\">\r\n <tr>\r\n <th> nomePokemon </th>\r\n <th> idPokemon </th>\r\n </tr>\r\n <tr>\r\n <td>\r\n <h1 class=\"name\">${pokemon.name}</h1>\r\n <h3 class=\"topico\">Número:</h3>\r\n <h3 class=\"descricao\">${pokemon.id}</h3>\r\n <h3 class=\"topico\">Tipo:</h3>\r\n <h3 class=\"descricao\">${pokemon.types.map(item => item.type.name).toString()}</h3>\r\n <h3 class=\"topico\">Peso:</h3>\r\n <h3 class=\"descricao\"> ${pokemon.weight}kg </h3>\r\n <h3 class=\"topico\">Altura:</h3>\r\n <h3 class=\"descricao\">${pokemon.height}m</h3>\r\n <h3 class=\"topico\">Habilidades:</h3>\r\n <h3 class=\"descricao\">${pokemon.moves.map(item => ' ' + item.move.name).toString()}</h3> \r\n \r\n </td>\r\n </tr>\r\n </table>`;\r\n }\r\n return card;\r\n}", "listCards() {\n const formArticle = document.createElement(\"article\");\n formArticle.classList.add(\"card-deck\")\n formArticle.id = \"friends-article\";\n formArticle.appendChild(build.elementWithText(\"h1\", `${window.sessionStorage.getItem(\"userName\")}'s Friends: `, \"friendPageHeader\"));\n fetch.getAll(`users/${userID}/friends?_expand=otherFriend`).then(friends => {\n\n let docFrag = document.createDocumentFragment();\n friends.forEach(friendObject => {\n docFrag.appendChild(this.postToDOM(friendObject));\n \n }); formArticle.appendChild(docFrag)\n })\n return formArticle\n }", "function crearPlayList(){\r\n\tconst listado = document.createElement('ol')\r\n\tlistado.setAttribute(\"id\", 'listadoMusica')\r\n\tfor (let i = 0; i<canciones.length; i++){\r\n\t\tconst item = document.createElement('li')\r\n\t\titem.appendChild(document.createTextNode(canciones[i])) \r\n\t\titem.setAttribute(\"id\", canciones.indexOf(canciones[i]))\r\n\t\tlistado.appendChild(item)\r\n\t}\r\n\treturn listado\r\n}", "function generateRecepieCard(recepie) {\n \n var divCard0i = $(\"<div>\");\n divCard0i.addClass(\"media searchresults\");\n var img0i = $(\"<img>\");\n //img0i.add\n img0i.attr(\"src\", recepie.image);\n img0i.addClass(\"align-self-start mr-3 recipeimage\");\n img0i.attr(\"imgId\", recepie.id);\n divCard0i.append(img0i);\n\n var divMedia0i = $(\"<div>\");\n divMedia0i.addClass(\"media-body\");\n var h5RecepieTitle0i = $(\"<h5>\");\n h5RecepieTitle0i.addClass(\"mt-0\");\n h5RecepieTitle0i.attr(\"id\", \"recipetitle3\");\n h5RecepieTitle0i.text(recepie.title);\n divMedia0i.append(h5RecepieTitle0i);\n\n var para0i = $(\"<p>\");\n var ingredients = recepie.usedIngredients[0].original;\n para0i.text(ingredients);\n divMedia0i.append(para0i);\n\n var aTag0i = $(\"<a>\");\n aTag0i.attr(\"href\", \"./viewrecepiepage.html?recepie-id=\"+recepie.id);\n aTag0i.attr(\"recepie-id\", recepie.id);\n\n var spanOfATag0i = $(\"<span>\");\n spanOfATag0i.addClass(\"divlink\");\n aTag0i.append(spanOfATag0i);\n divMedia0i.append(aTag0i);\n\n divCard0i.append(divMedia0i);\n return divCard0i;\n}", "function crearPlayList(){\n\tconst listado = document.createElement('ol')\n\tlistado.setAttribute(\"id\", 'listadoMusica')\n\tfor (let i = 0; i<canciones.length; i++){\n\t\tconst item = document.createElement('li')\n\t\titem.appendChild(document.createTextNode(canciones[i])) \n\t\titem.setAttribute(\"id\", canciones.indexOf(canciones[i]))\n\t\tlistado.appendChild(item)\n\t}\n\treturn listado\n}", "function createMovieList(fullInfo) {\n const galleryListMarkup = galleryElementTemplate(fullInfo);\n homeGalleryListRef.insertAdjacentHTML('afterbegin', galleryListMarkup);\n}", "function createMovie(movie) {\n let elMovie = movieTemplate.cloneNode(true);\n\n elMovie.querySelector(\".movie-img\").src = movie.poster;\n elMovie.querySelector(\".movie-img\").width = \"300\";\n elMovie.querySelector(\".movie-title\").textContent = movie.title;\n\n movie.genres.forEach((genre) => {\n let newGenreLi = makeElement(\"li\");\n\n newGenreLi.textContent = genre;\n elMovie.querySelector(\".genre-list\").appendChild(newGenreLi);\n\n getMovieGenre(genre);\n });\n\n elMovie.querySelector(\".movie-year\").textContent = date(movie.release_date);\n elMovie.querySelector(\".item-btn\").dataset.id = movie.id;\n elMovie.querySelector(\".bookmark-btn\").dataset.id = movie.id;\n\n movieList.appendChild(elMovie);\n}", "function domBuilder(movie){\n let movieobj = {\n title : [],\n id : [],\n posterpath : []\n };\n\n movie.forEach((data)=>{\n movieobj.title.push(data.original_title);\n movieobj.id.push(data.id);\n movieobj.posterpath.push(data.poster_path);\n });\n // console.log(\"obj from domBuilder\", movie);\n $(\".row\").html('');\n movie.forEach((item,index) => {\n // console.log(\"castiss?\", item.cast);\n \n if (item.poster_path!==null) {\n \n \n \n $(\".row\").append(cards(item));\n \n // console.log(\"BIGASS ITEM\", item.id);\n let realid = item.id;\n \n \n\n\n }\n // if (item.cast !==undefined) {\n \n // }\n \n\n });\n\n}", "function riempiCanzoni(list_canzoni)\r\n{\r\n\tvar divPartenza = $(\".canzoni\");\r\n\tdivPartenza.html(\"\");\r\n\t\r\n\tif(list_canzoni.length==0)\r\n\t{\r\n\t\tvar nessunRisultato = $(\"<p>\").addClass(\"text-white\").attr(\"style\", \"width:100%;font-size: 2rem;\").text(\"Nessun Risultato\");\r\n\t\tdivPartenza.append(nessunRisultato);\r\n\t}\r\n\t\r\n\tfor(var i=0; i<list_canzoni.length; i++)\r\n\t{\r\n\t\tvar divColonna = $(\"<div>\").addClass(\"col-xs-6 col-sm-4 col-md-3 col-lg-2 col-xl-2\").appendTo(divPartenza);\r\n\t\t\r\n\t\tvar divCard = $(\"<div>\").addClass(\"card\").attr(\"onclick\",\"prendiCanzoneDaId(\" + list_canzoni[i].id + \")\").attr(\"onmouseover\",\"\").attr(\"style\",\"cursor: pointer;\").appendTo(divColonna);\r\n\t\t\r\n\t\tvar immagine = $(\"<img>\")\r\n\t\t.attr(\"src\", list_canzoni[i].album.immagine)\r\n\t\t.attr(\"alt\", \"immagine canzone\")\r\n\t\t.addClass(\"card-img-top shape-vinyl\")\r\n\t\t.appendTo(divCard);\r\n\t\t\r\n\t\tvar divCardBody = $(\"<div>\").addClass(\"card-body\").appendTo(divCard);\r\n\t\t\r\n\t\tvar p = $(\"<p>\").addClass(\"card-title text-white\").text(list_canzoni[i].titolo).appendTo(divCardBody);\t\r\n\t}\r\n}", "function buildListePatrimoine() {\n\n\t$('#liste-fiches-patrimoine li').remove();\n\n\tvar num_row = 1;\n\n\t$.each(fiches_patrimoine, function(index, fiche) {\n\t\t\t\n\t\tvar vignette = '';\n\t\tif(fiche.photos == undefined) {\n\t\t\tconsole.log(fiche.nom);\n\t\t}\n\t\telse if (fiche.photos.length > 0)\n\t\t{\n\t\t\tvignette = serviceURL + 'sitlor/photos_100/'+ fiche.photos[0].src;\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvignette = 'img/no-photo.png';\n\t\t}\n\n\t\tvar li = \n\t\t'<li id=\"fiche' + fiche.id + '\" class=\"row' + num_row + '\">' +\n\t \t\t'<a data-transition=\"slide\" href=\"detail-fiche.html?id=' + fiche.id + '\" class=\"clearfix\">' +\n\t \t\t\t'<img src=\"' + vignette + '\" alt=\"lieu\" title=\"lieu\" class=\"vignette-liste\" />' +\n\t \t\t\t'<div class=\"infos\">' +\n\t\t \t\t\t'<h2 class=\"titre\"><span class=\"content\">' + fiche.nom + '</span></h2>' +\n\t\t \t\t\t'<div class=\"distance-ville\">' +\n\t\t\t \t\t\t'<p class=\"distance\">' + fiche.distanceLabel + '</p>' +\n\t\t\t \t\t\t'<p class=\"ville\">' + fiche.ville + '</p>' +\n\t\t \t\t\t'</div>' +\n\t\t\t\t'</div>' +\n\t\t\t'</a>' +\n\t\t'</li>';\n\n\t\tvar $fichesPatrimoine = $('#liste-fiches-patrimoine');\n\t\t$fichesPatrimoine.hide();\n\t\t$('#liste-fiches-patrimoine').append(li);\n\n\t\tnum_row++;\n\n\t\tif (num_row == 5)\n\t\t{\n\t\t\tnum_row = 1;\n\t\t}\n\t});\n}", "function createSectionVideoBtn(item, parent) {\n // const index = item.findIndex(x => x.type === \"h2\");\n\n // Create the div container\n const createSectionVideoBtn_onlyTitle = addSectionInput_Form_Elements('div', '', '', '', '', '', '', '')\n const createSectionVideoBtn_divContainer = addSectionInput_Form_Elements('div', 'flex-video', '', '', '', '', '', '')\n\n for(let i=0; i<item.length; i++) {\n if(item[i].type === \"has-video\") {\n const createSectionVideoBtn_hasVideo = document.querySelector(`[data-input=\"${item[i].id}\"]`).value;\n if(createSectionVideoBtn_hasVideo === \"yes\"){\n /* Code if positive */\n for(let i=0; i<item.length; i++) {\n switch(item[i].type) {\n case \"h2\":\n // Get the chapter number\n const createSectionVideoBtn_chapterNrIndex = item.findIndex(x => x.type === \"chapter-nr\");\n const createSectionVideoBtn_chapterNrId = document.querySelector(`[data-input=\"${item[createSectionVideoBtn_chapterNrIndex].id}\"]`)\n const createSectionVideoBtn_chapterNr = createSectionVideoBtn_chapterNrId.value;\n // Create the title container\n const createSectionVideoBtn_div_title = addSectionInput_Form_Elements('div', 'flex-video-title', '', createSectionVideoBtn_divContainer, '', '', '', '');\n const createSectionVideoBtn_div_titleMessage = document.querySelector(`[data-input=\"${item[i].id}\"]`).value;\n let chapterNr;\n if(inputAutomaticNumbering.value === \"yes\") {\n chapterNr = `${chapterCount}`;\n } else {\n chapterNr = createSectionVideoBtn_chapterNr;\n }\n addSectionInput_Form_Elements('h2', 'section-title', '', createSectionVideoBtn_div_title, createSectionVideoBtn_div_titleMessage, '', '', `<span class=\"chapter__number\">(${chapterNr})</span>`);\n // UPLOAD HTML COMMENTS - this uploads the title part:\n createSectionComments('div','flex-video','','','1','newLine','','Title & Video Button', '');\n createSectionComments('div','flex-video-title','','','2','newLine','','', '');\n createSectionComments('h2','section-title','', '','3','','','', '');\n createSectionComments('span','chapter__number','', `(${chapterNr})`,'','','','', 'closing');\n createSectionComments('h2','','', createSectionVideoBtn_div_titleMessage,'','newLine','','', 'only');\n createSectionComments('div','','', '','2','newLine','','', 'only');\n chapterCount++;\n // This is the selector for the value:\n // console.log(document.querySelector(`[data-input=\"${item[i].id}\"]`).value);\n break;\n // case \"video-url\":\n // createSectionVideoBtn_div_videoUrl = document.querySelector(`[data-input=\"${item[i].id}\"]`).value;\n // console.log(createSectionVideoBtn_div_videoUrl);\n // break;\n case \"has-video\":\n \n const createSectionVideoBtn_div_video = addSectionInput_Form_Elements('div', 'flex-video-btn', '', createSectionVideoBtn_divContainer, '', '', '', '');\n // for(let i=0; i<item.length; i++) {\n // if(item[i].type === \"video-nr\") {\n // createSectionVideoBtn_videoNr = document.querySelector(`[data-input=\"${item[i].id}\"]`).value;\n // }\n // const createSectionVideoBtn_videoNrId = item.findIndex(x => x.type === \"video-nr\");\n const createSectionVideoBtn_videoNrIndex = item.findIndex(x => x.type === \"video-nr\");\n const createSectionVideoBtn_videoNrId = document.querySelector(`[data-input=\"${item[createSectionVideoBtn_videoNrIndex].id}\"]`)\n const createSectionVideoBtn_videoNr = createSectionVideoBtn_videoNrId.value;\n \n for(let i=0; i<item.length; i++) {\n if(item[i].type === \"video-url\") {\n const createSectionVideoBtn_videoUrl = document.querySelector(`[data-input=\"${item[i].id}\"]`).value;\n let sectionVideoNr;\n if(inputAutomaticNumbering.value === \"yes\") {\n sectionVideoNr = `0${videoCount}`;\n } else {\n sectionVideoNr = createSectionVideoBtn_videoNr;\n }\n addSectionInput_Form_Elements('a', 'test-button', 'shadow-btn', createSectionVideoBtn_div_video, `Vídeo ${sectionVideoNr}`, '', '', '', createSectionVideoBtn_videoUrl);\n // UPLOAD HTML COMMENTS - this uploads the button part:\n createSectionComments('div','flex-video-btn','','','2','newLine','','', '');\n createSectionComments('a','test-button','shadow-btn', `Vídeo ${sectionVideoNr}`,'3','newLine', createSectionVideoBtn_videoUrl,'', 'closing');\n createSectionComments('div','','', '','2','newLine','','', 'only');\n createSectionComments('div','','', '','1','newLine','','', 'only');\n videoCount++;\n }\n }\n break;\n }\n }\n // Upload the div container\n parent.appendChild(createSectionVideoBtn_divContainer);\n } else if(createSectionVideoBtn_hasVideo === \"no\"){\n /* Code if negative */\n console.log(\"i'm a lonely title\")\n for(let i=0; i<item.length; i++) {\n switch(item[i].type) {\n case \"h2\":\n // Get the chapter number\n const createSectionVideoBtn_chapterNrIndex = item.findIndex(x => x.type === \"chapter-nr\");\n const createSectionVideoBtn_chapterNrId = document.querySelector(`[data-input=\"${item[createSectionVideoBtn_chapterNrIndex].id}\"]`)\n const createSectionVideoBtn_chapterNr = createSectionVideoBtn_chapterNrId.value;\n // Create the title container\n const createSectionVideoBtn_div_titleMessage = document.querySelector(`[data-input=\"${item[i].id}\"]`).value;\n let chapterNr;\n if(inputAutomaticNumbering.value === \"yes\") {\n chapterNr = `${chapterCount}`;\n } else {\n chapterNr = createSectionVideoBtn_chapterNr;\n }\n addSectionInput_Form_Elements('h2', 'section-title', '', createSectionVideoBtn_onlyTitle, createSectionVideoBtn_div_titleMessage, '', '', `<span class=\"chapter__number\">(${chapterNr})</span>`);\n \n // UPLOAD HTML COMMENTS - this uploads the title part:\n createSectionComments('','','','','1','','','Title', 'onlyComment');\n createSectionComments('h2','section-title','', '','1','','','', '');\n createSectionComments('span','chapter__number','', `(${chapterNr})`,'','','','', 'closing');\n createSectionComments('h2','','', createSectionVideoBtn_div_titleMessage,'','newLine','','', 'only');\n break;\n }\n }\n // Upload the only title container\n parent.appendChild(createSectionVideoBtn_onlyTitle);\n }\n }\n }\n}", "function renderCafe(doc){\n \n // create the list item\n let li = document.createElement(\"li\");\n li.setAttribute('data-id', doc.id); //Each document gets an id.\n let name = document.createElement('span'); \n let amount = document.createElement('span');\n let subject = document.createElement('span');\n \n // get the content\n name.textContent = doc.data().name;\n amount.textContent = doc.data().amount;\n subject.textContent = doc.data().subject;\n \n // append row\n li.appendChild(name);\n li.appendChild(amount);\n li.appendChild(subject);\n \n // insert the list item into body\n itemList.appendChild(li);\n\n}", "function renderMovies(title, desc, year, id, pic, movieSection) {\n let movieCard = `<div class=\"row justify-content-center\">`;\n\n for (let i = 0; i < id.length; i++) {\n movieCard += `<div class=\"card movie_card\">\n <img src=\"${pic[i]}\" class=\"card-img-top\" alt=\"${title[i]}\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${title[i]}</h5>\n <p class=\"card-text\">${desc[i]}</p>\n \n </div>\n <div class=\"card-footer\">\n <span class=\"movie_info\">${year[i]}</span><span class=\"movie_info float-end\">&#9733 9 / 10</span>\n </div>\n </div>`;\n }\n movieCard += \"</div>\";\n movieSection.innerHTML = movieCard;\n}", "function renderStoryList(nodelist) {\n console.log('renderStoryList');\n\n let main = document.querySelector('#column-page');\n\n var t = document.querySelector('#template__toc');\n // let t_menu = document.querySelector('#template__menu');\n // let menu = document.importNode(t_menu.content, true);\n var page = document.importNode(t.content, true);\n var container = page.querySelector('.template__toc__ul');\n\n\n\n var t = document.querySelector('#template__story_short');\n for (var i in nodelist) {\n let node = nodelist[i];\n let item = document.importNode(t.content, true);\n\n let a = item.querySelector('.template__story_short__a');\n let title = item.querySelector('.template__story_short__title');\n let terms = item.querySelector('.template__story__terms');\n title.textContent = node.title;\n a.textContent = '... continue reading ';\n a.option = node.nid;\n a.onclick = function (e) {\n let state = {\n section: \"story\",\n nid: this.option,\n position: \"chapterstart\"\n };\n window.history.pushState(state, null, \"\");\n render(state);\n };\n\n\n\n let teaser = item.querySelector('.template__story_short__teaser');\n teaser.innerHTML = node.teaser;\n let author = item.querySelector('.template__story__author');\n author.textContent = (node.author ? node.author : 'an unknown author');\n\n renderTerms(node.terms, terms)\n\n container.appendChild(item);\n }\n\n\n\n // main.appendChild(menu);\n main.appendChild(page);\n}", "function displaycard(num){\n for(let i =0; i<num; i++){\n //add details\n let articleEl = document.createElement('article')\n let h2El = document.createElement('h2')\n let imgEl = document.createElement('img')\n let divEl = document.createElement('div')\n let gameEl = document.createElement('span')\n //set class\n articleEl.setAttribute('class', 'card')\n h2El.setAttribute('class', 'card--title')\n imgEl.setAttribute('class', 'card--img')\n divEl.setAttribute('class', 'card--text')\n articleEl.setAttribute('class', 'card')\n h2El.innerText = data[i].name\n // varible\n imgEl.setAttribute('src', data[i].sprites.other[\"official-artwork\"].front_default )\n imgEl.setAttribute('width','256')\n // varible\n const stats = data[i].stats\n for(const item of stats){\n let pEl = document.createElement('p')\n pEl.innerText = `${item.stat.name.toUpperCase()}: ${item.base_stat}`\n divEl.append(pEl)\n }\n // chanllenge1\n const gameIndices = data[i].game_indices\n for(const indice of gameIndices ){\n gameEl.innerText = gameEl.innerText + indice.version.name +'/ '\n divEl.append(\n gameEl\n )\n }\n //chanllenge1\n let sectionEl = document.querySelector('section')\n sectionEl.append(articleEl)\n articleEl.append(h2El, imgEl,divEl)\n } \n}", "function stampaLista(lista) {\n\n cardContainer.innerHTML = \" \"\n\n for (let i = 0; i < lista.length; i++) {\n\n const oneCard = lista[i];\n\n const { name, prefix, family, type } = oneCard;\n\n const color = coloriIcone[type];\n\n // creo l'HTML \n\n stampaCard(name, prefix, family, color);\n\n }\n\n}", "function renderCafe(doc){\n let li = document.createElement('li');\n let name = document.createElement('span');\n\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name;\n \n\n li.appendChild(name);\n cafeList.appendChild(li);\n\n \n}", "function addSBToList(data) {\n\n\tvar row = document.getElementById('item-list-row');\n\n\tvar section = document.createElement(\"section\");\n\tsection.className = \"item-card-container col s12\";\n\tsection.setAttribute(\"item-id\", data.id);\n\n\tvar card_blue = document.createElement(\"div\");\n\tcard_blue.className = \"SBItem-card card blue-grey darken-1\";\n\n\tvar card_content = document.createElement(\"div\");\n\tcard_content.className = \"card-content SB white-text\";\n\tcard_content.setAttribute(\"id\", \"card-content-SB\");\n\n\tvar ul = document.createElement(\"ul\");\n\tul.className = \"SB-list-content\";\n\n\tvar li = document.createElement(\"li\");\n\tli.className = \"SB-header\";\n\n\tvar span1 = document.createElement(\"span\");\n\tspan1.className = \"SB-card-title\";\n\tspan1.innerText = data.titel;\n\tli.appendChild(span1);\n\n\tvar span2 = document.createElement(\"span\");\n\tspan2.className = \"SB-card-verfasser\";\n\tspan2.innerText = data.verfasser + \", am \" + data.erstellDatumFormated + \" um \" + data.erstellZeit;\n\tli.appendChild(span2);\n\n\tul.appendChild(li);\n\n\tvar li2 = document.createElement(\"li\");\n\tli2.className = \"SB-card-nachricht\";\n\tli2.innerText = data.nachricht;\n\tul.appendChild(li2);\t\n\n\tvar footer = document.createElement(\"div\");\n\tfooter.className = \"card-action\";\n\n\tvar a1 = document.createElement(\"a\");\n\ta1.className = \"delete-SBItem-button modal-trigger\";\n\ta1.setAttribute(\"href\", \"#modal-delete-SB\");\n\ta1.setAttribute(\"item-id\", data.id);\n\ta1.innerText = \"Löschen\";\n\n\tvar a2 = document.createElement(\"a\");\n\ta2.className = \"edit-SBItem-button\";\n\ta2.setAttribute(\"href\", \"#\");\n\ta2.innerText = \"Bearbeiten\";\n\n\tfooter.appendChild(a1);\n\tfooter.appendChild(a2);\n\n\tcard_content.appendChild(ul);\n\tcard_blue.appendChild(card_content);\n\tcard_blue.appendChild(footer);\n\tsection.appendChild(card_blue);\n\n\trow.appendChild(section);\n}", "function formatSectionListings(){\n\n console.log('11');\n var listingChildren = jQuery(\"#listing\").children();\n var firstSectionOption = 9999;\n\n var sectionListings = [];\n\n for(var i=0; i<listingChildren.length; i++){\n var currentChild = listingChildren.eq(i);\n //If this is the first time we've seen an h5, mark it as the first index\n if(currentChild.is('h5') && firstSectionOption == 9999){\n firstSectionOption=i;\n }\n //If we're already in the list of courses\n if(i>=firstSectionOption && currentChild.is('h5')){\n //Add it to the list of sections\n sectionListings.push(getSectionListing(currentChild, listingChildren.eq(i+2)));\n }\n }\n\n //Create all the section listing elements from the data\n\n jQuery('.sectionListing').remove();\n var sectionListingsHTML = '';\n for(i=0; i<sectionListings.length; i++){\n var section = sectionListings[i];\n //console.log(section);\n\n sectionListingsHTML += '<div class=\"sectionListing\" onclick=\"' + section.onClick + '\">' +\n '<div class=\"sectionLocation\">' + section.sectionLocation + '</div>' +\n '<div class=\"sectionLetter\">' + section.sectionType + ' ' + section.sectionLetter +'</div>' +\n '<div style=\"clear:both;\"></div>' +\n\n '<div class=\"sectionTeacher\">' + (section.professorName.first? section.professorName.first[0] + '. ':'')\n + section.professorName.last +'</div>' +\n\n '<div class=\"sectionDays\">' + section.days + '</div>' +\n\n '<div class=\"sectionTime\">' + section.times.start.split(' ')[0] + '&nbsp; <i class=\"fa fa-long-arrow-right\"></i> &nbsp;'\n + section.times.end + '</div>' +\n\n '<div style=\"clear:both;\"></div>' +\n ' </div>' +\n //The message center classes have essentially become a full width line for us\n '<p class=\"message center\"></p>';\n }\n\n jQuery(sectionListingsHTML).insertAfter('#cardTitle');\n}", "function pokazListeFilmow(msg) {\n listaFilmow = msg;\n var wiersze = document.querySelectorAll(\".filmStyle\");\n $('#result').addClass(\"active\");\n for (var i = 0; i < wiersze.length; i++) {\n var kontener = document.createDocumentFragment();\n var zdjecie = document.createElement(\"img\");\n var wiecej = document.createElement(\"div\");\n wiecej.className = \"filmWiecej\";\n var tytul = document.createElement(\"h2\");\n tytul.appendChild(document.createTextNode(msg[i].movieTitle));\n wiecej.appendChild(tytul);\n zdjecie.setAttribute(\"src\", msg[i].linkDoZdjecia);\n zdjecie.className += 'img-rounded';\n zdjecie.style.width = '300px';\n zdjecie.style.height = '300px';\n kontener.appendChild(zdjecie);\n var dane = document.createElement(\"h5\");\n dane.appendChild(document.createTextNode(msg[i].country + \", \" + msg[i].releaseDate + \", \" + msg[i].movieType));\n wiecej.appendChild(dane);\n var opis = document.createElement(\"p\");\n opis.appendChild(document.createTextNode(msg[i].shortDescription));\n wiecej.appendChild(opis);\n\n kontener.appendChild(wiecej)\n wiersze[i].textContent = \"\";\n wiersze[i].appendChild(kontener);\n }\n}", "function remplirListeNounours(nounours) {\n for (let elem of nounours) {\n const newProduct = document.createElement('div');\n newProduct.setAttribute('class', 'newProduct');\n\n const newLien = document.createElement(\"a\");\n newLien.setAttribute(\"class\", \"lienImg\");\n\n const newImg = document.createElement(\"img\");\n newImg.setAttribute(\"class\", \"detailImg\");\n\n const newParagraph = document.createElement(\"p\");\n newParagraph.innerHTML = elem.name;\n newImg.setAttribute(\"src\", elem.imageUrl);\n newImg.setAttribute(\"class\", \"detailImg\");\n newLien.setAttribute(\"href\", \"produit.html?id=\" + elem._id);//ajout de l'id produit dans l'url de la page de destination\n\n const parentLien = document.getElementById(\"listProducts\");\n parentLien.appendChild(newProduct);\n newProduct.appendChild(newLien);\n newLien.appendChild(newImg);\n newProduct.appendChild(newParagraph);\n }\n}", "function renderCards(deck, list) {\n list.forEach((elem, index) => {\n \n let li = document.createElement('li');\n let i = document.createElement('i');\n li.className = 'card';\n deck.appendChild(li);\n li.appendChild(i);\n i.className = \"fa fa-\" + list[index];\n\n li.addEventListener('click', e => {\n clicked++;\n addToSelectedCards(index);\n })\n \n });\n}", "function afficherVedette(film, filmDiv) {\n const section = document.createElement('section');\n\n const Vedette = film['vedette']; //Emmagasiner la valeur de la propriété JSON 'Vedette' dans la varaible tableau heroes \n // Récupérer les éléments du tableau Vedette pour remplir notre page html\n for (var i = 0; i < Vedette.length; i++) {\n const myArticle = document.createElement('article');// Pour chaque vedette, créer un article ('article'), une entête h2 ('h2'), 1 paragraphe ('p')\n const myH2 = document.createElement('h2');\n const myPara1 = document.createElement('p');\n\n myH2.textContent = Vedette[i].Nom; // Utiliser la valeur de la propriété JSON 'Nom' retourné par le serveur pour initialiser le texte de notre entête h2\n myPara1.textContent = 'Personnage: ' + Vedette[i].personnage + '\\n age: ' + Vedette[i].age; // Utiliser la valeur de la propriété JSON 'Personnage' retourné par le serveur pour initialiser le paragraphe\n\n // Assigner(associer) l'entête myH2 et le paragraphes myPara1 à l'article myArticle\n myArticle.appendChild(myH2);\n myArticle.appendChild(myPara1);\n\n filmDiv.appendChild(myArticle); // Associer notre article a notre section de la page HTML\n }\n}", "function display_card_list(card_list, expand, card_list_div, visible, action){\n\t//console.log(card_list);\n\tvar li;\n\tvar card_name;\n\tvar ul = document.createElement(\"ul\");\n\t\tul.setAttribute(\"class\", \"list_box\");\n\tif (expand) {\n\t\tvar iterations = card_list.cards.length; // as many iterations as cards\n\t}\n\telse { // display one if the list has at least one; otherwise, none\n\t\tvar iterations = Math.min(1, card_list.cards.length);\n\t}\n\tif (iterations > 0) {\n\t\tfor (var index=0; index < iterations; index++ ){ // for each card in list\n\t\t\tcard_name = card_list.cards[index].name; // get its name\n\t\t\tif (card_name == 'Unknown'){\n\t\t\t\tcard_name = '';\n\t\t\t}\n\t\t\tif (visible) {\n\t\t\t\tcard = display_icon(index, action, card_name);\n\t\t\t\tli = document.createElement(\"li\").appendChild(card);\n\t\t\t} else {\n\t\t\t\tli = document.createElement(\"li\").appendChild(display_back());\n\t\t\t//\tli.innerHTML = \"&nbsp;\";\n\t\t\t\tli.setAttribute(\"id\", index);\n\t\t\t}\n\t\t\tul.appendChild(li); // add this card to the list\n\t\t}\n\t}\n\tcard_list_div.appendChild(ul);\n}", "function showCardDetails (index) {\n // var movies = retrieveMovies()\n hideAllForms()\n\n if (movieDetailsEnabled) {\n hideMovieDetails()\n }\n\n movieDetailsEnabled = true\n\n document.getElementById('mainRight').style.display = 'block'\n\n // main div\n var mainCard = document.createElement('div')\n mainCard.setAttribute('class', 'showMovieDetails')\n mainCard.setAttribute('id', 'showMovieDetails')\n\n // sub div1\n var div1 = document.createElement('div')\n var div1Image = document.createElement('img')\n div1Image.setAttribute('src', movies[index].image)\n div1.appendChild(div1Image)\n\n // sub div2\n var div2 = document.createElement('div')\n // console.log(movies[index].title)\n div2.innerHTML = movies[index].title\n\n // sub div3\n var div3 = document.createElement('div')\n div3.innerHTML = movies[index].description\n\n // sub div4\n var div4 = document.createElement('div')\n div4.innerHTML = movies[index].rating\n\n // sub div5\n var div5 = document.createElement('div')\n div5.innerHTML = movies[index].year\n\n // sub div6\n var div6 = document.createElement('div')\n div6.innerHTML = movies[index].trailer\n\n // sub div7\n var div7 = document.createElement('div')\n div7.innerHTML = movies[index].download\n\n // add to card\n mainCard.appendChild(div1)\n mainCard.appendChild(div2)\n mainCard.appendChild(div3)\n mainCard.appendChild(div4)\n mainCard.appendChild(div5)\n mainCard.appendChild(div6)\n mainCard.appendChild(div7)\n\n // add to super card\n document.getElementById('mainRight').appendChild(mainCard)\n\n if (fullView) {\n fullToHalf()\n }\n}", "function printCards(recipeUrl, recipeLabel, recipeImage, currentCard) {\n\t$(\"#card-list\").append(\n\t\t$(\"<div>\").attr(\"class\", \"card mb rounded\").append(\n\t\t\t$(\"<div>\").attr(\"class\", \"card-header has-background-link top-rounded\").append(\n\t\t\t\t$(\"<div>\").attr(\"class\", \"card-header-title has-text-white\").text(recipeLabel)\n\t\t\t),\n\t\t\t$(\"<div>\").attr(\"class\", \"card-content\").append(\n\t\t\t\t$(\"<img>\").attr({ src: recipeImage, class: \"card-image mb\" }),\n\t\t\t\t$(\"<a>\").attr({href: recipeUrl, class: \"mb\"}).text(\"Full Recipe Here\").append(\n\t\t\t\t\t$(\"<br>\")\n\t\t\t\t),\n\t\t\t\t$(\"<button>\").attr({ class: \"button is-primary mt\", id: currentCard + \"btn\" }).text(\"Related Video\")\n\t\t\t)\n\t\t)\n\t)\n}", "function showPage(list, section, perPage) {\n let startIndex = (section * perPage) - perPage;\n let endIndex = (section * perPage);\n let ul = document.querySelector(\".student-list\");\n ul.innerHTML = \"\";\n \n for (let i = 0; i < list.length; i += 1) {\n if (i >= startIndex && i < endIndex) {\n let obj = list[i];\n if (obj.error) {\n ul.insertAdjacentHTML(\"beforeend\", `<h1 id=\"error\">${obj.error}<h1>`);\n } else {\n ul.insertAdjacentHTML(\"beforeend\", \n `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${obj.picture[\"large\"]} alt=\"Profile Picture\">\n <h3>${obj.name[\"first\"]} ${obj.name[\"last\"]}</h3>\n <span class=\"email\">${obj.email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\"> Join: ${obj.registered[\"date\"]}</span>\n </div>\n </li>` );\n } \n\n }\n }\n}", "function renderMovieList (list, $container, category) {\n $container.children[0].remove();\n list.forEach((movie) => {\n const HTMLString = videoItemTemmplate(movie, category);\n const movieElement = createTemplate(HTMLString);\n $container.append(movieElement);\n const image = movieElement.querySelector('img');\n image.addEventListener('load', (event) => {\n event.srcElement.classList.add('fadeIn');\n // debugger\n });\n addEventClick(movieElement);\n });\n }", "function buildSection(count,type) {\n\n var catalog = '';\n\n for (var i = 0; i < count; i++) {\n\t\t\t\n var teamID = '';\n var last_name = '';\n var first_name = '';\n var middle_name = '';\n var company_name = '';\n var title = '';\n var img = '';\n var url = '';\n // set the proper container div\n var location = '';\n\n // see what kind of team member we have\n if (type === \"team\") {\n\t\t\t\t\n teamID = teamCollection[i].id;\n last_name = teamCollection[i].name_last;\n first_name = teamCollection[i].name_first;\n middle_name = teamCollection[i].name_middle;\n title = teamCollection[i].title;\n img = teamCollection[i].img;\n url = teamCollection[i].url;\n location = 'team-company';\n }\n\t\n if (type === \"investors\") {\n\t\t\t\t\n teamID = investorsCollection[i].id;\n last_name = investorsCollection[i].name_last;\n first_name = investorsCollection[i].name_first;\n middle_name = investorsCollection[i].name_middle;\n company_name = investorsCollection[i].company_name;\n title = investorsCollection[i].title;\n url = investorsCollection[i].url;\n\t\t\t\timg\t\t\t= investorsCollection[i].image;\n location = 'team-investors';\n }\n\t\n // create the HTML for the card\n // we're using display: grid, so we don't have to worry about columns and rows\n\n\n // need to figure out if this is an invsetor and if this is a company\n // the key is company_name\n\n // format names \n if (first_name.length > 0) {\n var full_name;\n full_name = first_name;\n if (middle_name.length > 0) {\n full_name += \" \" + middle_name;\n }\n full_name += \" \" + last_name;\n }\n\t\t\t\n\n catalog += \"<div id='idCard\"+ teamID +\"' class='idCard'>\";\n \n if (type === \"team\") {\n // this is a staff member\n catalog += \"<div class='idImageSocialContainer'>\";\n catalog += \" <div class='idImage'></div>\";\n // if url, link image overlay\n if (url.length > 0) {\n catalog += \"<div class='idSocial'>\";\n catalog += \"<a class='peekaboo' href='\" + url + \"' aria-hidden='true'><i class='fa fa-linkedin-square idIcon'></i></a>\";\n catalog += \"</div>\";\n } \n catalog += \"</div>\"; // end socialContainer\n\n catalog += \"<div class='idBio'>\";\n catalog += \"<p class='idCardName'>\";\n\n if (url.length > 0) { \n catalog += \"<a href='\" + url + \"'>\" + full_name + \"</a>\";\n } else {\n catalog += full_name;\n }\n\n catalog += \"</p>\";\n catalog += \"<p class='idCardTitle'>\" + title + \"</p>\";\n catalog += \"</div>\";\n } else {\n // this is an investor\n // see if it's a person or a company\n if (company_name.length > 0) {\n // this is a company\n if (url.length > 0) {\n catalog += \"<a href='\" + url + \"'><img src='\" + img + \"' alt='\" + company_name + \" logo'></a>\"\n catalog += \"<div class='idBio'>\";\n catalog += \"<p class='idCardName'><a href='\" + url + \"'>\" + company_name + \"</a></p>\";\n catalog += \"</div>\";\n } else {\n catalog += \"<img src='\" + img + \"' alt='\" + company_name + \" logo'>\"\n catalog += \"<div class='idBio'>\";\n catalog += \"<p class='idCardName'>\" + company_name + \"</p>\";\n catalog += \"</div>\";\n }\n } else {\n // this is a person\n catalog += \"<div class='idImageSocialContainer'>\";\n catalog += \" <div class='idImage'></div>\";\n // if url, link image overlay\n if (url.length > 0) {\n catalog += \"<div class='idSocial'>\";\n catalog += \"<a class='peekaboo' href='\" + url + \"' aria-hidden='true'><i class='fa fa-linkedin-square idIcon'></i></a>\";\n catalog += \"</div>\";\n } \n catalog += \"</div>\"; // end socialContainer\n\n catalog += \"<div class='idBio'>\";\n catalog += \"<p class='idCardName'>\";\n\n if (url.length > 0) { \n catalog += \"<a href='\" + url + \"'>\" + full_name + \"</a>\";\n } else {\n catalog += full_name;\n }\n\n catalog += \"</p>\";\n catalog += \"<p class='idCardTitle'>\" + title + \"</p>\";\n catalog += \"</div>\";\n }\n }\n\n\n catalog += \"</div>\"; // end idCard\n \n }\n\t\t\n // Append the card to the UI\n\t\t\n\t\t$('#' + location).prepend(catalog);\n\t\t\n }", "function creatingList() {\r\n // for each section that's in \"sectionCollection\" Array\r\n for (section of sectionCollection) {\r\n listLocation = section.getAttribute(\"id\")\r\n listName = section.getAttribute(\"data-nav\");\r\n \r\n\r\n // creating list\r\n listy = document.createElement('li')\r\n listy.innerHTML = `<a class=\"menu__link\" href=#${listLocation}>${listName}</a>`\r\n\r\n navvbar.appendChild(listy)\r\n }\r\n \r\n }", "function assembelFilmography (movieList) {\n let madFragment = document.createDocumentFragment();\n\n let year = 0;\n let yearParse = 0;\n\n madTimeline.innerHTML = \"\";\n\n for (let i = 0; i < movieList.length; i++) {\n if (i == 0) { madFragment.appendChild(addFilmographyStart()) }\n\n yearParse = parseFloat(movieList[i].release_date);\n\n if (yearParse != year) {\n year = yearParse;\n madFragment.appendChild(addFilmographyYear(yearParse))\n }\n\n madFragment.appendChild(addFilmographyContent(movieList[i].title, movieList[i].id))\n\n if (i == movieList.length - 1) {\n madFragment.appendChild(addFilmographyEmpty());\n madFragment.appendChild(addFilmographyEnd());\n }\n\n }\n\n madTimeline.appendChild(madFragment);\n\n}", "function displayCards(event){\n let testName = event.target.parentNode;\n let pokeName = testName.querySelector('h2').textContent;\n arrayOfPokemon.forEach(pokemon => {\n if (pokeName == pokemon.name){\n let pokemonCard = document.createElement('div');\n pokemonCard.className = ('card');\n\n let h2 = document.createElement('h2');\n h2.textContent = pokemon.name;\n pokemonCard.appendChild(h2);\n\n let img = document.createElement('img');\n img.src = pokemon.image;\n img.classList = 'pokemon-avatar';\n pokemonCard.appendChild(img);\n\n let removeButton = document.createElement('button');\n removeButton.textContent = 'Remove From Lineup';\n removeButton.className = 'remove-btn';\n removeButton.id = pokemon.id;\n removeButton.addEventListener('click',(event) => event.target.parentNode.remove());\n pokemonCard.appendChild(removeButton);\n\n document.querySelector('#pokemon-collection').appendChild(pokemonCard);\n };\n });\n}", "function makeRecipeMenuAndCard() {\n\n // Create Recipe Menu List\n for (let i = 0; i < recipeBook.length; i++) {\n let tag = document.createElement(\"li\");\n tag.innerHTML = '<a href=\"#' + recipeBook[i]['name'] + '-recipe\">' + recipeBook[i]['name'] + '</a>';\n recipeMenu.appendChild(tag);\n };\n\n\n // Create Recipe Cards for Each Menu List Item\n for (let i = 0; i < recipeBook.length; i++) {\n let createDiv = document.createElement(\"div\");\n createDiv.className = 'recipe-card';\n createDiv.innerHTML = '<h4 id=\"' + recipeBook[i]['name'] + '-recipe\">' + recipeBook[i]['name'] + '</h4>'+\n '<br>'+\n '<span id=\"prep-time\">Prep time: ' + recipeBook[i]['prepTime'] + ' minutes</span>'+\n '<br>'+\n '<span id=\"cook-time\">Cook time: ' + recipeBook[i]['cookTime'] + ' minutes</span>'+\n '<br>'+\n '<div class=\"ingredients\">'+\n '<h5>Ingredients</h5>'+\n '<ol id=\"' + recipeBook[i]['name'] + '-ingredients\"></ol>'+\n '</div>'+\n '<h4>Instructions:</h4>'+\n '<ol id=\"' + recipeBook[i]['name'] + '-instructions\"></ol>'+\n '<button class=\"timer-btn\" value=\"' + (recipeBook[i]['prepTime'] + recipeBook[i]['cookTime']) + '\">start timer</button>';\n\n recipeCard.appendChild(createDiv);\n \n for (let x = 0; x < recipeBook[i]['ingredients'].length; x++) {\n let tag = document.createElement(\"li\");\n tag.innerHTML = recipeBook[i]['ingredients'][x];\n document.getElementById(recipeBook[i]['name'] + '-ingredients').appendChild(tag);\n };\n \n for (let x = 0; x < recipeBook[i]['instructions'].length; x++) {\n let tag = document.createElement(\"li\");\n tag.innerHTML = recipeBook[i]['instructions'][x];\n document.getElementById(recipeBook[i]['name'] + '-instructions').appendChild(tag);\n };\n \n };\n\n}", "function new_btn(){\r\n let bt=document.getElementById(\"new-section\");\r\n let x= cont_section();\r\n bt.addEventListener(\"click\", function(){\r\n let section =document.createElement('section');\r\n let div=document.createElement(\"div\");\r\n div.className =\"landing__container\";\r\n section.appendChild(div);\r\n\r\n\r\n\r\n//H2\r\nlet e= cont_section()+1;\r\n let h2=document.createElement(\"H2\");\r\n let spantext=document.createTextNode(\"Section \"+e);\r\n h2.appendChild(spantext);\r\n div.appendChild(h2);\r\n h2.style.fontSize=\"3em\";\r\n\r\n//P\r\n let p=document.createElement(\"P\");\r\n div.appendChild(p);\r\n let text=document.createTextNode(\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fermentum metus faucibus lectus pharetra dapibus. Suspendisse potenti. Aenean aliquam elementum mi, ac euismod augue. Donec eget lacinia ex. Phasellus imperdiet porta orci eget mollis. Sed convallis sollicitudin mauris ac tincidunt. Donec bibendum, nulla eget bibendum consectetur, sem nisi aliquam leo, ut pulvinar quam nunc eu augue. Pellentesque maximus imperdiet elit a pharetra. Duis lectus mi, aliquam in mi quis, aliquam porttitor lacus. Morbi a tincidunt felis. Sed leo nunc, pharetra et elementum non, faucibus vitae elit. Integer nec libero venenatis libero ultricies molestie semper in tellus. Sed congue et odio sed euismod.\");\r\n p.appendChild(text);\r\n let c=document.createElement(\"P\");\r\n let text2=document.createTextNode(\"Aliquam a convallis justo. Vivamus venenatis, erat eget pulvinar gravida, ipsum lacus aliquet velit, vel luctus diam ipsum a diam. Cras eu tincidunt arcu, vitae rhoncus purus. Vestibulum fermentum consectetur porttitor. Suspendisse imperdiet porttitor tortor, eget elementum tortor mollis non\");\r\n c.appendChild(text2);\r\n div.appendChild(c);\r\n p.style.lineHeight=\"1.6em\";\r\n c.style.lineHeight=\"1.6em\";\r\n\r\n //add new li with added section\r\n\r\n // DEBUG:\r\n\r\n let litext=document.createTextNode(\"Section \"+ e);\r\n let o=document.createElement('LI');\r\n o.appendChild(litext);\r\n document.getElementById(\"navbar__list\").appendChild(o);\r\n\r\nlet a = document.createElement(\"a\");\r\na.setAttribute('href', \"#section3\");\r\no.appendChild(a);\r\n\r\n\r\n\r\n//appending to main\r\nlet parent = document.getElementsByTagName('main');\r\n let u =parent[0];\r\n u.appendChild(section)\r\n });\r\n\r\n}", "function Card(props) {\n // console.log(props)\n return(\n <div className='card'>\n <section className='inner-text'>\n <h2 className='person-name'>{props.info.firstName} {props.info.lastName}</h2>\n <p><span className='bold'>From: </span>{props.info.city} {props.info.country}</p>\n <p><span className='bold'>Job Title: </span>{props.info.title}</p>\n <p><span className='bold'>Employer: </span>{props.info.employer}</p>\n <section className='movies'>\n <h4>Favorite Movies: </h4>\n <ol>1. {props.info.favoriteMovies[0]}</ol>\n <ol>2. {props.info.favoriteMovies[1]}</ol>\n <ol>3. {props.info.favoriteMovies[2]}</ol>\n </section>\n </section>\n </div>\n )\n}", "function creationElementListe(){\n cadre = document.createElement(\"li\");\n articleFiche = document.createElement(\"div\");\n articleImage = document.createElement(\"img\");\n articleNom = document.createElement(\"h2\");\n articlePrix = document.createElement(\"p\");\n articleDetails = document.createElement(\"a\");\n}", "function generateCard(cardData) {\n //Parent Container for cards\n var pp = document.createElement('div')\n pp.className = \"pp\"\n\n var cardContainer = document.createElement('div')\n cardContainer.className = \"card\"\n\n // cardContainer.append(generateCard(planet))\n\n // cardsBox.appendChild(cardContainer)\n var cardFront = document.createElement('div')\n cardFront.className = \"card__face card__face--front\"\n\n var cardBack = document.createElement('div')\n cardBack.className = \"card__face card__face--back\"\n\n var nameTag = document.createElement('p')\n nameTag.innerText = cardData.name\n // .appendChild(document.createTextNode(planet.name))\n\n\n cardBack.appendChild(createPTag(\"climate: \", cardData.climate))\n\n var l = createPTag(\"Gravity: \", cardData.gravity)\n cardBack.appendChild(l)\n\n var elDiam = createPTag(\"Diameter: \", cardData.diameter)\n cardBack.appendChild(elDiam)\n \n //this is how to you determine the image for the card\n var img = images.filter((el) => {\n return el.name == cardData.name\n })\n //return el.diameter > 20000\n if (img[0] != undefined) {\n // var imgEL = document.createElement('img')\n // imgEL.src = img[0].img\n cardFront.style.backgroundImage = `url(/${img[0].img})`\n cardFront.appendChild(nameTag)\n\n } else { ///Default Image\n var imgEL = document.createElement('image')\n imgEL.src = \"images/Alderaan.jpeg\"\n //cardFront.appendChild(imgEL)\n cardFront.style.backgroundImage = \"url(images/Alderaan.jpeg)\"\n cardFront.appendChild(nameTag)\n\n }\n\n cardContainer.appendChild(cardFront)\n cardContainer.appendChild(cardBack)\n pp.appendChild(cardContainer)\n return pp\n}", "function renderList(items, list, cat) {\n if (list === 'noneList') {\n let output = `<div id=\"noneTitle\" class=\"container list-title-bar\"><h2>To Decide</h2><ul id='noneList' class=\"list-of-items\"></ul></div>`;\n $('#noneHolder').prepend(output);\n } else {\n let output = `<div id=\"catdTitle\" class=\"container list-title-bar\"><h2>${titles[cat]}</h2><ul id='catdList' class=\"list-of-items\"></ul></div>`;\n $('#catdHolder').prepend(output);\n }\n items.forEach(function (item) {\n createItem(item, list, cat);\n });\n}", "function initList(intersections){\n //Getting street names:\n const streets = intersections.streets();\n\n //Putting street names in menu\n var list = document.querySelector('#list');\n streets.forEach(street=>{\n var div = document.createElement('div');\n div.innerText = street;\n div.classList.add(\"menu-item\");\n div.title=street;\n\n list.appendChild(div);\n //Putting a click listener on all street names\n div.addEventListener(\"click\", (e) => {showCamera(e.target.title, toronto);});\n })\n }", "function createElementCards(elementId, entryID, title, content, createdAt, createdBy){\n\n var entries_container = document.getElementById(elementId);\n\n //Containers\n var listGroupDiv = document.createElement(\"DIV\");\n listGroupDiv.setAttribute(\"class\", \"list-group\"); \n entries_container.appendChild(listGroupDiv);\n\n let a = document.createElement(\"A\");\n a.setAttribute(\"class\", \"list-group-item card-content flex-column align-items-start\");\n // a.setAttribute(\"href\", \"#\");\n listGroupDiv.appendChild(a);\n\n let contentBetweenDiv = document.createElement(\"DIV\");\n contentBetweenDiv.setAttribute(\"class\", \"d-flex w-100 justify-content-between\");\n a.appendChild(contentBetweenDiv);\n\n //title\n let h3 = document.createElement(\"H3\");\n h3.setAttribute(\"class\", \"mb-1\");\n let h3Text = document.createTextNode(title);\n h3.appendChild(h3Text);\n contentBetweenDiv.appendChild(h3);\n\n // Created at\n let smallAt = document.createElement(\"SMALL\");\n let creAt = \"Created at: \" + createdAt;\n let smallAtText = document.createTextNode(creAt);\n smallAt.appendChild(smallAtText);\n contentBetweenDiv.appendChild(smallAt);\n\n //Entry Id\n let entry_id = document.createElement(\"SMALL\");\n let entrId = \"Entry id: \" + entryID;\n let entryText = document.createTextNode(entrId);\n entry_id.appendChild(entryText);\n contentBetweenDiv.appendChild(entry_id);\n\n //Content\n let p = document.createElement(\"P\");\n p.setAttribute(\"class\", \"mb-1\");\n let pText = document.createTextNode(content);\n p.appendChild(pText);\n a.appendChild(p);\n\n //Created by\n let smallBy = document.createElement(\"SMALL\");\n let creBy = \"Created by: \" + createdBy;\n let smallByText = document.createTextNode(creBy);\n smallBy.appendChild(smallByText);\n a.appendChild(smallBy);\n\n if(elementId != \"getEntriesContainer\"){\n //Delete button\n let delBtn = document.createElement(\"BUTTON\");\n delBtn.setAttribute(\"class\", \"btn btn-success\");\n delBtn.setAttribute(\"id\", \"entryDeleteBtn\");\n let delText = document.createTextNode(\"Delete\");\n delBtn.appendChild(delText);\n a.appendChild(delBtn);\n\n delBtn.addEventListener(\"click\", function(evt){\n deleteEntry(entryID);\n evt.preventDefault();\n }); \n\n } \n\n}", "function buildVideoList(id, activeId, media) {\n var list = document.getElementById(id);\n \n // clear old content\n list.innerHTML = '';\n\n var n = media.length;\n \n console.log('Building menu ('+id+') with ' + n + ' elements');\n \n for (var i = 0; i < n; i++) {\n var video = media[i];\n \n \n var title = video.title;\n if (video.grandparentTitle) {\n title = video.grandparentTitle;\n }\n var meta = ' <img src=\"images/bullet1.png\" alt=\"\" /> ' + video.year;\n var offset = (video.viewOffset) ? video.viewOffset : 0;\n \n var item = document.createElement('li');\n item.setAttribute('data-key', video.key);\n\n if(video.type == \"photo\")\n item.setAttribute('data-type', (video.type));\n else\n item.setAttribute('data-type', (video.container) ? 'container' : 'video');\n item.setAttribute('data-title', title);\n item.setAttribute('data-meta', meta);\n item.setAttribute('data-offset', offset);\n //item.setAttribute('onclick', 'jump(,\"'+(i*140)+'px\");');\n\n var thumb = video.thumb;\n if (video.grandparentThumb) {\n thumb = video.grandparentThumb;\n }\n\n if (Settings.useBlobs()) {\n if(Blobs.retrieveBlob(thumb, \"small\"))\n var scaledThumb = Blobs.retrieveBlob(thumb, \"small\");\n else\n var scaledThumb = plexAPI.getScaledImageURL(plexAPI.getURL(thumb), 121, 170);\n }\n else\n var scaledThumb = plexAPI.getScaledImageURL(plexAPI.getURL(thumb), 121, 170);\n \n var imageContainer = document.createElement(\"div\");\n imageContainer.className = \"imagecnt\";\n \n var img = new Image();\n img.onerror = posterErrorHandler;\n \n /* this needs fixing \n if (i < PRELOADED_IMAGES) {\n img.src = scaledThumb;\n img.setAttribute('data-src', scaledThumb);\n }\n else {\n img.src = PLACEHOLDER_IMAGE;\n img.setAttribute('data-src', scaledThumb);\n }\n */\n img.src = scaledThumb;\n img.setAttribute('data-src', scaledThumb); \n \n var episdeSeason;\n if(video.season){\n episdeSeason = document.createElement(\"span\");\n episdeSeason.className = \"episodeseason\";\n episdeSeason.innerHTML = \"S\" + video.season + \" <span class='icon-small'></span> E\" + video.episode;\n }\n \n var photoTitle;\n if(video.type == \"photo\") {\n photoTitle = document.createElement(\"span\");\n photoTitle.className = \"photo-subtitle\";\n photoTitle.innerHTML = video.title; \n } \n \n \n var progressImage;\n \n if (offset > 0)\n progressImage = \"images/OverlayInProgress.png\";\n else if (!video.viewCount) \n progressImage = \"images/OverlayUnwatched.png\";\n \n if(progressImage){ \n var progress = new Image();\n progress.src = progressImage;\n progress.className = \"progress\";\n }\n \n item.appendChild(imageContainer);\n imageContainer.appendChild(img);\n if(photoTitle)\n imageContainer.appendChild(photoTitle);\n if(episdeSeason)\n item.appendChild(episdeSeason);\n if(progressImage)\n item.appendChild(progress); \n list.appendChild(item);\n\n if (i === 0) {\n item.setAttribute('id',activeId);\n }\n\n }\n }", "function showPage(list, page){\r\n let startIndex = (page * 9) - 9\r\n let endIndex = page * 9\r\n\r\n student_list.innerHTML = ''\r\n\r\n //Loops through the list of students and creates the dynamic content\r\n for(let i = 0; i < list.length; i++){\r\n let sourceList = list[i]\r\n if(i >= startIndex && i < endIndex) {\r\n student_list.insertAdjacentHTML('beforeend', `\r\n <li class=\"student-item cf\">\r\n <div class=\"student-details\">\r\n <img class=\"avatar\" src=${sourceList.picture.thumbnail} alt=\"Profile Picture\">\r\n <h3>${sourceList.name.first} ${sourceList.name.last}</h3>\r\n <span class=\"email\">${sourceList.email}</span>\r\n </div>\r\n <div class=\"joined-details\">\r\n <span class=\"date\">Joined ${sourceList.registered.date}</span>\r\n </div>\r\n </li>\r\n `)\r\n }\r\n }\r\n}", "createListItems() {\n //This is used to give active class to the selected category\n jQuery('.active_cat').removeClass('active_cat');\n jQuery(\"#category_\" + this.props.category.cat_id).addClass(\"active_cat\");\n\n //Store the selected meal under sub category(sub menu) to get access in order page\n if (this.props.meal)\n sessionStorage.setItem(\"selected_meal\", JSON.stringify(this.props.meal));\n\n //creates the sub category(sub menu) cards layout, selectMeal is the action triggered when meal card is clicked\n return this.props.category.sub_cat.map((meal, index) => {\n return (\n <div key={index} className=\"col-md-4 col-lg-3 col-sm-6 col-xs-12 cards\" onClick={() => this.props.selectMeal(meal)}>\n <img src={meal.subcat_thumbnail} alt=\"meal pic\" />\n <div style={{ padding: '5px' }}>\n <label>{meal.subcat_name}</label>\n <p>{meal.subcat_desc}</p>\n <label style={{ right: '0', position: 'absolute', bottom: '0', marginRight: '20px', color: 'red' }}>{meal.subcat_price}</label>\n </div>\n </div>\n );\n });\n }", "function selectedSection() {\n for (var i = 1; i <= sections.length; i++) {\n const createList = document.createElement('li');\n createList.innerHTML = `<a class='menu__link' href='#section${i}'>section ${i}</a>`;\n var getitems = docFrag.appendChild(createList);\n selectUl.appendChild(getitems);\n }\n\n}", "function cats(json) {\r\n let cats = json.cats;\r\n let section = document.querySelector('section');\r\n for(let i = 0; i < cats.length; i++)\r\n {\r\n // build HTML elements dynamically\r\n let article = document.createElement('article');\r\n let h2 = document.createElement('h2');\r\n let img = document.createElement('img');\r\n let p1 = document.createElement('p');\r\n let p2 = document.createElement('p');\r\n let p3 = document.createElement('p');\r\n let ul = document.createElement('ul');\r\n\r\n // set the image to the source\r\n img.setAttribute('src', cats[i].photo);\r\n img.setAttribute('alt', cats[i].name);\r\n\r\n // create the product information details\r\n h2.textContent = cats[i].name;\r\n p1.textContent = 'Species: ' + cats[i].species;\r\n p2.textContent = 'Age: ' + cats[i].age;\r\n p3.textContent = 'FavFoods: ';\r\n\r\n let favFoods = cats[i].favFoods;\r\n for(let j = 0; j< cats.length; j++)\r\n {\r\n let listItem = document.createElement('li');\r\n listItem.innerHTML = favFoods[j];\r\n ul.appendChild(listItem);\r\n }\r\n\r\n article.appendChild(img);\r\n article.appendChild(h2);\r\n article.appendChild(p1);\r\n article.appendChild(p2);\r\n article.appendChild(p3);\r\n article.appendChild(ul);\r\n section.appendChild(article);\r\n }\r\n}", "function ajoutCartes(produits) {\n let artCameras = document.querySelector(\"#article-produits\");\n\n // boucle forEach pour parcourir le tableau recuperé\n\n produits.forEach((item) => {\n let carte = document.createElement(\"article\");\n let image = document.createElement(\"img\");\n let divCarte = document.createElement(\"div\");\n let nomCarte = document.createElement(\"h2\");\n let lienCarte = document.createElement(\"a\");\n\n carte.classList.add(\"card\", \"mx-auto\", \"m-2\");\n carte.style = \"width: 18rem\";\n\n carte.id = item._id;\n image.classList.add(\"card-img\");\n image.alt = \"photo du produit\";\n image.src = item.imageUrl;\n divCarte.classList.add(\"card-body\");\n nomCarte.classList.add(\"card-title\", \"text-center\");\n nomCarte.textContent = item.name;\n lienCarte.classList.add(\"btn\", \"stretched-link\");\n lienCarte.id = \"link\";\n\n //recuperation de l id du produit\n\n lienCarte.href = `/front-end/html/produit.html?${item._id}`;\n lienCarte.textContent = \" Detail de \" + item.name;\n console.log(item._id);\n artCameras.appendChild(carte);\n carte.appendChild(image);\n carte.appendChild(divCarte);\n divCarte.appendChild(nomCarte);\n carte.appendChild(lienCarte);\n });\n}", "async function buildMoviesSection(sectionId) {\n const section = document.getElementById(sectionId);\n\n for (const category of categories) {\n const movies = await getMovies(\n category.query,\n category.start,\n category.end\n );\n\n // Create h2 title\n const h2 = document.createElement(\"h2\");\n h2.classList.add(category.id + \"_title\");\n h2.appendChild(document.createTextNode(category.title));\n\n // Create div to contains all movie divs\n const carouselDiv = document.createElement(\"div\");\n // Handle 1st movie presentation / resume / button\n if (category.id == \"best_movie\") {\n const bestMovieInfos = await buildBestMoviePrensentation(movieID);\n carouselDiv.setAttribute(\"id\", \"best-movie-presentation\");\n const resumeBox = document.createElement(\"div\");\n resumeBox.setAttribute(\"id\", \"best-movie-textbox\");\n const titleBox = document.createElement(\"div\");\n titleBox.setAttribute(\"id\", \"best-movie-titlebox\");\n titleBox.innerHTML = `<p>${bestMovieInfos[0]}</p>`;\n resumeBox.innerHTML = `<p>\" ${bestMovieInfos[1]} \"</p>`;\n const button = document.createElement(\"div\");\n button.setAttribute(\"id\", \"view-best-movie-button\");\n button.innerHTML += \"Voir\";\n carouselDiv.appendChild(button);\n carouselDiv.appendChild(titleBox);\n carouselDiv.appendChild(resumeBox);\n } else {\n carouselDiv.classList.add(\"caroussel-wrapper\");\n }\n\n if (category.end > category.visibleItems) {\n const previousDiv = document.createElement(\"div\");\n previousDiv.classList.add(\"left-arrow\");\n previousDiv.classList.add(\"arrow\");\n previousDiv.appendChild(document.createTextNode(\"<\"));\n previousDiv.onclick = previous;\n carouselDiv.appendChild(previousDiv);\n }\n\n let i = 0;\n for (const [movieID, movie] of Object.entries(movies)) {\n // Create img node\n const movieInfosHolder = document.createElement(\"img\");\n movieInfosHolder.src = movie.image_url;\n movieInfosHolder.alt = movie.title;\n\n const movieOverlay = document.createElement(\"div\");\n movieOverlay.classList.add(\"overlay\");\n // Create movie div and add img to it\n const movieDiv = document.createElement(\"div\");\n movieDiv.classList.add(\"movie-poster\");\n\n // On click Function to open the modal window\n movieDiv.onclick = function (e) {\n // Customize the modal to fit the current movie\n createModal(movieID);\n };\n movieDiv.appendChild(movieInfosHolder);\n movieDiv.appendChild(movieOverlay);\n // Hide movies if out of scope\n if (i >= category.visibleItems) {\n movieDiv.hidden = true;\n }\n carouselDiv.appendChild(movieDiv);\n i++;\n }\n\n if (category.end > category.visibleItems) {\n const nextDiv = document.createElement(\"div\");\n nextDiv.classList.add(\"right-arrow\");\n nextDiv.classList.add(\"arrow\");\n nextDiv.appendChild(document.createTextNode(\">\"));\n nextDiv.onclick = next;\n carouselDiv.appendChild(nextDiv);\n }\n\n // Create div for category and add title and carousel (list of movies)\n const sectionDiv = document.createElement(\"div\");\n sectionDiv.classList.add(category.id + \"_section\");\n sectionDiv.setAttribute(\"id\", category.id);\n sectionDiv.appendChild(h2);\n sectionDiv.appendChild(carouselDiv);\n\n // Add category div to section\n section.appendChild(sectionDiv);\n }\n}", "function visCovers() {\n const templatePointer = document.querySelector(\"template\");\n const listPointer = document.querySelector(\".item-c\");\n listPointer.innerHTML = \"\";\n console.log(covers);\n\n covers.feed.entry.forEach(cov => {\n if (filter == \"alle\" || filter == cov.gsx$kategori.$t) {\n const minKlon = templatePointer.cloneNode(true).content;\n minKlon.querySelector(\".billede\").src = `imgs/${cov.gsx$billede.$t}` + \".jpg\";\n minKlon.querySelector(\".kunstner\").textContent = cov.gsx$kunstner.$t;\n minKlon.querySelector(\".albumnavn\").textContent = cov.gsx$albumnavn.$t;\n\n\n minKlon.querySelector(\"article\").addEventListener(\"click\", () => visDetaljer(cov));\n\n listPointer.appendChild(minKlon);\n }\n\n })\n}", "function getInfoList(info) {\n const namesList = document.createElement('dl');\n namesList.setAttribute('class', 'card-names');\n\n const classType = document.createElement('dt');\n classType.innerText = 'Class';\n const className = document.createElement('dd');\n className.innerText = info.Class;\n namesList.append(classType);\n namesList.append(className);\n\n const orderType = document.createElement('dt');\n orderType.innerText = 'Order';\n const orderName = document.createElement('dd');\n orderName.innerText = info.Order;\n namesList.append(orderType);\n namesList.append(orderName);\n\n const familyType = document.createElement('dt');\n familyType.innerText = 'Family';\n const familyName = document.createElement('dd');\n familyName.innerText = info.Family;\n namesList.append(familyType);\n namesList.append(familyName);\n\n const genusType = document.createElement('dt');\n genusType.innerText = 'Genus';\n const genusName = document.createElement('dd');\n genusName.innerText = info.Genus;\n namesList.append(genusType);\n namesList.append(genusName);\n\n const speciesType = document.createElement('dt');\n speciesType.innerText = 'Species';\n const speciesName = document.createElement('dd');\n speciesName.innerText = info.Species;\n namesList.append(speciesType);\n namesList.append(speciesName);\n\n let card = document.createElement('div');\n card.appendChild(namesList);\n card.setAttribute('class', 'gallery-card');\n\n const animalPhoto = document.createElement('img');\n const cardFront = document.createElement('div');\n cardFront.setAttribute('class', 'card-photo');\n animalPhoto.setAttribute('src', info.picture);\n animalPhoto.setAttribute('width', '150px');\n cardFront.style.backgroundImage = `url(${info.picture})`;\n card.appendChild(cardFront);\n\n return card;\n}", "function createItem(data){\n l = document.createElement('li');\n var card = document.createElement('div');\n card.className = \"ui card small-item\";\n l.appendChild(card);\n var d_img = document.createElement('div');\n d_img.className = \"blurring dimmable image small-item\";\n card.appendChild(d_img);\n var img = document.createElement('img');\n img.src = \"/uploads/covers/\" + data.cover;\n d_img.appendChild(img);\n var d_dimmer = document.createElement('div');\n d_dimmer.className = \"ui dimmer\";\n var d_cotent = document.createElement('div');\n d_cotent.className = \"content\";\n d_dimmer.appendChild(d_cotent);\n var i_icon = document.createElement('i');\n i_icon.className = \"large play icon\";\n d_cotent.appendChild(i_icon);\n d_img.appendChild(d_dimmer);\n var p = document.createElement('p');\n p.align = \"center\";\n p.innerHTML = data.name;\n l.appendChild(p);\n l.onclick = function(){\n return window.location.href=\"/music?music_id=\"+data._id;\n };\n}", "function readingList(){ \n return (\n <section>\n <h2>Title Author</h2>\n <ol>\n {/* <Book/> */}\n </ol>\n </section>\n )\n}", "function build_Nav(){\n \n for(section of sections){\n let anchor = document.createElement(\"a\");\n //anchor.href = \"#\" + section.id;\n anchor.classList.add(\"menu__link\");\n anchor.innerHTML = section.getAttribute(\"data-nav\");\n frag.appendChild(anchor);\n }\n \n list.innerHTML = \"\";\n list.appendChild(frag);\n list.style.display = \"none\";\n }", "function generateList() {\n const ul = document.querySelector(\".list\");\n abrigoList.forEach((abrigo) => {\n const li = document.createElement(\"li\");\n const div = document.createElement(\"div\");\n const a = document.createElement(\"a\");\n const p = document.createElement(\"p\");\n a.addEventListener(\"click\", () => {\n irParaAbrigo(abrigo);\n });\n div.classList.add(\"abrigo-item\");\n a.innerText = abrigo.properties.name;\n a.href = \"#\";\n p.innerText = abrigo.properties.address;\n\n div.appendChild(a);\n div.appendChild(p);\n li.appendChild(div);\n ul.appendChild(li);\n });\n}", "function displayList(arrayOfPokemon){\n arrayOfPokemon.forEach(pokemon => {\n let pokemonInfo = document.createElement('div');\n pokemonInfo.className = 'list';\n\n let listing = document.createElement('h2');\n listing.textContent = pokemon.name;\n pokemonInfo.appendChild(listing);\n\n let sprite = document.createElement('img');\n sprite.src = pokemon.sprite;\n sprite.className = 'sprite';\n pokemonInfo.appendChild(sprite);\n\n let addButton = document.createElement('button');\n addButton.textContent = 'Add to Lineup';\n addButton.className = 'add-btn';\n addButton.addEventListener('click',displayCards);\n pokemonInfo.appendChild(addButton);\n\n document.querySelector('#pokemon-list').appendChild(pokemonInfo)\n });\n}", "function displayProducts(product) {\n // Structure HTML\n let productLink = document.createElement(\"a\");\n let productCard = document.createElement(\"figure\");\n let productCardTop = document.createElement(\"div\");\n let productImg = document.createElement(\"img\");\n let productCardLegend = document.createElement(\"figcaption\");\n let productName = document.createElement(\"h3\");\n let productPrice = document.createElement(\"p\");\n\n // Attributs des éléments HTML\n productLink.setAttribute(\"class\", \"card__link\");\n productLink.setAttribute(\"href\", \"pages/products.html?id=\" + product._id);\n productCard.setAttribute(\"class\", \"product-card\");\n productCardTop.setAttribute(\"class\", \"card__top\");\n productImg.setAttribute(\"class\", \"card__img\");\n productImg.setAttribute(\"src\", product.imageUrl);\n productImg.setAttribute(\"alt\", \"photo de \" + product.name);\n productCardLegend.setAttribute(\"class\", \"card__legend\");\n productName.setAttribute(\"class\", \"card__name\");\n productPrice.setAttribute(\"class\", \"card__price\");\n\n // Hierarchie des éléments HTML\n document.getElementById(\"productList\").appendChild(productLink);\n productLink.appendChild(productCard);\n productCard.appendChild(productCardTop);\n productCardTop.appendChild(productImg);\n productCard.appendChild(productCardLegend);\n productCardLegend.appendChild(productName);\n productCardLegend.appendChild(productPrice);\n\n // Ajout de contenu texte selon données récupérées \n productName.textContent = product.name;\n productPrice.textContent = product.price/100 + \".00€\"; \n}", "function renderCard(item) {\n const divCard = document.getElementById('perfil');\n const htmlElement = `\n <h1>${item.name}</h1>\n <div class=\"container-repo\">\n <div class=\"esq\">\n <img src=\"${item.avatar_url}\" alt=\"\">\n <a href=\"${item.html_url}\" target=\"_blank\">Visitar Perfil</a>\n </div>\n <div class=\"dir\">\n <ul>\n <li>REPOSITORIOS: ${item.public_repos}</li>\n <li>SEGUIDORES: ${item.followers}</li>\n <li>SEGUINDO: ${item.following}</li>\n </ul>\n <div class=\"btn-repo\">\n <input type=\"button\" value=\"Ver Respositorios\" id=\"btn-esq\" onclick=\"mostrarRepo()\"></input>\n <input type=\"button\" value=\"Ver Favoritos\" id=\"btn-dir\" onclick=\"mostrarRepo()\"></input>\n </div>\n </div>\n </div>\n <div id=\"repo-list\"></div>\n</div>\n`;\n divCard.innerHTML = htmlElement;\n}", "function populatePosters() {\n let list = document.querySelector(\"#posters ul\");\n var item = document.createElement(\"li\");\n\n movies.movieList.forEach(function (current, i) {\n //var item = document.createElement(\"li\");\n let image = document.createElement(\"img\");\n image.src = current.postUrl;\n image.alt = current.name;\n image.dataset.index = i;\n item.appendChild(image);\n list.appendChild(item);\n });\n\n let addMovie = document.createElement(\"button\");\n addMovie.id = \"addMovie\";\n addMovie.onclick = function () {\n let addMovSect = document.querySelector(\"#addMovieSec\");\n //console.log(\"event aknowledged\");\n addMovSect.style.display = \"block\";\n addMovSect.style.float = \"left\";\n }\n addMovie.textContent = \"Add Movie\";\n\n item.appendChild(addMovie);\n list.appendChild(item);\n \n}", "function appendList(arr) {\n var i = 0;\n var ul = document.createElement('ul');\n ul.classList.add('movie__ul');\n var movieList = document.getElementById('movieList');\n\n if (movieList.childNodes.length > 1) {\n movieList.childNodes[1].remove();\n }\n\n if (movieList.childNodes.length === 1) {\n movieList.appendChild(ul);\n arr.forEach(function(el) {\n var li = document.createElement('li');\n li.classList.add('movielist__item');\n eventListener.createEventListener(li, 'click', appendSection);\n ul.appendChild(li);\n li.textContent = arr[i].title;\n li.value = arr[i].id;\n i++;\n });\n }\n }", "function listSheet(sheet){\n $(\".contentdiv\").html('');\n\n for(i=0;i<sheet.length;i++){\n switch(sheet[i].type){\n \n case \"Chapter\":\n $(\".contentdiv\").append(\"<a name='\"+sheet[i].element.replace(/ /g,\"_\")+\"'></a><h1>\"+sheet[i].element+\"</h1>\");\n break;\n\n case \"Heading 1\":\n $(\".contentdiv\").append(\"<a name='#\"+sheet[i].element.replace(/ /g,\"_\")+\"'></a><h1>\"+sheet[i].element+\"</h1>\");\n break;\n\n case \"Heading 2\":\n $(\".contentdiv\").append(\"<h2>\"+sheet[i].element+\"</h2>\");\n break;\n\n case \"Heading 3\":\n $(\".contentdiv\").append(\"<h3>\"+sheet[i].element+\"</h3>\");\n break;\n\n case \"List Item\":\n if (sheet[i-1].type !=\"List Item\"){\n var list = $('<ul/>').appendTo(\".contentdiv\");\n var x = 0;\n while (sheet[i+x].type ==\"List Item\"){\n list.append(\"<li>\"+sheet[i+x].element+\"</li>\");\n x++;\n }\n }\n break;\n\n case \"Video\":\n $(\".contentdiv\").append(sheet[i].embed);\n break;\n\n case \"Video Caption\":\n $(\".contentdiv\").append(\"<p><em>\"+sheet[i].element+\"</p></em>\");\n break;\n\n case \"Glossary Item\":\n $(\".contentdiv\").append(\"<h3>\"+sheet[i].element+\"</h3>\");\n break;\n\n case \"Intro Text\":\n $(\".contentdiv\").append(\"<p class='summary'>\"+sheet[i].element+\"</p>\");\n break;\n\n default:\n $(\".contentdiv\").append(\"<p>\"+sheet[i].element+\"</p>\");\n break;\n }\n }\n}", "function appendCards() {\r\n var lastCat = -1;\r\n for(var i=0;i<portfolio.length;i++){\r\n if(portfolio[i].category != lastCat) {\r\n lastCat = portfolio[i].category;\r\n var cat = document.createElement(\"div\");\r\n cat.className = \"titleBox\";\r\n cat.id = \"cat\"+lastCat;\r\n cat.innerHTML = category[lastCat];\r\n wrapper.appendChild(cat);\r\n }\r\n var node = document.createElement(\"div\");\r\n node.className = \"card\";\r\n node.innerHTML = '<img src=\"' + portfolio[i].image[0] + '\"><p>' + portfolio[i].problem + '</p>';\r\n wrapper.appendChild(node);\r\n }\r\n }", "function renderVideos() {\n \n document.querySelector('.owl-carousel').innerHTML = ''; //limpa a lista para não repetir quando add nova tarefa\n \n video[0].video.forEach(task => {\n\n let li = document.createElement('div');\n li.className = \"item\";\n\n li.innerHTML = `\n \n <div class=\"card col-md-6 youtube_card bg-youtube\" style=\"background-image: url(${task.url});\">\n <a href=\"${task.href}\" target=\"_blank\" class=\"hide_card\"><img src=\"${task.src}\" alt=\"\"></a>\n </div>\n\n `;\n\n document.querySelector('.owl-carousel').append(li);\n\n });\n\n}", "function getlist(sport){\n var sport_id= sport.parentElement.parentElement.children[0].children[1].innerHTML;\n sport.parentElement.children[3].innerHTML=\"\";\n getSportParticipants(sport_id, sport);\n}", "function criarCard() {\n\n let strCard = \"\"\n\n for (var i = 0; i < docentes.length; i++) {\n if (i % 3 == 0) {\n strCard += `<div class=\"row\">`\n }\n // Cria o card\n strCard += `<div class=\"col-sm-4\">\n <div class=\"card\" onclick=\"\" style=\"width: 18rem;\">\n <img class=\"card-img-top\" src=\"${docentes[i]._imagem}\" alt=\"Card image cap\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${docentes[i]._nome}</h5>`\n\n strCard += `</div></div></div>`\n\n if (i % 3 == 2) {\n strCard += `</div>`\n }\n }\n let catalogoProfs = document.getElementById(\"card\")\n catalogoProfs.innerHTML = strCard\n\n}", "function showPage(list, page){\n const studentsPerPage = 9;\n const startIndex = page * studentsPerPage - studentsPerPage;\n const endIndex = page * studentsPerPage;\n const studentList = document.querySelector('.student-list');\n studentList.innerHTML = '';\n for(let i = 0; i< list.length; i++){\n if(i >= startIndex && i < endIndex){\n // Start of list elements\n // *NOTE* I used two different methods for adding the markup, for practice.\n const studentLI = document.createElement(`li`);\n studentLI.className = 'student-item cf';\n \n // student-details div\n const studentDetails = document.createElement('div');\n studentDetails.className = 'student-details';\n\n const avatar = document.createElement('img');\n avatar.className = 'avatar';\n avatar.src = list[i].picture.large;\n avatar.alt = 'Profile Picture';\n\n const studentName = document.createElement('h3');\n studentName.innerHTML = list[i].name.first + \" \" + list[i].name.last;\n\n const studentEmail = document.createElement('span');\n studentEmail.className = 'email';\n studentEmail.innerHTML = list[i].email;\n // End of student-details div\n\n // Start joined-details div\n const joinedDetails = document.createElement('div');\n joinedDetails.className = 'joined-details';\n\n const joinDate = document.createElement('span');\n joinDate.className = 'date';\n joinDate.innerHTML = `Joined ${list[i].registered.date}`\n // End of joined-details div\n\n studentList.appendChild(studentLI);\n studentLI.appendChild(studentDetails);\n studentDetails.appendChild(avatar);\n studentDetails.appendChild(studentName);\n studentDetails.appendChild(studentEmail);\n\n studentLI.appendChild(joinedDetails);\n joinedDetails.appendChild(joinDate);\n }\n }\n\n}", "function makePageForEpisodes(ListOfEpisodes) {\n // For each episode in getAllEpisodes() create a div and append it in the rootElement Container and have the class card\n ListOfEpisodes.forEach((oneEpisode) => {\n let createContainer = document.createElement(\"div\");\n rootElem.appendChild(createContainer);\n createContainer.className = \"card\";\n\n // let create the heading for each episode\n let headingDiv = document.createElement(\"div\");\n headingDiv.setAttribute(\"id\", \"headingContainer\");\n let headingElement = document.createElement(\"h2\");\n headingElement.innerText = oneEpisode.name;\n headingDiv.appendChild(headingElement);\n createContainer.appendChild(headingDiv);\n\n // let create the second heading indicating the episode code\n let episodeCodeHeading = document.createElement(\"h3\");\n episodeCodeHeading.innerHTML = `-- S0${oneEpisode.season}E0${oneEpisode.number}`;\n headingDiv.appendChild(episodeCodeHeading);\n\n //create an image element for each episode\n let imagesContainer = document.createElement(\"div\");\n imagesContainer.setAttribute(\"class\", \"imageContainer\");\n let createImageElement = document.createElement(\"img\");\n createImageElement.src = oneEpisode.image.medium;\n imagesContainer.appendChild(createImageElement);\n createContainer.appendChild(imagesContainer);\n\n //create a paragraph element containing the summary found in the getAllEpisode object\n let createParagraph = document.createElement(\"p\");\n createParagraph.innerHTML = oneEpisode.summary;\n imagesContainer.appendChild(createParagraph);\n });\n return ListOfEpisodes;\n}", "function createChildrenList() {\n//delete list elements\ndocument.getElementById(\"childrenlist\").innerHTML = \"\";\nthis.row = document.getElementById(\"row_blueprint\");\nrowcolor = \"black-text\";\nx=0;\n//console.log(studentList);\nstudentList.forEach(function(element) {\nmodeIcon = null;\niconEnabled = true;\t\nif (element['absent'] == \"true\") {\nstateIcon = \"healing\";\nrowcolor = \"red-text\";\niconEnabled = true;\t\n} else {\nstateIcon = \"\";\t\nrowcolor = \"black-text\";\niconEnabled = false;\n}\n\nthis.rowClone = this.row.cloneNode(true);\nthis.rowClone.id = \"row\"+element['id'];\nif (iconEnabled && element['entschuldigt'] != \"0000-00-00\") rowcolor = \"green-text\";\nthis.rowClone.className = rowcolor;\t\n//console.log(this.rowClone.childNodes);\nthis.listheader = this.rowClone.childNodes[1];\nthis.listheader.name = \"done\";\nthis.listheader.id = \"listheader\"+element['id'];\nthis.listheader.innerHTML = '<span class=\" ' + rowcolor+' \">'\n\t\t+element['name'] + ' ('\n\t\t+ element['klasse'] \n\t\t+')';\nif (!iconEnabled) {\n\tthis.listheader.innerHTML += '<a href=\"#\" onClick=\"enterParentAbsence('+element['id']+')\" class=\"black-text\"><i class=\"material-icons right\">healing</i><span class=\"secondary-content info grey-text\"></span></a>';\t\n\tthis.rowClone.childNodes[3].remove();\n\t}\n\nif(iconEnabled) {\n\tif (element['adminMeldung'] != \"0\") {\n\t\tif (element['adminMeldungTyp'] == 0) {\n\t\t\tthis.listheader.innerHTML +=\t'<i class=\"material-icons left\">contact_phone</i>';\n\t\t} else {\n\t\t\tthis.listheader.innerHTML += '<i class=\"material-icons left\">contact_mail</i>';\n\t\t}\n\t} else if (element['lehrerMeldung'] != \"0\") {\n\t\t\tthis.listheader.innerHTML += '<i class=\"material-icons left\">school</i>';\n\t} else {\n\t\tthis.listheader.innerHTML += '<i class=\"material-icons left\">healing</i>';\t\n\t}\n\t\n\tthis.listbody = this.rowClone.childNodes[3];\n\tthis.listbody.name = \"done\";\n\tthis.listbody.id = \"listbody\"+element['id'];\n\tthis.listbody.className += \" black-text\";\n\tthis.listbody.innerHTML = showAbsenceDetails(element['absenceId']);\t\n\t} \nx++;\ndocument.getElementById('childrenlist').appendChild(this.rowClone);\nthis.rowClone.style.display=\"block\";\n});\n\n\n\n}", "function renderReviewDonboscoMuseum(doc){\n let li = document.createElement('li');\n let DonboscoMuseum = document.createElement('h6');\n let name = document.createElement('h6');\n let headingDonboscoMuseum = document.createElement('b');\n let contentDonboscoMuseum = document.createElement('p');\n\n li.setAttribute('data-id',doc.id);\n DonboscoMuseum.textContent = \"Donbosco Museum: \";\n name.textContent = \"Author Name: \"+ doc.data().name;\n headingDonboscoMuseum.textContent =\"Title: \"+ doc.data().heading;\n contentDonboscoMuseum.textContent = doc.data().content;\n\n li.appendChild(DonboscoMuseum);\n li.appendChild(name);\n li.appendChild(headingDonboscoMuseum);\n li.appendChild(contentDonboscoMuseum);\n\n DonboscoMuseumPostList.appendChild(li);\n}", "function addCardToPage(cardToAddToPage){\n var newArticle = document.createElement(\"LI\");\n\n\n newArticle.innerHTML = \"<article class=\\\"container\\\">\" +\n \"<p class=\\\"card-title\\\">\" + cardToAddToPage.title + \"</p>\" +\n \"<br><hr class=\\\"line\\\"/>\" +\n \"<p class=\\\"website-link\\\"><a href=\\\"http://\" +cardToAddToPage.url +\"\\\" target=\\\"_blank\\\">\" + cardToAddToPage.url + \"</a></p>\" +\n \"<hr class=\\\"line\\\"/>\" +\n \"<button class=\\\"read-btn\\\">Read</button>\" +\n \"<button class=\\\"delete-btn\\\">Delete</button>\" +\n \"</artice>\";\n sectionRight.appendChild(newArticle);\n addEventListenerToReadButton();\n addEventListenerToDeleteButton();\n}", "function dataKorttiin(){\r\n var data = opetusaladatat;\r\n var kortti = '<div class=\"card\" style=\"width: 25rem;\">';\r\n for (var i = 0; i < data.length; i++){\r\n kortti += '<div class=\"card-body\">';\r\n kortti += '<h5 class=\"card-title\" id=\"ammattiala\">' + data[i].ammattiala + '</h5>';\r\n kortti += '<p class=\"card-text\" id=\"työtehtävä\">' + data[i].tyotehtava + '</p>';\r\n kortti += '</div>';\r\n kortti += '<ul class=\"list-group list-group-flush\">';\r\n kortti += '<li id=\"osoite\">' + data[i].osoite + '</li>';\r\n kortti += '<li id=\"haku\">' + \"Haku päättyy: \" + data[i].haku_paattyy_pvm + '</li>';\r\n kortti += '</ul>';\r\n kortti += '<div class=\"card-body\" id=\"linkki\">';\r\n kortti += '<a href=\"#\" class=\"card-link\">' + data[i].linkki + '</a>';\r\n kortti += '<hr>';\r\n kortti += '</div>'; \r\n \r\n }\r\n kortti += '</div>';\r\n document.getElementById(\"opetus\").innerHTML = kortti;\r\n}", "function getSectionsOf(item){\n let sl = []\n console.log(\"on renvoie deja \"+item.name)\n sl.push(item.name)\n if (typeof item.sections != 'undefined'){\n for (l=0;l<item.sections.length;l++){\n var ti = l;\n console.log(\"on traite l'enfant numero \"+l+\" soit \"+item.sections[l].name)\n for (const s of getSectionsOf(item.sections[l])){\n sl.push(s);\n } \n l=ti;\n console.log(\"...le \"+l+\" ieme est fini pass au suivant\")\n }\n }\n return sl\n}", "printNews(newsObj) {\n if (newsObj.userId === activeUser.info().id){\n new comp.section({className: \"news\", id: `${newsObj.id}`},\n new comp.anchor({href: `${newsObj.url}`, target: \"_blank\"}, new comp.image({src: `${newsObj.articleImage}`, alt: \"Article Image\", height: \"120\"})),\n new comp.div({className: \"news-info\"},\n new comp.title(\"h2\", {}, `${newsObj.articleName}`),\n new comp.title(\"h4\", {}, `Saved by: ${newsObj.user.firstName} | Date Saved: ${formatDate.getCorrectDate(newsObj.dateSaved)}`),\n new comp.par({}, newsObj.about)),\n new comp.btn(\"Delete Article\")).render(\".display--news\")\n } else {\n new comp.section({className: \"news friendsNews\", id: `${newsObj.id}`},\n new comp.anchor({href: `${newsObj.url}`, target: \"_blank\"}, new comp.image({src: `${newsObj.articleImage}`, alt: \"Article Image\", height: \"120\"})),\n new comp.div({className: \"news-info\"},\n new comp.title(\"h2\", {}, `${newsObj.articleName}`),\n new comp.title(\"h4\", {}, `Saved by: ${newsObj.user.firstName} | Date Saved: ${formatDate.getCorrectDate(newsObj.dateSaved)}`),\n new comp.par({}, newsObj.about))).render(\".display--news\")\n\n }}", "function showCat() {\n categories.forEach(elements => {\n\n elements.onclick = function () {\n\n document.querySelector('.row').innerHTML = '';\n\n // on filtre le tableau entier pour ne garder que la catégorie 'starters'\n productsCat = products.filter(property => property.category == elements.id);\n\n // on boucle sur le nouveau tableau pour afficher le contenu\n productsCat.forEach(item => {\n\n // on récupère l'id la card\n // et on la stocke dans une variable\n let colCard = document.querySelector('#colCard');\n\n // on clone la card\n let colCardClone = colCard.cloneNode(true);\n\n // on incrémente les ids des éléments html de la card\n // et on ajoute le contenu\n colCardClone.id = 'colCardClone' + newId;\n document.querySelector('.row').appendChild(colCardClone);\n // on affiche l'image du produit\n colCardClone.querySelector('#cardImg').id = 'cardImg' + newId;\n colCardClone.querySelector('#cardImg' + newId).src = `assets/img/${item.img}`;\n // on affiche le nom du produit\n colCardClone.querySelector('#cardTitle').id = 'cardTitle' + newId;\n colCardClone.querySelector('#cardTitle' + newId).innerHTML = item.name;\n // on affiche le prix du produit\n colCardClone.querySelector('#cardPrice').id = 'cardPrice' + newId;\n colCardClone.querySelector('#cardPrice' + newId).innerHTML = item.price + ' €';\n // on affiche le descrition du produit\n colCardClone.querySelector('#cardContent').id = 'cardContent' + newId;\n colCardClone.querySelector('#cardContent' + newId).innerHTML = item.infos;\n // on ajoute la référence sur le bouton grâce au data-id\n colCardClone.querySelector('#cardBtn').id = 'cardBtn' + newId;\n colCardClone.querySelector('#cardBtn' + newId).setAttribute('data-id', item.ref);\n\n //\n // Ajout au tableau panier\n //\n // on récupère les id des boutons 'Ajouter' + nouvel id\n let addToCartBtn = document.querySelectorAll('#cardBtn' + newId);\n\n // on parcours le tableau renvoyé par querySelectorAll\n addToCartBtn.forEach(element => {\n element.onclick = function () {\n\n // et à chaque itération, on récupére la référence produit dans data-id\n item = element.getAttribute('data-id');\n\n // on test le tableau pour trouver le bon produit avec la bonne référence\n addedItem = products.filter(product => product.ref == item);\n\n // on ajoute le produit dans le nouveau tableau cart\n addedItem[0].count = 1;\n cart.push(addedItem[0]);\n };\n });\n\n // on incrémente l'id\n newId++;\n\n\n });\n };\n });\n}", "function generate_card(curr_movie) {\n // curr_movie is an object which property will helps to make card\n let card = document.createElement(\"div\")\n card.className = \"col-lg-4 col-md-6 col-12 p-2 bg-light\"\n card.innerHTML = `<div class=\"card p-1 \" >\n <img id=\"movie_picture\" src=${curr_movie.img} class=\"card-img-top\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-info\">${curr_movie.name}</h5>\n <p class=\"card-text\">${curr_movie.desc}</p>\n <ul class=\"list-group\"> \n <h3> Locations: </h3>\n <li class=\"list-group-item\">\n ${curr_movie.locations.map(e => { return e })}\n </li>\n </ul> \n <h5 class=\"m-1\">Show Time : ${curr_movie.timing.from}-${curr_movie.timing.to} </h5>\n <button onclick=\"book_ticket()\" class=\"btn btn-success my-3\" id=${curr_movie.id}>Select</button>\n </div>\n </div>`\n return card\n}", "function CardList(props) {\n var els = [];\n for (var i = 0; i < props.cards.length; ++i) {\n els.push(e(\n Card,\n Object.assign({key: 'card-' + i}, props.cards[i])));\n }\n return e('div', null, els);\n}", "function buildNav() {\n var sectionContent = document.getElementsByClassName('section');\n var numberOfSections = sectionContent.length;\n var sideNav = document.getElementsByClassName('sideNav')[0];\n var titleList = [];\n var subSectionList = [];\n\n // Makes a list of all section titles and associated subsection titles\n // There should only be one sectionTitle per section\n for (i=0; i<numberOfSections; i++) {\n titleList.push(sectionContent[i].getElementsByClassName('sectionTitle'));\n subSectionList.push(sectionContent[i].getElementsByClassName('subSectionTitle'));\n }\n\n // Builds the listSection\n for (sec=0; sec<numberOfSections; sec++) {\n if (subSectionList[sec].length > 0) {\n var listSection = build(titleList[sec], 'sn-listSection', true);\n var sublist = build(subSectionList[sec], 'sn-sublist', false);\n\n listSection.appendChild(sublist)\n } else {\n var listSection = build(titleList[sec], 'sn-listSection', false);\n }\n sideNav.appendChild(listSection);\n }\n}", "function makePageForShows(showList) {\n const rootElem = document.getElementById(\"root\");\n let containerShows = document.createElement(\"div\");\n containerShows.className =\"containerShows\";\n rootElem.appendChild(containerShows);\n\n showList.forEach((show)=> {\n let showBoxDiv = document.createElement(\"div\");\n let showBoxImage = document.createElement(\"img\");\n let showBoxTitle = document.createElement(\"h3\");\n let listingSummary = document.createElement(\"p\");\n let episodeGenre = document.createElement(\"h4\");\n let episodeStatus = document.createElement(\"h4\");\n let episodeRating = document.createElement(\"h4\");\n let episodeRuntime = document.createElement(\"h4\"); \n \n \n showBoxImage.src = show.image.original;\n\n showBoxTitle.textContent=show.name; \n listingSummary.textContent = show.summary;\n episodeGenre.textContent = show.genres;\n episodeStatus.textContent = show.status;\n episodeRating.textContent = show.rating;\n episodeRuntime.textContent = show.runtime;\n containerShows.appendChild(showBoxDiv)\n showBoxDiv.appendChild(showBoxImage);\n showBoxDiv.appendChild(showBoxTitle); \n showBoxDiv.appendChild(listingSummary);\n showBoxDiv.appendChild(episodeGenre);\n showBoxDiv.appendChild(episodeRating);\n showBoxDiv.appendChild(episodeRuntime);\n showBoxDiv.appendChild(episodeStatus);\n \n }) \n }", "function showPage (list, page){\n const indexStart = (page * 9) - 9 \n const indexEnd = (page* 9)\n const studentList = document.querySelector('.student-list')\n studentList.innerHTML = '';\n for(i=0; i<list.length; i++){\n if(i >= indexStart && i<indexEnd){\n const studentName = list[i].name.first + ' ' + list[i].name.last\n const avatar = list[i].picture.large\n const date = list[i].registered.date\n const email = list[i].email\n let studentItem = \n `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${avatar}\">\n <h3>${studentName}</h3>\n <span class=\"email\">${email}</span>\n </div>\n <div class = \"joined details\">\n <span class = \"date\">${date}</span>\n </div>\n </li> `\n console.log(avatar)\n studentList.insertAdjacentHTML('beforeend', studentItem)\n }\n }\n}", "function CargarNodos(idioma){\n $(\"[id*=nodo_]\").remove();\n //Crear un cuadrado por cada nodo:\n for (var i=0; i<arrayNodos.length; i++){\n var nodoNumi = document.createElement(\"a\");\n nodoNumi.innerHTML = '<h4>' + arrayNodos[i].nombre.toUpperCase() + '</h4>';\n\n\n\n var idNodoNumi = \"nodo_\" + arrayNodos[i].id;\n nodoNumi.setAttribute(\"id\",idNodoNumi);\n nodoNumi.setAttribute(\"class\",\"card m-0 p-0\");\n nodoNumi.setAttribute(\"style\",\"height:8em;width:8em;border-radius:0;border-width:0;display:flex;justify-content:center;align-items:center;text-decoration:none;\" +\n \";background-color:\" + arrayNodos[i].color_fondo +\n \";color:#f8f8f8\"\n );\n //En función del idioma, un título (tip con el hover):\n if (idioma == 'en'){\n nodoNumi.setAttribute(\"title\",arrayNodos[i].tip_en);\n } else {\n nodoNumi.setAttribute(\"title\",arrayNodos[i].tip_es);\n }\n //Añadir el objeto Nodo al menú superior:\n nodoNumi.setAttribute(\"href\",arrayNodos[i].url);\n nodoNumi.setAttribute(\"target\",\"_blank\");\n document.getElementById(\"espNodos\").appendChild(nodoNumi);\n };\n}", "function createListElems(title, text, chairname, chairmail, advisorname, advisormail) {\r\n var description = '';\r\n var summary = '';\r\n\r\n // Parse from text a summary\r\n for (var i = 0; i < text.length; ++i) {\r\n description = description + text[i];\r\n if ((description.slice(-1)[0] == \".\") && (summary.slice(-1)[0] != \".\")) {\r\n summary = description;\r\n description = '';\r\n i = i + 1;\r\n }\r\n }\r\n\r\n // Check individual batch size\r\n if (batches.slice(-1)[0].length > 40) {\r\n batches.push([]);\r\n }\r\n // Push list elems into individual batch \r\n batches.slice(-1)[0].push({\r\n \"elementType\": \"list\",\r\n \"grouped\": true,\r\n \"items\": [{\r\n \"title\": \"<span style=\\\"color:green;\\\"><b>\" + title + \"</b></span>\",\r\n \"description\": summary,\r\n }]\r\n }, {\r\n \"elementType\": \"collapsible\",\r\n \"title\": \"<span style=\\\"display: block; margin-top:-1rem !important;margin-right: -1.82em;border-radius:0px 0px 5px 5px;color:#008800; background-color: #f6f6f6; border:none !important; padding:0.7em 2.4em 0.7em 0.7em\\\"><u>Read more about \" + title + \"</u></span>\",\r\n \"collapsed\": true,\r\n \"content\": [{\r\n \"elementType\": \"list\",\r\n \"grouped\": true,\r\n \"items\": [{\r\n \"description\": description\r\n }]\r\n },\r\n {\r\n \"elementType\": \"html\",\r\n \"focal\": true,\r\n \"html\": \"<div style = \\\" text-align: center;\\\" ><p><span style=\\\"color:green;\\\"> <b>Chairperson</b><br></span><b>\" + chairname + \"</b><br><a href=\\\"mailto:\" + chairmail + \"\\\"><span style=\\\"color:green;\\\"><u>\" + chairmail + \"</u></span></a></p><p><span style=\\\"color:green;\\\"><b>Advisor Name</b><br></span><b>\" + advisorname + \"</b><br><a href=\\\"mailto:\" + advisormail + \"\\\"><span style=\\\"color:green;\\\"><u>\" + advisormail + \"</u></span></a></p></div>\"\r\n }\r\n ]\r\n });\r\n}", "function createCard(movie, mediaType) {\n\tconst carWrapCard = document.createElement('div');\n\tcarWrapCard.classList.add('carousel__wrapper-card');\n\t// const flipCardContainer = document.createElement('div');\n\t// flipCardContainer.classList.add('flip-card-container');\n\t// const flipCard = document.createElement('div');\n\t// flipCard.classList.add('flip-card');\n\t// flipCard.dataset.movieId = movie.id;\n\t// flipCard.onclick = (evt) => {\n\t// \tevt.preventDefault();\n\t// \tonClickRenderOnJumbotron(movie.id);\n\t// };\n\t// onclick\n\t// addToWatchlist.dataset.movieId = movie.id;\n\t// addToWatchlist.dataset.movieTitle = movie.original_title;\n\n\t// const carImgInBg = document.createElement('div');\n\t// carImgInBg.style.backgroundImage = `url(${POSTER_BASE_URL}/w185${movie.poster_path})`;\n\t// carImgInBg.classList.add('card-img');\n\t// const flipCardFront = document.createElement('div');\n\t// flipCardFront.classList.add('flip-card-front');\n\t// const flipCardBack = document.createElement('div');\n\t// flipCardBack.classList.add('flip-card-back');\n\t// const description = document.createElement('p');\n\t// description.textContent = movie.overview;\n\t// const title = document.createElement('h6');\n\t// title.textContent = movie.title || movie.name || movie.original_title || movie.original_name;\n\n\t// console.log(movie.vote_count, movie.vote_average, movie.popularity, movie.genre_ids, movie.original_language, movie.backdrop_path, movie.video);\n\n\t// let genresId = 0;\n\t// movie.genre_ids.forEach((genre_id) => {\n\t// \tgenresId = genre_id;\n\t// });\n\n\t// for (const genresId of tvGenres) {\n\t// \tconsole.log(genresId.name);\n\t// }\n\n\t// let actionWrapper = createActionBar(movie);\n\n\t// console.log(movie);\n\t// flipCardBack.append(title, description);\n\t// flipCardFront.appendChild(carImgInBg);\n\t// flipCard.appendChild(flipCardFront);\n\t// flipCard.appendChild(flipCardBack);\n\t// flipCardContainer.appendChild(flipCard);\n\t// carWrapCard.appendChild(flipCardContainer);\n\t// carWrapCard.appendChild(actionWrapper);\n\t// let posCarWrapCard = flipCard.getClientRects();\n\t// console.log(posCarWrapCard);\n\treturn carWrapCard;\n}", "function showPapers(paperlist) {\n let container = document.querySelector('.container'), subcontainer, preview;\n let line, comment;\n for (let i = paperlist.revisions.length - 1; i >= 0; i--) {\n subcontainer = document.createElement('div');\n subcontainer.classList.add('subcontainer');\n subcontainer.classList.add('last');\n preview = document.createElement('embed');\n preview.src = '/' + paperlist.revisions[i].url;\n preview.type = 'application/pdf';\n subcontainer.appendChild(preview);\n let modi = document.createElement('div');\n modi.classList.add('modification');\n for (let j = paperlist.revisions[i].feedback.length - 1; j >= 0; j--) {\n comment = document.createElement('div');\n comment.classList.add('pcomment');\n comment.innerHTML = paperlist.revisions[i].feedback[j].feedback;\n modi.appendChild(comment);\n }\n subcontainer.appendChild(modi);\n container.appendChild(subcontainer);\n if (i != 0) {\n subcontainer.classList.remove('last');\n line = document.createElement('div');\n line.classList.add('line-break');\n container.appendChild(line);\n }\n }\n return paperlist\n}", "function showMovies(movies) {\n //loop through the data and for each movie we create a new div\n movies.forEach((movie)=> {\n //destructure the object\n const {poster_path, title, overview } = movie\n\n //create a div\n const movieCard = document.createElement(\"div\");\n movieCard.classList.add(\"card\");\n \n movieCard.innerHTML= `\n <img src=${IMGPATH + poster_path } alt=${title} />\n <h1>${title}</h1>\n <p>${overview}</p>\n `;\n //implement movie properties into the inner HTML of movieCard\n main.appendChild(movieCard);\n });\n \n}" ]
[ "0.63207793", "0.61935884", "0.6134472", "0.6095769", "0.6014912", "0.59326345", "0.5922069", "0.5888276", "0.58866423", "0.58226746", "0.5819623", "0.577625", "0.5741258", "0.56826484", "0.5671089", "0.5657915", "0.5654481", "0.5650534", "0.5647578", "0.5637486", "0.5606895", "0.5605362", "0.55804837", "0.55782914", "0.5574706", "0.55738807", "0.5570266", "0.5569814", "0.55464506", "0.5544498", "0.5540181", "0.55391675", "0.5532435", "0.5507172", "0.54985565", "0.5494369", "0.54729337", "0.54707104", "0.54640853", "0.5445836", "0.5444745", "0.5443148", "0.5441685", "0.5424587", "0.5420423", "0.54175586", "0.54127175", "0.5411608", "0.54105514", "0.53963333", "0.5394841", "0.5394167", "0.53747356", "0.5374729", "0.53634995", "0.5363437", "0.53456724", "0.5343864", "0.53275234", "0.53150034", "0.531377", "0.53109455", "0.5303702", "0.5302419", "0.5299837", "0.52970487", "0.52866", "0.5268237", "0.5260972", "0.52599096", "0.52524114", "0.5252184", "0.52509797", "0.5246263", "0.5245316", "0.52430665", "0.5241368", "0.5239157", "0.5235802", "0.5230458", "0.52252907", "0.52236867", "0.5223467", "0.52135414", "0.52129066", "0.5203475", "0.52024037", "0.52005893", "0.5198693", "0.51973635", "0.5184568", "0.51657873", "0.5160893", "0.51603156", "0.5159523", "0.5158193", "0.51553375", "0.51529956", "0.5151795", "0.5149456" ]
0.7291359
0
funzione che ottiene i dati dall'eseterno, e quando li ha ottenuti renderizza il carosello dei film popolari
function handleHTMLMounted() { Promise.all([handleSession(), getConfiguration(), getPopularMovies(false, false, 'movie', 0), getTop_ratedMovies(false, false, 'movie', 1), getNow_playingMovies(false, false, 'movie', 2), getUpcomingMovies(false, false, 'movie', 3)]).then(() => { // ci permette di lavorare con i dati ottenuti dall'esterno renderCarousel(stateMovies[sectionNameId[0]], nodeSectionId[0]); renderCarousel(stateMovies[sectionNameId[1]], nodeSectionId[1]); renderCarousel(stateMovies[sectionNameId[2]], nodeSectionId[2]); renderCarousel(stateMovies[sectionNameId[3]], nodeSectionId[3]); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dodajFilm() {\n\n // resetowanie pola jesli tam wczesniej bylo cos wpisane\n parWalidacjaDodanegoFilmu.innerHTML = \"\";\n \n let filmDoDodania = \"\";\n let FilmZweryfikowany = weryfikujFilm();\n \n // weryfikacja dodanego filmu\n // sprawdza czy wczesniej bylo sortowanie\n // jesli nie to film dodawany jest na koniec listy filmow i kafelkow\n if (FilmZweryfikowany && ostatnioSortowanePo === \"\"){\n\t// dodanie zweryfikowanego filmu na koniec listy filmow\n\tfilmDoDodania += poleDodajTytul.value + \" (\" + poleDodajRok.value + \")\";\n\tlistOfMovies.push(filmDoDodania);\n\n\t// wyswietlenie wiadomosci o dodaniu filmu\n\tparWalidacjaDodanegoFilmu.innerHTML = \"Pomyślnie dodano film do \" +\n\t \"końca listy filmów\";\n\tparWalidacjaDodanegoFilmu.style.color = \"green\";\n\t\n\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n\t\n\t// update listyTagow\n\tupdateListaTagow();\n\n\t// sprawdza czy wczesniej bylo sortowanie\n\t// jesli tak (po roku) to film dodawany jest w odp. miejsce listy i kafelkow\n } else if (FilmZweryfikowany && ostatnioSortowanePo === \"rok\") {\n\trokRosnaco = !rokRosnaco; // zamieniamy do stanu poprzedniego sortowania\n\n\t// dodanie zweryfikowanego filmu na koniec listy filmow\n\tfilmDoDodania += poleDodajTytul.value + \" (\" + poleDodajRok.value + \")\";\n\tlistOfMovies.push(filmDoDodania);\n\n\t// sortujemy po roku\n\t// (tu jest usuwanie i tworzenie listy kafelkow, \n\t// update liczby filmow i filmow widocznych)\n\tsortujPoRoku();\n\n\t// updateujemy tagi\n\tupdateListaTagow();\n\n\t// wyswietlenie wiadomosci o dodaniu filmu\n\t// tu film zostal wstawiony we wlasciwe miejsce a nie na koniec kafelkow\n\tparWalidacjaDodanegoFilmu.innerHTML = \"Pomyślnie dodano film do listy.\";\n\tparWalidacjaDodanegoFilmu.style.color = \"green\";\n\t\n\t// sprawdza czy wczesniej bylo sortowanie\n\t// jesli tak (po tytule) to film dodawany jest w odp. miejsce listy i kafelkow\n } else if (FilmZweryfikowany && ostatnioSortowanePo === \"tytul\"){\n\n\ttytulRosnaco = !tytulRosnaco; // zamieniamy do stanu poprzedniego sortowania\n\n\t// dodanie zweryfikowanego filmu na koniec listy filmow\n\tfilmDoDodania += poleDodajTytul.value + \" (\" + poleDodajRok.value + \")\";\n\tlistOfMovies.push(filmDoDodania);\n\n\t// sortujemy po tytule\n\t// (tu jest usuwanie i tworzenie listy kafelkow,\n\t// update liczby filmow i filmow widocznych)\n\tsortujPoTytule();\n\t\n\t// updateujemy tagi\n\tupdateListaTagow();\n\n\t// wyswietlenie wiadomosci o dodaniu filmu\n\t// tu film zostal wstawiony we wlasciwe miejsce a nie na koniec kafelkow\n\tparWalidacjaDodanegoFilmu.innerHTML = \"Pomyślnie dodano film do listy.\";\n\tparWalidacjaDodanegoFilmu.style.color = \"green\";\n\t\n }\n \n // resetowanie zawartosci poleDodajTytul i poleDodajRok\n // po dodaniu nowego filmu\n poleDodajTytul.value = \"\";\n poleDodajRok.value = \"\";\n \n}", "function weryfikujFilm() {\n \n let czyOk = true;\n\n // + 1900 bo:\n // https://www.tutorialspoint.com/javascript/date_getyear.htm\n let aktualny_rok = new Date().getYear() + 1900;\n // wg. https://en.wikipedia.org/wiki/Film najstarszy znany film pochodzi z 1888\n \n // dodanie koloru czerwonego do czcionki z ostrzezeniem\n parWalidacjaDodanegoFilmu.style.color = \"firebrick\";\n\n if (poleDodajTytul.value === \"\") {\n\tparWalidacjaDodanegoFilmu.innerHTML = \"Pole 'dodaj tytuł' nie może być puste!\";\n\tczyOk = false;\n }\n if (poleDodajRok.value === \"\") {\n\tparWalidacjaDodanegoFilmu.innerHTML += \" Pole 'dodaj rok' nie może być puste!\";\n\tczyOk = false;\n } else if (!czyTylkoCyfry(poleDodajRok.value)) {\n\tparWalidacjaDodanegoFilmu.innerHTML += \" Pole 'dodaj rok' musi zawierać 4 cyfry\";\n\tczyOk = false;\n } else if (poleDodajRok.value < 1888 || // patrzy wczesniejszy komentarz\n\t poleDodajRok.value > aktualny_rok) {\n\tparWalidacjaDodanegoFilmu.innerHTML += \" Pole 'dodaj rok' musi zawierać wartość\" +\n\t \" pomiędzy rokiem 1888 a rokiem bieżącym.\";\n\tczyOk = false;\n } else if (czyFilmJestWbazie(poleDodajTytul.value, poleDodajRok.value)) {\n\tparWalidacjaDodanegoFilmu.innerHTML = \"Podany film znajduje się już w bazie.\";\n\tczyOk = false;\n }\n return czyOk;\n}", "function verRepeticion(cadena) {\n cargarCadenaMovimientos(cadena);\n // Muestro el primer movimiento de la partida\n crearEventosMovRepeticion();\n cargarTablero(1);\n estilosMovActualRep(0);\n}", "function CaricaDati() {\n\n\t// Vengono caricate tutte le piazzole\n\turl = \"api/?method=piazzole&format=json\";\n\t$.getJSON(url, function(data) {\n\t\t\n\t\t// Questo contatore serve per allineare a destra ed a sinistra le piazzole\n\t\t// man mano che vengono caricate. NON usare il numero di piazzola: se non \n\t\t// ci fossero tutte, si creerebbe un disallinemaneto nell'impaginazione. \n\t\tvar piazzolaVideo = 1;\n\t\t$.each(data.data, function(key, val) {\n\t\t\tvar PiazzolaCorrente = val.Piazzola;\n\t\t\tvar PiazzolaPrecedente = sessionStorage.PiazzolaPrecedente;\n\t\t\t\n\t\t\tvar idPiazzola = \"Piazzola\" + PiazzolaCorrente;\n\t\t\t\n\t\t\t// Al cambio del numero piazzola (o al primo ingresso nella funzione)\n\t\t\t// viene stampata la tabella senza righe. Verranno aggiunte successivamente.\n\t\t\tif (PiazzolaPrecedente != PiazzolaCorrente) {\n\t\t\t\tsessionStorage.PiazzolaPrecedente = PiazzolaCorrente;\n\t\t\t\tvar allineamento = (piazzolaVideo++ % 2 == 1 ? \"dispari\" : \"pari\");\n\t\t\t\tvar table = \"<table class='tbpiazzola \" + allineamento + \"' id='\" + idPiazzola + \"''><thead><tr><td>Piazzola \" + PiazzolaCorrente + \"</td></tr></thead><tbody></tbody></table>\";\n\t\t\n\t\t\t\t$('#boxInterno').append( table);\n\t\t\t}\n\t\t\t\n\t\t\t// Aggiunta righe\n\t\t\t$('#' + idPiazzola).append('<tr><td>' + toTitleCase(val.Cognome) + ' ' + toTitleCase(val.Nome) + '</td></tr>');\n\t\t\t\t\n\t\t\t\n\t\t});\n\t\n\t});\n\n}", "function afficherVedette(film, filmDiv) {\n const section = document.createElement('section');\n\n const Vedette = film['vedette']; //Emmagasiner la valeur de la propriété JSON 'Vedette' dans la varaible tableau heroes \n // Récupérer les éléments du tableau Vedette pour remplir notre page html\n for (var i = 0; i < Vedette.length; i++) {\n const myArticle = document.createElement('article');// Pour chaque vedette, créer un article ('article'), une entête h2 ('h2'), 1 paragraphe ('p')\n const myH2 = document.createElement('h2');\n const myPara1 = document.createElement('p');\n\n myH2.textContent = Vedette[i].Nom; // Utiliser la valeur de la propriété JSON 'Nom' retourné par le serveur pour initialiser le texte de notre entête h2\n myPara1.textContent = 'Personnage: ' + Vedette[i].personnage + '\\n age: ' + Vedette[i].age; // Utiliser la valeur de la propriété JSON 'Personnage' retourné par le serveur pour initialiser le paragraphe\n\n // Assigner(associer) l'entête myH2 et le paragraphes myPara1 à l'article myArticle\n myArticle.appendChild(myH2);\n myArticle.appendChild(myPara1);\n\n filmDiv.appendChild(myArticle); // Associer notre article a notre section de la page HTML\n }\n}", "function ricercaTitolo(){\r\n // creo variabile dove salvo valore input ricerca titolo\r\n // per query in data nella chiamata Ajax\r\n var valoreInput = $(\".input-film\").val();\r\n console.log(\"Ricerca:\" + valoreInput);\r\n\r\n // funzione chiamata ajax per film\r\n chiamataAjax(linkFilm, apiKeyMio, valoreInput, \"film\");\r\n\r\n // funzione chiamata ajax per serie tv\r\n chiamataAjax(linkTv, apiKeyMio, valoreInput, \"tv\");\r\n\r\n // cancello tutti i risultati in pagina\r\n $(\".container-film\").html('');\r\n }", "async function liste() {\n const bilan = await Present.findAll({\n where: {\n Classe: \"lp-fi\"\n }\n });\n //console.log(date);\n //var nom;\n const abs = await Absent.findAll({\n where: {\n Classe: \"lp-fi\"\n }\n });\n\n const exampleEmbed = new MessageEmbed()\n .setColor('#4C1B1B')\n .setTitle(\"La liste des appels d'aujourd'hui \")\n .setTimestamp(message.createdAt)\n /*bilan.forEach((eleve) => {\n console.log(eleve.NomEleve);\n nom = eleve.NomEleve;\n exampleEmbed.addField(\n `${eleve.filter(el => el === eleve.toLowerCase()).map(elv => elv.NomEleve).join(', ')}`\n )\n });*/\n exampleEmbed.addField(\n `voici la liste des élèves présent :`,\n `${bilan.map(elv => elv.NomEleve).join(', \\n')}`\n );\n\n exampleEmbed.addField(\n `voici la liste des élèves absent :`,\n `${abs.map(elv => elv.NomEleve).join(', \\n')}`\n );\n message.channel.send(exampleEmbed)\n }", "function ricerca() {\r\n // recupero il testo inserito dall'utente\r\n var testo_utente = $('#testo-ricerca').val().trim();\r\n\r\n // controllo che l'utente abbia digitato qualcosa\r\n if(testo_utente.length > 1) {\r\n reset_risultati();\r\n // faccio partire la chiamata ajax\r\n $.ajax({\r\n 'url': 'https://api.themoviedb.org/3/search/movie',\r\n 'method': 'GET',\r\n 'data': {\r\n 'api_key': 'c4a5d0f9204fe8ed8998978f4fb5f4c2',\r\n 'query': testo_utente,\r\n 'language': 'it'\r\n },\r\n 'success': function(risposta) {\r\n // inserisco il testo cercato dall'utente nel titolo della pagina\r\n $('#ricerca-utente').text(testo_utente);\r\n // visualizzo il titolo della pagina\r\n $('.titolo-ricerca').addClass('visible');\r\n\r\n // recupero i risultati della ricerca\r\n var risultati = risposta.results;\r\n // ciclo su tutti i risultati\r\n for (var i = 0; i < risultati.length; i++) {\r\n // recupero il risultato corrente\r\n var risultato_corrente = risultati[i];\r\n disegna_card(risultato_corrente);\r\n }\r\n },\r\n 'error': function() {\r\n console.log('errore');\r\n }\r\n });\r\n } else {\r\n // l'utente ha digitato meno di 2 caratteri\r\n alert('devi digitare almeno 2 caratteri');\r\n }\r\n }", "function dibujarFresado120(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior)\n\t\n\tvar fresado8 = new RVector(pos.x+anchura1+anchura2,pos.y)\n\t\n\tvar fresado9 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado16 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado9, fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\n\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){ \n\t\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){ \n\t\tvar fresado23 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado22 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\treturn op_fresado;\n}", "function dibujarFresado118(modelo,di,pos,document){\n\t\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4, pliegueInf5]\n\tEAction.handleUserMessage(\"ha entrado 11111111111111111 \");\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (n=0;n<5;n=n+1){ \n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria \n\t\n\t\n\tvar fresado11 = new RVector(pos.x-anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x-anchura1-anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x-anchura1-anchura2-anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior) //nuevo\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x-anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x-anchura1-anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x-anchura1-anchura2-anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca) //muevo\n\t\n\tvar fresado23 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\t\n\t\n\tif (anchura5>pliegueInf5){ \n\t\tvar fresado14b = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5-alaInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado14b , fresado23 ));\n\t\top_fresado.addObject(line,false);\n\n\t}else{\n\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado23 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\tEAction.handleUserMessage(\"ha entrado 44444444444444444444444444 \");\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x-anchura1+pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n\t}\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){ \n\t\tvar fresado4 = new RVector(pos.x-anchura1-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x-anchura1-anchura2+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){ \n\t\tvar fresado6 = new RVector(pos.x-anchura1-anchura2-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>(pliegueInf4*2)){ \n\t\tvar fresado8 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\n\t//anchura4 - Inferior\n\tif (anchura5>pliegueInf5){ \n\t\tvar fresado10 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueInf5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar fresado11 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\t\n\t\n\t\n\n\tEAction.handleUserMessage(\"ha entrado 555555555555555555555555555555555555555555555555 \");\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){ \n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x-anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x-anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x-anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){ \n\t\tvar fresado31 = new RVector(pos.x-anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado29 = new RVector(pos.x-anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x-anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior*2){ \n\t\tvar fresado43 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado41 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado45 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado46 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado45 , fresado46 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura5 - Superior\n\tif (anchura5>pliegueSuperior){ \n\t\tvar fresado49 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado50 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado49 , fresado50 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado47 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado48 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado47 , fresado48 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\treturn op_fresado;\n\t\n\t\n\t\n\t\n\t\n}", "function dibujarFresado127(modelo,di,pos,document){\n\t\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t//Puntos trayectoria \n\t\n\t\n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchuraPlaca,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchuraPlaca+pliegueDer,pos.y+alaInferior)\n\t\n\tvar fresado5 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchuraPlaca,pos.y+alaInferior+alturaPlaca)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchuraPlaca+pliegueDer,pos.y+alaInferior+alturaPlaca)\n\t\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\n\n\t\n\n\treturn op_fresado; \n\n}", "function dibujarFresado126(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t//Puntos trayectoria \n\t\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchuraPlaca,pos.y+alaInferior)\n\t\n\tvar fresado4 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+alturaPlaca)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchuraPlaca,pos.y+alaInferior+alturaPlaca)\n\t\n\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\n\treturn op_fresado; \n\n\t\n}", "function dibujarFresado117(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tEAction.handleUserMessage(\"ha entrado 11111111111111111 \");\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\t\n\t//Puntos trayectoria \n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n var line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\top_fresado.addObject(line,false);\n\n\t\n\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x+alaIzquierda,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n var line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n }\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3)){\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t\n\t\n\t\n\t\n\t\n\t//Puntos extra para esta pieza\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueDer)\n var line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\top_fresado.addObject(line,false);\n\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior+pliegueDer)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n var line = new RLineEntity(document, new RLineData( fresado9 , fresado10 ));\n\top_fresado.addObject(line,false);\n\t\n\n var line = new RLineEntity(document, new RLineData( fresado21 , fresado10 ));\n\top_fresado.addObject(line,false);\n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado20 , fresado11 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado2 , fresado25 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\n\treturn op_fresado; \n}", "function dibujarFresado115(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (n=1 ; n<4 ; n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]) {\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado20 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1) {\n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)) {\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)) {\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4) {\n\t\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)) {\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) { //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)) {\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2) {\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior) {\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado25 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function render_critique(){\n //create dictionary of [sent time of critique] -> text of critique\n var critiques = [];\n practice_session.child('critiques').on('value', function(snapshot){\n if(snapshot.val()){\n for(var critique_key in snapshot.val()){\n\n var critique = snapshot.val()[critique_key];\n \n critiques[critique.sent] = critique.text;\n\n //musician needs a local copy of all the critiques\n if(if_musician)\n add_critique_item(critique.sent, critique.duration, critique.text, critique.type);\n }\n\n //draw timeline\n if (if_musician){\n timeline.setItems(critiqueItems);\n timeline.setOptions({\n end: zeroTime.getTime()+recordDuration,\n zoomMax: recordDuration\n });\n }\n }\n });\n \n //show things\n $(\"#critiques_wrapper\").css({\n \"left\": \"400px\"\n });\n $(\"#critiques_wrapper\").removeClass(\"hidden\");\n }", "function desclickear(e){\n movible = false;\n figura = null;\n}", "function dibujarFresado123(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior) \n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior)\n\t\n\tvar fresado4 = new RVector(pos.x+alaIzquierda,pos.y) \n\t\n\t\n\t\n\t\n\t\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y) \n\t\n\t\n\t\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado12 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\n\n\n\t\n\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){ \n\t\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){ \t\t\n\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\n\n\treturn op_fresado; \n\n}", "function dibujarFresado116(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tanchura4=0\n\tanchura5=0\n\t\n\t//Puntos trayectoria \n\t\t\t//Son los mismos puntos que la figura 001 (el unico que cambia es fresado6 y fresado14)\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior) \n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\tvar fresado6 = new RVector(pos.x+alaIzquierda,pos.y) //punto fresado abajo a la izquierda\n\t\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior)\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado14 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior+alturaPlaca)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado7 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){\n\t\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){\n\t\t\n\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura3\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura4\n\tif (anchura4>pliegueSuperior){\n\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function dibujarFresado111(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4, pliegueInf5]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0 ; n<5 ; n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\t\n\t//Puntos trayectoria \n\n\t\n\tvar fresado11 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior) //nuevo\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca) //muevo\n\t\n\tvar fresado23 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\t\n\t\n\tif (anchura5>pliegueInf5){\n\t\tvar fresado14b = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5-alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado14b , fresado23 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }else{\n var line = new RLineEntity(document, new RLineData( fresado15 , fresado23 ));\n\t op_fresado.addObject(line,false);\n }\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado22 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n var line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n } \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){\n\t\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n } \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>(pliegueInf4*2)){\n\t\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n var line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t op_fresado.addObject(line,false);\n\t\t\n } \n\t\n\t//anchura4 - Inferior\n\tif (anchura5>pliegueInf5){\n\t\tvar fresado10 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueInf5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar fresado11 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n var line = new RLineEntity(document, new RLineData( fresado10 , fresado11 ));\n\t op_fresado.addObject(line,false);\n\t\t\n } \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado29 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior*2){\n\t\tvar fresado43 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado41 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado45 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado46 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado45 , fresado46 ));\n\t op_fresado.addObject(line,false);\n }\n }\n\t\n\t//anchura5 - Superior\n\tif (anchura5>pliegueSuperior){\n\t\tvar fresado49 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado50 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado49 , fresado50 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado47 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado48 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado47 , fresado48 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t\n\treturn op_fresado;\n}", "function estado() {\n\tmostrarDuracion(medio.currentTime,duracion_avance)\n\tif( !medio.ended ) {\t\t\n\t\tvar total = parseInt( medio.currentTime*maximo/medio.duration )\n\t\tprogreso.style.width = total + \"px\"\n\t} else {\n\t\ttotal = parseInt( medio.currentTime*maximo/medio.duration )\n\t\tprogreso.style.width = total + \"px\"\n\t\treproducir.innerHTML = \"Reproducir\"\n\t\twindow.clearInterval(bucle)\n\t}\t\n}", "function dibujarFresado124(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+anchura1)\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+alaDerecha,pos.y+alaInferior)\n\t\n\tvar fresado5 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\t\n\t\n\t\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado12 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){ \n\t\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){ \t\n\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\n\treturn op_fresado; \n\n}", "function dibujarFresado138(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\n\t\n\t//Puntos fresado\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInferior,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInferior,pos.y+alaInferior)\n\t//var fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInferior,pos.y+alaInferior)\n\t//var fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInferior,pos.y+alaInferior)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\t//var fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado16 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t//var fresado17 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\t\n\tvar fresado19\n\tif (anchura1>alaSuperior){ \n\t\tfresado19 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+alaSuperior)\n\t}else{ \n\t\tfresado19 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+anchura1)\n\t}\n\t\n\t\n\tvar fresado20\n\tif (anchura3>alaSuperior){ \n\t\tfresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca+alaSuperior)\n\t}else{ \n\t\tfresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca+anchura3)\n\t}\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\t/*var line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\t\top_fresado.addObject(line,false);*/\n\t\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado14 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado19 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\t/*var line = new RLineEntity(document, new RLineData( fresado12 , fresado17 ));\n\t\top_fresado.addObject(line,false);*/\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\n\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueInferior){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t//anchura2 \n\tif (anchura2>pliegueInferior*2){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\t\top_fresado.addObject(line,false);\n\n\t\t}\n\t}\n\t\n\t\n\t\n\t//anchura3 \n\tif (anchura3>pliegueInferior*2){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\t\n\t\t\t//var fresado29 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInferior+margenFresado,pos.y)\n\t\t\t//var fresado30 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\t//dibujarFresado_auxiliar(doc,fresado29,fresado30)\n\t\t}\n\t}\n\t\n\treturn op_fresado\n}", "function muestraReloj()\n{\n// Compruebo si se puede ejecutar el script en el navegador del usuario\nif (!document.layers && !document.all && !document.getElementById) return;\n// Obtengo la hora actual y la divido en sus partes\nvar num = new Array (\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\");\nvar fechacompleta = new Date();\nvar horas = fechacompleta.getHours();\nvar minutos = fechacompleta.getMinutes();\nvar segundos = fechacompleta.getSeconds();\n\nvar day = fechacompleta.getDate();\nvar mes = fechacompleta.getMonth(); \nvar year = fechacompleta.getFullYear();\n\n// Pongo el dia, minutos y segundos con dos digitos\nif (day <= 9) day = \"0\" + day;\nif (horas <= 9) horas = \"0\" + horas;\nif (minutos <= 9) minutos = \"0\" + minutos;\nif (segundos <= 9) segundos = \"0\" + segundos;\n// En la variable 'cadenareloj' puedes cambiar los colores y el tipo de fuente\n//cadenareloj = \"<font size='-1' face='verdana'>\" + horas + \":\" + minutos + \":\" + segundos + \" \" + mt + \"</font>\";\ncadenareloj = \"<i class='fa fa-calendar'></i> \" + day + \"-\" + num[mes] + \"-\" + year + \" \" + horas + \":\" + minutos + \":\" + segundos;\n\n// Escribo el reloj de una manera u otra, segun el navegador del usuario\nif (document.layers) {\n document.layers.spanreloj.document.write(cadenareloj);\n document.layers.spanreloj.document.close();\n}\nelse if (document.all) spanreloj.innerHTML = cadenareloj;\nelse if (document.getElementById) document.getElementById(\"spanreloj\").innerHTML = cadenareloj;\n// Ejecuto la funcion con un intervalo de un segundo\nsetTimeout(\"muestraReloj()\", 1000);\n}", "function retourDeMonClic(idClique)\r\n {\r\n \r\n // console.log(idClique)+\" = clic\";\r\n // ex: e1, c1 ...\r\n\r\n // Affiche et garde la première lettre (position 0)\r\n let premiereLettreDeId = idClique.charAt(0); // ex: e\r\n\r\n\r\n// *********** Objectif retirer la première lettre pour avoir le numéro de l'id \r\n \r\n // Remplacer c ou e par rien\r\n let numeroId = idClique.replace(premiereLettreDeId, \"\");\r\n\r\n\r\n // On / off \r\n // (si = e + int et première lettre égal à e)\r\n\r\n if(idClique== (premiereLettreDeId + numeroId) && (premiereLettreDeId == \"e\")){\r\n\r\n x = document.getElementById(idClique).parentNode.nodeName;\r\n // console.log(x +\" lien parent\") // DIV\r\n\r\n let PointageCibleOn=document.getElementById(\"tache\"+numeroId);\r\n // console.log(numeroId + \" : id cliqué !\");\r\n\r\n let cibleIcon=document.getElementById(\"ico\"+numeroId);\r\n\r\n // Ajout du fond vert \"tache\"+numeroId\r\n PointageCibleOn.style.backgroundColor=\"rgba(232, 255, 117, 1)\";\r\n\r\n\r\n // ajout de class pour le design css\r\n\r\n cibleIcon.setAttribute(\"class\",\"far fa-check-circle\");\r\n\r\n// *********** Chercher le key de maListeDesTaches qui contient comme id: x le id cliqué \r\n \r\n for (let a = 0; a < maListeDesTaches.length; a++) {\r\n const element = maListeDesTaches[a];\r\n // console.log(element);\r\n\r\n// *********** Etat à true (pour mémoriser la couleur et ico validé)\r\n\r\n if (maListeDesTaches[a].id==numeroId) {\r\n // alert(\"L'array \"+a+\" à la valeur\"+maListeDesTaches[a].tache);\r\n maListeDesTaches[a].etat=true;\r\n console.log(maListeDesTaches)\r\n\r\n // ****** storage à sauver (mis à jour)\r\n localStorage.setItem(\"donnesSauvegardees\", JSON.stringify(maListeDesTaches));\r\n\r\n // break fonctionne également\r\n return;\r\n }\r\n }\r\n\r\n }\r\n\r\n// *********** Supprimer le Div cliqué\r\n\r\n if(idClique== (premiereLettreDeId + numeroId) && (premiereLettreDeId == \"c\")){\r\n\r\n function supprimerDiv() {\r\n \r\n // pointer le div tache et son numéro\r\n let myobj = document.getElementById(\"tache\"+numeroId);\r\n console.log(numeroId + \" Numéro Id cliqué\")\r\n\r\n // supprime la cible\r\n myobj.remove();\r\n\r\n\r\n// *********** supprimer la clef de id cliqué de l'objet ******************************************************************************\r\n \r\n // Supprimer de mon tableau id correspondant 1 = le nombre entrée(s) à supprimer\r\n maListeDesTaches.splice(numeroId, 1);\r\n\r\n // ****** storage à sauver (mis à jour)\r\n localStorage.setItem(\"donnesSauvegardees\", JSON.stringify(maListeDesTaches));\r\n }\r\n\r\n // Appel fonction\r\n supprimerDiv();\r\n\r\n\r\n } // fin condition if\r\n } // fin retourDeMonClic", "function ControlloDataInserita(datadafiltrare,campo,dt,colore,sfondo) {\r\n\r\nvar gg; //variabile per i giorni\r\nvar mm; // variabile per i mesi\r\nvar yy; // variabile per l'anno\r\nvar dateNow = new Date(); // assegna la data corrente (presa dal pc locale)\r\nvar yearNow = dateNow.getFullYear(); //assegna l'anno corente\r\nvar indice=0; // variabile di servizio\r\n\r\nvar nrgiorni = new Array();\r\n\tnrgiorni[0]=29; // febbraio bisestile\r\n\tnrgiorni[1]=31; // gennaio\r\n\tnrgiorni[2]=28; // febbraio\r\n\tnrgiorni[3]=31; // marzo\r\n\tnrgiorni[4]=30;\t// aprile\r\n\tnrgiorni[5]=31; // maggio\r\n\tnrgiorni[6]=30; // giugno\r\n\tnrgiorni[7]=31; // luglio\r\n\tnrgiorni[8]=31; // agosto\r\n\tnrgiorni[9]=30; // settembre\r\n\tnrgiorni[10]=31; // ottobre\r\n\tnrgiorni[11]=30; // novembre\r\n\tnrgiorni[12]=31; // dicembre\r\n\r\nif (datadafiltrare==null || datadafiltrare==\"\") { //se il campo è vuoto esce dalla funzione\r\n document.getElementById(campo).style.color=colore;\r\n document.getElementById(campo).style.background=\"white\";\r\n return;\r\n}\r\n\r\nswitch (datadafiltrare.length) { //analizza il formato della data e prepara le variabili gg, mm, yy\r\n case is = 6: //formato data breve\r\n gg = datadafiltrare.slice(0,2);\r\n mm = datadafiltrare.slice(2,4);\r\n yy = datadafiltrare.slice(4,6);\r\n break; \r\n \r\n case is = 8: //formato data a 8 caratteri\r\n if (datadafiltrare.indexOf(\"/\") >= 0 || datadafiltrare.indexOf(\"-\")>=0) { //con separatori\r\n gg = datadafiltrare.slice(0,2);\r\n mm = datadafiltrare.slice(3,5);\r\n yy = datadafiltrare.slice(6,8);\r\n } else { //data a 8 cifre senza separatori\r\n gg = datadafiltrare.slice(0,2);\r\n mm = datadafiltrare.slice(2,4);\r\n yy = datadafiltrare.slice(4,8);\r\n }\r\n break;\r\n \r\n case is = 10: //formato data completa\r\n gg = datadafiltrare.slice(0,2);\r\n mm = datadafiltrare.slice(3,5);\r\n yy = datadafiltrare.slice(6,10);\r\n break;\r\n\r\n default: //negli altri formati inseriti la routine genera un errore\r\n alert(\"Attenzione! La data che hai inserito e' errata. Sono validi i seguenti formati: 'ggmmaa','gg/mm/aa','ggmmaaaa' e 'gg/mm/aaaa'\");\r\n document.getElementById(campo).focus();\r\n //datadafiltrare.focus();\r\n datadafiltrare=\"\";\r\n return datadafiltrare;\r\n}\r\n\r\n//controlla che i dati di riferimento al giorno, al mese e all'anno siano dati numerici \r\nif (isNaN(gg) || isNaN(mm) || isNaN(yy)) {\r\n\talert(\"Attenzione! La data che hai inserito e' errata.\");\r\n document.getElementById(campo).focus();\r\n //datadafiltrare.focus();\r\n datadafiltrare=\"\";\r\n return datadafiltrare;\r\n}\r\n\r\n//controlla che siano stati inseriti giusti tutti gli elementi che compongono la data\r\nif (Number(gg) <= 0 || Number(mm) <= 0 || Number(mm) > 12 || Number(yy) < 0) { \r\n alert(\"Attenzione! La data che hai inserito e' errata.\");\r\n document.getElementById(campo).focus();\r\n //datadafiltrare.focus();\r\n datadafiltrare=\"\";\r\n return datadafiltrare;\r\n}\r\n\r\n//porta l'anno a quattro cifre calcolando il cambio del millennio\r\nif (Number(yy) <= (Number(yearNow)-2000)) { \r\n yy = (Number(yy)+2000); \r\n } else if (Number(yy) < 100 && Number(yy) > (Number(yearNow)-2000)){\r\n yy = (Number(yy)+1900);\r\n }\r\n\r\n//controlla che l'anno non sia maggiore o uguale a quello corrente\r\n//(dt e dn significano data tesseramento e data di nascita)\r\nif (dt==\"dn\") {\r\n if (Number(yy) >= Number(yearNow)) { \r\n alert(\"Attenzione! L'anno che hai inserito e' errato!\");\r\n document.getElementById(campo).focus;\r\n //datadafiltrare.focus();\r\n datadafiltrare=\"\";\r\n return datadafiltrare;\r\n }\r\n}\r\n// controlla che l'anno inserito non sia bisestile e assegna il valore alla variabile indice\r\nif ((Number(yy) % 4) == 0 && Number(mm)==2) {\r\n\tindice=0;\r\n} else {\r\n\tindice=Number(mm);\r\n}\r\n\r\n// controlla che l'utente non abbia inserito un numero giorni del mese errato\r\nif (Number(gg) > nrgiorni[indice]) {\t\r\n\talert(\"Attenzione! La data che hai inserito e' errata.\");\r\n document.getElementById(campo).focus();\r\n //datadafiltrare.focus();\r\n datadafiltrare=\"\";\r\n return datadafiltrare;\r\n}\r\n// ricompone e stampa la data filtrata\r\ndatadafiltrare=gg+\"/\"+mm+\"/\"+yy;\r\ndocument.getElementById(campo).value=datadafiltrare;\r\ndocument.getElementById(campo).style.color=colore;\r\ndocument.getElementById(campo).style.background=\"white\";\r\nreturn;\r\n}", "function dibujarFresado139(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t\n\t//Puntos fresado\n\tvar fresado1 = new RVector(pos.x,pos.y)\n\tvar fresado2 = new RVector(pos.x,pos.y+pliegueInferior)\n\tvar fresado3 = new RVector(pos.x-anchura3,pos.y+pliegueInferior)\n\tvar fresado4 = new RVector(pos.x-anchura3-anchura2,pos.y+pliegueInferior)\n\tvar fresado5 = new RVector(pos.x-anchura3-anchura2-anchura1,pos.y+pliegueInferior)\n\tvar fresado6 = new RVector(pos.x-anchura3-anchura2-anchura1,pos.y+pliegueInferior+alturaPlaca)\n\tvar fresado7 = new RVector(pos.x-anchura3-anchura2,pos.y+pliegueInferior+alturaPlaca)\n\tvar fresado8 = new RVector(pos.x-anchura3,pos.y+pliegueInferior+alturaPlaca)\n\tvar fresado9 = new RVector(pos.x,pos.y+pliegueInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado10 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\treturn op_fresado;\n}", "function dibujarFresado102(modelo,di,pos,document){\n\t\n\t\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t\n\t////////////////////////// Modelo F2 //////////////////////-\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4, pliegueInf5, pliegueInf6, pliegueInf7]\n\n\t//sacar el mayor pliegue\n\tvar pliegueInferior=pliegueInf1\n\tfor (var n=0; n<7;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria \n\t\n\t\n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior)\n\tvar fresado2 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado3 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado4 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado5 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior)\n\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6,pos.y+alaInferior+pliegueInferior)\n\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+anchura7,pos.y+alaInferior+pliegueInferior)\n\tvar fresado9 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueInferior)\n\tvar fresado10 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca+pliegueInferior)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+alturaPlaca+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6,pos.y+alaInferior+alturaPlaca+pliegueInferior)\n\tvar fresado16 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+anchura7,pos.y+alaInferior+alturaPlaca+pliegueInferior)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado8 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado16 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado15 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\n\tcrearFresado=1 \n\t//anchura1 - Superior\n\tif (anchura1>pliegueSuperior){\n\t\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar fresado18 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado19 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado20 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura2 - Superior\n\tif (anchura2>pliegueSuperior*2){ \n\t\tvar fresado23 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar fresado24 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado22 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado21 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\tvar fresado25 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado26 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado29 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar fresado30 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado28 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\tvar fresado31 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\t\top_fresado.addObject(line,false);\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior*2 ) {\n\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar fresado36 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif ( crearFresado==1 ) {\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado34 , fresado33 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\tvar fresado37 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado38 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura5 - Superior\n\tif ( anchura5>pliegueSuperior*2 ) {\n\t\tvar fresado41 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar fresado42 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t\n\t\tif ( crearFresado==1 ) {\n\t\t\tvar fresado40 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado39 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado40 , fresado39 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\n\t\t\tvar fresado43 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado44 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t}\n\t}\n\t\n\t\n\t//anchura6 - Superior\n\tif ( anchura6>pliegueSuperior*2 ) {\n\t\tvar fresado47 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar fresado48 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado47 , fresado48 ));\n\t\top_fresado.addObject(line,false);\n\n\t\t\n\t\tif ( crearFresado==1 ) {\n\t\t\tvar fresado46 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado45 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado46 , fresado45 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\n\t\t\tvar fresado49 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado50 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado49 , fresado50 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura7 - Superior\n\tif ( anchura7>pliegueSuperior ) {\n\t\tvar fresado53 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar fresado54 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+anchura7,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado53 , fresado54 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif ( crearFresado==1 ) {\n\t\t\tvar fresado52 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+pliegueInferior)\n\t\t\tvar fresado51 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior+pliegueInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado51 , fresado52 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif ( anchura1>(pliegueInf1) ) { \n\t\tvar fresado55 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior-pliegueInf1)\n\t\tvar fresado56 = new RVector(pos.x+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado55 , fresado56 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura2 - Inferior\n\tif ( anchura2>(pliegueInf2)*2 ) { \n\t\tvar fresado55 = new RVector(pos.x+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado56 = new RVector(pos.x+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado56 , fresado55 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura3 - Inferior\n\tif ( anchura3>(pliegueInf3)*2 ) { \n\t\tvar fresado55 = new RVector(pos.x+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado56 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado55 , fresado56 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t}\n\t\n\t//anchura4 - Inferior\n\tif ( anchura4>(pliegueInf4)*2 ) { \n\t\tvar fresado55 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado56 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado55 , fresado56 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t}\n\t\n\t//anchura5 - Inferior\n\tif ( anchura5>(pliegueInf5)*2 ) { \n\t\tvar fresado55 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueInf5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar fresado56 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5-pliegueInf5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado55 , fresado56 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura6 - Inferior\n\tif ( anchura6>(pliegueInf6)*2 ) { \n\t\tvar fresado55 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+pliegueInf6,pos.y+alaInferior+pliegueInferior-pliegueInf6)\n\t\tvar fresado56 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6-pliegueInf6,pos.y+alaInferior+pliegueInferior-pliegueInf6)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado55 , fresado56 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura7 - Inferior\n\tif ( anchura7>(pliegueInf7) ) { \n\t\tvar fresado55 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+pliegueInf7,pos.y+alaInferior+pliegueInferior-pliegueInf7)\n\t\tvar fresado56 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+anchura7,pos.y+alaInferior+pliegueInferior-pliegueInf7)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado55 , fresado56 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t\n\treturn op_fresado\n\t\n}", "function dibujarFresado110(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\tvar fresado11 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\tif (anchura4>pliegueInf4){\n\t\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4-alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }else{\n var line = new RLineEntity(document, new RLineData( fresado14 , fresado22 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t var line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado20 , fresado13 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\t op_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n }\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){\n\t\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4){\n\t\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n var line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t op_fresado.addObject(line,false);\n\t\t\n } \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado29 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior){ \n\t\tvar fresado43 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado41 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t op_fresado.addObject(line,false);\n }\n }\n\t\n\t\n\t\n\treturn op_fresado;\n}", "function dibujarFresado119(modelo,di,pos,document){\n\t\n\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t//Puntos trayectoria \n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x,pos.y)\n\tvar fresado3 = new RVector(pos.x+anchura1,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior)\n\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+alturaPlaca)\n\tvar fresado9 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado10 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado16 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado17 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado18 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado19 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado20 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado22 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado23 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado22 , fresado21 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\n\n\treturn op_fresado; \n\n}", "function renderizaMunicoes(){\n\tmunicoes.forEach(desenhaMunicao);\n\tmunicoesAndam();\n}", "function mostrarEstDocente(){ // Cuando toque el boton \"estadisticas\" voy a ver la seccion (ver estadisticas)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"block\"; // muestro visualizar estadisticas\r\n generarListaAlumnos();\r\n}", "function dibujarFresado121(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchuraPlaca,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInf2)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchuraPlaca,pos.y+alaInferior+pliegueInf2)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInf2+pliegueInf1)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchuraPlaca,pos.y+alaInferior+pliegueInf2+pliegueInf1)\n\tvar fresado7 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInf2+pliegueInf1+alturaPlaca)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchuraPlaca,pos.y+alaInferior+pliegueInf2+pliegueInf1+alturaPlaca)\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInf2+pliegueInf1+alturaPlaca+pliegueSuperior)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchuraPlaca,pos.y+alaInferior+pliegueInf2+pliegueInf1+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado10));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\t\top_fresado.addObject(line,false);\n\n\treturn op_fresado; \n\n}", "function dibujarFresado125(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior)\n\t\n\tvar fresado8 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+altura1)\n\tvar fresado9 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+altura1)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+altura1)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+altura1)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+altura2)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+altura2)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+altura2)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior+altura2)\n\t\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado10 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado12 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\n\n\n\treturn op_fresado; \n\n\t\n\t\n}", "function pedir_tiempos_conc(){\n\tdataBase.query(\"USE reactor40\", function (err, result,field) {\n\t\t\tif (err) throw err;\n\t});\n\tdataBase.query('SELECT * FROM concentracion ORDER BY ID DESC LIMIT 20;', function(err, result, fiel){\n\t\tdatosY.y_1 = result[19].time;\n\t\tdatosY.y_2 = result[18].time;\n\t\tdatosY.y_3 = result[17].time;\n\t\tdatosY.y_4 = result[16].time;\n\t\tdatosY.y_5 = result[15].time;\n\t\tdatosY.y_6 = result[14].time;\n\t\tdatosY.y_7 = result[13].time;\n\t\tdatosY.y_8 = result[12].time;\n\t\tdatosY.y_9 = result[11].time;\n\t\tdatosY.y_10 = result[10].time;\n\t\tdatosY.y_11 = result[9].time;\n\t\tdatosY.y_12 = result[8].time;\n\t\tdatosY.y_13 = result[7].time;\n\t\tdatosY.y_14 = result[6].time;\n\t\tdatosY.y_15 = result[5].time;\n\t\tdatosY.y_16 = result[4].time;\n\t\tdatosY.y_17 = result[3].time;\n\t\tdatosY.y_18 = result[2].time;\n\t\tdatosY.y_19 = result[1].time;\n\t\tdatosY.y_20 = result[0].time;\n\t});\n}", "function atkDuMonstre (monstre){\n cible();\n if (vieCible == vieGue){\n nomCible = \"au Guerrier\";\n }\n if (vieCible == viePre){\n nomCible = \"au Prêtre\";\n }\n if (vieCible == vieArc){\n nomCible = \"à l'Archer\";\n }\n if (vieCible == vieVol){\n nomCible = \"au Voleur\";\n }\n\tvieCible.value -= atkMonstre;\n\tvieCible.innerHTML = vieCible.value;\n\tdescription.innerHTML = monstre+\" inflige \"+atkMonstre+\" \"+nomCible;\n}", "function dibujarFresado101(modelo,di,pos,document){\n\t\n\t\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t////////////////////////// Modelo F1 //////////////////////\n\t//Puntos trayectoria \n\t\n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior)\n\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6,pos.y+alaInferior)\n\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+anchura7,pos.y+alaInferior)\n\tvar fresado9 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+alturaPlaca)\n\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6,pos.y+alaInferior+alturaPlaca)\n\tvar fresado16 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+anchura7,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado8 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado16 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado15 ));\n\top_fresado.addObject(line,false);\n\t\n\n\t\n\tcrearFresado=1 \n\t//anchura1\n\tif (anchura1>pliegueSuperior){\n\t\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t}\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){\n\t\tvar fresado23 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\n\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado22 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado26 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura3\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado29 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado30 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado28 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado28 , fresado27 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\n\t\t\tvar fresado31 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\t\n\t}\n}\n\t\n\t\n\t//anchura4\n\tif (anchura4>pliegueSuperior*2){\n\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado36 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\n\t\t\tvar fresado37 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado38 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t//anchura5\n\tif (anchura5>pliegueSuperior*2){\n\t\tvar fresado41 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado42 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado40 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado39 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\n\t\t\tvar fresado43 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado44 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\n\t\t}\n\t}\n\t\n\t\n\t//anchura6\n\tif (anchura6>pliegueSuperior*2){\n\t\tvar fresado47 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado48 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado47 , fresado48 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado46 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado45 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado46 , fresado45 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\n\t\t\tvar fresado49 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado50 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado49 , fresado50 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t}\n\t}\n\t\n\t//anchura7\n\tif (anchura7>pliegueSuperior){\n\t\tvar fresado53 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado54 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+anchura7,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado53 , fresado54 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado52 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado51 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5+anchura6+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\t\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado51 , fresado52 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\n\t\t}\n\t}\n\n\n\treturn op_fresado;\n}", "function jeu()\n{\n if(nom==nomP1) //Jeu Joueur 1\n {\n //----------------------------Verification Saisie P1------------------------------------------- \n idInputSaisie.max=idInputMax.value;\n \n if (idInputSaisie.value.length==0 || !idInputSaisie.checkValidity())\n {\n alert(\"Entrez un nombre plus petit que \"+ idInputMax.value);\n idInputSaisie.value=\"\";\n }\n\n\n else\n {\n tableau1[tour]=idInputSaisie.value;\n\n //---------------------------En cas de Victoire P1--------------------------------------------\n\n if(idInputSaisie.value==hasard)\n {\n audio=document.getElementById(\"victoire\");\n audio.play();\n\n let dateFin= new Date();\n let minutes = dateFin.getMinutes()-dateDebut.getMinutes();\n\n\n document.querySelectorAll(\"#ligneNombre1 td\")[tour].textContent = tableau1[tour];\n document.querySelectorAll(\"#ligneNombre1 td\")[tour].style.color = \"green\";\n\n for(let i=0;i<=tour;i++){document.querySelectorAll(\"#ligneNombre2 td\")[i].style.color = \"black\";}\n\n document.querySelector(\"#plusMoins img\").src = 'img/gagne.png';\n\n document.getElementById(\"divClavier\").style.display=\"none\";\n document.getElementById(\"resultat\").style.display=\"flex\";\n document.querySelector(\"#resultat p\").innerHTML =\n `Félicitations <strong>${nom}</strong>, le nombre était bien\n <strong>${hasard}</strong>.\n <br>\n Tu as gagné en <strong>${tour+1}</strong> tour(s)\n et en <strong>${minutes}</strong> minutes.`;\n\n\n\n }\n //--------------------------Gestions des essais/erreurs-----------------------------------\n else \n {\n audio=document.getElementById(\"error\");\n audio.play();\n\n\n let diff = Math.abs(idInputSaisie.value - hasard);\n\n if (idInputSaisie.value < hasard) \n {\n\n if (diff > 9)\n {\n document.querySelector(\"#plusMoins img\").src = 'img/plus.png';\n document.querySelectorAll(\"#lignePlusMoins1 .imgPlusMoins\")[tour].src=\"img/plusplus.png\";\n }\n\n else\n {\n document.querySelector(\"#plusMoins img\").src = 'img/petitplus.png';\n document.querySelectorAll(\"#lignePlusMoins1 .imgPlusMoins\")[tour].src='img/2pplus.png';\n }\n } \n\n else if (idInputSaisie.value > hasard) \n {\n if (diff > 9)\n { document.querySelector(\"#plusMoins img\").src = 'img/moins.png';\n document.querySelectorAll(\"#lignePlusMoins1 .imgPlusMoins\")[tour].src='img/moinsmoins.png';\n }\n\n else\n {\n document.querySelector(\"#plusMoins img\").src = 'img/petitmoins.png';\n document.querySelectorAll(\"#lignePlusMoins1 .imgPlusMoins\")[tour].src='img/2pmoins.png';\n }\n\n }\n\n \n document.querySelectorAll(\"#ligneNombre1 .nombreJoueur\")[tour].style.background=\"url('img/casebarre.png') center /100% 100%\";\n document.querySelectorAll(\"#ligneNombre1 td\")[tour].textContent = tableau1[tour];\n\n //---------------------------------------Préparation tour joueur suivant---------------------------------------\n nom=nomP2;\n \n document.getElementById(\"divClavier\").style.display=\"none\";\n document.getElementById(\"divNextPlayer\").style.display=\"flex\";\n\n }\n }\n }\n\n else\n {\n //----------------------------Verification Saisie P2------------------------------------------- \n idInputSaisie.max=idInputMax.value;\n \n if (idInputSaisie.value.length==0 || !idInputSaisie.checkValidity())\n {\n alert(\"Entrez un nombre plus petit que \"+ idInputMax.value);\n idInputSaisie.value=\"\";\n }\n\n\n else\n {\n tableau2[tour]=idInputSaisie.value;\n\n //---------------------------En cas de Victoire P2--------------------------------------------\n\n if(idInputSaisie.value==hasard)\n {\n audio=document.getElementById(\"victoire\");\n audio.play();\n\n let dateFin= new Date();\n let minutes = dateFin.getMinutes()-dateDebut.getMinutes();\n\n document.querySelectorAll(\"#ligneNombre2 td\")[tour].textContent = tableau2[tour];\n document.querySelectorAll(\"#ligneNombre2 td\")[tour].style.color = \"green\";\n\n for(let i=0;i<=tour;i++){document.querySelectorAll(\"#ligneNombre1 td\")[i].style.color = \"black\";}\n\n document.querySelector(\"#plusMoins img\").src = 'img/gagne.png';\n\n document.getElementById(\"divClavier\").style.display=\"none\";\n document.getElementById(\"resultat\").style.display=\"flex\";\n document.querySelector(\"#resultat p\").innerHTML =\n `Félicitations <strong>${nom}</strong>, le nombre était bien\n <strong>${hasard}</strong>.\n <br>\n Tu as gagné en <strong>${tour+1}</strong> tour(s)\n et en <strong>${minutes}</strong> minutes.`;\n\n\n }\n //--------------------------Gestions des essais/erreurs-----------------------------------\n else \n {\n audio=document.getElementById(\"error\");\n audio.play();\n\n\n let diff = Math.abs(idInputSaisie.value - hasard);\n\n if (idInputSaisie.value < hasard) \n {\n\n if (diff > 9)\n {\n document.querySelector(\"#plusMoins img\").src = 'img/plus.png';\n document.querySelectorAll(\"#lignePlusMoins2 .imgPlusMoins\")[tour].src='img/plusplus.png';\n }\n\n else\n {\n document.querySelector(\"#plusMoins img\").src = 'img/petitplus.png';\n document.querySelectorAll(\"#lignePlusMoins2 .imgPlusMoins\")[tour].src='img/2pplus.png';\n }\n } \n\n else if (idInputSaisie.value > hasard) \n {\n if (diff > 9)\n { document.querySelector(\"#plusMoins img\").src = 'img/moins.png';\n document.querySelectorAll(\"#lignePlusMoins2 .imgPlusMoins\")[tour].src='img/moinsmoins.png';\n }\n\n else\n {\n document.querySelector(\"#plusMoins img\").src = 'img/petitmoins.png';\n document.querySelectorAll(\"#lignePlusMoins2 .imgPlusMoins\")[tour].src='img/2pmoins.png';\n }\n\n }\n\n \n document.querySelectorAll(\"#ligneNombre2 .nombreJoueur\")[tour].style.background=\"url('img/casebarre.png') center /100% 100%\";\n document.querySelectorAll(\"#ligneNombre2 td\")[tour].textContent = tableau2[tour];\n\n //---------------------------------------Préparation tour joueur suivant---------------------------------------\n nom=nomP1;\n \n document.getElementById(\"divClavier\").style.display=\"none\";\n document.getElementById(\"divNextPlayer\").style.display=\"flex\";\n\n }\n }\n }\n\n}", "function MostrarVehiculos(vehiculos) {\n\n const fragmen = document.createDocumentFragment()\n const contenedorVehiculoEncontrado = document.getElementById('contenedorVehiculoEncontrado')\n vehiculos.forEach((vehiculo) => {\n\n const contenedorVehiculoEncontrado = document.getElementById('contenedorVehiculoEncontrado')\n let { placa, tipo, propietario, } = vehiculo.data()\n\n if (tipo == 1) {\n tipo = 'Automovil'\n } else if (tipo == 2) {\n tipo = 'Bicicleta'\n }\n\n let fecha_ingreso = new Date(vehiculo.data()['fecha-ingreso'].seconds * 1000).toLocaleDateString()\n\n let tr = document.createElement('tr')\n tr.innerHTML = `\n <td>${vehiculo.id}</td>\n <td>${placa}</td>\n <td>${propietario.nombre}</td>\n <td>${propietario.identificacion}</td>\n <td>${tipo}</td>\n <td>${fecha_ingreso}</td>\n `\n fragmen.appendChild(tr)\n })\n\n contenedorVehiculoEncontrado.innerHTML = `\n <article class=\"message\">\n <div class=\"message-header\">\n <p>Vehiculos Parqueados respecto a su busqueda</p>\n </div>\n <div class=\"message-body\">\n <div class=\"table-container\">\n <table class=\"table is-bordered is-striped is-fullwidth\">\n <thead>\n <tr>\n <td>ID</td>\n <td>Placa</td>\n <td>Nom.propietario</td>\n <td>C.C propietario</td>\n <td>Tipo</td>\n <td>Fecha ingreso</td>\n </tr>\n </thead>\n <tbody id='tabla_body'>\n </tbody>\n </table>\n </div>\n </div>\n </article >\n `\n\n document.getElementById('tabla_body').appendChild(fragmen)\n\n\n\n}", "function dibujarFresado109(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t} \n\t\n\t\n\t//Puntos trayectoria \n \n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+pliegueIzq)\n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado15 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado22 , fresado17 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado16 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\tvar fresado10 = new RVector(pos.x+alaIzquierda,pos.y+pliegueInferior+alaInferior-pliegueIzq) \n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado2 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado1 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\n\t} \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4){\n\t\tvar fresado8 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t\n\t\n\n\t\n\t\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){ \n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t \n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior){\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t\n\treturn op_fresado;\n}", "function rechner () { \r\n\tvar datum = new Date();\r\n\tvar tag = zweiStellen(datum.getDate());\r\n\tvar monat = zweiStellen(datum.getMonth() + 1);\r\n\tvar jahr = datum.getFullYear();\t\r\n\tvar aktuell = tag + \".\" + monat + \".\" + jahr;\r\n \tvar datumEntwurf = new Date(2015,2,18);\r\n\tvar tagEnt = zweiStellen(datumEntwurf.getDate());\r\n\tvar monatEnt = zweiStellen(datumEntwurf.getMonth() + 1);\r\n\tvar jahrEnt = datumEntwurf.getFullYear();\r\n\tvar entwurf = tagEnt + \".\" + monatEnt + \".\" + jahrEnt;\r\n\tvar diff = parseInt((datumEntwurf - datum) / 1000);\r\n\tvar days = parseInt(diff / (60 * 60 * 24));\t\t\r\n\t\tdiff -= (days * 60 * 60 * 24);\r\n days *= -1;\r\n days = zweiStellen(days);\r\n\tvar hours = parseInt(diff / (60 * 60));\r\n\t\tdiff -= (hours * (60 * 60));\r\n hours *= -1;\r\n\tvar minutes = parseInt(diff / 60);\r\n\t\tdiff -= (minutes * 60);\r\n minutes *= -1;\r\n\tvar seconds = parseInt(diff);\r\n\t\tdiff -= (seconds);\r\n seconds *= -1;\r\n\tsetTimeout(500);\r\n\t\tdocument.getElementById(\"zeit\").innerHTML = \"<p class='heute'>\" +\"Heute ist der : </br>\" + aktuell + \"</br>\" + \"</p>\" + \"<p class='zaehler'>\"\r\n\t\t+\"Die Site wurde am \" + \"</br>\" + tagEnt + \".\" + monatEnt + \".\" + jahrEnt + \"</br>\" + \" erstellt </br>\" + \"das ist jetzt genau </br>\"\r\n\t\t+ days + \" Tage</br>\" + hours + \" Stunden</br>\" + minutes + \" Minuten</br>\" + seconds + \" Sekunden\" + \"</p>\";\r\n\t}", "function renderDataPrestamos(data){\n\n var databodyPre = document.querySelector('#databody-prestamos-pendientes');\n databodyPre.innerHTML = '';\n\n\n if (data[0].cedula == 'false') {\n \n databodyPre.innerHTML = data[0].mensaje;\n \n \n }else{\n\n data.forEach(item => { \n\n switch (item.estado) {\n \n case \"pendiente\":\n \n databodyPre.innerHTML += `<tr>\n <td data-titulo=\"ID Prestamo:\">${item.id_prestamo}</td data-titulo=\"Numero:\">\n <td data-titulo=\"Nombre:\">${item.nombre}</td data-titulo=\"Numero:\">\n <td data-titulo=\"Fecha Creacion:\">${item.fecha_creacion}</td data-titulo=\"Numero:\">\n <td data-titulo=\"Monto:\">¢${item.monto}</td data-titulo=\"Numero:\">\n <td data-titulo=\"Estado:\">${item.estado}</td data-titulo=\"Numero:\">\n <td>\n <a class=\"btnVer show\" id=\"btnVerItem_pre_${item.id_prestamo}\" href=\"#\" onclick=\"verPrestamo(${item.id_prestamo})\">Ver</a>\n </td>\n </tr>\n <tr>\n <div class=\"planilla-container hide\" id=\"info_pre_${item.id_prestamo}\" value=\"${item.id_prestamo}\"></div>\n </tr>\n `;\n \n \n break;\n \n default:\n databodyPre.innerHTML += `<tr>\n <td data-titulo=\"ID Prestamo:\">${item.id_prestamo}</td>\n <td data-titulo=\"Nombre:\">${item.nombre}</td>\n <td data-titulo=\"Fecha Creacion:\">${item.fecha_creacion}</td>\n <td data-titulo=\"Monto:\">¢${item.monto}</td>\n <td data-titulo=\"Estado:\">${item.estado}</td>\n <td>\n <a class=\"btnVer show\" id=\"btnVerItem_pre_${item.id_prestamo}\" href=\"#\" onclick=\"verPrestamo(${item.id_prestamo})\">Ver</a>\n </td> \n </tr>\n <div class=\"planilla-container hide\" id=\"info_pre_${item.id_prestamo}\" value=\"${item.id_prestamo}\"></div>\n `;\n \n break;\n }\n });\n\n\n } \n\n\n\n \n }", "function dibujarFresado113(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t//Puntos trayectoria\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado22 , fresado17 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado16 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)) {\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif (crearFresado==1) { //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)) {\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2) {\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior) {\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function IndicadorRangoEdad () {}", "function dibujarFresado107(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t//Puntos trayectoria \n\t\t\t//Son los mismos puntos que la figura 001 (el unico que cambia es fresado6 y fresado14)\n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior) \n\tvar fresado2 = new RVector(pos.x+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\t\n\t\n\t\n\t\n\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y) //punto fresado abajo a la izquierda [hay que corregirlo]\n\t\n\t\n\t\n\t\n\tvar fresado9 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\n\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado5 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado3 , fresado11 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){\n\t\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado19 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t op_fresado.addObject(line,false);\n }\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){\t\t\n\t\tvar fresado23 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado22 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado26 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t\n\t//anchura3\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado29 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado30 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\n\t\tif (crearFresado==1){\n\t\t\tvar fresado28 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado28 , fresado27 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado31 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t\n\t//anchura4\n\tif (anchura4>pliegueSuperior*2){\n\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado14 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n\t}\n\t\n\t\n\t\n\treturn op_fresado;\n\n}", "function dibujarFresado137(modelo,di,pos,document){\n\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\n\t//Puntos fresado\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInferior,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInferior,pos.y+alaInferior)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInferior,pos.y+alaInferior)\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInferior,pos.y+alaInferior)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado16 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado17 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\n\tvar fresado19\n\tif (anchura1>alaSuperior){ \n\t\tfresado19 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+alaSuperior)\n\t}else{ \n\t\tfresado19 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+anchura1)\n\t}\n\t\n\t\n\tvar fresado20\n\tif (anchura4>alaSuperior){\n\t\tfresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+alaSuperior)\n\t}else{ \n\t\tfresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+anchura4)\n\t}\n\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado14 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado19 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado12 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\n\n\t\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueInferior){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\n\t//anchura2 \n\tif (anchura2>pliegueInferior*2){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t\n\t//anchura3 \n\tif (anchura3>pliegueInferior*2){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\n\t\t}\n\t}\n\t\n\t//anchura4 //inferior\n\tif (anchura4>pliegueInferior){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\t\top_fresado.addObject(line,false);\n\n\t\t}\n\t}\n\t\n\t\n\n\treturn op_fresado; \n\n}", "function readResult(e){\n\t piePerv = 0;\n\t for (var k in e){\n\t dataSetMun[e[k][\"municipio\"]] = e[k][\"perc\"];\n\t\tdataSetDetMun[parseInt(e[k][\"municipio\"])] = e[k][\"perc\"];\n\t\tvar ple = e[k][\"plessi\"];\n\t\tfor (var x in ple){\n\t\t\tvar sez = ple[x][\"sezioni\"];\n\t\t\tfor (var s in sez){\n\t\t\t var perv = false;\n\t\t\t if (sez[s][\"pervenuta\"] == \"SI\"){perv = true;piePerv++;}\n\n\t\t\t dataSetSez[parseInt(sez[s][\"numero\"])] = perv;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (name == 'Aff'){cambiaTitolo(statoAttuale);}else{\n\t\t\t\tvar tit = 'Scrutinio ';\n\t\t\t\tif (tipo == 0){tit += 'Camera';}\n\t\t\t\tif (tipo == 1){tit += 'Senato';}\n\t\t\t\tif (tipo == 2){tit += 'Regionali Lista';}\n\t\t\t\tif (tipo == 3){tit += 'Regionali Preferenze';}\n\t\t \tcambiaTitolo(tit);\n\t\t\t}\n\n\t\t\tremMarkerAll();\n\t\t\tif (map.getZoom() >= 14){addMarkerSez();}else{addMarkerMun();}\n\t\t\tjQuery('#nav-panel').panel('close');\n\t\t\tif (statusTimer == false){startTimer();}else{resetTimer();}\n\t\t\taddDataGraph();\n\t\t\tconsole.log(\"Dati Caricati: \",name+tipo+\"\");\n\t\t\tloadingCustom(1);\n\t\t\t\n}", "function wyswietlFilmyWszystkieIwidoczne() {\n \n // elementy HTML wyswietlaje liczbe filmow (wszystkie i widoczne)\n let starePar = document.querySelectorAll(\"p.liczba-filmow\");\n \n if (starePar.length) { \t// jesli sa juz stare paragrafy\n\t// to podmieniamy ich tresc\n\t// zmienne liczbaFilmow i liczbaWidocznych musza byc aktualne\n\t// i sa bo zawsze najpierw wywolywana jest updateFilmyWszystkieIwidoczne()\n\tstarePar[0].innerHTML = \"Liczba wszystkich filmów w bazie: \" + \n\t liczbaFilmow;\n\tstarePar[1].innerHTML = \"Liczba filmów aktualnie widocznych: \" +\n\t liczbaWidocznych;\n } else { \t\t\t// w przeciwnym wypadku tworzymy je\n\t// i dodajemy\n\tlet filmy = document.createElement(\"p\");\n\tfilmy.setAttribute(\"class\", \"liczba-filmow\");\n\tlet widoczne = document.createElement(\"p\");\n\twidoczne.setAttribute(\"class\", \"liczba-filmow\");\n\n\tfilmy.innerHTML = \"Liczba wszystkich filmów w bazie: \" +\n\t liczbaFilmow;\n\twidoczne.innerHTML = \"Liczba filmów aktualnie widocznych: \" +\n\t liczbaWidocznych;\n\t\n\t// wstawienie nowych (zupdate-owanych paragrafow) do HTML\n\toutput.prepend(filmy, widoczne);\n }\n}", "function dibujarFresado103(modelo,di,pos,document){\n\t\n\t\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t////////////////////////// Modelo F3 //////////////////////-\t\n\tvar alturas=[altura1,altura2,altura3,altura4,altura5,altura6,altura7,altura8,altura9,altura10]\n\t\n\tvar nPestanas=numeroPestanas003(alturas)\n\t\n\t\n\tvar fresado1\n\tvar fresado2\n\tvar fresado3\n\tvar fresado4\n\tvar fresado5\n\tvar fresado6\n\tvar fresado7\n\tvar fresado8\n\tvar fresado9\n\tvar fresado10\n\tvar fresado11\n\tvar fresado12\n\tvar fresado13\n\tvar fresado14\n\tvar fresado15\n\tvar fresado16\n\tvar fresado17\n\tvar fresado18\n\tvar fresado19\n\tvar fresado20\n\tvar fresado21\n\tvar fresado22\n\t\n\tvar x\n\tvar y\n\t\n\t//Puntos trayectoria\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y\n\tif (dibujoHorizontal==1) { //Dibujo horizontal\n\t\tfresado1 = new RVector(y,x)\n\t}else{ //dibujo vertical\n\t\tfresado1 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1\n\tif (dibujoHorizontal==1) {\n\t\tfresado2 = new RVector(y,x)\n\t}else{\n\t\tfresado2 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1+altura2\n\tif (dibujoHorizontal==1) {\n\t\tfresado3 = new RVector(y,x)\n\t}else{\n\t\tfresado3 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1+altura2+altura3\n\tif (dibujoHorizontal==1) {\n\t\tfresado4 = new RVector(y,x)\n\t}else{\n\t\tfresado4 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1+altura2+altura3+altura4\n\tif (dibujoHorizontal==1) {\n\t\tfresado5 = new RVector(y,x)\n\t}else{\n\t\tfresado5 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5\n\tif (dibujoHorizontal==1) {\n\t\tfresado6 = new RVector(y,x)\n\t}else{\n\t\tfresado6 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6\n\tif (dibujoHorizontal==1) {\n\t\tfresado7 = new RVector(y,x)\n\t}else{\n\t\tfresado7 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6+altura7\n\tif (dibujoHorizontal==1) {\n\t\tfresado8 = new RVector(y,x)\n\t}else{\n\t\tfresado8 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6+altura7+altura8\n\tif (dibujoHorizontal==1) {\n\t\tfresado9 = new RVector(y,x)\n\t}else{\n\t\tfresado9 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6+altura7+altura8+altura9\n\tif (dibujoHorizontal==1) {\n\t\tfresado10 = new RVector(y,x)\n\t}else{\n\t\tfresado10 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda+anchuraPlaca\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6+altura7+altura8+altura9+altura10\n\tif (dibujoHorizontal==1) {\n\t\tfresado11 = new RVector(y,x)\n\t}else{\n\t\tfresado11 = new RVector(x,y)\n\t}\n\t\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y\n\tif (dibujoHorizontal==1) {\n\t\tfresado12 = new RVector(y,x)\n\t}else{\n\t\tfresado12 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1\n\tif (dibujoHorizontal==1) {\n\t\tfresado13 = new RVector(y,x)\n\t}else{\n\t\tfresado13 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1+altura2\n\tif (dibujoHorizontal==1) {\n\t\tfresado14 = new RVector(y,x)\n\t}else{\n\t\tfresado14 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1+altura2+altura3\n\tif (dibujoHorizontal==1) {\n\t\tfresado15 = new RVector(y,x)\n\t}else{\n\t\tfresado15 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1+altura2+altura3+altura4\n\tif (dibujoHorizontal==1) {\n\t\tfresado16 = new RVector(y,x)\n\t}else{\n\t\tfresado16 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5\n\tif (dibujoHorizontal==1) {\n\t\tfresado17 = new RVector(y,x)\n\t}else{\n\t\tfresado17 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6\n\tif (dibujoHorizontal==1) {\n\t\tfresado18 = new RVector(y,x)\n\t}else{\n\t\tfresado18 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6+altura7\n\tif (dibujoHorizontal==1) {\n\t\tfresado19 = new RVector(y,x)\n\t}else{\n\t\tfresado19 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6+altura7+altura8\n\tif (dibujoHorizontal==1) {\n\t\tfresado20 = new RVector(y,x)\n\t}else{\n\t\tfresado20 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6+altura7+altura8+altura9\n\tif (dibujoHorizontal==1) {\n\t\tfresado21 = new RVector(y,x)\n\t}else{\n\t\tfresado21 = new RVector(x,y)\n\t}\n\t\n\tx=pos.x+alaIzquierda\n\ty=pos.y+altura1+altura2+altura3+altura4+altura5+altura6+altura7+altura8+altura9+altura10\n\tif (dibujoHorizontal==1) {\n\t\tfresado22 = new RVector(y,x)\n\t}else{\n\t\tfresado22 = new RVector(x,y)\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\tvar fresadoIzq=[fresado12,fresado13,fresado14,fresado15,fresado16,fresado17,fresado18,fresado19,fresado20,fresado21,fresado22] //Se ponen los puntos en un vector para poder usarlos en un bucle for\n\tvar fresadoDer=[fresado1,fresado2,fresado3,fresado4,fresado5,fresado6,fresado7,fresado8,fresado9,fresado10,fresado11] //Se ponen los puntos en un vector para poder usarlos en un bucle for\n\t\n\t\n\t//Dibujar lineas horizontales\n\tif (nPestanas==2) {\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t} else if ( nPestanas==3) {\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t} else if ( nPestanas==4) {\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t} else if ( nPestanas==5) {\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t} else if ( nPestanas==6) {\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t} else if ( nPestanas==7) {\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t} else if ( nPestanas==8) {\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado19 ));\n\t\top_fresado.addObject(line,false);\n\t} else if (nPestanas==9) {\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado19 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t} else if (nPestanas==10) {\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado19 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado21 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t\n\t//dibujar lineas verticales\n\tvar pliegueIzq=[pliegueIzq1,pliegueIzq2,pliegueIzq3,pliegueIzq4,pliegueIzq5,pliegueIzq6,pliegueIzq7,pliegueIzq8,pliegueIzq9,pliegueIzq10]\n\tvar pliegueDer=[pliegueDer1,pliegueDer2,pliegueDer3,pliegueDer4,pliegueDer5,pliegueDer6,pliegueDer7,pliegueDer8,pliegueDer9,pliegueDer10]\n\t\n\tfor (var n=0 ; n<nPestanas ; n=n+1){\n\t\tif (pliegueDer[n]==1) {\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresadoDer[n] , fresadoDer[n+1] ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t\tif (pliegueIzq[n]==1) {\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresadoIzq[n] , fresadoIzq[n+1] ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\treturn op_fresado;\n}", "function tulostatuotteet(result){\n \n for(i=0; i < result.ruokalista.length; i++){\n ateriat += \"<div class='ateriat'><span class='glyphicon glyphicon-plus-sign vasen mob'></span><p class='eiNay'>\" + result.ruokalista[i].id + \"</p><h1 class='ateria mob'>\" + result.ruokalista[i].nimi + \"</h1><div class='tiedot piilo'><p>\" + result.ruokalista[i].ainekset + \" <b>\" + result.ruokalista[i].hinta.toFixed(2) + \"€</b></p></div><h1 class='desk'>\" + result.ruokalista[i].nimi + \"</h1><div class='desk'><p>\"\n + result.ruokalista[i].ainekset + \" <b>\" + result.ruokalista[i].hinta.toFixed(2) +\"€</b></p><p class='lyhenne'>\" + result.ruokalista[i].lyhenne + \"</p><span class='glyphicon glyphicon-plus-sign oikea'></span>\" + \"<p class='eiNay'>\" + result.ruokalista[i].id + \"</p></div></div>\";\n ateria.push(result.ruokalista[i]);\n }\n \n $(\"#ruokalista\").html(ateriat);\n }", "function afficherResultats(verifTableau) {\r\n // Méthode filter() va créer un nouveau tableau avec les el triés\r\n // el = élément (couramment utilisé)\r\n // fonction callback type array qui filtre chaque el différents de la valeur true\r\n // .length pour avoir la longueur du tableau ET l'affichage du nbre de fautes\r\n const nbDeFautes = verifTableau.filter((el) => el !== true).length;\r\n // console.log(nbDeFautes);\r\n titreResultat.textContent = \"\";\r\n\r\n switch (nbDeFautes) {\r\n case 0:\r\n titreResultat.textContent = `${emojis[0]} Bravo, c\"est un sans faute ! ${emojis[0]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `5/5`;\r\n break;\r\n case 1:\r\n titreResultat.textContent = `${emojis[1]} Vous y êtes presque ! ${emojis[1]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `4/5`;\r\n break;\r\n case 2:\r\n titreResultat.textContent = `${emojis[1]} Encore un effort ... ${emojis[2]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `3/5`;\r\n break;\r\n case 3:\r\n titreResultat.textContent = `${emojis[2]} Il reste quelques erreurs. ${emojis[3]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `2/5`;\r\n break;\r\n case 4:\r\n titreResultat.textContent = `${emojis[3]} Peux mieux faire. ${emojis[3]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `1/5`;\r\n break;\r\n case 5:\r\n titreResultat.textContent = `${emojis[4]} Peux mieux faire. ${emojis[4]}`;\r\n texteResultat.textContent = `0/5`;\r\n break;\r\n }\r\n}", "function dibujarFresado114(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior) \n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\t\n\t\n\t\n\t\n\tvar fresado6 = new RVector(pos.x+alaIzquierda,pos.y) //punto fresado abajo a la izquierda\n\t\n\t\n\t\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado14 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado5 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){\n\t\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\n\t\tif (crearFresado==1){\n\t\t\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){\n\t\t\n\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura3\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\top_fresado.addObject(line,false);\n\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\n\t\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\t\top_fresado.addObject(line,false);\n\n\t\t}\n\t}\n\t\n\t\n\t//anchura4\n\tif (anchura4>pliegueSuperior){\n\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\n\t\t}\n\t}\n\t\n\t\n\n\treturn op_fresado; \n\n}", "function obtener_datos_por_establecimiento() {\n var lista = conexion_resultados();\n //var promedios = conexion_resultados_promedio_por_fecha();\n var contenido = \"\";\n var fecha = \"\";\n\n //removemos los datos previos de la tabla\n\n //checamos si la tabla tiene datos\n if (lista.length > 0) {\n $(\".celda_tabla_res\").remove();\n $.each(lista, function (index, item) {\n\n //obtenemos el nombre de usuario por medio de una consulta\n //var nombre_cuest = nombres_cuestionarios_por_folio(item.zona);\n var cuestionario = resultados_cuestionario_por_dia(item.fecha, item.id_cuestionario);\n\n if (index == 0) {\n fecha = item.fecha;\n // console.log(fecha + \">\");\n //creamos el contenido\n contenido = \" <tr class='celda_tabla_res fecha'> <td id='indice'colspan='6' > \" + nombre_fecha(fecha) + \"<td></tr><tr class='celda_tabla_res'> <th>#</th><th>CUESTIONARIO</th> <th>LIMPIEZA %</th> <th>SURTIDO % </th> <th>IMAGEN %</th> <th>APLICADOR</th> </tr>\"\n // $(\"#tabla_res\").append(contenido);\n }//fin if\n if (fecha == item.fecha) {\n\n //creamos el contenido\n contenido += \" <tr class='celda_tabla_res dato' onclick='llenar_modal_cuestionarios(\\\"\" + item.fecha + \"\\\",\" + item.id_cuestionario + \")'> <td id='indice'>\" + item.id_cuestionario + \"</td><td class='nombre' >\" + cuestionario.cuestionario + \"</td> <td id='zona_lim' >\" + cuestionario.limpieza + \"</td> <td id='zona_surt' >\" + cuestionario.surtido + \"</td> <td id='zona_imag' >\" + cuestionario.imagen + \"</td> <td id='zona_aplicador'>\" + item.aplicador + \"</td> </tr>\";\n //$(\"#tabla_res\").append(contenido);\n //llenamos los datos de pie\n }//fin if\n else if (fecha != item.fecha) {\n\n //$(\"#tabla_res\").append(contenido);\n\n var promedio = conexion_resultados_promedio_por_fecha(fecha);\n\n // console.log(promedios[contador_fecha].fecha + \":\" + promedios[contador_fecha].aspecto+\":\"+promedios[contador_fecha].aspecto);\n fecha = item.fecha;\n //creamos el contenido\n contenido += \" <tr class='celda_tabla_res'><th colspan='2'>Total:</th> <th>\" + promedio.limpieza + \"</th> <th>\" + promedio.surtido + \"</th> <th>\" + promedio.imagen + \"</th><th>\" + promedio.total + \"</th> </tr><tr class='celda_tabla_res fecha'> <td id='indice'colspan='6' > \" + nombre_fecha(fecha) + \"<td> <tr class='celda_tabla_res'> <th>#</th><th>CUESTIONARIO</th> <th>LIMPIEZA %</th> <th>SURTIDO %</th> <th>IMAGEN %</th> <th>APLICADOR</th> </tr> </tr><tr class='celda_tabla_res dato' onclick='llenar_modal_cuestionarios(\\\"\" + item.fecha + \"\\\",\" + item.id_cuestionario + \")' > <td id='indice'>\" + item.id_cuestionario + \"</td><td class='nombre' >\" + cuestionario.cuestionario + \"</td> <td id='zona_lim' >\" + cuestionario.limpieza + \"</td> <td id='zona_surt' >\" + cuestionario.surtido + \"</td> <td id='zona_imag' >\" + cuestionario.imagen + \"</td> <td id='zona_aplicador'>\" + item.aplicador + \"</td> <</tr>\"\n // $(\"#tabla_res\").append(contenido);\n \n }//fin if\n\n });\n var promedio = conexion_resultados_promedio_por_fecha(fecha);\n contenido += \" <tr class='celda_tabla_res'><th colspan='2'>Total:</th> <th>\" + promedio.limpieza + \"</th> <th>\" + promedio.surtido + \"</th> <th>\" + promedio.imagen + \"</th><th>\" + promedio.total + \"</th></tr>\"\n $(\"#tabla_res\").append(contenido);\n //ajustamos los decimales de total \n // total_limpieza = r(total_limpieza) ;\n //total_limpieza = Math.round(total_limpieza);\n //total_limpieza = total_limpieza / 100;\n var totales = conexion_resultados_ckl_total_por_fechas_establecimiento();\n //console.log(r(total_limpieza / contador) + \":\" + r(total_surtido / contador) + \":\" + r(total_imagen / contador));\n $(\"#total_limpieza\").val(totales.limpieza), $(\"#total_surtido\").val(totales.surtido), $(\"#total_imagen\").val(totales.imagen);\n var res = (total_limpieza + total_surtido + total_imagen);\n //console.log(res);\n $(\"#total_neto\").val(totales.total);\n\n }//fin\n //si no hay datos manda una advertencia\n else {\n alert(\"No Hay Datos...\");\n }\n\n}//fin", "function mostraretro1() {\n retrouno.style.display=\"block\";\n fronte1fronte1.replaceChild(retrouno,fronte1);\n //modifica delle descrizioni con il contenuto della lettera\n testo.style.display=\"block\";\n descrizionedescrizione.replaceChild(testo, descrizione); \n }", "function restaurarReloj() {\n $horasDom.text('00');\n $minutosDom.text('00');\n $segundosDom.text('00');\n }", "function daComentarioFbk(){\r\n var limit = 150; \r\n /* ahora brega con el parrafo y da feedback pq ya se cuantos faltan */\r\n var parrafo = document.getElementById('comentario-feedback-paragraph');\r\n \r\n var faltan = noUsado(); \r\n if(faltan == limit && ! escogioFoto()){\r\n parrafo.style.color='red';\r\n parrafo.innerHTML='<b>Comentario del juego de hoy.</b>'; \r\n parrafo.style.fontSize = '1.00em';\r\n }else if(faltan == limit && escogioFoto()){\r\n parrafo.style.color='green';\r\n parrafo.innerHTML='<b>Comentario opcional del juego.</b>'; \r\n parrafo.style.fontSize = '1.00em'; \r\n }else if(faltan > 1){\r\n parrafo.style.color='green';\r\n //parrafo.innerHTML= 'Puedes usar ' + faltan + ' letras mas.';\r\n parrafo.innerHTML= '<b>' + faltan + '</b>';\r\n parrafo.style.fontSize = '0.70em';\r\n }else if(faltan == 1){\r\n parrafo.style.color='green';\r\n //parrafo.innerHTML= 'Puedes usar ' + faltan + ' letra mas.';\r\n parrafo.innerHTML= '<b>' + faltan + '</b>';\r\n parrafo.style.fontSize = '0.70em';\r\n }else if(faltan == 0){\r\n parrafo.style.color='green';\r\n //parrafo.innerHTML= 'Usando exactamente ' + limit + ' letras.';\r\n parrafo.innerHTML= '<b>' + faltan + '</b>'; \r\n parrafo.style.fontSize = '0.70em';\r\n }else if(faltan == -1 ){\r\n parrafo.style.color='red';\r\n parrafo.innerHTML='<b>Tienes ' + (-1 * faltan) + ' letra de mas.</b>';\r\n parrafo.style.fontSize = '1.00em';\r\n }else if(faltan < -1 ){\r\n parrafo.style.color='red';\r\n parrafo.innerHTML='<b>Tienes ' + (-1 * faltan) + ' letras de mas.</b>';\r\n parrafo.style.fontSize = '1.00em';\r\n }\r\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}", "function randomArmaduraEscudo(itera_bucle, rareza) {\n var item = \"\";\n var material = \"\";\n var mejora = 0;\n var cont_aptitudes = 0;\n\n var tirada = tiraDados(1,100);\n\n switch (rareza) {\n case 1:\n if (tirada <= 60) {\n itera_bucle = 0;\n\n item = \"Escudo\";\n mejora = 1;\n material = getMaterial(0);\n\n console.log(\"- Escudo +1\");\n } else if (tirada <= 80) {\n itera_bucle = 0;\n\n item = \"Armadura\";\n mejora = 1;\n\n console.log(\"- Armadura +1\");\n } else if (tirada <= 85) {\n itera_bucle = 0;\n\n item = \"Escudo\";\n mejora = 2;\n\n console.log(\"- Escudo +2\");\n } else if (tirada <= 87) {\n itera_bucle = 0;\n\n item = \"Armadura\";\n mejora = 2;\n\n console.log(\"- Armadura +2\");\n } else if (tirada <= 89) {\n itera_bucle = 1;\n\n // TODO: Armadura específica\n console.log(\"- Armadura esp.\");\n } else if (tirada <= 91) {\n itera_bucle = 1;\n\n // TODO: Escudo específico\n console.log(\"- Escudo esp.\");\n } else {\n cont_aptitudes++;\n\n randomArmaduraEscudo(1, rareza);\n }\n\n break;\n case 2:\n break;\n case 3:\n break;\n default:\n\n }\n\n // TODO: Materiales especiales\n\n if (itera_bucle == 0) {\n if (mejora > 0) {\n document.getElementById(\"objetos\").innerHTML = document.getElementById(\"objetos\").innerHTML + \" <br> \" + item + material + \" +\" + mejora + \" \";\n }\n }\n\n if (item == \"Armadura\") {\n for (var i = 0; i < cont_aptitudes; i++) {\n document.getElementById(\"objetos\").innerHTML = document.getElementById(\"objetos\").innerHTML + aptitudArmadura(rareza);\n }\n } else if (item == \"Escudo\") {\n for (var i = 0; i < cont_aptitudes; i++) {\n document.getElementById(\"objetos\").innerHTML = document.getElementById(\"objetos\").innerHTML + aptitudEscudo(rareza);\n }\n }\n\n document.getElementById(\"objetos\").innerHTML = document.getElementById(\"objetos\").innerHTML + \", \";\n}", "function mostrarResumen(){\n const resumen = document.querySelector('.contenido-resumen');\n //Destructuring al objeto\n const {nombre,fecha,hora,servicios} = cita;\n //Limpiar el contenido de resumen \n while(resumen.firstChild){\n resumen.removeChild(resumen.firstChild);\n } \n if( Object.values(cita).includes('') || cita.servicios.length === 0){ \n mostrarAlerta('Faltan datos de servicios, fecha u hora','error','.contenido-resumen',false);\n return;\n }\n //Creamos el heading\n \n const headingCita = document.createElement('H2');\n headingCita.textContent = 'Resumen cita';\n resumen.appendChild(headingCita); \n //Añadimos en el orden que deseamos que aparezcan los datos.\n const nombreCliente = document.createElement('P');\n nombreCliente.innerHTML = `<span>Nombre : </span>${nombre}`;\n resumen.appendChild(nombreCliente);\n fechaFormateada = formatearFecha(fecha);\n const fechaCita = document.createElement('P');\n fechaCita.innerHTML = `<span>Fecha : </span>${fechaFormateada}`;\n resumen.appendChild(fechaCita);\n const horaCita = document.createElement('P');\n horaCita.innerHTML = `<span>Hora : </span>${hora}`;\n resumen.appendChild(horaCita); \n //Variable para calcular el precio total \n let precioTotal = 0;\n servicios.forEach(servicio =>{ \n //Destructuring al objeto \n const {id, precio, nombre} = servicio;\n //Sumatorio del precio total \n precioTotal += parseInt( precio); \n\n const contenedorServicio = document.createElement('DIV');\n contenedorServicio.classList.add('contenedor-servicio');\n const textoServicio = document.createElement('P');\n textoServicio.textContent = nombre; \n const precioServicio = document.createElement('DIV');\n precioServicio.innerHTML = `<span> Precio: </span> ${precio} €`;\n contenedorServicio.appendChild(textoServicio);\n contenedorServicio.appendChild(precioServicio);\n resumen.appendChild(contenedorServicio);\n });\n \n const totalTexto = document.createElement('H2');\n totalTexto.innerHTML = `<span> Total: </span> ${precioTotal} €`;\n resumen.appendChild(totalTexto); \n\n //Crear boton\n \n const botonReservar = document.createElement('BUTTON');\n botonReservar.classList.add('boton');\n botonReservar.textContent = \"Reservar cita\";\n botonReservar.onclick = reservarCita;\n \n resumen.appendChild(botonReservar); \n}", "function mostrarEstAlumnosParaDocente(){\r\n let contadorEjXNivel = 0;//variable para contar cuantos ejercicios planteo el docente para el nivel del alumno\r\n let contadorEntXNivel = 0;//variable para contar cuantos ejercicios de su nivel entrego el alumno\r\n let alumnoSeleccionado = document.querySelector(\"#selEstAlumnos\").value;\r\n let posicionUsuario = alumnoSeleccionado.charAt(1);\r\n let usuario = usuarios[posicionUsuario];\r\n let nivelAlumno = usuario.nivel;\r\n for (let i = 0; i < ejercicios.length; i++){\r\n const element = ejercicios[i].Docente.nombreUsuario;\r\n if(element === usuarioLoggeado){\r\n if(ejercicios[i].nivel === nivelAlumno){\r\n contadorEjXNivel ++;\r\n }\r\n }\r\n }\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.nombreUsuario;\r\n if(element === usuario.nombreUsuario){\r\n if(entregas[i].Ejercicio.nivel === nivelAlumno){\r\n contadorEntXNivel++;\r\n }\r\n }\r\n }\r\n document.querySelector(\"#pMostrarEstAlumnos\").innerHTML = `El alumno ${usuario.nombre} tiene ${contadorEjXNivel} ejercicios planteados para su nivel (${nivelAlumno}) sobre los cuales a realizado ${contadorEntXNivel} entrega/s. `;\r\n}", "function newGame(){\n\t\t\tretournee = 0;\n\t\t\tlet affiche = '';\n\t\t\ttableaucarte.melangecarte();\n\t\t\tfor( i = 0; i < tableaucarte.length; i++){\n\t\t\t\t\n\t\t\t\taffiche += '<img src=\"img/dos.gif\" id=\"carte'+i+'\" onclick=\"retournement(this,\\''+tableaucarte[i]+'\\')\">';\n\t\t\t}\n\t\t\tdocument.getElementById('plateau').innerHTML = affiche;\n\t\t}", "function mostrarPlantearEje(){ // Cuando toque el boton \"plantear ejercicios\" voy a ver la seccion (plantear tarea a alumnos)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"block\"; // muestro plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\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 activaFuncionamientoReloj() {\n let tiempo = {\n hora: 0,\n minuto: 0,\n segundo: 0\n };\n\n tiempo_corriendo = null;\n\n\n tiempo_corriendo = setInterval(function () {\n // Segundos\n tiempo.segundo++;\n if (tiempo.segundo >= 60) {\n tiempo.segundo = 0;\n tiempo.minuto++;\n }\n\n // Minutos\n if (tiempo.minuto >= 60) {\n tiempo.minuto = 0;\n tiempo.hora++;\n }\n\n $horasDom.text(tiempo.hora < 10 ? '0' + tiempo.hora : tiempo.hora);\n $minutosDom.text(tiempo.minuto < 10 ? '0' + tiempo.minuto : tiempo.minuto);\n $segundosDom.text(tiempo.segundo < 10 ? '0' + tiempo.segundo : tiempo.segundo);\n }, 1000);\n corriendo = true;\n\n }", "function rec_mese(mese){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) settembre 2010\n // recupero del nome del mese vigente.\n \nif(mese!=undefined) {mese=mese-1;} \n\nif(mese==undefined) {\n\n var data=new Date();\n var mese =data.getMonth(); // mese 0 a 11\n var nome_mese=\"\";\n}\n\n if(mese==0) {nome_mese=\"Gennaio\"; }\nelse if(mese==1) {nome_mese=\"Febbraio\"; }\nelse if(mese==2) {nome_mese=\"Marzo\"; }\nelse if(mese==3) {nome_mese=\"Aprile\"; }\nelse if(mese==4) {nome_mese=\"Maggio\"; }\nelse if(mese==5) {nome_mese=\"Giugno\"; }\nelse if(mese==6) {nome_mese=\"Luglio\"; }\nelse if(mese==7) {nome_mese=\"Agosto\"; }\nelse if(mese==8) {nome_mese=\"Settembre\"; }\nelse if(mese==9) {nome_mese=\"Ottobre\"; }\nelse if(mese==10) {nome_mese=\"Novembre\"; }\nelse if(mese==11) {nome_mese=\"Dicembre\"; }\n\nreturn nome_mese;\n\n}", "function mostrarFechasResultantes (infoFechaInmunidad, infoFechaRevacunacion){\n //levanto el modal donde están las cajas de mensaje donde\n //cargo la información de las fechas\n $('#modalInfo').modal();\n //asigno la información de las fechas a las cajas de texto\n const infoFechaInmune = document.getElementById(\"fInmune\");\n infoFechaInmune.innerHTML = `${infoFechaInmunidad}`;\n const infoFechaRevacunar = document.getElementById(\"fRevacunacion\");\n infoFechaRevacunar.innerHTML = `${infoFechaRevacunacion}`;\n\n\n}", "function formPeticion(ressult){\n if(ressult.length == 0){ injectCaption(\"No hay documentos que mostrar\"); }\n else {\n for(let i = 0; i < ressult.length; i++){\n let peticion = new Peticion(ressult[i]);\n gestor.addPeticiones(peticion);\n }\n injectFormBasicPeticion(gestor.getPeticiones()[0]);\n injectFormEspecificPeticion(gestor.getPeticiones()[0]);\n\n if(gestor.getPeticiones()[0].getCola() == \"penJustificante\"){\n injectActualDate(gestor.getPeticiones()[0]);\n }\n evalDirectorFirma();\n }\n\n disables();\n}", "function reemplazo(id){\n\n\t//console.log(id); \n\tvar cuanto=$(\".selesuper\").length;\n\t\n\tif(cuanto>0){\n\t\tvar reemplazo=$(\".reempla\").html();\n\t\t\n\t\tvar baja=$(\".baja\").html();\n\t\t//var area=$(\".area\").html();\n\t\tvar ingreso=$(\".ingreso\").html();\n\t\t//var supernumera=$(\".super\").html();\n\t\tvar fec_ini=$(\".fecini\").html();\n\t\tvar fec_fin=$(\".fecfin\").html();\n\t\t//var jefe=$(\".jefe\").html();\n\t\tvar obser=$(\".obser\").html();\n\t\t\n\t\t$.ajax({\n\t\t\turl:\"movimiento_traer.php\",\n\t\t\ttype:\"post\",\n\t\t\tdataType:'json',\n\t\t\tdata:\"id=\"+id,\n\t\t\tsuccess:function(data){\n\t\t\t\t//console.log(data); \n\t\t\t\t//console.log(data[0].nom_car);\n\t\t\t var area=data[0].nom_cc2;\n\t\t\t var area2=data[0].centro_costo2;\n\t\t\t var jefe2=data[0].cod_epl_jefe;\n\t\t\t var jefe=data[0].jefe;\n\t\t\t var reemplazo2=data[0].cod_epl_reemp;\n\t\t\t var supernumerario2=data[0].cod_epl_super;\n\t\t\t var tipobaja2=data[0].nombre_baja;\n var tipo_baja=data[0].tipo_baja\t\t\t \n\t\t\t var cod_car=data[0].cod_car;\n\t\t\t var nom_car=data[0].nom_car;\n\t\t\t var supernumerario='supernumerarios';\n\t\t\t var supernumera=data[0].supernumerario\n\t\t\t\tvar fecha= new Date();\n\t\t\t\tvar dia=fecha.getDate();\n\t\t\t\tvar mes=fecha.getMonth() + 1;\n\t\t\t\tvar anio=fecha.getFullYear();\n\n\t\t\t\t\t\t\tvar contenido=\"\";\n\t\t\t\t\t\t\tcontenido+='<div id=\"reemplazo\">';\n\t\t\t\t\t\t\tcontenido+='<div id=\"obligatorio\" style=\"color:red; text-align:center; display:none;\">Los campos con (*) son requeridos</div>';\n\t\t\t\t\t\t\tcontenido+='<form class=\"form-horizontal\" style=\"color:black\" id=\"reemplazo_form\">';\n\t\t\t\t\t\t\tcontenido+='<div class=\"control-group\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"control-label\" for=\"inputsupernumerario\" >Supernumerario</label>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"controls\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"inputsupernumerario\">'+supernumera+'</label><input type=\"hidden\" name=\"cod_epl_super\" id=\"inputsupernumerario\" value='+supernumerario2+' />';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"control-group\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"control-label\" for=\"inputbaja\">Tipo de baja</label>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"controls\">';\n\t\t\t\t\t\t\tcontenido+='<select id=\"inputbaja\" name=\"tipo_baja\" ></select>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"control-group\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"control-label\" for=\"inputreemplazar\">Empleado a Reemplazar</label>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"controls\">';\n\t\t\t\t\t\t\tcontenido+='<select id=\"inputreemplazar\" name=\"cod_epl_reemp\" >';\n\t\t\t\t\t\t\tcontenido+='</select>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"control-group\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"control-label\">&Aacute;rea</label>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"controls\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"area\">'+area+'</label><input type=\"hidden\" id=\"area\" name=\"cod_cc2\" value=\"'+area2+'\">';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"control-group\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"control-label\" >Cargo</label>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"controls\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"cargo\">'+nom_car+'</label><input type=\"hidden\" id=\"cargo\" value=\"'+cod_car+'\" />';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"control-group\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"control-label\">Jefe de Proceso</label>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"controls\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"jefe\">'+jefe+'</label><input type=\"hidden\" id=\"jefe\" name=\"cod_epl_jefe\" value=\"'+jefe2+'\" />';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontenido+='<div class=\"controls-row\" style=\"margin-left: 118px;\">';\n\t\t\t\t\t\t\tcontenido+='<span class=\"help-inline fec_ini\" style=\" color: black;\">Inicial</span>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"input-append date\" id=\"fec_ini\" data-date=\"'+dia+'-'+mes+'-'+anio+'\" data-date-format=\"dd-mm-yyyy\" style=\"margin-left: 20px; max-width: 100px;\"> ';\n\t\t\t\t\t\t\tcontenido+=' <input class=\"span2\" size=\"16\" type=\"text\" name=\"fec_ini\" id=\"fec_inir\" value=\"'+fec_ini+'\"/>';\n\t\t\t\t\t\t\tcontenido+='<span class=\"add-on\"><i class=\"icon-th\"></i></span>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='<span class=\"help-inline fec_fin\" style=\"margin-left: 91px; color: black;\">Final </span>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontenido+='<div class=\"input-append date\" id=\"fec_fin\" data-date=\"'+dia+'-'+mes+'-'+anio+'\" data-date-format=\"dd-mm-yyyy\" style=\"margin-left: 20px; max-width: 100px;\"> ';\n\t\t\t\t\t\t\tcontenido+=' <input class=\"span2\" size=\"16\" type=\"text\" name=\"fec_fin\" id=\"fec_finr\" value=\"'+fec_fin+'\"/>';\n\t\t\t\t\t\t\tcontenido+='<span class=\"add-on\"><i class=\"icon-th\"></i></span>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='</div><br>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontenido+='<div class=\"control-group\">';\n\t\t\t\t\t\t\tcontenido+='<label class=\"control-label observaciones\">Observaciones</label>';\n\t\t\t\t\t\t\tcontenido+='<div class=\"controls\">';\n\t\t\t\t\t\t\tcontenido+='<textarea id=\"observaciones\" style=\"width: 528px;height:40px; max-width: 499px;\" name=\"observaciones\">'+obser+'</textarea>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='<input type=\"hidden\" name=\"id_super_nov\" value=\"'+id+'\">';\n\t\t\t\t\t\t\tcontenido+='<input type=\"hidden\" name=\"id_reemp_old\" value=\"'+reemplazo2+'\">';\n\t\t\t\t\t\t\tcontenido+='<div style=\"text-align: center;\">';\n\t\t\t\t\t\t\tcontenido+='<div class=\"boton\">';\n\t\t\t\t\t\t\tcontenido+='<input type=\"submit\" class=\"btn btn-primary\" id=\"reemp\" value=\"Aceptar\" />';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontenido+='</form>';\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\t\n\t\t\t\tmodals_supernumerario_admin(\"Editar Reemplazo<i class='icon-retweet' ></i>\",contenido);\n\t\t\t\t/*script de reemplazo*/\n\t\t\t\t//$(\"#inputsupernumerario\").chosen({width:\"95%\"});\n\t\t\t\t$(\"#inputbaja\").chosen({width:\"95%\"});\n\t\t\t\t$(\"#inputreemplazar\").chosen({width:\"95%\"});\n\t\t\t\tvalidar_fechas('fec_inir','fec_finr');\n\t\t\t\t/*fin reemplazo*/\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\t\turl:\"select_tipobaja.php\",\n\t\t\t\t\t\ttype:\"post\",\n\t\t\t\t\t\tdata:\"supernume=\"+supernumerario+\"&data1=\"+tipo_baja+\"&data2=\"+tipobaja2,\n\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\t//console.log(data); return false;\n\t\t\t\t\t\t\t$(\"#inputbaja\").html(data);\n\t\t\t\t\t\t\t$(\"#inputbaja\").trigger(\"liszt:updated\");\n\t\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t/*ajax para traer todos los empleados basic*/\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\t\turl:\"select_eplreemplazo.php\",\n\t\t\t\t\t\ttype:\"post\",\n\t\t\t\t\t\tdata:\"supernume=\"+supernumerario+\"&data1=\"+reemplazo2+\"&data2=\"+reemplazo+\"&supernu=\"+supernumerario2,\n\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\t//console.log(data); return false;\n\t\t\t\t\t\t\t$(\"#inputreemplazar\").html(data);\n\t\t\t\t\t\t\t$(\"#inputreemplazar\").trigger(\"liszt:updated\");\n\t\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$(\"#inputreemplazar\").change(function(){\n\t\t\t\t\tvar id_reempla=$(this).val();\n\t\t\t\t\t\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl:\"get_jefe.php\",\n\t\t\t\t\t\tdataType:\"json\",\n\t\t\t\t\t\ttype:\"post\",\n\t\t\t\t\t\tdata:\"id=\"+id_reempla,\n\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\t$(\"#cargo\").val(data[0].cargo);\n\t\t\t\t\t\t\t$(\".cargo\").html(data[0].nom_car);\n\t\t\t\t\t\t\t$(\"#area\").val(data[0].cod_cc2);\n\t\t\t\t\t\t\t$(\".area\").html(data[0].area);\n\t\t\t\t\t\t\t$(\"#jefe\").val(data[0].cod_epl_jefe);\n\t\t\t\t\t\t\t$(\".jefe\").html(data[0].nom_jefe);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t/*insert para el reemplazo*/\n\t\t\t\t$(\"#reemp\").click(function(){\n\n\t\t\t\t\t$(\"#obligatorio\").css(\"display\",\"block\");\n\t\t\t\t\t\n\t\t\t\t\t$(\".error\").remove();\n\t\t\t\t\tif($(\"#reemplazo_form select\").val() == 0 ){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#reemplazo_form select\").after(\"<span class='error' style='color:red; font-size:16px;'> * </span>\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t\t\t\t}else if($(\"#reemplazo_form #fec_inir\").val() == \"\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$(\"#reemplazo_form .fec_inir\").after(\"<span class='error' style='color:red; font-size:16px;'> *</span>\");\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else if($(\"#reemplazo_form #fec_finr \").val() == \"\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$(\"#reemplazo_form .fec_finr\").after(\"<span class='error' style='color:red; font-size:16px;'> *</span>\");\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#obligatorio\").css(\"display\",\"none\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#reemplazo_form\").hide(\"slow\");\n\t\t\t\t\t\t\tvar contenido=\"\";\n\t\t\t\t\t\t\tcontenido+='<div class=\"alert alert-info\" style=\"text-align:center;\">';\n\t\t\t\t\t\t\t\t\tcontenido+='<h4>Informaci&oacute;n!</h4>';\n\t\t\t\t\t\t\t\t\tcontenido+='<p>Est&aacute; seguro de este movimiento?</p>';\n\t\t\t\t\t\t\t\t\tcontenido+='<p><input class=\"btn btn-primary\" type=\"button\" id=\"aceptar_reem\" value=\"Aceptar\"/>';\n\t\t\t\t\t\t\t\t\tcontenido+='<input class=\"btn btn-primary\" type=\"button\" id=\"cancelar_reem\" value=\"Cancelar\" style=\"margin-left:10px;\"/></p>';\n\t\t\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\t$(\"#reemplazo\").append(contenido);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(\"#aceptar_reem\").click(function(){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\turl:\"update_movsuper.php\",\n\t\t\t\t\t\t\t\t\ttype:\"post\",\n\t\t\t\t\t\t\t\t\tdata:$(\"#reemplazo_form\").serialize(),\n\t\t\t\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\t\t\t\t//console.log(data); return false;\n\t\t\t\t\t\t\t\t\t\t$(\".alert\").remove();\n\t\t\t\t\t\t\t\t\t\tif(data==1){\n\t\t\t\t\t\t\t\t\t\t\tvar contenido=\"\";\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<div class=\"alert alert-success\" style=\"text-align:center;\">';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<h4>Informaci&oacute;n!</h4>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<p>Se Atualizo correctamente</p>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<a href=\"#\" style=\"color:#fff;\" id=\"aceptar_cofirm\" class=\"btn btn-primary\">Aceptar</a>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$(\"#reemplazo\").append(contenido);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$(\"#content\").load('admin_supernumerario.php');\n\t\t\t\t\t\t\t\t\t\t\t$(\"#aceptar_cofirm\").click(function(){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$('#myModal4').modal('hide');\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\t\t\t}else if(data==3){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar contenido=\"\";\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<div class=\"alert alert-error\" style=\"text-align:center;\">';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<h4>Alerta!</h4>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<p>El supernumerario ya esta haciendo reemplazo</p>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<a href=\"#\" style=\"color:#fff;\" id=\"aceptar_cofirm\" class=\"btn btn-primary\">Aceptar</a>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\t\t\t\t\t$(\"#reemplazo\").append(contenido);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$(\"#aceptar_cofirm\").click(function(){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$('#myModal4').modal('hide');\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t });\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}else if(data==4){\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tvar contenido=\"\";\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<div class=\"alert alert-error\" style=\"text-align:center;\">';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<h4>Alerta!</h4>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<p>El supernumerario ya esta haciendo cubrimiento</p>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<a href=\"#\" style=\"color:#fff;\" id=\"aceptar_cofirm\" class=\"btn btn-primary\">Aceptar</a>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\t\t\t\t\t$(\"#reemplazo\").append(contenido);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$(\"#aceptar_cofirm\").click(function(){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$('#myModal4').modal('hide');\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t });\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tvar contenido=\"\";\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<div class=\"alert alert-error\" style=\"text-align:center;\">';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<h4>Alerta!</h4>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='<p>No Se ingreso correctamente Contacta al administrador</p>';\n\t\t\t\t\t\t\t\t\t\t\tcontenido+='</div>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$(\"#reemplazo\").append(contenido);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$(\"#content\").load('admin_supernumerario.php');\n\t\t\t\t\t\t\t\t\t\t\t$(\"#aceptar_cofirm\").click(function(){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$('#myModal4').modal('hide');\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn 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\n\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\t\t\t$(\"#cancelar_reem\").click(function(){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$(\".alert\").remove();\n\t\t\t\t\t\t\t\t$(\"#reemplazo_form\").show(\"slow\");\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});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}\n\t\t});\n\t\t\n\t}\n\t\t\n\n\treturn false;\n}", "function filtrarAuto() {\r\n // Funcion de alto nivel. Una funcion que toma a otra funcion.\r\n const resultado = autos.filter(filtrarMarca).filter(filtrarYear).filter(filtrarMinimo).filter(filtrarMaximo).filter(filtrarPuertas).filter(filtrarTransmision).filter(filtrarColor);\r\n // console.log(resultado);\r\n if (resultado.length)\r\n mostrarAutos(resultado);\r\n else\r\n noHayResultados();\r\n}", "function setEventos() {\n validar();\n\n DOM.btnAdicionar.on(\"click\",function(){\n if ( DOM.codigo_materia_prima.val() === '' ) {\n Util.alerta('warning','Debe seleccionar una materia prima',2000);\n return 0;\n }\n\n if ( DOM.cantidad.val() === '' ) {\n Util.alerta('warning','Debe ingresar una cantidad para la materia prima',2000);\n return 0;\n }\n\n if (! validarMismo(DOM.codigo_materia_prima.val())) {\n Util.alerta('warning','No es posible agregar la misma materia prima mas de 1 veces',2000); \n return 0; //detiene el programa\n }\n //Elaborar una variable con el HTML para agregar al detalle\n var fila = '<tr data-id=\"'+DOM.codigo_materia_prima.val()+'\">' +\n '<td class=\"text-center\"><i style=\"font-size:20px;\" class=\"fa fa-close text-danger\"></i></td>' +\n '<td class=\"text-center\">' + DOM.codigo_materia_prima.select2('data').text + '</td>' +\n '<td class=\"text-center\">' + DOM.cantidad.val() + '</td>' + \n '</tr>';\n\n //AGREGAR TABLA Y ARREGLO\n $(\"#detalle_materia_primas\").append(fila);\n l2();\n });\n\n DOM.btnAumentar.on(\"click\",function(){\n if ( DOM.codigo_materia_prima.val() === '' ) {\n Util.alerta('warning','Debe seleccionar una materia prima',2000);\n return 0;\n }\n\n if ( DOM.cantidad.val() === '' ) {\n Util.alerta('warning','Debe ingresar una cantidad para la materia prima',2000);\n return 0;\n }\n\n if (! validarMismo(DOM.codigo_materia_prima.val())) {\n Util.alerta('warning','No es posible agregar la misma materia prima mas de 1 veces',2000); \n return 0; //detiene el programa\n }\n //Elaborar una variable con el HTML para agregar al detalle\n var fila = '<tr data-id=\"'+DOM.codigo_materia_prima.val()+'\">' +\n '<td class=\"text-center\"><i style=\"font-size:20px;\" class=\"fa fa-close text-danger\"></i></td>' +\n '<td class=\"text-center\">' + DOM.codigo_materia_prima.select2('data').text + '</td>' +\n '<td class=\"text-center\">' + DOM.cantidad.val() + '</td>' + \n '</tr>';\n\n //AGREGAR TABLA Y ARREGLO\n $(\"#detalle_materia_primas\").append(fila);\n\n var funcion = function (resultado) {\n console.log(resultado);\n if (resultado.estado === 200) {\n if (resultado.datos.rpt === true) {\n Util.alertaA(resultado.datos);\n }else{\n Util.alertaB(resultado.datos);\n }\n }\n };\n new Ajex.Api({\n modelo: \"Producto\",\n metodo: \"agregarMP\",\n data_in: {\n p_cod_producto : DOM.codigo_producto.val(),\n p_cod_materia_prima : DOM.codigo_materia_prima.val(),\n p_cantidad : DOM.cantidad.val()\n }\n },funcion);\n l2();\n });\n\n\n\n DOM.btnAgregar.on(\"click\", function () {\n DOM.self.find(\".modal-title\").text(\"Agregar nuevo producto\");\n DOM.operacion.val(\"agregar\");\n DOM.imagen.hide();\n $(\"#detalle_materia_primas tr\").remove();\n $(\"#b1\").show();\n $(\"#b2\").hide();\n limpiar();\n });\n\n DOM.foto.on(\"change\", function(){\n DOM.imagen.hide();\n }); \n\n DOM.form.submit(function (evento) {\n evento.preventDefault();\n\n if ( parseFloat(DOM.precio.val()) >= 0.000 && parseFloat(DOM.precio.val()) <= 0.009) {\n Util.alerta('warning','El precio debe ser mayor de cero',2000);\n return 0;\n };\n\n arreglo.splice(0,arreglo.length);\n\n $(\"#detalle_materia_primas tr\").each(function(){\n var codigo_materia_prima = this.dataset.id;\n var cantidad = $(this).find(\"td\").eq(2).html();\n\n var obj = {\n p_codigo_materia_prima : parseInt(codigo_materia_prima),\n p_cantidad : parseInt(cantidad)\n };\n\n arreglo.push(obj); //agregar el objeto objDetalle al array arrayDetalle\n });\n\n var json = JSON.stringify(arreglo);\n \n \n var n = new Noty({ \n layout: 'bottomCenter', \n text: '¿Esta seguro de grabar los datos ingresados?',\n buttons: [ \n Noty.button('Si', 'btn btn-success', function () {\n var datos_frm = new FormData();\n datos_frm.append(\"p_array_datos\", DOM.form.serialize());\n datos_frm.append(\"p_foto\", DOM.foto.prop('files')[0]);\n datos_frm.append(\"p_arreglo\",json);\n\n var funcion = function (resultado) {\n if (resultado.estado === 200) {\n if (resultado.datos.rpt === true) { \n Util.alertaA(resultado.datos);\n listar();\n limpiar(); \n DOM.self.modal(\"hide\"); \n }else{\n Util.alertaB(resultado.datos);\n DOM.self.modal(\"hide\"); \n } \n } \n }; \n $.ajax({\n url: \"../../controlador/guardar.producto.php\",\n dataType: 'json',\n cache: false,\n contentType: false,\n processData: false,\n data: datos_frm,\n type: 'post',\n success: funcion\n }); \n n.close(); \n }),\n Noty.button('No', 'btn btn-error', function () {\n n.close();\n })\n ]\n }).show(); \n });\n\n $(\"#detalle_materia_primas\").on(\"click\",\"tr td i\",function(){\n $tr = this.parentElement.parentElement; \n var n = new Noty({ \n layout: 'bottomCenter', \n text: '¿Desea eliminar el registro seleccionado?',\n buttons: [ \n Noty.button('Si', 'btn btn-success', function () {\n $tr.remove();\n var funcion = function (resultado) {\n if (resultado.estado === 200) {\n if (resultado.datos.rpt === true) {\n Util.alertaA(resultado.datos);\n }else{\n Util.alertaB(resultado.datos);\n }\n }\n };\n new Ajex.Api({\n modelo: \"Producto\",\n metodo: \"eliminarMP\",\n data_in: {\n p_cod_producto : DOM.codigo_producto.val(),\n p_cod_materia_prima : $tr.dataset.id\n }\n },funcion); \n n.close(); \n }),\n Noty.button('No', 'btn btn-error', function () {\n n.close();\n })\n ]\n }).show();\n });\n}", "function majAffichage () {\n\tif (win) {\n\t\tdocument.getElementById(\"affichage\").innerHTML = \"Victoire du joueur \"+joueur+\" !\";\n\t\tanimationVictoire ();\n\t}\n\telse if (!win && casesJouees.length==9) {\n\t\tdocument.getElementById(\"affichage\").innerHTML = \"Egalite entre les joueurs !\";\n\t}\n\telse if (joueur==1) {\n\t\tdocument.getElementById(\"affichage\").innerHTML = \"Tour du joueur 2\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"affichage\").innerHTML = \"Tour du joueur 1\";\n\t}\n}", "function crearEstructura() {\n caja.append(\"<div class=timeline0><div class=line><ol class=linei id=recorrido></ol> </div> <div class=datos>hora\"+0+\" de salida</div></div>\");\n timeline0 = $(\".timeline0\"),\n datos = timeline0.children(\".datos\"),\n line = timeline0.children(\".line\"),\n lineG = line.children(\".linei\"),\n estaciones = [],\n lineasContol = [],\n retorno = [];\n //agregamos las lineas de estaciones, se les asigno la clase estacione1 para poder manejar unos estylos diferente (css)\n for (var i = 0; i < nEstaciones; i++) {\n estaciones.push(\"<li class=estacion1></li>\")\n //lineG.append(\"<li class=estacion1></li>\")\n }\n lineG.append(estaciones.join(\"\"));\n //creamos las lineas de control que nos indicaran de forma parcial el estado del recorrido\n for (var i = 0; i < nEstaciones; i++) {\n lineasContol.push(\"<div class='lineT' style=left:\"+disEE*i+\"px><span class=tooltiptext>Hola</span></div>\");\n \n //lineG.append(\"<li class=estacion1></li>\")\n \n \n }\n lineG.append(lineasContol.join(\"\"));\n // se hace la nueva llamada desde este lugar debido a que en la anteror linea se estaban agregando las estaciones\n // y en ese momento no se contaba con esos elementos en el DOM\n var lineLi=lineG.children(\".estacion1\");\n for (var i = 0; i < nEstaciones; i++) {\n setPosTimelineE(i,disEE,lineLi.eq(i));\n }\n retorno.push($('.timeline'));\n retorno.push(setTimelineWidth(disEE,retorno[0],nEstaciones));\n retorno.push($('#recorrido').html());\n timeline0.remove();\n\n return retorno;\n}", "function effemeridi_sole(TEMPO_RIF,LAT,LON,ALT,ITERAZIONI,LAN){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) Ottobre 2011.\n // funzione per il calcolo delle effemeridi del Sole.\n\n // Parametri utilizzati\n \n // TEMPO_RIF= \"TL\" o \"TU\" tempo locale o tempo universale.\n // LAT= latitudine in gradi sessadecimali.\n // LON= longtudine in gradi sessadecimali.\n // ALT= altitudine in metri.\n // ITERAZIONE =numero di ripetizioni del calcolo.\n // LAN=\"EN\" versione in inglese.\n \n \nvar njd=calcola_jdUT0(); // numero del giorno giuliano all'ora 0 di oggi.\n\n njd=njd+0.00078; // correzione per il Terrestrial Time.\n \nvar data_ins=0; // data\nvar data_inser=0; // data\n\nvar numero_iterazioni=ITERAZIONI;\n\nvar effe_sole=0;\nvar ar_sole=0;\nvar de_sole=0;\nvar classetab=\"colore_tabellaef1\";\nvar crep=0; // crepuscolo astronomico.\nvar coo_app=0; // coordinate equatoriali apparenti.\nvar costl=\"\"; // costellazione.\nvar t_locale=0;\n\n var effe1=0;\n\n\n document.write(\"<table width=100% class='.table_effemeridi'>\");\n document.write(\" <tr>\");\n\n // versione in italiano.\n\n if (LAN!=\"EN\") // diverso da EN\n {\n document.write(\" <td class='colore_tabella'>Data:</td>\");\n document.write(\" <td class='colore_tabella'>Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Culmina:</td>\");\n document.write(\" <td class='colore_tabella'>Tramonta:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Tram.:</td>\");\n document.write(\" <td class='colore_tabella'>Ascensione Retta:</td>\");\n document.write(\" <td class='colore_tabella'>Declinazione:</td>\");\n document.write(\" <td class='colore_tabella'>Inizio Crep.:</td>\");\n document.write(\" <td class='colore_tabella'>Fine Crep.:</td>\");\n document.write(\" <td class='colore_tabella'>Cost.:</td>\");\n }\n\n // versione in inglese.\n\nif (LAN==\"EN\")\n {\n document.write(\" <td class='colore_tabella'>Date:</td>\");\n document.write(\" <td class='colore_tabella'>Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Transit:</td>\");\n document.write(\" <td class='colore_tabella'>Set:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Set.:</td>\");\n document.write(\" <td class='colore_tabella'>Right Ascension:</td>\");\n document.write(\" <td class='colore_tabella'>Declination:</td>\");\n document.write(\" <td class='colore_tabella'>Beg. Twilight:</td>\");\n document.write(\" <td class='colore_tabella'>End. Twilight:</td>\");\n document.write(\" <td class='colore_tabella'>Const.:</td>\");\n\n }\n\n document.write(\" </tr>\");\n\n njd=njd-1;\n\n for (b=0; b<numero_iterazioni; b++){\n njd=njd+1;\n effe1=ST_SOLE_LUNA(njd,TEMPO_RIF,\"S\",LON,LAT,ALT,0.25);\n \n effe_sole=pos_sole(njd);\n\n coo_app=pos_app(njd,effe_sole[0],effe_sole[1]) // coordinate apparenti.\n\n ar_sole= sc_ore(coo_app[0]); // ascensione retta.\n de_sole=sc_angolo(coo_app[1]); // declinazione.\n\n\n \n crep=crepuscolo(njd,TEMPO_RIF,LON,LAT,ALT);\n\n \n data_ins=jd_data(njd);\n\n if (LAN!=\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\" : \"+Lnum(parseInt(data_ins[1]),2)+\"| \"+data_ins[3];} // versione in italiano.\n if (LAN==\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\" : \"+Lnum(parseInt(data_ins[1]),2)+\"| \"+data_ins[4];} // versione in inglese.\n\n costl=costell(coo_app[0]); // costellazione. \n\n if (b%2==0){classetab=\"colore_tabellaef2\"; }\n\n else {classetab=\"colore_tabellaef1\";}\n\n\n document.write(\" <tr>\");\n document.write(\" <td class='\"+classetab+\"'>\"+data_inser+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[2]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[3]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[4]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[0]+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+effe1[1]+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+ar_sole+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+de_sole+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+crep[0]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+crep[1]+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+costl+\"</td>\");\n\n document.write(\" </tr>\");\n\n }\n document.write(\" </table>\");\n\n\n\n}", "function getFilmoviGlumca(data) {\n var broj = data.id;\n var ruta = \"http://localhost:8080/glumci/film\";\n\n var data = {};\n data.glumac_id = \"\"+broj+\"\";\n data.name = \"Jackie\";\n data.lastname = \"Chan\";\n data.nationality = \"Chinese\";\n data.birthyear = \"1954\";\n var json = JSON.stringify(data);\n \n\n var httprequest = new XMLHttpRequest();\n\n httprequest.onreadystatechange = function() {\n if (httprequest.readyState == 4) {\n\n // ova linija 412 cisti prethodno dovucenog glumca\n document.getElementById(\"content\").innerHTML = httprequest.responseType; \n \n var ourFilmData = JSON.parse(httprequest.responseText);\n renderFilmHTML(ourFilmData);\n console.log(ourFilmData);\n }\n }\n\n httprequest.open(\"POST\", ruta, true);\n httprequest.setRequestHeader(\"Content-type\", \"application/json\");\n httprequest.send(json);\n}", "function mostrarMovimientosEnPantalla() {\n let cartel = document.getElementById('movimientos');\n let limite = document.getElementById('movimientos-restantes');\n cartel.innerText = movimientos.length;\n limite.innerText = `Movimientos restantes: ${limiteMovimientos}`;\n}", "function mostrarVentanaInicio(){\n\t//verificar el rol\n\tif (datosUsuario[0][\"idRol\"] == 3) {\n\t\tmostrarVentanaChef1(datosUsuario[0][\"nombre\"]);\t// Invoca la ventana de Cocina y envia nombre del empleado\n\t}\n\telse if(datosUsuario[0][\"idRol\"] == 2) {\n\t\tmostrarVentanaCajero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Cajero y envia nombre del empleado\n\t}\n\telse{\n\t\tmostrarVentanaMesero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Mesero y envia nombre del empleado\n\t}\n\n}", "function reemplazarDocumento(folio, fecha, descripcion)\n{\n var iRecorre = 0;\n var iTotal = _Documento.length;\n var dHoy = new Date();\n\n for (iRecorre = 0; iRecorre < iTotal; iRecorre++)\n {\n if ( _Documento[iRecorre].rtpformato !== null)\n {\n _Documento[iRecorre].rtpformato = _Documento[iRecorre].rtpformato.replace(\"|Folio|\", _solclave );\n _Documento[iRecorre].rtpformato = _Documento[iRecorre].rtpformato.replace(\"|Solicitud|\", \"\\\"\"+ _Solicitud + \"\\\"\");\n _Documento[iRecorre].rtpformato = _Documento[iRecorre].rtpformato.replace(\"|Fecha|\", dHoy.getDate() + '/'+ (dHoy.getMonth()+1) +'/'+ dHoy.getFullYear() );\n }\n }\n}", "function afficherResult(elem){\r\n rechercheEnCours = false;\r\n //enlever l'affichage du svg de chargement\r\n gifLoading.removeAttribute(\"style\");\r\n //elem retourner de l'appel ajax, transformation en objet JSON pour pouvoir l'exploiter\r\n var obj = JSON.parse(elem);\r\n // si l'element retourner de l'appel ajax ne retourne pas de resultat, le marquer, sinon tout afficher\r\n if(obj.results.length == 0){\r\n var titre = document.createElement('h2');\r\n titre.textContent = \"Aucun resultat\";\r\n divResultat.appendChild(titre);\r\n }\r\n else{\r\n //pour tous les éléments de l'ojet retourner, creation des division/elements permettant de les afficher\r\n for(let a = 0; a<obj.results.length; a++){\r\n var objetFilm = obj.results[a];\r\n if(objetFilm.overview != \"\"){\r\n var overview = document.createElement('p');\r\n overview.textContent = \"Overview : \"+objetFilm.overview.toString();\r\n var releaseDate = document.createElement('p');\r\n if (objetFilm.release_date == null){\r\n releaseDate.textContent = \"Release date : date not specified\";\r\n\r\n }else{\r\n releaseDate.textContent = \"Release date : \"+objetFilm.release_date.toString();\r\n\r\n }\r\n var starsRating = objetFilm.vote_average;\r\n var titleMovie = document.createElement('h2');\r\n titleMovie.textContent = objetFilm.original_title;\r\n var urlImage = (objetFilm.poster_path != null)?(url_image+'w154'+objetFilm.poster_path.toString()):'images/imageNot.jpg';\r\n var imageComplete = document.createElement('img');\r\n imageComplete.src = urlImage;\r\n\r\n var informationsDiv = document.createElement('div');\r\n informationsDiv.appendChild(titleMovie);\r\n\r\n var complementaireInfo = document.createElement('div');\r\n complementaireInfo.appendChild(releaseDate);\r\n var divStars = document.createElement('div');\r\n var starsRateP = document.createElement('p');\r\n starsRateP.textContent = \"Rate : \";\r\n\r\n //Calcul du nombre d'étoile à afficher; les créer et les ajouter à une division, qu'on ajoutera à nos resultats\r\n divStars.appendChild(starsRateP);\r\n if(objetFilm.vote_count == 0){\r\n starsRateP.textContent = \"Rate : Not Rated\";\r\n }else{\r\n var nbEtoile = Math.round(starsRating/2);\r\n var nbEtoileVide = 5-nbEtoile;\r\n for(var i = 0; i<nbEtoile;i++){\r\n var imageEtoile = document.createElement('img');\r\n imageEtoile.src = \"images/etoile-pleine.svg\";\r\n divStars.appendChild(imageEtoile);\r\n }\r\n for(var i = 0; i<nbEtoileVide;i++){\r\n var imageEtoile = document.createElement('img');\r\n imageEtoile.src = \"images/etoile-vide.svg\";\r\n divStars.appendChild(imageEtoile);\r\n }\r\n divStars.title = starsRating+'/10';\r\n }\r\n\r\n\r\n complementaireInfo.appendChild(divStars);\r\n informationsDiv.appendChild(complementaireInfo);\r\n informationsDiv.appendChild(overview);\r\n var classFilm = document.createElement('div');\r\n classFilm.className = \"film\";\r\n classFilm.appendChild(imageComplete);\r\n classFilm.appendChild(informationsDiv);\r\n divResultat.appendChild(classFilm);\r\n }\r\n }\r\n }\r\n}", "function visualizza() {\n for (let i = 0; i < parola_length; i++) {\n lettere[i].innerHTML = parola_scelta[i];\n if (!trovate[i]) {\n lettere[i].style.transition = \".8s\";\n lettere[i].style.transform = \"translateY(1rem)\";\n lettere[i].style.backgroundColor = \"var(--non-indovinata)\";\n }\n }\n res.style.display = \"none\";\n return false;\n}", "function realizarDevolucion(){\r\n let i = this.getAttribute(\"id\");\r\n i = i.charAt(1);\r\n let textoDevolucion = document.querySelector(`#devolucion${i}`).value;\r\n if(validarCampoLleno(textoDevolucion)){\r\n entregas[i].correccion = textoDevolucion;\r\n entregas[i].devolucion = true;\r\n generarTablaEntregasSinDevolucion();\r\n }else{\r\n document.querySelector(`#devolucion${i}`).value = \"Ingrese una devolución!\";\r\n }\r\n}", "function visUre() {\n container.textContent = \"\";\n alleUre.forEach((ur) => {\n if (filter == ur.Farve || filter == \"alle\") {\n let klon = temp.cloneNode(true).content;\n klon.querySelector(\"img\").src = \"images/\" + ur.Billede + \".webp\";\n klon.querySelector(\".navn\").textContent = ur.Navn;\n klon.querySelector(\".farve\").textContent = ur.Farve;\n klon.querySelector(\".pris\").textContent = ur.Pris + \",-\";\n klon.querySelector(\"article\").addEventListener(\"click\", () => {\n location.href = \"produkter_detaljer.html?id=\" + ur._id;\n });\n\n container.appendChild(klon);\n }\n });\n}", "function posarBoleta(e) {\r\n// console.log(\"has clicat el \"+ e.target.getAttribute('id'));\r\n if (numDeClics==0) {\r\n //si guanya\r\n if (e.target.getAttribute('id')==aleatorio) {\r\n resultat(\"guany\", \"Felicitats :)\");\r\n // resultat(\"Felicitats :)\");\r\n //si perd\r\n }else{\r\n // resultat(\"Torna a provar! :S\");\r\n resultat(\"perd\", \"Torna a provar! :S\");\r\n\r\n }\r\n numDeClics=numDeClics+1;\r\n }\r\n}", "function listarAvionetasDespegadasDuranteElDia() {\n var contador = 0;\n\n console.log('-------------INICIO LISTADO-----');\n console.log('Fecha: ' + describirFecha(elDiaDeHoy.fecha));\n console.log('Total de Avionetas: ' + elDiaDeHoy.cantidadTotal);\n console.log('Total de Fumigación: ' + elDiaDeHoy.cantidadDeFumigacion);\n\n console.log('');\n console.log('-----Detalle de despegues-----');\n\n // Se recorren todos los despegues\n while (contador < elDiaDeHoy.despeguesDeAvionetas.length) {\n\n console.log('Despegue: ' + contador);\n\n console.log('Hora: ' + describirHora(elDiaDeHoy.despeguesDeAvionetas[contador].hora));\n console.log('Placa: ' + elDiaDeHoy.despeguesDeAvionetas[contador].Avioneta.placa);\n console.log('Numero De Pilotos: ' + elDiaDeHoy.despeguesDeAvionetas[contador].Avioneta.cantidadPilotos);\n\n // Se toma la avioneta y se evalua si es de fumigacion para el resultado\n if (elDiaDeHoy.despeguesDeAvionetas[contador].Avioneta.esDeFumigacion) {\n console.log('Avioneta de Fumigacion: Si');\n }\n else {\n console.log('Avioneta de Fumigacion: No');\n }\n\n console.log('');\n\n // se avanza en uno el contador\n contador++;\n }\n\n console.log('-------------FIN LISTADO-----');\n}", "function displayFacture(){\n\n // Si elle existe déjà, on la détruit\n $(\"#factureDetail\").empty();\n $(\"#factureSomme\").empty();\n\n // Titre\n var titre = document.createElement(\"h2\");\n titre.setAttribute(\"class\", \"w3-center\");\n titre.innerHTML= \"La Livrairie vous remercie !\";\n\n // Si la personne a fournie ses coordonnées, on les affiches (Pas de vérification demandée dans le TP)\n if(coordonnees.nom){\n $(\"#factureCoord\").show();\n $(\"#factureNom\").text(\"Nom : \" + coordonnees.nom);\n $(\"#facturePrenom\").text(\"Prénom : \" + coordonnees.prenom);\n $(\"#factureAdresse\").text(\"Adresse : \" + coordonnees.address);\n }\n\n // On crée les éléments correspondants aux achats\n for(var p in panier){\n $(\"#factureDetail\").append(createFactureElement(panier[p]));\n }\n\n // On crée la zone somme\n var somme = createSumZone(); \n \n // Ajout de la somme\n var list = $(\"#factureSomme\").append(somme);\n\n\n // On affiche\n document.getElementById(\"factureModal\").style.display='block';\n\n // On remplie les montants de la somme\n refreshSomme();\n}", "function gestisciResponse(evento){\r\n console.log(evento);\r\n if(evento.target.readyState == 4 && evento.target.status==200){\r\n filmografia=JSON.parse(evento.target.responseText);\r\n // ordino i film per titolo\r\n filmografia.sort(sort_film);\r\n console.log(filmografia);\r\n }\r\n creaGeneri();\r\n creaAttori();\r\n selezFilm();\r\n}", "resumen_estado_nave(){\n this.ajuste_potencia();\n if (typeof this._potencia_disponible !== \"undefined\"){\n if (this._potencia_disponible){\n let estado_plasma = \"\";\n for (let i = 0; i < this._injectores.length; i++) {\n estado_plasma += \"Plasma \"+i.toString()+\": \";\n let total = this._injectores[i].get_plasma+this._injectores[i].get_extra_plasma;\n estado_plasma += total+\"mg/s \";\n }\n console.log(estado_plasma);\n\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i].get_danio_por<100){\n if (this._injectores[i].get_extra_plasma>0){\n console.log(\"Tiempo de vida: \"+this._injectores[i].tiempo_vuelo().toString()+\" minutos.\");\n } else {\n console.log(\"Tiempo de vida infinito!\");\n break;\n }\n }\n }\n } else {\n console.log(\"Unable to comply.\")\n console.log(\"Tiempo de vida 0 minutos.\")\n }\n } else {\n throw \"_potencia_disponible: NO DEFINIDA\";\n }\n }", "function calcularMejorEquipo() {\n const equipos = [\n new Equipo('Maria', [62, 34, 55]),\n new Equipo('Paula', [35, 60, 59]),\n new Equipo('Rebeca', [40, 39, 63])\n ];\n\n for (let i = 0; i < equipos.length; i++) {\n equipos[i].media = calcularMedia(equipos[i].resultados);\n }\n\n let mediaMasAlta = obtenerMediaMasAlta(equipos);\n console.log(\n `El equipo con la media más alta es el equipo ${obtenerEquipo(\n equipos,\n mediaMasAlta\n )} con una media de ${mediaMasAlta}`\n );\n}", "function tiempoPerdido(){\n\tif(compReloj == true){\n\t\tgameStart=false;\n\t\tanadirTexto(\"Lo sentimos se ha terminado el tiempo.\");\n\t\tanadirTexto(\"Has perdido la partida\");\n\t}\n}", "function seleccionarDia () {\n \n var fecha = $('#fechas_seleccionadas_cita').val();\n globalFecha = fecha;\n var idMedico = $('#idMedico').text();\n\n if (fecha) {\n var date = new Date(fecha);\n //alert(date, idMedico);\n var obj_dates_idMedico = _dates_idMedico(fecha, date.getDay(), idMedico);\n tramosDisponibles(obj_dates_idMedico);\n\n } else { \n alert(\"Selecione una fecha\");\n }\n}", "cambio(){\n\n productos.forEach(producto => {\n if(producto.nombre === this.productoSeleccionado) this.productoActual = producto;\n });\n\n //Ver si el producto actual tiene varios precios\n if(this.productoActual.variosPrecios){\n //Verificar si sobrepasa algun precio extra\n\n //Si es menor al tope del primer precio\n if(this.cantidadActual < this.productoActual.precios.primerPrecio.hasta){\n this.precioActual = this.productoActual.precios.primerPrecio.precio;\n //Seteamos el precio tachado a 0 de nuevo\n this.precioPorUnidadTachado = 0;\n }\n //Si es mayor o igual al tope del primer precio pero menor al tope del segundo\n else if(this.cantidadActual >= this.productoActual.precios.primerPrecio.hasta && this.cantidadActual < this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.segundoPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n //Si es igual o mayor al tope del segundo precio\n else if(this.cantidadActual >= this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.tercerPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n }\n }", "function TiempoRestante()\n{\n var today = new Date();\n var eventdate = new Date(fechaEvento);\n var timeLeft = (eventdate.getTime() - today.getTime());\n var e_daysLeft = timeLeft / msPerDay;\n var daysLeft = Math.floor(e_daysLeft);\n var e_hrsLeft = (e_daysLeft - daysLeft)*24;\n var hrsLeft = Math.floor(e_hrsLeft);\n var minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);\n if (timeLeft >= 0)\n return \"Quedan {0} dias, {1} horas, {2} minutos!\".format(daysLeft, hrsLeft, minsLeft);\n}", "function pelis(){\n var url = 'http://hbflix.tk//api/verPelis';\n $.ajax({\n type: \"GET\",\n url:url,\n dataType: 'json',\n timeout: 5000,\n }).done(function( data, textStatus, jqXHR ) {//data van los datos\n if ( console && console.log ) {\n\n //Estrenos\n \tdocument.getElementById(\"estrenos1\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=' '><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"estrenos\"][0][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a class='ver'><p style='color: #EC67A2;''>\"+data[\"estrenos\"][0][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"estrenos\"][0][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"estrenos2\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"estrenos\"][1][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a class='ver'><p style='color: #EC67A2;''>\"+data[\"estrenos\"][1][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"estrenos\"][1][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"estrenos3\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"estrenos\"][2][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a class='ver'><p style='color: #EC67A2;''>\"+data[\"estrenos\"][2][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"estrenos\"][2][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"estrenos4\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"estrenos\"][3][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a class='ver'><p style='color: #EC67A2;''>\"+data[\"estrenos\"][3][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"estrenos\"][3][\"aLanzamiento\"]+\"</span></div></div>\";\n //Favoritos\n document.getElementById(\"fav1\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=' '><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][0][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][0][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][0][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav2\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][1][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][1][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][1][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav3\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][2][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][2][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][2][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav4\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][3][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][3][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][3][\"aLanzamiento\"]+\"</span></div></div>\";\n //Favoritos2\n document.getElementById(\"fav5\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=' '><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][4][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][4][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][4][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav6\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][5][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][5][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][5][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav7\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][6][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][6][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][6][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"fav8\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"favoritos\"][7][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"favoritos\"][7][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"favoritos\"][7][\"aLanzamiento\"]+\"</span></div></div>\";\n //Ultimas agregadas\n document.getElementById(\"ult1\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=' '><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"ultimas\"][0][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"ultimas\"][0][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"ultimas\"][0][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"ult2\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"ultimas\"][1][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"ultimas\"][1][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"ultimas\"][1][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"ult3\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"ultimas\"][2][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"ultimas\"][2][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"ultimas\"][2][\"aLanzamiento\"]+\"</span></div></div>\";\n document.getElementById(\"ult4\").innerHTML = \"<div class='row' style='margin-left: 5%;'><div class='hijo' style=''><div class='portada-p'><img src='http://hbflix.tk/peliculas/imgPeliculas/\"+data[\"ultimas\"][3][\"titulo\"]+\"'style='height: 120px; border-radius: 8px;'></br></br><a href='/inicio/verPelicula/'><p style='color: #EC67A2;''>\"+data[\"ultimas\"][3][\"titulo\"]+\"</p></a><span style='color: #EC67A2; text-align: center;'>\"+data[\"ultimas\"][3][\"aLanzamiento\"]+\"</span></div></div>\";\n \n }\n }).fail(function( jqXHR, textStatus, errorThrown) {\n if ( console && console.log ) {\n console.log( \"La solicitud a fallado: partidas \" + textStatus);favoritos}\n });\n}", "function mostrarMediciones() {\n var medicionesContent = document.getElementById(\"mediciones-content\");\n console.log(medicionesContent);\n\n //console.log(\"mostrarMediciones()\");\n let promesa = laLogica.recuperarMediciones().then((mediciones) => {\n if (mediciones) {\n medicionesContent.innerHTML = \"\";\n mediciones.forEach((medicion) => {\n //console.log(medicion);\n let row = document.createElement(\"div\");\n row.classList.add(\"row\");\n\n let divHora = document.createElement(\"div\");\n divHora.innerText = medicion.momento\n .toString()\n .replace(\"T\", \" \")\n .replace(\"Z\", \" \");\n divHora.classList.add(\"cell\");\n let divValor = document.createElement(\"div\");\n divValor.innerText = medicion.valor;\n divValor.classList.add(\"cell\");\n\n let divUbicacion = document.createElement(\"div\");\n divUbicacion.innerText =\n \"lat: \" + medicion.ubicacion.x + \", lng: \" + medicion.ubicacion.y;\n divUbicacion.classList.add(\"cell\");\n\n row.append(divHora);\n row.append(divValor);\n row.append(divUbicacion);\n medicionesContent.appendChild(row);\n });\n } else {\n }\n });\n}", "function stampa_serie(film){\n //template per i film\n var source = $(\"#template_film\").html();\n var template = Handlebars.compile(source);\n var film = film.results;\n\n //ciclo for lungo quanto tutto l'array\n for(var i=0; i<film.length; i++){\n //context si rifa all'handlebars e gli metto dentro le proprietà da stampare\n var context = {\n 'titolo':film[i].name,\n 'titolo_originale':film[i].original_name,\n 'lingua':flag_show(film[i].original_language),\n 'voto': film[i].vote_average,\n 'stelle': stelle(film[i].vote_average),\n 'copertina': copertina(film[i].poster_path),\n 'overview': overview(film[i].overview)\n };\n //creo l'html contenente il template\n var html = template(context);\n //appendo tutto al contenitore delle carte\n $('.container_film').append(html);\n }\n\n }", "function dodajClana() {\n if (ime.value == \"\" || prezime.value == \"\" || datumRodjenja.value == \"\") {\n alert(\"Unesite sve potrebne podatke: Ime, prezime, datum rođenja!!!\");\n } else if (danasnjDatum < new moment(datumRodjenja.value)) {\n alert(\"Potrebno je da unesete datum ne mlađi od današnjeg !!!\");\n } else {\n var ispis = racunjanjeDatuma(datumRodjenja.value);\n brojClanovaPorodice();\n var row =\n \"<tr><td>\" +\n ime.value +\n \"</td><td>\" +\n prezime.value +\n \"</td><td>\" +\n datumRodjenja.value +\n \"</td><td>\" +\n ispis +\n \"</td>\" +\n trash +\n edit +\n check +\n \"</tr>\";\n var novi = tableTbody.innerHTML + row;\n tableTbody.innerHTML = novi;\n obrisiVrijednosti();\n console.table(porodica);\n }\n}", "function visualEaten()\n{\n\tdocument.getElementById(\"eaten_n\").innerHTML=\"\";\n\tdocument.getElementById(\"eaten_b\").innerHTML=\"\";\n\t//visualizza le pedine mangiate nere\n\tfor(var i=0;i<mangiate_n.length;i++)\n\t\tdocument.getElementById(\"eaten_n\").innerHTML+=mangiate_n[i];\n\t//visualizza le pedine mangiate bianche\n\tfor(var i=0;i<mangiate_b.length;i++)\n\t\tdocument.getElementById(\"eaten_b\").innerHTML+=mangiate_b[i];\n}", "function mossa(pos)\n{\n//reset in casella statistiche e messaggi a sinistra dello schermo\n\tdocument.getElementById(\"faccia\").innerHTML=\"(• ‿ •)\";\n\tif(colturno=='n')\n\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai neri\";\n\telse\n\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai bianchi\";\n\n/*_________________________PRIMO CLICK___________________________________*/\n\n\tif(cont%2==0)\n\t{\n\t\tprimo=document.getElementById(pos).innerHTML;\n\t\tvecchiaPos=pos;\n\t\t//ottengo colore giocatore\n\t\tvar lenstr=primo.length;\n\t\tvar colp=primo.charAt(lenstr-7);\n\t\t//controllo se la selezione corrisponde al colore della mossa\n\t\tif(colp!=colturno)\n\t\t{\n\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"mossa non valida...\";\n\t\t\tdocument.getElementById('faccia').innerHTML=\"(ಠ╭╮ಠ)\";\n\t\t\t\treturn;//esce dalla funzione in caso di selezione colore sbagliato\n\t\t}\n\n\t\t//cambia colore selezionato\n\t\tdocument.getElementById(pos).className=\"selezionato\";\n\t\t//controllo pedina + selezione mosse possibili\n\t\tSeleziona(primo, colp, colturno, pos);\n\t\t\n\t}\n//_____________________________SECONDO CLICK___________________________//\n\n\telse\n\t{\n\t\t//SE LA MOSSA E' VALIDA\n\t\tif(document.getElementById(pos).className==\"selezionato\"&&pos!=vecchiaPos)\n\t\t{\n\t\t\t//se viene mangiata una pedian avversaria, la faccia si stupisce e viene salvata la pedina mangiata in un array\n\t\t\tif(document.getElementById(pos).innerHTML!='<img src=\"imm/vuota.png\">')\n\t\t\t{\n\t\t\t\tdocument.getElementById('faccia').innerHTML=\"(^ ‿ ^)\";\n\t\t\t\tif(colturno=='b')//se era nera\n\t\t\t\t\tmangiate_n.push(document.getElementById(pos).innerHTML);\n\t\t\t\telse\t//se era bianca\n\t\t\t\t\tmangiate_b.push(document.getElementById(pos).innerHTML);\n\t\t\t}\n\t\t\t//se viene mangiato il re finisce il gioco\n\t\t\tif(document.getElementById(pos).innerHTML=='<img src=\"imm/re_b.png\">')//vincono i neri\t\t\t\n\t\t\t\tfine(true);\n\t\t\telse if(document.getElementById(pos).innerHTML=='<img src=\"imm/re_n.png\">')//vincono i bianchi\t\t\t\n\t\t\t\tfine(false);\n\t\t\t\n\t\t\t/*_____________________CONTROLLO ARROCCO____________________*/\n\t\t\tif(pos==\"13\" && isArrocco==true)//nero sx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"14\").innerHTML='<img src=\"imm/torre_n.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"11\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[0]=false;\n\t\t\t}\n\t\t\telse if(pos==\"17\" && isArrocco==true)//nero dx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"16\").innerHTML='<img src=\"imm/torre_n.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"18\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[0]=false;\n\t\t\t}\n\t\t\telse if(pos==\"83\" && isArrocco==true)//bianco sx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"84\").innerHTML='<img src=\"imm/torre_b.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"81\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[3]=false;\n\t\t\t}\n\t\t\telse if(pos==\"87\" && isArrocco==true)//bianco dx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"86\").innerHTML='<img src=\"imm/torre_b.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"88\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[3]=false;\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//se è stato mossa una pedina per l'arrocco, ma non è stato fatto (quindi l'arrocco non è più possibile per quelle pedine)\n\t\t\tvar sum=[\"15\", \"11\", \"18\", \"85\", \"81\", \"88\"]\n\t\t\tfor(var i=0; i<6; i++)\n\t\t\t{\n\t\t\t\tif(vecchiaPos==sum[i])\n\t\t\t\t\tarrocco[i]=false;\n\t\t\t\t\t\n\t\t\t}\n\t\t\t//spostamento pedine\n\t\t\tdocument.getElementById(pos).innerHTML=primo; //assegna alla nuova casella la pedina\n\t\t\tdocument.getElementById(vecchiaPos).innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t//cambiamenti finali\n\t\t\tcontrolloPedoneFinal(pos,primo);//controlla se la pedina spostata era un pedone è arrivato alla parte opposta della scacchiera\n\t\t\tturno++;\n\t\t\ttimersec=300;\n\t\t\tdocument.getElementById(\"mosse\").innerHTML=\"mossa numero: \"+turno;\n\t\t\t//indica a chi tocca il turno successivo\n\t\t\tif(colturno=='b')\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai neri\";\n\t\t\t\tcolturno='n';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai bianchi\";\n\t\t\t\tcolturno='b';\n\t\t\t}\n\t\t}\n\t\t//SE LA MOSSA NON E' VALIDA\n\t\telse\n\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"mossa non valida!!!\";\n\t\t\n\t\tDeseleziona();//deseleziona tutto\n\t\tvisualEaten();//visualizza le pedine mangiate\t\n\t}\n\tcont++;\n}", "function FimJogo(){\n\t\tswitch(_vitoria){\n\t\t\tcase 1:AnunciarVitoria(1);p1.Vencer();break;\n\t\t\tcase 2:AnunciarVitoria(2);p2.Vencer();break;\n\t\t\tcase 4:AnunciarVitoria(3);p3.Vencer();break;\n\t\t\tcase 8:AnunciarVitoria(4);p4.Vencer();break;\n\t\t\tcase 0:AnunciarVitoria(0);AnimacaoEmpate();break;\n\t\t\tdefault:if(_minutos==0 && _segundos==0){AnunciarVitoria(0);AnimacaoEmpate();}break;\n\t\t}\n\t}", "function esquiver() \n{\n //Cas spéciaux : Mort, ou pas d'ennemi\n if (presenceEnnemi === 666){\n dialogBox(\"Eh me saoule pas là relance le jeu ou casse toi connard J'AI AUTRE CHOSE A FOUTRE LA.\")\n \n }else if(presenceEnnemi ===0){ \n dialogBox(\"Tu donnes l'impression de danser sur les chemins, c'est mignon mais ça va pas t'aider.\")\n }\n \n //PROCEDURE HABITUELLE\n else if (presenceEnnemi = 1, tourJoueur(tour)=== true){\n var Min= Number(personnage.esquive - 5)\n var Max= Number(personnage.esquive + 15)\n var Miin = Number(1)\n var Maax = Number(100)\n function getRndInterger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;}\n\njetEsquive = getRndInterger(Min, Max);\nvaleurEsquive = getRndInterger(Miin, Maax);\nconsole.log(\"jetEsquive du joueur : \"+jetEsquive+\" et la valeur minimale à avoir était \"+valeurEsquive);\n //Esquive réussie\n if (jetEsquive >= valeurEsquive){\n actionPerso = 2;\n } \n //Echec de l'esquive\n else if (jetEsquive < valeurEsquive){\n actionPerso = 3;\n }\nreactionEnnemi();\nresetSpecial();\n }\n \n}", "function afficherResultats(verifTableau) {\n // Méthode filter() va créer un nouveau tableau avec les el triés\n // el = élément (couramment utilisé)\n // fonction callback type array qui filtre chaque el différents de la valeur true\n // .length pour avoir la longueur du tableau ET l'affichage du nbre de fautes\n const nbDeFautes = verifTableau.filter((el) => el !== true).length;\n // console.log(nbDeFautes);\n\n switch (nbDeFautes) {\n case 0:\n titreResultat.textContent = `${emojis[0]} Bravo, c\"est un sans faute ! ${emojis[0]}`;\n aideResultat.textContent =\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\n texteResultat.textContent = `5/5`;\n break;\n case 1:\n titreResultat.textContent = `${emojis[1]} Vous y êtes presque ! ${emojis[1]}`;\n aideResultat.textContent =\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\n texteResultat.textContent = `4/5`;\n break;\n case 2:\n titreResultat.textContent = `${emojis[1]} Encore un effort ... ${emojis[2]}`;\n aideResultat.textContent =\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\n texteResultat.textContent = `3/5`;\n break;\n case 3:\n titreResultat.textContent = `${emojis[2]} Il reste quelques erreurs. ${emojis[3]}`;\n aideResultat.textContent =\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\n texteResultat.textContent = `2/5`;\n break;\n case 4:\n titreResultat.textContent = `${emojis[3]} Peux mieux faire. ${emojis[3]}`;\n aideResultat.textContent =\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\n texteResultat.textContent = `1/5`;\n break;\n case 5:\n titreResultat.textContent = `${emojis[4]} Peux mieux faire. ${emojis[4]}`;\n texteResultat.textContent = `0/5`;\n break;\n default:\n \"Ce n'était pas prévu !\";\n }\n}", "function hozzaszolasMegjelenit(obj, id) {\n var str = new String();\n if (typeof(obj) == \"object\" && !obj.nulla) {\n for (var i = 0; i < obj.length; i++) {\n str += '<blockquote>';\n str += '<p>' + obj[i].szoveg + '</p>';\n str += '<footer>' + obj[i].kitol + ' <i>' + obj[i].letrehozva + '</i></footer>';\n str += '</blockquote>';\n $(\"#hszmegjelenito_\" + obj[i].id).html(str);\n\n }\n } else if (typeof(obj) == \"object\" && obj.nulla) {\n $(\"#hszmegjelenito_\" + id).html(obj.nulla);\n } else {\n console.log(\"Object type hiba: \" + obj);\n }\n\n var attr = document.getElementById(\"hszmegjelenito_\" + id);\n\n if (attr.getAttribute(\"data-volttog\" + id) == 0) {\n $(\"#hszmegjelenito_\" + id).slideDown(1500, function() {\n $(\" .spalpha_\" + id).\n removeClass(\"glyphicon glyphicon-chevron-down\").\n addClass(\"\tglyphicon glyphicon-chevron-up\")\n });\n attr.setAttribute(\"data-volttog\" + id, 1);\n } else {\n $(\"#hszmegjelenito_\" + id).slideUp(1500, function() {\n $(\".spalpha_\" + id).\n removeClass(\"glyphicon glyphicon-chevron-up\").\n addClass(\"\tglyphicon glyphicon-chevron-down\")\n });\n attr.setAttribute(\"data-volttog\" + id, 0);\n }\n }", "function renderPrestamo(data, id_prestamo){\n \n var divInfoPrestamoId = `info_pre_${id_prestamo}`;\n const divInfoPrestamo = document.querySelector(`#${divInfoPrestamoId}`);\n divInfoPrestamo.classList.replace(\"hide\",\"show\");\n\n\n divInfoPrestamo.innerHTML =\n\n `<div class=\"prestamo-item view-prestamo-info\">\n <div class=\"\">\n <label for=\"planillaIdPr\">Planilla No.: ${data[0].peticion_pago_id}</label>\n <a id=\"verPlanillaInfo\" href=\"#\" onclick=\"getDataPlanilla(${data[0].id_planilla})\">Ver Planilla</a>\n </div>\n <div class=\"\">\n <label for=\"cedulaPr\">Contratista: ${data[0].cedula}</label>\n </div>\n <div class=\"\">\n <label for=\"descripcionPr\">Razon: ${data[0].detalles}</label>\n </div>\n <div class=\"\">\n <label for=\"estadoPr\">Estado: ${data[0].estado}</label>\n </div>\n <div class=\"\">\n <label for=\"nombrePr\">Nombre: ${data[0].nombre}</label>\n </div>\n <div class=\"\">\n <label for=\"apellido1Pr\">Primer Apellido: ${data[0].apellido1}</label>\n </div>\n <div class=\"\">\n <label for=\"apellido2Pr\">Segundo Apellido: ${data[0].apellido2}</label>\n </div>\n <div class=\"\">\n <label for=\"apellido1Pr\">Monto: ${data[0].monto}</label>\n </div>\n <div class=\"\">\n <label for=\"fecha_creacionPr\">Creada: ${data[0].fecha_creacion}</label>\n </div>\n </div>\n <div class=\"prestamo-item\" id=\"view-info-planilla_${data[0].id_planilla}\"></div>\n `;\n\n\n switch (data[0].estado) {\n\n case \"pendiente\":\n\n divInfoPrestamo.innerHTML +=\n `<div class=\"planilla-item\" id=\"view-info-acciones\">\n <a id=\"verUsuario href=\"#\" onclick=\"cerrarFormularioPrestamo(${id_prestamo})\">Cerrar</a>\n <a id=\"verUsuario href=\"#\" onclick=\"rechazarPrestamo(${id_prestamo})\">Rechazar</a>\n <a id=\"pagarItem\" href=\"#\" onclick=\"autorizarPrestamo(${id_prestamo})\">Aprobar</a>\n \n \n </div>`;\n \n break;\n \n default:\n\n divInfoPrestamo.innerHTML +=\n `<div class=\"planilla-item\" id=\"view-info-acciones\">\n <a id=\"verUsuario href=\"#\" onclick=\"cerrarFormularioPrestamo(${id_prestamo})\">Cerrar</a>\n \n </div>`;\n\n break;\n }\n \n \n }" ]
[ "0.659589", "0.63849556", "0.63849247", "0.6341519", "0.62649053", "0.62314546", "0.6216256", "0.6191479", "0.61893386", "0.6160423", "0.61096406", "0.6086501", "0.6084515", "0.60821456", "0.60722154", "0.6067023", "0.60588336", "0.6039981", "0.6034579", "0.603136", "0.6030869", "0.6022594", "0.601504", "0.6005098", "0.59972864", "0.5997198", "0.5977699", "0.59714437", "0.5968158", "0.5963383", "0.5960795", "0.5956559", "0.59517986", "0.59489006", "0.5947412", "0.59410745", "0.5931616", "0.59199476", "0.59142923", "0.591378", "0.59113747", "0.59085166", "0.59028804", "0.5900257", "0.58990705", "0.58817375", "0.5868875", "0.5862609", "0.5862123", "0.5861265", "0.5858049", "0.58560854", "0.58458436", "0.5838749", "0.58362895", "0.58320916", "0.581571", "0.5814636", "0.5813244", "0.58118093", "0.580918", "0.58046496", "0.58013743", "0.57996994", "0.57970107", "0.57901114", "0.5779808", "0.5775587", "0.57741725", "0.5772434", "0.57708615", "0.576503", "0.5762367", "0.5761092", "0.57507", "0.57504743", "0.57484674", "0.57436967", "0.5741182", "0.57384276", "0.5737971", "0.57340616", "0.57324827", "0.5731763", "0.5729424", "0.572854", "0.5722383", "0.5721514", "0.5718752", "0.57174355", "0.5716511", "0.57158405", "0.5715753", "0.571233", "0.57112885", "0.5706848", "0.57059073", "0.57039195", "0.57029986", "0.57016915", "0.57001317" ]
0.0
-1
A simple elastic interaction, similar to a spring. Default bounciness is 1, which overshoots a little bit once. 0 bounciness doesn't overshoot at all, and bounciness of N > 1 will overshoot about N times. Wolfram Plots: (default bounciness = 1) (bounciness = 3)
static elastic(bounciness = 1) { const p = bounciness * Math.PI return t => 1 - Math.cos(t * Math.PI / 2) ** 3 * Math.cos(t * p) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static elastic(bounciness = 1) {\n const p = bounciness * Math.PI;\n return t => 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p);\n }", "static elastic(bounciness: number = 1): (t: number) => number {\n const p = bounciness * Math.PI;\n return (t) => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p);\n }", "logic() {\n // Loose intensity\n this.intensity = Math.max(this.intensity - this.intensityLoss, 0);\n\n // Apply velocity\n this.pos.add(this.velocity);\n }", "function elastic(t) {\n return Math.pow(2, -10 * t) * Math.sin((t - 0.075) * (2 * Math.PI) / 0.3) + 1;\n}", "function elastic(t) {\n return Math.pow(2, -10 * t) * Math.sin((t - 0.075) * (2 * Math.PI) / 0.3) + 1;\n }", "function particle(posX, posY, sizeX, sizeY, hue) {\n \n //this.indx = inDx; // Array index for this particle.\n \n this.mySize = createVector(sizeX, sizeY);\n this.pos = createVector(posX, posY);\n \n this.origPos = createVector();\n \n this.prevPos = createVector(posX,posY);\n \n this.colour = hue;\n this.visible = true;\n \n this.mortal = false; // Default, an immortal.\n this.birthTime = millis(); // Birth time.\n this.longevity = 30000; // 30 seconds.\n // Below allows us to pass in string\n // to write custom functions\n // when particle's longevity met.\n // NB leave as \"\" for default call of 'setActive(false)';\n this.afterLife = \"\"; \n \n this.screenWrap = true;\n \n this.velocity = createVector(0,0);\n this.acceleration = createVector(0,0);\n this.maxV = 1; // Topspeed.\n //this.gravity = Math.random(0.8)+0.09;\n this.gravity = 0; // Gravity that pulls to bottom of window.\n this.gravityON = false; // Gravity that pulls to bottom of window.\n \n this.damp = 0.5;\n this.dampingON = true;\n \n this.frozen = false;\n this.solid = false;\n \n // Want to bounce when hit ground or walls?\n this.groundSolid = false;\n this.wallSolid = false;\n \n this.bounciness = Math.random(0.1,7); // The higher the bounciness.\n // NB highest value is 7. Must change this.bounce() below.\n \n this.flickable = false;\n \n this.flickStrength = 7.2;\n \n // Parameters = *what* is a string, allowing you to render\n // particle in chosen style.\n // *alphaVal* is a number, from 0 to 255, setting alpha.\n this.render = function(what, alphaVal){\n \n if (!this.visible) return;\n \n if (what===\"trail\"){\n \n var colourScale = 100;\n \n var Bc = colourScale * Math.abs(this.velocity.mag())*4;\n var Gc = colourScale * Math.abs(this.velocity.x);\n var Rc = colourScale * Math.abs(this.velocity.y);\n \n Rc = constrain(Rc, 120, 255);\n Gc = constrain(Gc, 120, 255);\n Bc = constrain(Bc, 120, 255);\n \n //stroke(Rc,Gc,Bc,alphaVal);\n fill(0,0,Bc, alphaVal); \n //strokeWeight(4);\n line(this.pos.x,this.pos.y,this.prevPos.x,this.prevPos.y);\n this.prevPos = this.pos;\n return null;\n }\n \n else if (what===\"earthquaking\"){\n \n \n var colourScale = 100;\n \n var Bc = colourScale * Math.abs(this.velocity.mag())*4;\n var Gc = colourScale * Math.abs(this.velocity.x);\n var Rc = colourScale * Math.abs(this.velocity.y);\n \n Rc = constrain(Rc, 200, 255);\n Gc = constrain(Gc, 200, 255);\n Bc = constrain(Bc, 200, 255);\n \n //stroke(Rc,Gc,Bc,alphaVal);\n fill(Rc,Gc,Bc, alphaVal); \n \n //stroke (255,255,255); \n //strokeWeight(3);\n if (!quantum) noStroke();\n else stroke (255,255);\n \n fill(Rc,Gc,Bc, alphaVal);\n //point(this.pos.x,this.pos.y);\n ellipse(this.pos.x,this.pos.y,16,16);\n //line(this.pos.x,this.pos.y,this.prevPos.x,this.prevPos.y);\n // this.prevPos = this.pos;\n return null;\n \n }\n else {\n // Last resort, draw a point.\n stroke (255,255,255,alphaVal); \n strokeWeight(8);\n point(this.pos.x,this.pos.y);\n }\n \n \n \n };\n \n // Flicks particle upwards.\n this.flick = function(whichWay){\n \n this.velocity.x = 0;\n \n this.acceleration.y = -this.flickStrength;\n \n if (whichWay===\"left\") {\n if (this.acceleration.x > 0) this.acceleration.x = 0; \n this.acceleration.x -= latF;}\n else if (whichWay===\"right\"){\n if (this.acceleration.x < 0) this.acceleration.x = 0;\n this.acceleration.x += latF;}\n //console.log(\"Flicked!\");\n };\n \n this.checkMouse = function(){\n if(mouseX > this.pos.x - (this.mySize.x/2) &&\n mouseX < this.pos.x + (this.mySize.x/2) &&\n mouseY > this.pos.y - (this.mySize.y/2) &&\n mouseY < this.pos.y + (this.mySize.y/2)){\n if (mouseX < this.pos.x) { this.flick(\"right\"); return null;}\n if (mouseX > this.pos.x) {this.flick(\"left\"); return null;}\n else this.flick(\"sweet\");\n }\n\n \n \n };\n \n \n \n // Bouncing on ground only!\n // See this.flick() for 'bouncing' on solid particles.\n this.bounce = function() {\n this.pos.y = height-(this.mySize.y/2)-0.01;\n this.velocity.y = 0;//-this.velocity.y/(10-this.bounciness);\n this.acceleration.y = -this.acceleration.y/(10-this.bounciness);\n };\n \n // Checks whether this particle has\n // collided with the passed-in particle.\n // NB only works with particles.\n this.checkCollision = function(whom)\n {\n \n // NB only returns true if both particles are solid.\n if(this.frozen === false && this.solid === true &&\n whom.solid === true &&\n whom.pos.x + whom.mySize.x/2 > this.pos.x - (this.mySize.x/2) &&\n whom.pos.x - whom.mySize.x/2 < this.pos.x + (this.mySize.x/2) &&\n whom.pos.y - whom.mySize.y/2 > this.pos.y - (this.mySize.y/2) &&\n whom.pos.y + whom.mySize.y/2 < this.pos.y + (this.mySize.y/2))\n {\n \n return true;\n \n } else return false;\n };\n \nthis.setActive = function(bool){\n // If no longer active...\n if (!bool) {\n this.visible = false;\n this.frozen = true;\n this.solid = false;\n //this.pos.y = -99999; // Orbitally offscreeeeen!\n }\n};\n \n// Example of a custom afterlife state (instead of setActive(false).) \nthis.custom_snowDrop = function(){ \n \n this.birthTime = millis(); // Reborn!\n this.longevity = 5000; // 10 more seconds life!\n this.mortal = true;\n this.solid = false;\n this.frozen = false;\n // Don't forget to set new afterLife condition!\n this.afterLife = \"\";\n };\n \n this.update = function(){\n \n // Only concerns the mortal...\n if (this.mortal) {\n if (millis() - this.birthTime > this.longevity)\n {\n if (this.afterLife === \"\") this.setActive(false);\n //if (this.afterLife === \"sd\") this.custom_snowDrop();\n }\n }\n \n if (this.frozen) return;\n \n \n \n // Gravity physics, as well as general damping.\n \n \n // this.velocity.x *= this.damp;\n //this.velocity.y *= this.damp;}\n \n // Gravity (towards bottom of window).\n if (this.gravityON){\n this.acceleration.y += this.gravity;}\n \n // Core of the physics engine.\n this.pos.add(this.velocity); \n this.velocity.add(this.acceleration);\n \n // Damping (like air resistance).\n if (this.dampingON){\n \n if (this.velocity.mag() > this.maxV) // Velocity cap.\n this.velocity.setMag(this.maxV);\n // this.velocity.setMag(this.velocity.mag()* this.damp);\n // Deceleration.\n this.acceleration.setMag(this.acceleration.mag()* this.damp);\n }\n \n // Have we hit the ground?\n if (this.groundSolid && this.pos.y + (this.mySize.y/2) > height)\n this.bounce();\n \n // Check for mouse contact (i.e. flickability).\n // We check in this method since it's a physics procedure.\n if (this.flickable) this.checkMouse();\n \n \n if (this.screenWrap) {\n if (this.pos.x < 0) this.pos.x = width;\n if (this.pos.x > width) this.pos.x = 0;\n if (this.pos.y < 0) this.pos.y = height;\n if (this.pos.y > height) this.pos.y = 0;\n }\n \n \n // If hitting walls (improved).\n // At the moment, doesn't matter whether frozen.\n if(this.wallSolid && this.pos.x - (this.mySize.x/2) < 0) {\n this.pos.x = 0 + (this.mySize.x/2);\n this.acceleration.x = Math.abs(this.acceleration.x) / 2;\n }\n if(this.wallSolid && this.pos.x + (this.mySize.x/2) > width - 20) {\n this.pos.x = width - (this.mySize.x/2) - 20; \n this.acceleration.x = Math.abs(this.acceleration.x) / -2;\n }\n \n };\n \n \n}", "constructor(x, y) {\n this.x = x;\n this.y = y;\n this.size = 80;\n this.vx = 0;\n this.vy = 0;\n this.speed = 5;\n this.jitteriness = 0.1;\n this.alive = true;\n }", "update() {\n this.size -= 0.5;\n //this def e3very time new object creates its shrinks to 0.05times\n //create if ststement for update\n if (this.size < 0){\n this.x = (mouse.x + ((Math.random() * 20) - 10 ));\n this.y = (mouse.y + ((Math.random() * 20) - 10 ));\n this.size = (Math.random() * 10 ) + 20 ;\n this.weight = (Math.random() *2) - 0.5 ;\n }\n\n // create bounce effect\n this.y += this.weight;\n this.weight += 0.6;\n\n if (this.y > canvas.height - this.size){\n this.weight *= -1;\n };\n }", "function inB2(s) {\n s.draw(80 + 120, 320 - 120, 0.3, {\n easing: ease.ease('bounce-out', 1, 0.3)\n });\n}", "function floatySnow() {\n setCond({\n amp: 250,\n speedMin: .1,\n speedMax: 1,\n spinMin: .001,\n spinMax: .005,\n sizeMin: .1,\n sizeMax: .2,\n scaleMin: 1,\n scaleMax: 10,\n alphaMin: .7,\n alphaMax: .9,\n grow: false,\n numShapes: 100,\n direction: \"Down\",\n shape: \"Pill\",\n words: \"\",\n bounce: false,\n bgColor: '#7CD3D8', // blue greyish sky\n colors: ['#FFFFFF'] // white snow\n });\n}", "function main() {\n let\n cavitySepT = 1.5,\n height = 7,\n axleD = 5,\n ballD = 5,\n springID = 3.8,\n springMinL = 6.6,\n springMaxL = 5,\n cablePlateT = 2,\n width = 2 * (ballD + cavitySepT) + 2\n ballSpringCavity =\n union(\n cylinder({r: ballD / 2 + .3, h: ballD + springMaxL + cablePlateT}) // spring cavity\n .union(cylinder({r: 1.5, h: 30})).rotateX(-90), // cable inlet\n sphere({r: ballD / 2 + .3}))\n .translate([0, axleD * 2 / 3, 0])\n .union(\n cube({center: [true, false, false]})\n .scale([ballD + 0.4, ballD + springMaxL + cablePlateT - axleD / 2, height])\n .translate([0, axleD, 0])\n );\n return cylinder({r: width / 2, h: height, fn: 32})\n .union(cube({center: [true, false, false]}).scale([width, axleD + ballD + springMaxL + cablePlateT, height]))\n .subtract(cylinder({r: axleD / 2 + 0.2, h: height})) // axle hole\n .subtract(ballSpringCavity.translate([(cavitySepT + ballD) / 2, 0, height / 2]))\n .subtract(ballSpringCavity.translate([-(cavitySepT + ballD) / 2, 0, height / 2]))\n .setColor(.8, .8, .8, 1)\n}", "powerUpBrickBreaker() {\r\n if (this.powerUps.isActive(BrickBreaker) && this.powerUps.hitPaddle) {\r\n if(activeEffects) this.particleS.addParticle(floor(random(2, 10)), this.ball.pos);\r\n\r\n this.ball.behaviors(this.bricks, this.blocks);\r\n }\r\n }", "function principle5() {\n background(46, 71, 74);\n fill(255);\n noStroke();\n\n // Display title\n if (frameCount < 120){\n return;\n } else if (frameCount == 120) {\n document.getElementById('title5').style.display = 'none';\n }\n\n // Update velocity and position\n velocity += a * dir;\n pos += velocity;\n\n // After halfway, apply opposite acceleration\n if (pos <= windowWidth*.5) {\n dir = 1;\n }\n\n // If it reaches the end stop it\n if (pos <= windowWidth*.3) {\n dir = 0;\n velocity = 0;\n }\n\n translate(0, windowHeight/2);\n translate(pos, boxSize[1]);\n\n // When it's moving, shear based on velocity.\n if (dir != 0) {\n shearX(map(abs(velocity), 0, 36, 0, -.7));\n } else {\n // Once it's stopped, sway it and apply some dampening\n if (count < 8) {\n shearX(map(Math.cos(count), -1, 1, .3888888888, -.3888888888));\n } else if (count < 23.5) {\n shearX(map(Math.cos(count), -1, 1, 8*.3888888888/count, 8*-.3888888888/count));\n }\n count += .2;\n }\n\n translate(0, -boxSize[1]);\n\n rect(0, 0, boxSize[0], boxSize[1]);\n}", "function inB2(s) { s.draw(80 + 120, 320 - 120, 0.3, {easing: ease.ease('bounce-out', 1, 0.3)}); }", "function bounce() {\n ball.body.velocity.x = 400;\n if (ball.body.velocity.y > 0) {\n ball.body.velocity.y = Math.random() * 750\n }\n else {\n ball.body.velocity.y = -Math.random() * 750\n }\n ball.body.velocity.x = ball.body.velocity.x + 10\n this.counter++;\n }", "function Physics()\n{\n var self = this;\n var _b2Vec2=null, _world=null; _enabled=true;\n\tvar _scale = 10; //units per meter\n\tvar _velScale = 0.8; //velocity scale\n\tvar _gravScale = 5;\n var _gravity = _gravScale*10/_scale, _accuracy=3, _fps=60, _sleep=false;\n this.obs = [];\n \n this.Init = function( gravity, accuracy, sleep )\n {\n if( _isGles ) _script( \"/Sys/Libs/Box2d.js\" );\n\t \n _b2Vec2 = Box2D.Common.Math.b2Vec2\n \t,\t_b2BodyDef = Box2D.Dynamics.b2BodyDef\n \t,\t_b2Body = Box2D.Dynamics.b2Body\n \t,\t_b2FixtureDef = Box2D.Dynamics.b2FixtureDef\n \t,\t_b2Fixture = Box2D.Dynamics.b2Fixture\n \t,\t_b2World = Box2D.Dynamics.b2World\n \t,\t_b2MassData = Box2D.Collision.Shapes.b2MassData\n \t,\t_b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape\n \t,\t_b2CircleShape = Box2D.Collision.Shapes.b2CircleShape\n \t,\t_b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n \t\n if( gravity!=null ) _gravity = _gravScale*gravity/_scale;\n if( accuracy!=null ) _accuracy = accuracy;\n\t\tif( sleep!=null ) _sleep = sleep;\n \n\t\t//Note: we set sleep to false or objects won't slide off tipping platforms.\n _world = new _b2World( new _b2Vec2(0,_gravity), _sleep );\n }\n \n this.SetEnabled = function( enabled ) { \n\t _enabled = enabled;\n\t}\n\t\n this.Step = function()\n {\n if( !_enabled ) return;\n \n\t\t//Step the physics world.\n _world.Step( 1/_fps, _accuracy*3,_accuracy );\n _world.ClearForces();\n \n\t\t//Move the graphics world objects according to physics world.\n for( var o in self.obs )\n {\n var obj = self.obs[o];\n var body = obj.body;\n if( !body ) continue;\n \n\t\t\t//Set graphics object position and angle.\n var p = body.GetPosition();\n //obj.x = p.x / _scale - obj.width/2;\n //obj.y = p.y / _scale - obj.height/2;\n\t\t\t//obj.x = (p.x - obj.width/2) / _scale;\n //obj.y = (p.y - obj.height/2) / _scale * _asp;\n\t\t\tobj.x = p.x/_scale - obj.width/2;\n obj.y = p.y/_scale*_asp - obj.height/2;\n\t\t\t\n obj.angle = body.GetAngle()/(Math.PI*2)// /_asp; //<-- why need /_asp ?????\n\t\t\t\n //not needed cos of loop in render func: if( obj.Update ) obj.Update();\n }\n }\n\t\n //Add object to world and give it physics methods.\n this.Add = function( obj )\n {\n //Add object to list.\n self.obs.push( obj );\n \n //Add 'SetPhysics' property to source object.\n\t\t//type: fixed, moveable, dynamic\n\t\t//groups with negative nums don't interact\n \tobj.SetPhysics = function( groupId, type, density, bounce, friction, linearDamp, angularDamp )\n \t{\n var fixDef = new _b2FixtureDef;\n fixDef.density = density;\n fixDef.friction = friction;\n fixDef.restitution = bounce;\n fixDef.filter.groupIndex = groupId;\n \n //Scale up values to prevent rounding errors.\n\t\t\tif( obj.width==0 ) console.log( \"WARNING: physics cannot be set for object with zero width\" )\n var w = obj.width*_scale;\n var h = obj.height*_scale/_asp;\n\t\t\tvar x = obj.x*_scale + w/2;\n var y = obj.y*_scale/_asp + h/2;\n \n var bodyDef = new _b2BodyDef;\n\t\t\ttype = type.toLowerCase();\n bodyDef.type = (type==\"fixed\" ? _b2Body.b2_staticBody : ( type==\"moveable\" ? _b2Body.b2_kinematicBody : _b2Body.b2_dynamicBody )); \n if( linearDamp ) bodyDef.linearDamping = linearDamp;\n if( angularDamp ) bodyDef.angularDamping = angularDamp;\n\t\t\tbodyDef.position.Set( x, y );\n\t\t\tbodyDef.angle = obj.angle * Math.PI * 2\n \n\t\t\tvar shape = \"box\"\n\t\t\tif( shape!=null ) shape = shape.toLowerCase();\n if( shape!=null && shape.indexOf(\"round\")>-1 ) {\n\t\t\t\tfixDef.shape = new _b2CircleShape;\n\t\t\t\tfixDef.shape.m_radius = h/2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfixDef.shape = new _b2PolygonShape;\n\t\t\t\t//console.log( \"setbox:\" + w/2 + \",\" + h/2 )\n\t\t\t\tfixDef.shape.SetAsBox( w/2, h/2 );\n\t\t\t} \n /*\n else fixDef.shape.SetAsArray([\n new b2Vec2( x, y ),\n new b2Vec2( x+w, y ),\n new b2Vec2( x+w, y+h ),\n new b2Vec2( x, y+h )\n ], 4 );\n */\n \n var body = _world.CreateBody(bodyDef);\n obj.fixture = body.CreateFixture(fixDef);\n //body.SetPosition( new _b2Vec2( 0, 0 ) );\n body._parent = obj;\n obj.body = body;\n\t\t\tobj.fixDef = fixDef;\n\t\t\t\n\t\t\t//Update the position.\n\t\t\t//obj.UpdatePhysics();\n \t}\n \t\n\t\t//Set fixture shape (currently only a single fixture supported)\n\t\tobj.SetShape = function( shape, width, height )\n\t\t{\n\t\t\tif( width==null ) width = 1\n\t\t\tif( height==null ) height = 1\n\t\t\t\n\t\t\tvar shape = shape.toLowerCase();\n\t\t\tvar w = obj.width * _scale;\n var h = obj.height * _scale/_asp;\n\t\t\t\n\t\t\tif( obj.fixture ) obj.body.DestroyFixture( obj.fixture );\n\t\t\t\n if( shape.indexOf(\"round\")>-1 ) {\n\t\t\t\tobj.fixDef.shape = new _b2CircleShape;\n\t\t\t\tobj.fixDef.shape.m_radius = h*width/2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tobj.fixDef.shape = new _b2PolygonShape;\n\t\t\t\tobj.fixDef.shape.SetAsBox( w*width/2, h*height/2 );\n\t\t\t} \n\t\t\tobj.fixture = obj.body.CreateFixture( obj.fixDef );\n\t\t}\n\t\t\n \t//Add 'SetVelocity' property to source object.\n \tobj.SetVelocity = function( x, y, angular, bodyRelative )\n \t{\n \t if( obj.body ) \n \t {\n\t\t\t\tif( bodyRelative ) {\n\t\t\t\t\tvar a = obj.body.GetAngle()// /_asp\n\t\t\t\t\tvar xr = Math.cos(a)*x - Math.sin(a)*y\n\t\t\t\t\tvar yr = Math.sin(a)*x + Math.cos(a)*y\n\t\t\t\t\tx = xr; y = yr \n\t\t\t\t}\n \t\t//if( x!=null && y!=null) \n \t\t//\tobj.body.SetLinearVelocity( new _b2Vec2(x,y*_asp) );\n\t\t\t\tif( x!=null ) obj.body.m_linearVelocity.x = x * _scale * _velScale\n\t\t\t\tif( y!=null ) obj.body.m_linearVelocity.y = y * _scale * _velScale\n \t\tif( angular!=null ) obj.body.SetAngularVelocity( angular * Math.PI * 2 );\n \t }\n \t obj.Update();\n \t}\n\t\t\n\t\t//Add 'AddVelocity' property to source object.\n \tobj.AddVelocity = function( x, y, angular, bodyRelative )\n \t{\n \t if( obj.body && obj.body.m_type != _b2Body.b2_staticBody ) \n \t {\n\t\t\t\tobj.body.IsAwake() == false && obj.body.SetAwake(true);\n\t\t\t\t\n\t\t\t\tif( bodyRelative ) {\n\t\t\t\t\tvar a = obj.body.GetAngle() // /_asp\n\t\t\t\t\tvar xr = Math.cos(a)*x - Math.sin(a)*y\n\t\t\t\t\tvar yr = Math.sin(a)*x + Math.cos(a)*y\n\t\t\t\t\tx = xr; y = yr\n\t\t\t\t}\n \t\tif( x!=null ) obj.body.m_linearVelocity.x += x * _scale * _velScale\n\t\t\t\tif( y!=null ) obj.body.m_linearVelocity.y += y * _scale * _velScale\n \t\tif( angular!=null ) obj.body.m_angularVelocity += angular * Math.PI * 2\n \t }\n \t obj.Update();\n \t}\n \t\n\t\t//Get the velocity of the object ( \"x\", \"y\", \"angular\", null)\n\t\tobj.GetVelocity = function( component )\n\t\t{\n\t\t\tif( obj.body )\n\t\t\t{\n\t\t\t\tif( component==\"x\" ) return obj.body.m_linearVelocity.x\n\t\t\t\telse if( component==\"y\" ) return obj.body.m_linearVelocity.y\n\t\t\t\telse if( component==\"angular\" ) return obj.body.m_angularVelocity\n\t\t\t\telse { \n\t\t\t\t\tvar vx = obj.body.m_linearVelocity.x; var vy = obj.body.m_linearVelocity.y\n\t\t\t\t\treturn Math.sqrt( vx*vx + vy*vy )\n\t\t\t\t}\n\t\t\t}\n\t\t\telse return 0\n\t\t}\n\t\t\n\t\t//Add 'ApplyImpulse' property to source object.\n\t\t// dx, dy are offsets from object center (range -1 to +1)\n\t\tobj.ApplyImpulse = function( x, y, offsetX, offsetY )\n\t\t{\n \t if( obj.body ) \n \t {\n \t\tif( x!=null && y!=null) \n\t\t\t\t{\n\t\t\t\t\tvar w = obj.width*_scale;\n\t\t\t\t\tvar h = obj.height*_scale/_asp;\n\t\t\t\t\tvar fx = obj.x*_scale + w/2 + w * (offsetX ? offsetX : 0)/2;\n\t\t\t\t\tvar fy = obj.y*_scale/_asp + h/2 + h * (offsetY ? offsetY : 0)/2;\n \t\t\tobj.body.ApplyImpulse( new _b2Vec2(x/_fps,y/_fps), new _b2Vec2(fx,fy) );\n\t\t\t\t}\n \t }\n \t obj.Update();\n \t}\n\t\t\n \t//Add 'Update' property to source object.\n \tobj.UpdatePhysics = function()\n \t{\n \t if( obj.body ) \n \t {\n \t var w = obj.width*_scale;\n var h = obj.height*_scale/_asp;\n var x = obj.x*_scale + w/2;\n var y = obj.y*_scale/_asp + h/2;\n \n \t\t obj.body.SetPosition( new _b2Vec2( x, y ) );\n\t\t\t\tobj.body.SetAngle( obj.angle * Math.PI * 2 ) //* _asp ); //<-- why need _asp ?????\n \t }\n \t}\n\t\t\n\t\t//Disable or enable physics for this object.\n\t\tobj.EnablePhysics = function( enable ) \n\t\t{\n\t\t\tif( obj.body ) obj.body.SetActive( enable )\n\t\t}\n\t\t\n\t\tobj.RemovePhysics = function()\n\t\t{\n\t\t\tif( obj.body ) {\n\t\t\t\t_world.DestroyBody( obj.body )\n\t\t\t\tobj.body = null\n\t\t\t}\n\t\t}\n }\n \n //Detect collisions.\n this.SetOnCollide = function( callback )\n {\n var listener = new Box2D.Dynamics.b2ContactListener;\n _world.SetContactListener( listener );\n \n listener.BeginContact = function(contact) \n\t\t{\n //console.log( contact.GetFixtureA().GetBody() );\n\t\t\tvar a = contact.GetFixtureA().GetBody()\n\t\t\tvar b = contact.GetFixtureB().GetBody()\n\t\t\tif( a.IsActive() && b.IsActive() ) \n\t\t\t{\n\t\t\t\t//Sort objects alphabetically by group name\n\t\t\t\tvar aa=a, bb=b;\n\t\t\t\tif( a._parent.group > b._parent.group ) { aa=b; bb=a }\n\t\t\t\t\n\t\t\t\t//setTimeout or we cant destroy body cos it's locked\n\t\t\t\tsetTimeout( function(){ callback( aa._parent, bb._parent ) }, 0 )\n\t\t\t}\n }\n \n listener.EndContact = function(contact) \n\t\t{\n //console.log( contact.GetFixtureA().GetBody() );\n var a = contact.GetFixtureA().GetBody()\n\t\t\tvar b = contact.GetFixtureB().GetBody()\n\t\t\t//if( a.IsActive() && b.IsActive() ) callback( a._parent, b._parent );\n }\n }\n \n \n}", "function BounceBall() {\n this.radius = Math.random() * 10 + 10;\n this.x = Math.random() * (canWidth - this.radius * 2) + this.radius;\n this.y = Math.random() * (canHeight - this.radius * 2) + this.radius;\n this.color = randomColor();\n this.dy = Math.random() * 2;\n this.dx = Math.round((Math.random() - 0.5) * 10);\n}", "function OnBeat(index) {\n\n //if (index % 2 === 0) console.log('off');\n //console.log('danceability: ' + danceability);\n beatAlternator++;\n\n\n var maxDisplaceValue = Math.min(energy * energy, 1);\n\n var tween = new TWEEN.Tween(danceBallBuffers)\n .to( {rotateBoostBuffer: maxDisplaceValue}, 80)\n .start();\n\n\n var tween = new TWEEN.Tween(danceBallBuffers)\n .to( {displacementScaling: maxDisplaceValue}, 200)\n .start();\n\n //console.log(\"beat\");\n}", "constructor() {\n this.x = random(100, width - 100);\n this.y = -25;\n //devides the height of the screen into steps, where the bolt changes angles\n this.steps = ceil(random(15, 25));\n this.stepSize = ceil(height/this.steps);\n this.color = color(random(220, 255), random(220, 255), random(150, 220));\n //random yellow to white colour\n this.size = floor(random(3, 7));\n //thickness\n }", "knockHit(){\n this.knockResistance--;\n this.body.velocity.x\n }", "visualPowerUp() {\r\n if (this.powerUps.isPowerUpActive && activeEffects) {\r\n this.particleS.setColor('#9A8DF2');\r\n const temp1 = createVector(this.paddle.x, this.paddle.y);\r\n this.particleS.addParticle(2, temp1);\r\n const temp2 = createVector(this.paddle.x + this.paddle.w, this.paddle.y);\r\n this.particleS.addParticle(2, temp2);\r\n }\r\n }", "function letItSnow() {\n // Calling the addSnow function in a loop to add 50 snow elements\n for (let i = 0; i < 50; i++) {\n addSnow();\n }\n}", "function addBall (e) {\n p[num] = new Pelota();\n\n\tif (e) {\n\t\tp[num].pos = [e.clientX, e.clientY];\n\t}\n\n\t// p[num].color = \"rgb(\" + parseInt(Math.random() * 255) + \", \"\n\t// \t+ parseInt(Math.random() * 255) + \", \" + parseInt(Math.random() * 255) + \")\";\n p[num].color = \"white\";\n\tp[num].velocity = [\n\t\tMath.random() * 20 - 10,\n\t\tMath.random() * 5 - 2.5\n\t];\n\tp[num].bounciness = Math.random() * 0.1 + 0.9;\n\tp[num].friction = Math.random() * 0.05 + 1;\n\tp[num].init();\n\tnum++;\n}", "function Evilball(x, y, vx, vy, size, speed, color) {\n this.x = x;\n this.y = y;\n this.vx = vx;\n this.vy = vy;\n this.size = size;\n this.speed = speed;\n this.color = color;\n}", "@autobind\n clumpColors(event) {\n this.clumpPoints = [];\n this.clumpMass = [];\n this.clumpTargetPoints = [];\n this.clumpOriginPoints = [];\n var minClumps = 20;\n var maxClumps = 100;\n var blueClumps = minClumps + Math.round(Math.random()*maxClumps);\n var redClumps = minClumps + Math.round(Math.random()*maxClumps);\n var greenClumps = minClumps + Math.round(Math.random()*maxClumps);\n var yellowClumps = minClumps\n var max = 10;\n for (var i=0; i< blueClumps + redClumps + greenClumps + yellowClumps; i++) {\n this.clumpPoints[i] = new THREE.Vector3(Math.random() * max-(max*0.5), Math.random() * max-(max*0.5), Math.random() * max-(max*0.5));\n this.clumpOriginPoints[i] = new THREE.Vector3(0,0,0);\n this.clumpTargetPoints[i] = new THREE.Vector3(0,0,0);\n this.clumpMass[i] = -10 - Math.random()*200;\n this.limits[i] = 0.02 + Math.random() * 0.03;\n }\n for (var i = 0, i3 = 0, l = this.particleCount; i < l; i ++, i3 += 3 ) {\n if (i/l < 0.25) {\n this.e = 0 + Math.round(Math.random() * (redClumps-1));\n } else if(i/l < 0.5) {\n this.e = redClumps + Math.round(Math.random() * (greenClumps-1));\n } else if(i/l < 0.75) {\n this.e = redClumps + greenClumps + Math.round(Math.random() * (blueClumps-1));\n } else {\n this.e = redClumps + greenClumps + blueClumps + Math.round(Math.random() * (yellowClumps-1));\n }\n this.attractTargetArray [ i ] = this.e;\n }\n\n this.geometry.getAttribute( 'attracttarget' ).needsUpdate = true;\n this.material.uniforms[ 'mode' ].value = 4.0;\n\n this.tweenContainer.scale = 0;\n this.tweenContainer.time = 0;\n this.tweenContainer.colorTime = 0;\n\n TweenMax.killTweensOf(this.tweenContainer);\n\n TweenMax.to(this.tweenContainer, 3, {scale: 10, time: 1, colorTime: 1, onUpdate: this.updateColorTime, onComplete: this.updateColorTime, ease: Power2.easeOut});\n\n TweenMax.to(this.mesh.position, 3, {x: 0, y:0, z:0, ease: Power2.easeOut});\n TweenMax.to(this.mesh2.position, 3, {x: 0, y:0, z:0, ease: Power2.easeOut});\n }", "function mousePressed() {\n // Here's Wispy to keep you company while I work on oscillation.\n // wispy.activate(\n // 50, // amplitude\n // 10, // period\n // 10 // delay\n // )\n\n for (let particle of particles) {\n particle.activate(\n 16, // amplitude\n 8, // period\n particle.originalX // delay. This should change as the\n // particles get farther from the origin's x-coordinate. I can\n // also subtract the\n )\n }\n}", "function bouncingBall(h,bounce,window) {\n var count = -1;\n if (bounce > 0 && bounce < 1) while (h > window) count+=2, h *= bounce;\n return count;\n}", "function whoam_rays() {\n\t\t$('.whoam_rays').velocity(\n\t\t{\n\t\ttop: 90,\n\t\topacity: 1,\n\t\t},\n\t\t1000);\n\t}", "function bouncingBall(h, bounce, window) {\n console.log(h, bounce, window)\n if(bounce >= 1 || bounce < 0 || h < 0 || window >= h) return -1\n var res = 1\n h *= bounce\n while(h > window) {\n h *= bounce\n res += 2\n }\n return res\n}", "function exampleScenario() {\n\tnewtonsBalls();\n\tcreateMassSpring(550, 180, 1.5, 20,1, balls, springs);\n\trandomBalls(offset, canvas.width-offset, canvas.height-offset-50, canvas.height-offset, 0, -0.7,5, 1,8, {\"radius\":8},balls);\n\tballs.push(new Ball(canvas.width/2, canvas.height-offset-50, 6, 0, -2.5, {\"radius\":24, \"colour\":\"#AA00FF\"}));\n}", "@autobind\n triggerQuestionEffect(color) {\n this.questionDisplayParticleStart = 0;\n switch (color) {\n case \"green\":\n this.questionDisplayParticleStart = this.particleCount * 0.25;\n break;\n case \"blue\":\n this.questionDisplayParticleStart = this.particleCount * 0.5;\n break;\n case \"yellow\":\n this.questionDisplayParticleStart = this.particleCount * 0.75;\n break;\n }\n\n if (color != this.currentColor) {\n this.currentColor = color;\n this.questionDisplayParticleEnd = this.questionDisplayParticleStart + this.questionParticleMin + Math.round(Math.random()*this.quesitonParticleVariable);\n\n for (var i = 0, i3 = 0, l = this.particleCount2; i < l; i ++, i3 += 3 ) {\n this.scaleArray2[i] = 0;\n this.scaleOriginArray2[i] = 0;\n this.scaleTargetArray2[i] = 0;\n }\n\n for (var i =0, i3 = 0, l = this.particleCount; i < l; i++, i3 += 3){\n this.scaleOriginArray[i] = this.scaleArray[i];\n this.scaleTargetArray[i] = 0;\n this.opacityArray[i] = 1.0;\n\n if ( i/l < 0.25 ) {\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][0].length);\n this.colorsTargetArray[ i3 + 0 ] = this.colors[this.colorSet][0][this.a][0];\n this.colorsTargetArray[ i3 + 1 ] = this.colors[this.colorSet][0][this.a][1];\n this.colorsTargetArray[ i3 + 2 ] = this.colors[this.colorSet][0][this.a][2];\n } else if ( i/l < 0.5 ) {\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][1].length);\n this.colorsTargetArray[ i3 + 0 ] = this.colors[this.colorSet][1][this.a][0];\n this.colorsTargetArray[ i3 + 1 ] = this.colors[this.colorSet][1][this.a][1];\n this.colorsTargetArray[ i3 + 2 ] = this.colors[this.colorSet][1][this.a][2];\n } else if ( i/l < 0.75 ) {\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][2].length);\n this.colorsTargetArray[ i3 + 0 ] = this.colors[this.colorSet][2][this.a][0];\n this.colorsTargetArray[ i3 + 1 ] = this.colors[this.colorSet][2][this.a][1];\n this.colorsTargetArray[ i3 + 2 ] = this.colors[this.colorSet][2][this.a][2];\n } else if ( i/l < 1 ) {\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][3].length);\n this.colorsTargetArray[ i3 + 0 ] = this.colors[this.colorSet][3][this.a][0];\n this.colorsTargetArray[ i3 + 1 ] = this.colors[this.colorSet][3][this.a][1];\n this.colorsTargetArray[ i3 + 2 ] = this.colors[this.colorSet][3][this.a][2];\n }\n }\n\n for(var i = this.questionDisplayParticleStart, i3 = this.questionDisplayParticleStart*3, l = this.particleCount; i<this.questionDisplayParticleEnd; i++, i3 +=3){\n\n this.scaleTargetArray [ i ] = 10 + Math.random()*60;\n\n this.translateArray[i3 + 0] = Math.random()*8 - 4;\n this.translateArray[i3 + 1] = Math.random()*4 - 2;\n this.translateArray[i3 + 2] = Math.random()*4 - 2;\n this.opacityArray[i] = 1.0;\n\n switch (color) {\n case \"red\":\n if( Math.round(Math.random()) ) {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][0][0][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][0][0][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][0][0][2];\n } else {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][0][1][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][0][1][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][0][1][2];\n }\n break;\n case \"green\":\n if( Math.round(Math.random()) ) {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][1][0][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][1][0][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][1][0][2];\n } else {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][1][1][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][1][1][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][1][1][2];\n }\n break;\n case \"blue\":\n if( Math.round(Math.random()) ) {\n this.colorsArray[i3 + 0] = 0.243;\n this.colorsArray[i3 + 1] = 0.509;\n this.colorsArray[i3 + 2] = 0.968;\n } else {\n this.colorsArray[i3 + 0] = 0.729;\n this.colorsArray[i3 + 1] = 0.87;\n this.colorsArray[i3 + 2] = 0.988;\n }\n break;\n case \"yellow\":\n if( Math.round(Math.random()) ) {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][3][0][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][3][0][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][3][0][2];\n } else {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][3][1][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][3][1][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][3][1][2];\n }\n break;\n }\n\n }\n\n }\n this.geometry.getAttribute( 'opacity' ).needsUpdate = true;\n\n this.tweenContainer.time = 0;\n\n TweenMax.to(this, 1, {fadeDistance: 300});\n\n TweenMax.to(this.camera.position, 3, {x:0, y:0, z:1000, ease: Power2.easeOut});\n TweenMax.to(this.camera.rotation, 3, {z: 0, x: 0, y: 0});\n\n TweenMax.to(this.mesh.position, 3, {x: 200, y:0, z:0, ease: Power2.easeOut});\n TweenMax.to(this.mesh2.position, 3, {x: 200, y:0, z:0, ease: Power2.easeOut});\n TweenMax.killTweensOf(this.tweenContainer);\n TweenMax.to(this.tweenContainer, 1, {time:1, ease:Power2.easeOut});\n\n this.geometry.getAttribute( 'translate' ).needsUpdate = true;\n this.geometry.getAttribute( 'scale' ).needsUpdate = true;\n\n this.material.uniforms[ 'mode' ].value = 3.0;\n }", "function elastic(t, p) {\n return t === 0 || t === 1 ? t :\n -Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2.0) * Math.asin(1))) * (Math.PI * 2)) / p );\n }", "function bombs(){\r\n \tpineapples = game.add.group();\r\n pineapples.enableBody = true;\r\n pineapples.physicsBodyType = Phaser.Physics.ARCADE;\r\n\r\n for (var i = 0; i < 10; i++)\r\n {\r\n var pineapple = pineapples.create(200 + i * 48,50, 'pineapple');\r\n\r\n //This allows your sprite to collide with the world bounds like they were rigid objects\r\n pineapple.body.collideWorldBounds=true;\r\n pineapple.body.gravity.x = game.rnd.integerInRange(-50, 50);\r\n pineapple.body.gravity.y = 100 + Math.random() * 100;\r\n pineapple.body.bounce.setTo(1.1, 1.1);\r\n } \r\n }", "start () {\n if (this.ball.velocity.x === 0 && this.ball.velocity.x === 0) {\n this.ball.velocity.x = 3 * (Math.random() > .5 ? 1 : -1);\n this.ball.velocity.y = 3 * (Math.random() * 2 - 1);\n this.ball.velocity.len = 3;\n }\n }", "@autobind\n triggerIntroEffect(color) {\n this.clearLabels();\n\n if (this.pause) {\n this.unPauseVisuals();\n }\n\n this.mesh2.position.z = 0;\n for (var i = 0, i3 = 0, l = this.particleCount2; i < l; i ++, i3 += 3 ) {\n this.scaleArray2[i] = 0;\n this.scaleOriginArray2[i] = 0;\n this.scaleTargetArray2[i] = 0;\n this.opacityArray2[i] = 1;\n\n this.translateArray2[i3 + 0] = 0;\n this.translateArray2[i3 + 1] = 0;\n this.translateArray2[i3 + 2] = 0;\n this.targetArray2[i3 + 0] = 0;\n this.targetArray2[i3 + 1] = 0;\n this.targetArray2[i3 + 2] = 0;\n }\n\n for (var i =0, i3 = 0, l = this.particleCount; i < l; i++, i3 += 3){\n this.scaleOriginArray[i] = this.scaleArray[i];\n this.scaleTargetArray[i] = 0;\n this.opacityArray[i] = 1.0;\n }\n this.geometry.getAttribute('opacity').needsUpdate = true;\n\n switch (color) {\n case \"blue\":\n this.colorsArray2[0] = 0.2588;\n this.colorsArray2[1] = 0.5215;\n this.colorsArray2[2] = 0.9568;\n break;\n case \"red\":\n this.colorsArray2[0] = this.colors[this.colorSet][1][0][0];\n this.colorsArray2[1] = this.colors[this.colorSet][1][0][1];\n this.colorsArray2[2] = this.colors[this.colorSet][1][0][2];\n break;\n case \"yeallow\":\n this.colorsArray2[0] = this.colors[this.colorSet][2][1][0];\n this.colorsArray2[1] = this.colors[this.colorSet][2][1][1];\n this.colorsArray2[2] = this.colors[this.colorSet][2][1][2];\n break;\n case \"green\":\n this.colorsArray2[0] = this.colors[this.colorSet][3][0][0];\n this.colorsArray2[1] = this.colors[this.colorSet][3][0][1];\n this.colorsArray2[2] = this.colors[this.colorSet][3][0][2];\n break;\n }\n\n this.triggerQuestionEffect(color);\n\n this.scaleTargetArray2 [ 0 ] = 30000;\n\n this.translateArray2[0] = -2;\n this.translateArray2[1] = 0;\n this.translateArray2[2] = -100;\n\n this.targetArray2[0] = -2;\n this.targetArray2[1] = 0;\n this.targetArray2[2] = -100;\n this.tweenContainer.time = 0;\n\n TweenMax.to(this.tweenContainer, 1, {time: 1});\n TweenMax.to(this.mesh2.position, 1, {z: -100});\n\n this.material.uniforms[ 'mode' ].value = 3.0;\n }", "function scene1() {\n background(backdrop);\n image(player, cx, cy, cr, cr);\n cx += (targetX - cx) * easing;\n cy += (targetY - cy) * easing;\n\n //all butterflies \n\n //other butterdlies \n for (let i = 0; i < bubbles.length; i++) {\n bubbles[i].move();\n bubbles[i].show();\n }\n \n // score board!\n fill('#03a9f4');\n textSize(50);\n textFont('Impact');\n text(\"Score: \" + score, 10, 45);\n\n\n}", "shootBeam() {\n var beam = new Beam(this);\n this.beamSound.play(); //play the noise\n }", "function update() {\r\n // 'ticks' counts the number of frames from the start of the game\r\n if (!ticks) {\r\n // Initialize variables at the first frame (ticks === 0)\r\n balls = [];\r\n // 'vec()' creates a 2d vector instance\r\n walls = times(5, (i) => vec(i * -29, -9));\r\n }\r\n if (!(ticks % 99)) {\r\n // 'rnd()' returns a random number\r\n balls.push({ p: vec(rnd(50), 0), v: 0 });\r\n }\r\n // 'color()' sets a drawing color\r\n color(\"blue\");\r\n walls.map((w) => {\r\n // 'input.isPressed' returns true if\r\n // a mouse button, a key or a touch screen is pressed\r\n w.x -= input.isPressed ? 2 : 1;\r\n // 'box()' draws a rectangle\r\n box(w, 36, 3);\r\n if (w.x < -19) {\r\n w.x += rnd(130, 150);\r\n w.y = rnd(50, 90);\r\n }\r\n });\r\n color(\"purple\");\r\n balls.map((b) => {\r\n if ((b.p.y += b.v += 0.03) > 99) {\r\n // 'play()' plays a sound effect\r\n play(\"explosion\");\r\n // A game is over when 'end()' is called\r\n end();\r\n }\r\n // 'box()' returns a collision status\r\n if (box(b.p, 5).isColliding.rect.blue) {\r\n play(\"select\");\r\n // 'score' represents the score of the game\r\n score++;\r\n b.p.y += (b.v *= -1) * 2;\r\n }\r\n });\r\n}", "constructor(x, y, img) {\n this.pos = createVector(random(x - 20, x + 20), y);\n let vx = randomGaussian() * 0.3;\n let vy = randomGaussian() * 0.5 - 1;\n this.vel = createVector(vx, vy);\n // this.acc = createVector(0.1, this.);\n\n this.life = round(random(50, 150));\n this.size = random(30, 50);\n this.alpha = 255;\n \n // let xDiff = abs(x - this.pos.x);\n let xDiff = log(map(abs(x - this.pos.x), 0, 20, 0.1, 10)) + 1;\n this.h = round(map(xDiff, 0, 2, 50, 0));\n this.s = floor(random(90, 100));\n this.l = round(map(xDiff, 0, 1, 70, 50));\n // this.flameColor = color('hsl(' + h + ', ' + s + '%, ' + l + '%)');\n \n this.texture = img;\n\n if (random(100) > 95) {\n this.life += 10;\n this.spark = true;\n }\n\n }", "function draw() {\n background(0, 0, 0);\n frameRate(50);\n fill(0, 25);\n rect(0, 0, width, height);\n fill(255);\n ellipse(random(width), random(height), 10, 10);\n\n //calling zenomorph function and movement\n drawXenoMorph()\n if (xCoord2 > 250) {\n xCoord2 = xCoord2 - 1;\n }\n if (yCoord2 < 240) {\n yCoord2 = yCoord2 + 1;\n }\n //calling Riley function and movement\n drawRiley()\n if (xCoord3 < 125) {\n xCoord3 = xCoord3 + 1;\n }\n if (yCoord3 > 300) {\n yCoord3 = yCoord3 - 1;\n }\n\n //calling baby zenomorph function to appear once both\n //Zenomorph and Riley meet\n if ((xCoord2 < 251) && (yCoord2 > 239) && (xCoord3 > 124) && (yCoord3 < 301)) {\n scale(.5);\n for (i = 0; i < XBABY_TO_DRAW; i = i + 1) {\n frameRate(10)\n drawBabyzenomorph(round(random(CONST_WIDTH * 2, 0)), round(random(0, CONST_HEIGHT * 2)))\n }\n\n }\n //baby Zenomporph\n //creating the function to draw the baby zenomorph\n function drawBabyzenomorph(x, y) {\n fill('grey')\n stroke('grey')\n strokeWeight(5)\n ellipse(x, y, w)\n ellipse(x, y - 20, w + 5, 25)\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 25, y - 25);\n vertex(x - 25, y - 25);\n vertex(x - 20, y - 35)\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 25, y - 25);\n vertex(x + 25, y - 25);\n vertex(x + 20, y - 35);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 30, y - 15);\n vertex(x + 30, y - 15);\n vertex(x + 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 30, y - 15);\n vertex(x - 30, y - 15);\n vertex(x - 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 35, y + 5);\n vertex(x - 35, y + 5);\n vertex(x - 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 35, y + 5);\n vertex(x + 35, y + 5);\n vertex(x + 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 10, y - 50);\n vertex(x - 10, y - 50);\n vertex(x - 25, y - 60);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 10, y - 50);\n vertex(x + 10, y - 50);\n vertex(x + 25, y - 60);\n endShape();\n\n beginShape(TRIANGLES)\n vertex(x - 10, y);\n vertex(x + 10, y);\n vertex(x, y + 50);\n vertex(x - 5, y + 40);\n vertex(x + 5, y + 40);\n vertex(x, y + 75);\n endShape();\n }\n}", "function _beeswarm () {} // constructor ???", "set animatePhysics(value) {}", "function ballHitPaddle(ball, paddle) {\n ball.animations.play('wobble');\n ball.body.velocity.x = -1 * 5 * (paddle.x - ball.x)\n}", "function dogBounce() {\n dogInit();\n\n // if it's currently not bouncing but should be\n if ((cursor === \"both\" || cursor === \"ball\" || (cursor === \"bell\" && dogIsConditioned === true) )) {\n dog.classList.add(\"bounce\"); // make dog jump\n }\n // if it shouldn't be bouncing\n else { // if user wants to put stimuli back\n dog.classList.remove(\"bounce\");\n }\n}", "function BossBlue(player){\n Boss.call(this, player, \"enemy2\", 0x00bfff, BossNamespace.Color.blue);\n const boss = this;\n this.behaviors = [\n // Entry behavior\n {\n time : 0,\n beginPosition : function() {return new THREE.Vector2(-14.0, 20);},\n begin : function(){\n boss.bulletProps.speed = 7.5;\n boss.bulletProps.angleAperture = 180;\n boss.bulletProps.number = 40;\n boss.shotTimer.goalTime = 3.0;\n boss.shotTimer.running = true;\n },\n play : function(){\n boss.position.x = Math.cos(this.time + Math.PI) * 14;\n if(boss.player.pivot != undefined){\n boss.facePoint = boss.player.pivot.position;\n }\n this.time += Game.delta * 1.25;\n }\n },\n // Magic circle beavior\n {\n time : 0,\n beginPosition : function(){\n if(boss.player != undefined){\n return boss.player.position.clone().add(new THREE.Vector2(-1.0, 0.0).multiplyScalar(this.radius));\n }\n return new THREE.Vector2();\n },//new THREE.Vector2(0.0, 0.0),\n speed : -2.2,//-1.2\n radius : 10,\n rotator : new THREE.Vector2(1.0, 0.0),\n begin : function(){\n const _this = this;\n boss.bulletProps.speed = 10.5;//5.5\n boss.bulletProps.angleAperture = 30;\n boss.bulletProps.number = 1;\n boss.shotTimer.goalTime = 0.1;//0.35\n boss.shotTimer.retrigger();\n },\n play : function(){\n //\n this.time += Game.delta;\n this.rotator.set(1.0, 0.0);\n this.rotator.rotateAround(new THREE.Vector2(), this.time * this.speed+ Math.PI);\n // TODO ease position...\n if(boss.player.pivot != undefined){\n boss.position = boss.player.position.clone().add(this.rotator.clone().multiplyScalar(this.radius));\n boss.facePoint = boss.player.pivot.position;\n boss.facePoint.add(new THREE.Vector2(-20.0, 0.0));\n }\n },\n end : function(){\n }\n },\n // spread behavior\n {\n time : 0,\n speed : 1,\n beginPosition : function(){ return new THREE.Vector2(0.0, 0.0);},\n begin : function(){\n boss.bulletProps.speed = 4.0;\n boss.bulletProps.angleAperture = 360;\n boss.bulletProps.number = 11;\n boss.shotTimer.goalTime = 1.0;\n boss.shotTimer.retrigger();\n boss.facePoint.x = Math.cos(this.time * this.speed + Math.PI + 2.0);\n boss.facePoint.y = Math.sin(this.time * this.speed + Math.PI + 2.0);\n },\n play : function(){\n boss.facePoint.x = Math.cos(this.time * this.speed + Math.PI + 2.0);\n boss.facePoint.y = Math.sin(this.time * this.speed + Math.PI + 2.0);\n this.time += Game.delta;\n }\n },\n // line behavior\n {\n speed : 1.5, //1.4\n beginPosition : function(){ \n if(boss.player != undefined){\n return new THREE.Vector2(boss.player.position.x, 25.0);\n }\n return new THREE.Vector2();\n },\n begin : function(){\n boss.bulletProps.speed = 8.0;\n boss.bulletProps.angleAperture = 180;\n boss.bulletProps.number = 50;\n boss.shotTimer.goalTime = 1.2;\n boss.shotTimer.retrigger();\n },\n play : function(){\n if(boss.player != undefined){\n boss.position.x = boss.player.position.x;\n }\n boss.facePoint.x = boss.position.x;\n boss.facePoint.y = boss.position.y - 1.0;\n }\n },\n // DVD behavior\n {\n timer : null,\n beginPosition : function() {return new THREE.Vector2(10.0, 10.0);},\n force : new THREE.Vector2(),\n speed : 11,\n faceAngleVector : new THREE.Vector2(1.0, 0.0),\n begin : function(){\n const _this = this;\n boss.bulletProps.speed = 2;\n boss.bulletProps.angleAperture = 240;\n boss.bulletProps.number = 1;\n boss.shotTimer.goalTime = 0.3;\n boss.shotTimer.retrigger();\n this.timer = boss.addTimer(0.2, function(){\n //const facePoint = boss.position.clone();\n _this.faceAngleVector.rotateAround(new THREE.Vector2(), Math.random() * Math.PI * 2);\n //boss.facePoint.set(boss.position.x + Math.random() - 0.5, boss.position.y + Math.random() - 0.5);\n }, true);\n this.timer.retrigger();\n //\n this.force.x = 1.0; //Math.random() > 0.5? 1.0 : -1.0;\n this.force.y = 1.0; //Math.random() > 0.5? 1.0 : -1.0;\n },\n play : function(){\n if(Math.abs(boss.position.x) >= boss.widthLimit){\n boss.position.x -= Math.sign(this.force.x) * this.speed / 20;\n this.force.x *= -1;\n }\n if(Math.abs(boss.position.y) >= boss.heightLimit - 2.5){\n boss.position.y -= Math.sign(this.force.y) * this.speed / 20;\n this.force.y *= -1;\n }\n boss.position.add(this.force.clone().multiplyScalar(Game.delta * this.speed));\n boss.facePoint = boss.position.clone().add(this.faceAngleVector);\n },\n end : function(){\n timer.toRemove();\n }\n }\n ];\n}", "function displayBubble(){\n // moving the bubble\n bubble.x += bubble.vx;\n bubble.y += bubble.vy;\n\n if (bubble.y < 0){\n bubble.x = random(width);\n bubble.y = height;\n }\n\n //where we change the speed of how fast the ball is moving\n //based on your points\n if (count === 4){\n bubble.vy = -5;\n bubble.r = 255;\n bubble.g = 255;\n bubble.b = 0;\n\n }\n\n// where if you get to a score of 7 it will icrease the difficulty\n// by increasing the speed and change the colour\n if (count === 7){\n bubble.vy = -10;\n bubble.r = 255;\n bubble.g = 0;\n bubble.b = 0;\n }\n\n push();\n fill(bubble.r, bubble.g, bubble.b);\n noStroke();\n ellipse(bubble.x, bubble.y, bubble.size);\n pop();\n }", "bounce(){\n // left to right movement\n if (this.x_location >= width || this.x_location <= 0){\n this.delta_x *= -1;\n }\n\n // up and down movement\n if (this.y_location >= height -100 || this.y_location <= 0){\n this.delta_y *= -1;\n }\n }", "function draw() {\n background(0);\n\n for (let i = 0; i < balls.length; i++) {\n let ball = balls[i];\n ball.move();\n ball.bounce();\n ball.display();\n }\n}", "function setup() {\n\tcreateCanvas(800, 600);\n\t//rectMode(CENTER);\n\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\tvar ball_options={\n\t\trestitution:0.1\n \n\t }\n\tvar ball2_options={\n\t\t\n\t\trestitution:0.1\n \n\t }\n\t var ball3_options={\n\t\t\n\t\trestitution:0.1\n \n\t }\n\t var ball4_options={\n\t\t\n\t\trestitution:0.1\n \n\t }\n\t var ball5_options={\n\t\t\n\t\trestitution:0.1\n \n\t }\n\t ball = Bodies.circle(200,50,10,ball_options);\n\t World.add(world,ball);\n \n\t ball2 = Bodies.circle(200,50,10,ball2_options);\n\t World.add(world,ball2)\n\n\t ball3= Bodies.circle(200,50,10,ball3_options)\n\t World.add(world,ball3)\n\n\t ball4= Bodies.circle(200,50,30,ball4_options)\n\t World.add(world,ball4)\n\n\t ball5= Bodies.circle(400,200,30,ball5_options)\n\t World.add(world,ball5)\n\n\t con = Matter.Constraint.create({\n\t\tpointA:{x:300,y:100},\n\t\tbodyB:ball,\n\t\tpointB:{x:0,y:0},\n\t\tlength:230,\n\t\tstiffness:0.1\n\t });\n\n\tWorld.add(world,con);\n\n\tcon2 = Matter.Constraint.create({\n\t\tpointA:{x:350,y:100},\n\t\tbodyB:ball2,\n\t\tpointB:{x:0,y:0},\n\t\tlength:230,\n\t\tstiffness:0.1\n\t });\n\n\tWorld.add(world,con2);\n\n\tcon3 = Matter.Constraint.create({\n\t\tpointA:{x:400,y:100},\n\t\tbodyB:ball3,\n\t\tpointB:{x:0,y:0},\n\t\tlength:230,\n\t\tstiffness:0.1\n\t });\n\n\tWorld.add(world,con3);\n\n\tcon4 = Matter.Constraint.create({\n\t\tpointA:{x:450,y:100},\n\t\tbodyB:ball4,\n\t\tpointB:{x:0,y:0},\n\t\tlength:230,\n\t\tstiffness:0.1\n\t });\n\n\tWorld.add(world,con4);\n\n\tcon5 = Matter.Constraint.create({\n\t\tpointA:{x:500,y:100},\n\t\tbodyB:ball5,\n\t\tpointB:{x:0,y:0},\n\t\tlength:230,\n\t\tstiffness:0.1\n\t });\n\n\tWorld.add(world,con5);\n\n\tvar roof_options={\n\t\tisStatic:true\t\t\t\n\t}\n\n\troof = Bodies.rectangle(400,100,250,20,roof_options);\n World.add(world,roof);\n\n\trectMode(CENTER);\n//\tellipseMode(RADIUS);\n\n//\tEngine.run(engine);\n\t\n \n}", "function easeInQuad(x) {\n return x * x\n}", "powerUpBlockBreaker() {\r\n if (this.powerUps.isActive(BlockBreaker) && this.powerUps.hitPaddle) {\r\n if(activeEffects) this.particleS.addParticle(floor(random(2, 10)), this.ball.pos);\r\n this.ball.destroyBlock(this.blocks);\r\n }\r\n }", "effect(){\n return(player.points.pow(0.25).times(0.5).plus(1))\n }", "function PhyBox(props) {\n const [ref, api] = useBox(() => ({ args: [1, 1, 1], mass: 1, ...props }));\n\n return (\n <Box\n args={[1, 1, 1]}\n ref={ref}\n onClick={() =>\n\n // This shoots the object when clicked on\n api.applyImpulse([0, 5, -10], [1, 1, 1])\n &&\n\n // This makes the object fly upwards when clicked on\n\n api.velocity.set(0, 2, 0)\n\n }\n >\n <meshNormalMaterial />\n </Box>\n );\n}", "get animatePhysics() {}", "function Mover(){\n this.location = createVector(random(width), random(height));\n this.velocity = createVector(random(-2, 2), random(-2, 2));\n this.acceleration = createVector(-0.001,0.01); // 2 a constant accelleration, for now\n this.topspeed = 10; //2\n\n this.update = function() {\n // 4 Move towards the mouse. Delete part 3\n let mouse = createVector(mouseX,mouseY);\n let dir = p5.Vector.sub(mouse, this.location);\n dir.normalize();\n dir.mult(0.5);\n this.acceleration = dir;\n\n\n //3 Random acelleration\n // this.acceleration = p5.Vector.random2D(); //3 We are not only changing the speed here, but also the direction\n // // Exercise, could you change the acelleration using noise?\n // // https://p5js.org/reference/#/p5/noise\n // this.acceleration.mult(random(2));\n\n //2\n this.velocity.add(this.acceleration);\n this.velocity.limit(this.topspeed);\n \n // 1\n this.location.add(this.velocity);\n }\n \n this.display = function() {\n stroke(0);\n fill(10,20,175);\n ellipse(this.location.x,this.location.y,16,16);\n }\n \n this.checkEdges = function() {\n if (this.location.x > width) {\n this.location.x = 0;\n } else if (this.location.x < 0) {\n this.location.x = width;\n }\n \n if (this.location.y > height) {\n this.location.y = 0;\n } else if (this.location.y < 0) {\n this.location.y = height;\n }\n }\n}", "springEend2() {\n if (this.yCor < this.beginyCor) {\n onGround = false\n this.springfactor = 3\n this.yLpootOnder = this.yCor + (this.straal * (64 / 20))\n this.yRpootOnder = this.yCor + (this.straal * (64 / 20))\n this.yPootBoven = this.yCor + (2 * this.straal + (this.straal * (5 / 8)))\n this.yLvoetR = this.yCor + (this.straal * (64 / 20));\n this.yRvoetR = this.yCor + (this.straal * (64 / 20));\n this.xLpoot = this.xCor - this.straal * 1.5;\n this.xRpoot = this.xCor;\n this.xLvoetR = this.xCor - this.straal;\n this.xRvoetR = this.xCor + this.straal * 0.5;\n } else {\n onGround = true\n this.springfactor = 0;\n }\n if (keyIsDown(32)) {\n if (onGround) {\n this.springfactor -= 100\n }\n }\n this.yCor += this.springfactor\n this.maxHeigth += this.springfactor\n this.yLpootOnder += this.springfactor\n this.yRpootOnder += this.springfactor\n this.yPootBoven += this.springfactor\n this.yLvoetR += this.springfactor\n this.yRvoetR += this.springfactor\n }", "function Particle(x, y) {\n this.pos = createVector(x, y);\n this.vel = createVector(0, 0);\n this.acc = createVector(0, 0);\n this.a = 255;\n this.val = sin(frameCount*10)*random(10,30);\n this.rand = this.val*3 +1;\n\n this.addForce = function(force) {\n this.acc.add(force);\n }\n\n this.checkEdges = function() {\n\n // Left edge\n if (this.pos.x < 0){\n this.vel.x = Math.abs(this.vel.x);\n }\n\n // Bottom\n if (this.pos.y > height){\n this.vel.y = -Math.abs(this.vel.y);\n }\n\n // right edge\n if (this.pos.x > width){\n var normalisedY = this.pos.y / height;\n send(IP_VOISIN, { y: normalisedY});\n\n // enlever\n var index = particles.indexOf(this);\n particles.splice(index, 1);\n\n }\n\n }\n\n this.update = function() {\n this.vel = this.vel.add(this.acc);\n\n this.pos.add(this.vel);\n this.acc.mult(0);\n\n this.checkEdges();\n }\n\n this.createDot = function() {\n noStroke();\n fill(245, 65, 35, this.a);\n ellipse(this.pos.x, this.pos.y, this.val, this.val);\n ellipse(this.pos.x, this.pos.y, this.val, this.val);\n\n }\n\n this.createAura = function() {\n\n fill(0, 152, 216,this.a*.05);\n strokeWeight(.5);\n stroke(0, 152, 216,this.a);\n ellipse(this.pos.x, this.pos.y, this.val*10, this.val*10);\n\n }\n\n this.createCircles = function() {\n push();\n strokeWeight(.5);\n stroke(11, 53, 54,this.a);\n noFill();\n var rand = random(5,10);\n ellipse(this.pos.x, this.pos.y,rand*this.val,rand*this.val);\n }\n\n\n this.alpha = function () {\n\n this.a -= .1;\n }\n\n this.wiggle = function() {\n\n this.pos.x = random(this.pos.x-30, this.pos.x+30);\n this.pos.y = random(this.pos.y-this.rand, this.pos.y+this.rand);\n }\n\n\n this.isOut = function() {\n if (this.pos.x > width || this.pos.y > height){\n return true;\n }\n return false;\n }\n\n this.evolving = function() {\n\n var k = random(.7,1.3);\n\n this.val *=k;\n }\n\n}", "function shake () {\n\tfor (var i = 0; i < num; i++) {\n\t\tp[i].velocity = [\n\t\t\tMath.random() * 40 - 20,\n\t\t\tMath.random() * 5 - 20\n\t\t];\n\t}\n}", "abductionBeam(){\n //Uses boolean logic to draw a new ellipse centered around the this.x and this.y point\n if( mouseIsPressed ){\n fill( 'red' );\n ellipseMode( CENTER );\n //Use of custom variables allows for the updating of shape position\n ellipse( this.x, this.y, this.abductionSize );\n }\n }", "function addSpeed(player, fruits)\n{\n fruits.disableBody(true, true);\n activateFruit = true;\n}", "function performExplosion() {\r\n if (!hasParticle) {\r\n return;\r\n } else if (particleFly >= 100) {\r\n particleFly = 0;\r\n hasParticle = false;\r\n scene.remove(particles);\r\n }\r\n for (var i = 0; i < 1000; i++){\r\n var particle = particles.geometry.vertices[i]\r\n particle.y += directions[i].y;\r\n particle.x += directions[i].x;\r\n particle.z += directions[i].z;\r\n }\r\n particles.geometry.verticesNeedUpdate = true;\r\n particleFly += 1;\r\n}", "function makeExplosion(xPos, yPos){\n console.log(\"makeExplosion at \", xPos,yPos);\n\n playSound(\"boom\");\n\n var size = 3;\n var width = 3 * 20;\n var offset = (width - 20) / 2;\n var x = xPos * 20 - offset;\n var y = yPos * 20 - offset;\n\n $(\".border, .leader\").addClass(\"shake\");\n $(\".border\").one(\"animationend\",function(){\n $(\".border, .leader\").removeClass(\"shake\");\n })\n\n var particle = {};\n particle.el = $(\"<div class='boom'><div class='shock'/><div class='body'/></div>\");\n particle.el.css(\"height\", width);\n particle.el.css(\"width\", width);\n particle.el.css(\"transform\",\"translate3d(\"+x+\"px,\"+y+\"px,0)\");\n\n setTimeout(function(el) {\n return function(){\n el.remove();\n };\n }(particle.el),500);\n\n //Move function\n $(\".board\").append(particle.el);\n\n // Make Bomb Puffs\n for(var i = 0; i < 8; i++){\n\n var options = {\n x : xPos * 20, // absolute non-relative position on gameboard\n y : yPos * 20, // absolute non-relative position on gameboard\n angle: getRandom(0,359), // just on the x,y plane, works with speed\n zR : getRandom(-15,15), // zRotation velocity\n oV : -.008, // opacity velocity\n width : getRandom(20,55), // size of the particle\n className : 'puff', // adds this class to the particle <div/>\n lifespan: 125, // how many frames it lives\n }\n\n // Need to put this offset code into the makeParticle function\n // You should pass it an x,y of 0\n\n var offset = (options.width - 20) / 2;\n options.x = options.x - offset;\n options.y = options.y - offset;\n options.height = options.width;\n options.speed = 1 + (2 * (1 - options.width / 50)); // The bigger the particle, the lower the speed\n\n makeParticle(options);\n }\n}", "createParticles() {\n this.sparkParticles = this.add.particles('sparkHit');\n this.sparkEmitter = this.sparkParticles.createEmitter({\n x: this.centerX,\n y: 500,\n speed: 15,\n lifespan: 1400,\n blendMode: 'ADD',\n maxParticles: 400,\n scale: { start: 0.3, end: 0 },\n on: false\n });\n }", "set Impulse(value) {}", "function bouns(pointA, pointB, speed, obj) {\n \n if (obj.y <= pointA) flag = true;\n if (obj.y >= pointB) flag = false;\n \n if (flag) {\n obj.y+=speed;\n } else {\n obj.y-=speed;\n } \n \n}", "function displayBombs() {\n fill(ballColour);\n \n for (let b = 0; b < numberofbombs; b++) {\n circle(bombposX[b], bombposY[b], bombSize)\n \n hit = collidePointCircle(mouseX, mouseY - duck.height * duckScalar / 2, bombposX[b], bombposY[b], bombSize);\n \n if (hit) {\n endGame();\n }\n }\n}", "bounce() {\r\n if ((this.y - this.radius) + (this.yspeed * this.ydirection) < 0 ||\r\n (this.y + this.radius) + (this.yspeed * this.ydirection) > height) {\r\n this.ydirection = -this.ydirection;\r\n }\r\n }", "land() {\n this.velocity += 20; \n }", "function Base(hob_h)\n{\n this.base_h = 4.2; // Base plate thickness.\n this.support_wall = 2.0;\n \n this.round_d = nema.side_size - nema.mount_dist * 2;\n this.shaft_base_h = hob_h - lever.h / 2.0;\n this.spring_z = hob_h;\n this.spring_x = lever.spring_offset_x;\n this.spring_y = lever.spring_offset_y;\n \n this.draw = function ()\n {\n // Around left motor mount hole\n var left = (circle ({r: lever.shaft_hole_d / 2, center: true, fn: global.fn})\n .translate ([-nema.mount_dist, nema.mount_dist, 0]));\n // Around right motor mount hole\n var right = (circle ({r: this.round_d / 2, center: true, fn: global.fn})\n .translate ([nema.mount_dist, nema.mount_dist, 0]));\n // base plate.\n var plate = linear_extrude ({height: this.base_h}, hull (left, right));\n\n // Shaft support.\n var shaft_support = (cylinder ({d: lever.shaft_hole_d, h: this.shaft_base_h, fn: global.fn})\n .translate ([-nema.mount_dist, nema.mount_dist, 0]));\n\n // Spring support plate.\n var base_min_y = nema.mount_dist - 9;\n var spring_plate = (cube ([nema.side_size / 2.0, nema.mount_dist + base_min_y, this.base_h])\n .translate ([0, -base_min_y, 0]));\n // \n var res = union (plate, shaft_support, spring_plate);\n\n // Cut off motor ring.\n res = res.subtract (cylinder ({r: nema.motor_ring_r + 1,\n h: this.base_h * 3,\n center: true,\n fn: global.fn}));\n\n // Spring support (ss_).\n var ss_x = this.support_wall * 2 + spring.od + 1;\n var ss_y = nema.mount_dist - lever.shaft_hole_d / 2.0;\n ss_z = this.shaft_base_h + lever.h;\n ss_base = (cube ([ss_x, ss_y, this.shaft_base_h + lever.h / 2])\n .translate ([this.spring_x - ss_x / 2.0, -base_min_y, 0]));\n ss_head = (cylinder ({d: ss_x, h: ss_y, fn: global.fn})\n .rotateX (-90)\n .translate ([this.spring_x, -base_min_y, this.shaft_base_h + lever.h / 2]));\n\n ss_plate = (cube ([ss_x, nema.mount_dist, this.base_h])\n .translate ([this.spring_x - ss_x / 2.0, -base_min_y, 0]));\n \n // Right lever guide. For minimizing lever twist.\n var r_guide = (cube ([2, nema.side_size / 2, this.shaft_base_h])\n .translate ([this.spring_x - ss_x / 2.0, 0, 0]));\n\n\n res = union (res, ss_base, ss_head, ss_plate, r_guide);\n \n // Spring housing.\n var spr_d = spring.od + 0.6;\n var spr_hous = (cylinder ({d: spr_d, h: spring.work_l, fn: global.fn})\n .rotateX (90)\n .translate ([this.spring_x, this.spring_y, this.spring_z]));\n res = res.subtract (spr_hous);\n // Mount holes\n var hole = cylinder ({r: Size.m3.r, h: this.shaft_base_h + 2, fn: global.fn});\n res = difference (res,\n hole.translate ([nema.mount_dist, nema.mount_dist, -1]),\n hole.translate ([-nema.mount_dist, nema.mount_dist, -1]));\n // Screw head housings.\n var head_house = (cylinder ({r: Size.m3.head_r, h: this.shaft_base_h, fn: global.fn})\n .translate ([0, nema.mount_dist, this.base_h - Size.m3.head_h]));\n res = res.subtract (head_house.translate ([nema.mount_dist, 0, 0]));\n\n // Cut off motor ring.\n res = res.subtract (cylinder ({r: nema.motor_ring_r + 1,\n h: nema.motor_ring_h + global.axial_clr,\n fn: global.fn}));\n\n // Look inside\n if (global.debug == \"yes\")\n {\n res = res.subtract (cube ([30,30,30])\n .rotateZ(90)\n .translate ([-nema.mount_dist, nema.mount_dist, 0]));\n res = res.subtract (cube ([30,30,30])\n .translate ([nema.mount_dist, nema.mount_dist, 0]));\n res = res.subtract (cube ([30,30,30])\n .translate ([nema.mount_dist,\n -base_min_y,\n this.shaft_base_h + lever.h / 2]));\n }\n \n return res;\n };\n}", "show() {\n let pos = this.body.position;\n fill(this.c);\n ellipse(pos.x,pos.y,40)\n }", "function snowyGround() {\n\n let geometry = new THREE.PlaneGeometry(500, 500, 22, 12);\n for (let i = 0; i < geometry.vertices.length; i++) {\n //geometry.vertices[i].x += (Math.cos( i * i )+1/2); \n //geometry.vertices[i].y += (Math.cos(i )+1/2); \n geometry.vertices[i].z = (Math.sin(i * i * i) + 1 / 2) * 3;\n }\n geometry.verticesNeedUpdate = true;\n geometry.normalsNeedUpdate = true;\n geometry.computeFaceNormals();\n\n let material = new THREE.MeshPhongMaterial({\n color: 0xFFFFFF,\n shininess: 60,\n //metalness: 1,\n //specularMap: noiseMap(512,255),\n bumpMap: noise,\n bumpScale: 0.025,\n //emissive: 0xEBF7FD,\n //emissiveIntensity: 0.05,\n shading: THREE.SmoothShading\n });\n\n let plane = new THREE.Mesh(geometry, material);\n plane.rotation.x = Math.PI / -2;\n plane.receiveShadow = true;\n plane.position.y = -5;\n\n return plane;\n\n}", "explode() {\n\t\tlet v = 50;\n\t\tfor( let i = 0; i < 5; i++ ) {\n\t\t\tgame.addPar( this.expl, this.x - v / 2 + Math.random() * v, this.y - v / 2 + Math.random() * v );\n\t\t}\n\t\tthis.anim = display.getAnim( this.dspr );\n\t\tthis.dead = true;\n\t}", "show() {\n noStroke();\n if (currentScene === 3) {\n switch(this.quality) {\n case 1:\n fill(\"white\");\n break;\n case 2:\n fill(\"grey\");\n break;\n case 3:\n fill(\"black\");\n break;\n }\n }\n if (currentScene === 4) {\n fill(0)\n this.vel = createVector(-1, 0);\n }\n // changing these numbers makes the collision not work, why?\n rect(this.pos.x, this.pos.y, 10, 10) // try changing the numbers in person collision too\n \n }", "function bounce(val) {\r\n return spring(val, {\r\n stiffness: 330,\r\n damping: 22,\r\n });\r\n}", "show(){\n for(let i = 0; i<this.body.length; i++){\n fill(0);\n noStroke();\n rect(this.body[i].x, this.body[i].y, 1,1)\n }\n }", "function SnobbyPeep(scene){\n\n\tvar self = this;\n\tPeep.apply(self, [scene]);\n self._CLASS_ = \"SnobbyPeep\";\n\n\t// Add the body & face sprites\n self.bodyMC = self.addMovieClip(\"body\");\n self.bodyMC.gotoAndStop(1);\n self.faceMC = self.addMovieClip(\"face_snobby\");\n self.faceMC.anchor.y = 1.25;\n self.faceMC.gotoAndStop(0);\n self.wordMC = self.addMovieClip(\"face_snobby_hmph\");\n self.wordMC.anchor.y = 1.25;\n self.wordMC.gotoAndStop(0);\n\n // IS SMUG?\n self.isSmug = false;\n\n // Animate on triples\n var doubles = 0;\n var MODE = -1;\n var MODE_STARE = 0;\n var MODE_BLINK = 1;\n var MODE_SMUG = 2;\n var MODE_HMPH = 3;\n var MODE_POP = 4;\n var MODE_AWAY = 5;\n self.gracePeriod = -1;\n\n // HACK\n self.HACK_JUMPSTART = function(){\n MODE = MODE_BLINK;\n };\n\n self.callbacks.update = function(){\n \n // Animate on doubles! ...or... TRIPLES?\n doubles = (doubles+1)%3;\n\n // stay within game frame\n self.stayWithinRect({\n l:100, r:860, t:100, b:480\n },0.05);\n\n // FRAMES: MANUALLY\n var face = self.faceMC;\n var frame = face.currentFrame;\n self.wordMC.scale.x = self.flip*self.DRAWING_SCALE;\n if(doubles==0){\n switch(MODE){\n case MODE_STARE:\n if(frame<3) face.gotoAndStop(frame+1);\n break;\n case MODE_BLINK:\n if(frame<7) face.gotoAndStop(frame+1);\n break;\n case MODE_SMUG:\n if(frame<14) face.gotoAndStop(frame+1);\n break;\n case MODE_HMPH:\n if(frame<20){\n frame = frame+1;\n face.gotoAndStop(frame);\n if(frame>=18){\n if(self.wordMC.currentFrame==0){\n self.wordMC.gotoAndStop(1);\n }else{\n var nextFrame = self.wordMC.currentFrame+1;\n if(nextFrame>3) nextFrame=1;\n self.wordMC.gotoAndStop(nextFrame);\n }\n }\n }\n break;\n case MODE_POP:\n self.wordMC.gotoAndStop(0);\n if(frame<25) face.gotoAndStop(frame+1);\n break;\n case MODE_AWAY:\n if(frame<29){\n face.gotoAndStop(frame+1);\n }else{\n\n // Loop back\n face.gotoAndStop(7);\n MODE = MODE_BLINK;\n self.isSmug = false;\n \n }\n break;\n }\n }\n\n ///////////////////////////\n ///////////////////////////\n ///////////////////////////\n\n // Shocked by a square!\n if(!self.isSmug){\n\n if(self.gracePeriod<=0){\n var closeTo = self.touchingPeeps(90, function(peep){\n return(!peep.offended && peep.type==\"circle\");\n });\n if(closeTo.length>0 && self.isWalking){\n\n // Bounce back\n self.flip = (closeTo[0].x>self.x) ? 1 : -1;\n self.bounce = 1.5;\n\n // BE SHOCKED\n MODE = MODE_SMUG;\n self.isWalking = false;\n\n // Sound!\n Game.sounds.peep_huh.play();\n\n // They get confused!\n closeTo.forEach(function(other){\n if(other.offended) return;\n other.beOffended(self);\n });\n\n // HMPH!\n self.setTimeout(function(){\n \n MODE = MODE_HMPH;\n self.isSmug = true;\n\n // Sound!\n Game.sounds.peep_hmph.play();\n\n // POP!\n self.setTimeout(function(){\n MODE = MODE_POP;\n\n // Then stop\n self.setTimeout(function(){\n\n // Turn around & walk\n self.flip *= -1;\n self.startWalking();\n self.direction = (self.flip>0) ? 0 : Math.PI; // override!\n self.direction += Math.random()*0.2-0.1;\n\n // Move away...\n MODE = MODE_AWAY;\n self.gracePeriod = 60;\n\n },_s(0.8));\n\n },_s(1.4));\n\n },_s(0.9));\n\n }\n }else{\n self.gracePeriod--;\n }\n\n }\n\n };\n\n // AT FIRST...\n self.watchTV = function(){\n\n self.clearAnims(); // just in case...\n \n // 0) Stop & look\n var tv = scene.tv;\n self.stopWalking(true);\n self.flip = (tv.x>self.x) ? 1 : -1;\n var OFFSET = 0; // (Math.abs(self.x-tv.x)-60)/100;\n var WAIT = Director.ZOOM_OUT_1_TIME + Director.SEE_VIEWERS_TIME;\n\n // 1) Become nervous\n self.setTimeout(function(){\n \n self.bounce = 1.6;\n MODE = MODE_STARE;\n\n // SQUEAK\n Game.sounds.squeak.play();\n\n },_s(OFFSET+BEAT*2));\n\n // 2) Blink...\n self.setTimeout(function(){\n self.bounce = 1.3;\n MODE = MODE_BLINK;\n },_s(OFFSET+WAIT));\n\n // 3) And go on.\n self.setTimeout(function(){\n // self.bounce = 1.2;\n self.startWalking();\n },_s(OFFSET+WAIT+1));\n\n };\n\n}", "function Bounce()\n{\t\n\tshaking = true;\n\tvar startY : float = gameObject.transform.position.y;\n\tfor(var v1=0; v1<5; v1++)\n\t{\n\t\tgameObject.transform.position.y += 0.1;\n\t\tyield WaitForSeconds(0.01);\n\t}\n\tfor(var v2=0; v2<7; v2++)\n\t{\n\t\tgameObject.transform.position.y -= 0.1;\n\t\tyield WaitForSeconds(0.01);\n\t}\n\tfor(var v3=0; v3<2; v3++)\n\t{\n\t\tgameObject.transform.position.y += 0.1;\n\t\tyield WaitForSeconds(0.01);\n\t}\n\tgameObject.transform.position.y = startY;\n\tyield WaitForSeconds(0.2);\n\tshaking = false;\n}", "function drawBowl(){\n //for every pixel in the square surrounding the bowl \n for(x = -bowlRadius; x <= bowlRadius; x++){\n for(y = -bowlRadius; y <= bowlRadius; y++){\n //if y is at the height of the base of the bowl\n if(y == bowlBaseY){\n //draw a line as the base of the bowl\n if(x > -bowlBaseWidth && x < bowlBaseWidth){\n drawRect(x, y, 1, 1, \"#000000\");\n }\n //else if y is between bowl base height and bowl max height\n }else if(y > bowlBaseY && y <= bowlMaxY){\n //if (x,y) lies on the circle with r = bowlRadius, center = (0,0)\n if(computeCircle(x, 0, y, 0) == bowlRadius){\n //draw a dot\n drawRect(x, y, 1, 1, \"#000000\");\n }\n //if the perlin noise function places its point inside the bowl\n if(computeCircle(x, 0, y + perlinNoise1D(x), 0) < bowlRadius){\n //if y is at the height of the water\n if(y == waterHeight){\n //draw a point at x and y + where the perlin noise function places y for that x and mirror to other side\n drawRect(x, y + perlinNoise1D(x), 1, 1, \"#233dbc\");\n drawRect(-x, y + perlinNoise1D(x), 1, 1, \"#233dbc\");\n }\n }\n //if y is at bowl max y\n }else if(y > bowlMaxY){\n //if (x, y) lies on the circle with r = lidRad, center =(the horizontal component of the radius to y + the radius of the lid, y)\n if(computeCircle(x, getCircleXFromY(bowlMaxY, 0, 0, bowlRadius) + lidRad, y, bowlMaxY, lidRad) == lidRad){\n //draw a point and mirror it\n drawRect(x, y, 1, 1, \"#000000\");\n drawRect(-x, y, 1, 1, \"#000000\");\n }\n }\n \n \n }\n }\n}", "function showBeam(){\r\n $beam = $(\".lighthouse-beam\");\r\n $beam.addClass('grow-beam');\r\n TweenMax.set($lighthouse,{clearProps: \"top\"});\r\n }", "function Eater(x,y) {\r\n\r\nthis.x = x;\r\nthis.y = y;\r\n\r\nthis.xpos = function() {\r\n return x.toString();\r\n}\r\n\r\nthis.ypos = function() {\r\n return y.toString();\r\n}\r\n\r\nthis.edisplay = function() {\r\n fill(0,0,200);\r\n ellipse(x,y,80,80);\r\n if(random() < 0.75){\r\n this.stalk(this.track());\r\n }\r\n\r\n}\r\n\r\nthis.track = function() {\r\n var curr = createVector(x,y);\r\n var stan = createVector(b[0].xpos(),b[0].ypos());\r\n var near = curr.dist(stan);\r\n var target = 0;\r\n\r\n for(var i = 0; i < b.length; i++){\r\n var look = createVector(b[i].xpos(),b[i].ypos());\r\n if(curr.dist(look) < near) {\r\n near = curr.dist(look);\r\n target = i;\r\n }\r\n }\r\n return target;\r\n}\r\n\r\nthis.stalk = function(t) {\r\n var mov = createVector(b[t].xpos()-x,b[t].ypos()-y);\r\n mov.normalize();\r\n x += mov.x;\r\n y += mov.y;\r\n if(x+60 > b[t].xpos() && x-60 < b[t].xpos() && y+60 > b[t].ypos() && y-60 < b[t].ypos()) {\r\n b[t].caught();\r\n }\r\n if(x+10 > b[t].xpos() && x-10 < b[t].xpos() && y+10 > b[t].ypos() && y-10 < b[t].ypos()) {\r\n b.splice(t,1);\r\n }\r\n}\r\n}", "function draw() {\n \n // Colouring the background\n background(220);\n\n // Changing the x and the y position\n xPosition = xPosition + xSpeed * xDirection;\n yPosition = yPosition + ySpeed * yDirection;\n\n // Changing the x direction so that it bounces off\n if (xPosition > width - radius || xPosition < radius) {\n xSpeed *= -1;\n }\n\n // Changing the y direction so that it bounces off\n if (yPosition > height - radius || yPosition < radius) {\n ySpeed *= -1;\n }\n\n // Creating the ellipse\n ellipse(xPosition, yPosition, radius, radius);\n\n}", "function tick(e) {\n this.x = this.body.GetPosition().x * SCALE;\n this.y = this.body.GetPosition().y * SCALE;\n }", "function bouncingBallY(h, bounce, window) {\n if(h < 0 ||\n bounce <= 0 ||\n bounce >= 1 ||\n window >= h)\n return -1;\n \n if(window >= h*bounce)\n return 1;\n else\n return 1 + 2*Math.floor((Math.log(window/h)/Math.log(bounce)));\n }", "function init() {\n \tvar STEER_NONE=0;\n\t\tvar STEER_RIGHT=1;\n\t\tvar STEER_LEFT=2;\n\n\t\tvar ACC_NONE=0;\n\t\tvar ACC_ACCELERATE=1;\n\t\tvar ACC_BRAKE=2;\n\n\t\tvar WIDTH_PX=800; //screen width in pixels\n\t\tvar HEIGHT_PX=600; //screen height in pixels\n\t\tvar SCALE=15; //how many pixels in a meter\n\t\tvar WIDTH_M=WIDTH_PX/SCALE; //world width in meters. for this example, world is as large as the screen\n\t\tvar HEIGHT_M=HEIGHT_PX/SCALE; //world height in meters\n\n\n var b2Vec2 = Box2D.b2Vec2\n , b2BodyDef = Box2D.b2BodyDef\n , b2Body = Box2D.b2Body\n , b2FixtureDef = Box2D.b2FixtureDef\n , b2Fixture = Box2D.b2Fixture\n , b2World = Box2D.b2World\n , b2MassData = Box2D.b2MassData\n , b2PolygonShape = Box2D.b2PolygonShape\n , b2CircleShape = Box2D.b2CircleShape\n , b2DebugDraw = Box2D.b2DebugDraw\n ;\n \n world = new b2World(\n new b2Vec2(0, 0) //gravity\n , true //allow sleep\n );\n \n\n cars=[];\n \n\n var props=[];\n\n b2world = world;\n\n\n\t \n\t //outer walls\n\t var p = new BoxProp({'size':[WIDTH_M, 1], 'position':[WIDTH_M/2, 0.5]});\n\t props.push(p);\n\t props.push(new BoxProp({'size':[1, HEIGHT_M-2], 'position':[0.5, HEIGHT_M/2]}));\n\t props.push(new BoxProp({'size':[WIDTH_M, 1], 'position':[WIDTH_M/2, HEIGHT_M-0.5]}));\n\t props.push(new BoxProp({'size':[1, HEIGHT_M-2], 'position':[WIDTH_M-0.5, HEIGHT_M/2]}));\n\t \n\t //pen in the center\n\t var center=[WIDTH_M/2, HEIGHT_M/2];\n\t props.push(new BoxProp({'size':[1, 6], 'position':[center[0]-3, center[1]]}));\n\t props.push(new BoxProp({'size':[1, 6], 'position':[center[0]+3, center[1]]}));\n\t props.push(new BoxProp({'size':[5, 1], 'position':[center[0], center[1]+2.5]}));\n \n \n //setup debug draw\n var debugDraw = new b2DebugDraw();\n debugDraw.SetSprite(canvas.getContext(\"2d\"));\n debugDraw.SetDrawScale(SCALE);\n debugDraw.SetFillAlpha(0.3);\n debugDraw.SetLineThickness(1.0);\n debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);\n world.SetDebugDraw(debugDraw);\n\n $(document).keydown(function(e){\n \t\tswitch(e.which){\n \t\t\tcase 37: // left\n \t\t\tremote.action(\"left\");\n \t\t\tKEYS_DOWN['left'] = true;\n\t\t break;\n\n\t\t case 38: // up\n \t\t\tremote.action(\"up\");\n \t\t\tKEYS_DOWN['up'] = true;\n\t\t break;\n\n\t\t case 39: // right\n \t\t\tKEYS_DOWN['right'] = true;\n\t\t break;\n\n\t\t case 40: // down\n\n \t\t\tKEYS_DOWN['down'] = true;\n\t\t break;\n\n\t\t default: return; // exit this handler for other keys\n\t\t }\n\t\t parsekeys();\n\t\t e.preventDefault(); // prevent the default action (scroll / move caret)\n });\n\n $(document).keyup(function(e){\n\n \t\tswitch(e.which){\n \t\t\tcase 37: // left\n \t\t\tKEYS_DOWN['left'] = false;\n\t\t break;\n\n\t\t case 38: // up\n\n \t\t\tKEYS_DOWN['up'] = false;\n\t\t break;\n\n\t\t case 39: // right\n \t\t\tKEYS_DOWN['right'] = false;\n\t\t break;\n\n\t\t case 40: // down\n\n \t\t\tKEYS_DOWN['down'] = false;\n\t\t break;\n\n\t\t default: return; // exit this handler for other keys\n\t\t }\n\t\t parsekeys();\n\t\t e.preventDefault(); // prevent the default action (scroll / move caret)\n });\n \n }", "function Tween(equation, parameters, context) {\n if (context === void 0) { context = DreamsArk; }\n this.equation = equation;\n this.context = context;\n this.bounceInOut = function (time, begin, change, duration) {\n if (time < duration / 2) {\n return this.bounceIn(time * 2, 0, change, duration) * 0.5 + begin;\n }\n else {\n return this.bounceOut(time * 2 - duration, 0, change, duration) * 0.5 + change * 0.5 + begin;\n }\n };\n this.circIn = function (time, begin, change, duration) {\n return -change * (Math.sqrt(1 - (time = time / duration) * time) - 1) + begin;\n };\n this.circOut = function (time, begin, change, duration) {\n return change * Math.sqrt(1 - (time = time / duration - 1) * time) + begin;\n };\n this.circInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return -change / 2 * (Math.sqrt(1 - time * time) - 1) + begin;\n }\n else {\n return change / 2 * (Math.sqrt(1 - (time -= 2) * time) + 1) + begin;\n }\n };\n this.cubicIn = function (time, begin, change, duration) {\n return change * (time /= duration) * time * time + begin;\n };\n this.cubicOut = function (time, begin, change, duration) {\n return change * ((time = time / duration - 1) * time * time + 1) + begin;\n };\n this.cubicInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return change / 2 * time * time * time + begin;\n }\n else {\n return change / 2 * ((time -= 2) * time * time + 2) + begin;\n }\n };\n this.elasticOut = function (time, begin, change, duration, amplitude, period) {\n var overshoot;\n if (amplitude == null) {\n amplitude = null;\n }\n if (period == null) {\n period = null;\n }\n if (time === 0) {\n return begin;\n }\n else if ((time = time / duration) === 1) {\n return begin + change;\n }\n else {\n if (!(period != null)) {\n period = duration * 0.3;\n }\n if (!(amplitude != null) || amplitude < Math.abs(change)) {\n amplitude = change;\n overshoot = period / 4;\n }\n else {\n overshoot = period / (2 * Math.PI) * Math.asin(change / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * time)) * Math.sin((time * duration - overshoot) * (2 * Math.PI) / period) + change + begin;\n }\n };\n this.elasticIn = function (time, begin, change, duration, amplitude, period) {\n var overshoot;\n if (amplitude == null) {\n amplitude = null;\n }\n if (period == null) {\n period = null;\n }\n if (time === 0) {\n return begin;\n }\n else if ((time = time / duration) === 1) {\n return begin + change;\n }\n else {\n if (!(period != null)) {\n period = duration * 0.3;\n }\n if (!(amplitude != null) || amplitude < Math.abs(change)) {\n amplitude = change;\n overshoot = period / 4;\n }\n else {\n overshoot = period / (2 * Math.PI) * Math.asin(change / amplitude);\n }\n time -= 1;\n return -(amplitude * Math.pow(2, 10 * time)) * Math.sin((time * duration - overshoot) * (2 * Math.PI) / period) + begin;\n }\n };\n this.elasticInOut = function (time, begin, change, duration, amplitude, period) {\n var overshoot;\n if (amplitude == null) {\n amplitude = null;\n }\n if (period == null) {\n period = null;\n }\n if (time === 0) {\n return begin;\n }\n else if ((time = time / (duration / 2)) === 2) {\n return begin + change;\n }\n else {\n if (!(period != null)) {\n period = duration * (0.3 * 1.5);\n }\n if (!(amplitude != null) || amplitude < Math.abs(change)) {\n amplitude = change;\n overshoot = period / 4;\n }\n else {\n overshoot = period / (2 * Math.PI) * Math.asin(change / amplitude);\n }\n if (time < 1) {\n return -0.5 * (amplitude * Math.pow(2, 10 * (time -= 1))) * Math.sin((time * duration - overshoot) * ((2 * Math.PI) / period)) + begin;\n }\n else {\n return amplitude * Math.pow(2, -10 * (time -= 1)) * Math.sin((time * duration - overshoot) * (2 * Math.PI) / period) + change + begin;\n }\n }\n };\n this.expoIn = function (time, begin, change, duration) {\n if (time === 0) {\n return begin;\n }\n return change * Math.pow(2, 10 * (time / duration - 1)) + begin;\n };\n this.expoOut = function (time, begin, change, duration) {\n if (time === duration) {\n return begin + change;\n }\n return change * (-Math.pow(2, -10 * time / duration) + 1) + begin;\n };\n this.expoInOut = function (time, begin, change, duration) {\n if (time === 0) {\n return begin;\n }\n else if (time === duration) {\n return begin + change;\n }\n else if ((time = time / (duration / 2)) < 1) {\n return change / 2 * Math.pow(2, 10 * (time - 1)) + begin;\n }\n else {\n return change / 2 * (-Math.pow(2, -10 * (time - 1)) + 2) + begin;\n }\n };\n this.linearIn = function (time, begin, change, duration) {\n return this.linearNone(time, begin, change, duration);\n }.bind(this);\n this.linearOut = function (time, begin, change, duration) {\n return this.linearNone(time, begin, change, duration);\n }.bind(this);\n this.linearInOut = function (time, begin, change, duration) {\n return this.linearNone(time, begin, change, duration);\n }.bind(this);\n this.quadIn = function (time, begin, change, duration) {\n return change * (time = time / duration) * time + begin;\n };\n this.quadOut = function (time, begin, change, duration) {\n return -change * (time = time / duration) * (time - 2) + begin;\n };\n this.quadInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return change / 2 * time * time + begin;\n }\n else {\n return -change / 2 * ((time -= 1) * (time - 2) - 1) + begin;\n }\n };\n this.quartIn = function (time, begin, change, duration) {\n return change * (time = time / duration) * time * time * time + begin;\n };\n this.quartOut = function (time, begin, change, duration) {\n return -change * ((time = time / duration - 1) * time * time * time - 1) + begin;\n };\n this.quartInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return change / 2 * time * time * time * time + begin;\n }\n else {\n return -change / 2 * ((time -= 2) * time * time * time - 2) + begin;\n }\n };\n this.quintIn = function (time, begin, change, duration) {\n return change * (time = time / duration) * time * time * time * time + begin;\n };\n this.quintOut = function (time, begin, change, duration) {\n return change * ((time = time / duration - 1) * time * time * time * time + 1) + begin;\n };\n this.quintInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return change / 2 * time * time * time * time * time + begin;\n }\n else {\n return change / 2 * ((time -= 2) * time * time * time * time + 2) + begin;\n }\n };\n this.sineIn = function (time, begin, change, duration) {\n return -change * Math.cos(time / duration * (Math.PI / 2)) + change + begin;\n };\n this.sineOut = function (time, begin, change, duration) {\n return change * Math.sin(time / duration * (Math.PI / 2)) + begin;\n };\n this.sineInOut = function (time, begin, change, duration) {\n return -change / 2 * (Math.cos(Math.PI * time / duration) - 1) + begin;\n };\n this.duration = parameters.duration * 1000;\n this.destination = parameters.destination;\n this.origin = parameters.origin;\n this.update = parameters.update;\n this.complete = parameters.complete;\n this.start = parameters.start;\n this.delay = parameters.delay;\n this.overshoot = parameters.overshoot;\n }", "wallBounce() {\n if (this.x >= width ||\n this.x <= 0) {\n this.vx = -this.vx\n }\n }", "springEend1() {\n if (keyIsDown(32)) {\n this.yLpootOnder = this.yCor + (this.straal * (64 / 20))\n this.yRpootOnder = this.yCor + (this.straal * (64 / 20))\n this.yPootBoven = this.yCor + (2 * this.straal + (this.straal * (5 / 8)))\n this.yLvoetR = this.yCor + (this.straal * (64 / 20));\n this.yRvoetR = this.yCor + (this.straal * (64 / 20));\n this.xLpoot = this.xCor - this.straal * 1.5;\n this.xRpoot = this.xCor;\n this.xLvoetR = this.xCor - this.straal;\n this.xRvoetR = this.xCor + this.straal * 0.5;\n\n for (let i = this.springfactor; this.yCor < this.beginyCor || this.yCor === this.beginyCor; i -= this.afremming) {\n if (this.yCor === this.springhoogte) {\n this.afremming = -this.afremming\n }\n this.yCor -= i\n this.maxHeigth -= i\n this.yLpootOnder -= i\n this.yRpootOnder -= i\n this.yPootBoven -= i\n this.yLvoetR -= i\n this.yRvoetR -= i\n }\n } else {\n this.yLpootOnder -= this.yloopSpeed\n this.xLpoot -= this.xloopSpeed\n this.yRpootOnder -= this.yloopSpeed\n this.xRpoot += this.xloopSpeed\n this.xLvoetR -= this.xSpeedLvoet\n this.yLvoetR -= this.ySpeedLvoet\n this.xRvoetR += this.xSpeedRvoet\n this.yRvoetR -= this.ySpeedRvoet\n\n if (this.yLpootOnder < this.maxHeigth || this.yRvoetR < this.maxHeigth || this.xLpoot < (this.xCor - this.straal * 1.5) - this.lengtePoot && this.xRpoot > (this.xCor) - this.lengtePoot || this.yLpootOnder > this.yCor + (this.straal * (64 / 20)) && this.yRpootOnder > this.yCor + (this.straal * (64 / 20)) || this.xLpoot > this.xCor - this.straal * 1.5 && this.xRpoot < this.xCor) {\n this.yloopSpeed = -this.yloopSpeed;\n this.ySpeedLvoet = -this.ySpeedLvoet\n this.ySpeedRvoet = -this.ySpeedRvoet\n this.xloopSpeed = -this.xloopSpeed\n this.xSpeedLvoet = -this.xSpeedLvoet\n this.xSpeedRvoet = -this.xSpeedRvoet\n }\n }\n }", "function makeAWall (startPos, endPos, num) {\n var dPos = subVectors(endPos, startPos);\n var dY = dPos[Y]/num;\n var dX = dPos[X]/num;\n var x = startPos[X];\n var y = startPos[Y];\n for (var i = 0; i < num; i++) {\n //pos v a m q r dynam color\n genParticle([x, y], [0,0], [0,0], 1, 500, 10, false, \"#F54836\");\n x += dX;\n y += dY;\n }\n}", "function wavify(e,t){void 0===t&&(t={});var n,o=Object.assign({},{container:t.container?t.container:\"body\",height:200,amplitude:100,speed:.15,bones:3,color:\"rgba(255,255,255, 0.20)\"},t),i=e,r=document.querySelector(o.container).getBoundingClientRect().width,a=document.querySelector(o.container).getBoundingClientRect().height,c=0,l=!1,u=!1;function y(){var e=window.Date.now();if(n){var t=(e-n)/1e3;n=e;var s=(c+=t)*Math.PI;u=TweenMax.to(i,o.speed,{attr:{d:function(e){var t=\"M \"+e[0].x+\" \"+e[0].y,n={x:(e[1].x-e[0].x)/2,y:e[1].y-e[0].y+e[0].y+(e[1].y-e[0].y)};t+=\" C \"+n.x+\" \"+n.y+\" \"+n.x+\" \"+n.y+\" \"+e[1].x+\" \"+e[1].y;for(var o=n,i=-1,c=1;c<e.length-1;c++){Math.sqrt(o.x*o.x+o.y*o.y);var l={x:e[c].x-o.x+e[c].x,y:e[c].y-o.y+e[c].y};t+=\" C \"+l.x+\" \"+l.y+\" \"+l.x+\" \"+l.y+\" \"+e[c+1].x+\" \"+e[c+1].y,o=l,i=-i}return t+=\" L \"+r+\" \"+a,t+=\" L 0 \"+a+\" Z\"}(function(e){for(var t=[],n=0;n<=o.bones;n++){var i=n/o.bones*r,a=(e+(n+n%o.bones))*o.speed*100,c=Math.sin(a/100)*o.amplitude,l=Math.sin(a/100)*c+o.height;t.push({x:i,y:l})}return t}(s))},ease:Power1.easeInOut})}else n=e;l=requestAnimationFrame(y)}var s,d,f,p,x=(s=function(){v(),[],c=0,r=document.querySelector(o.container).getBoundingClientRect().width,a=document.querySelector(o.container).getBoundingClientRect().height,n=!1,m()},d=250,function(){var e=this,t=arguments;clearTimeout(p),p=setTimeout(function(){p=null,f||s.apply(e,t)},d),f&&!p&&s.apply(e,t)});function m(){l||(l=requestAnimationFrame(y))}function v(){l&&(cancelAnimationFrame(l),l=!1)}function g(){l&&(v(),u.kill(),u=TweenMax.set(i,{x:0,y:0,rotation:0,opacity:0,clearProps:\"all\",attr:{d:\"M0,0\",fill:\"\"}}),window.removeEventListener(\"resize\",x),l=!1)}return l||(u=TweenMax.set(i,{attr:{fill:o.color}}),m(),window.addEventListener(\"resize\",x)),{reboot:function(e){var t;g(),void 0!==typeof e&&(t=e,o=Object.assign({},o,t)),u=TweenMax.set(i,{attr:{fill:o.color}}),m(),window.addEventListener(\"resize\",x)},play:m,pause:v,kill:g,updateColor:function(e){void 0===typeof e.timing&&(e.timing=1),void 0===typeof e.color&&(e.color=o.color),u=TweenMax.to(i,parseInt(e.timing),{attr:{fill:e.color},onComplete:function(){void 0!==typeof e.onComplete&&\"[object Function]\"==={}.toString.call(e.onComplete)&&e.onComplete()}})}}}", "function DemoOne(){\n\t\n\t// Get a specific element or create a new one\n\tvar target_div = document.getElementById(\"demo-one\");\n\t// Create a function which returns a random number based on target div width. Will be used as particles init position\n\tvar random_n = function(){ return (Math.random()*target_div.offsetWidth);};\n\t\n\t// Create a new particle system. \n\tvar new_system = new ParticleSystem({syslifetime:0, lifetime: 1000, burstrate: 100, burstamount: 1, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinitsize:{x:32, y:32},endsize:{x:12, y:12}, texture: \"http://stranz.info/public/h5ps/img/star.png\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinitpos: {x:random_n, y: 0}, velocity:{x:0, y:100}, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trotation:{start:0, end:180}, target: target_div});\n\t\n\t// Get the demo display element and show the particle count\n\tvar display_div = document.getElementById(\"display-demo-one\");\n\tsetInterval( function(){ display_div.innerHTML = \"Shower | Particle Count: \"+ new_system.particles.length;}, 100);\n}", "function setup() {\r\n \r\n createCanvas(600,500);\r\n engine = Engine.create();\r\n world = engine.world;\r\n\r\n\r\n bg = createSprite(850,150); \r\n bg.addImage(bgImg);\r\n bg.scale = 4;\r\n bg.velocityX = -2;\r\n\r\n balloon=createSprite(150,250,150,150);\r\n balloon.addAnimation(\"hotAirBalloon\",balloonImage1);\r\n balloon.scale=0.4;\r\n\r\n stone = new Stone(balloon.x+60,balloon.y+50,10);\r\n\r\n stoneSprite = createSprite(stone.body.position.x,stone.body.position.y,10,10);\r\n stoneSprite.addImage(stoneImg);\r\n stoneSprite.scale = 0.03;\r\n\r\n //balloon.debug = true ;\r\n balloon.setCollider(\"rectangle\",50,-20,350,550);\r\n\r\n resetb = createSprite(300,250);\r\n resetb.addImage(resetImage);\r\n resetb.scale = 0.05 ;\r\n resetb.visible = false ;\r\n\r\n sling= new Sling(stone.body,{x:balloon.x+65,y:balloon.y+40})\r\n bgroup = new Group();\r\n cg = new Group();\r\n Engine.run(engine);\r\n}", "function createJwellery() {\n if (World.frameCount % 80 == 0) {\n var jwellery = createSprite(Math.round(random(50, 350),40, 10, 10)); \n jwellery.addImage(jwelleryImg);\n jwellery.scale=0.13;\n jwellery.velocityY = 3;\n jwellery.lifetime = 150;\n jwelleryG.add(jwellery);\n }\n}", "function slap() {\n health -= 1 + target.modifier\n drawhealth()\n console.log(\"slapworks\")\n\n}", "createParticle() {\n noStroke();\n // strokeWeight(1);\n \n if(this.isSick) {\n fill(color(200,0,0));\n } else {\n if(this.daysImmune > 0) {\n fill(200);\n } else {\n fill(100);\n // stroke(255);\n // fill(255);\n }\n }\n circle(this.position.x,this.position.y,this.r);\n\n // show radius of influence\n if(showInfectionRadius && this.isSick) {\n strokeWeight(1);\n stroke(150,20,20);\n noFill();\n circle(this.position.x,this.position.y,neighborhoodSize);\n }\n }", "createTileWithHighObstacleTile(tileNumber) {\n\n let tile = this.createTile(tileNumber);\n let positionX = tile.position.x;\n let slideByX = 0;\n let playerMesh = this.player.getMesh();\n let playerMesh2 = this.player.getMesh2();\n\n // To position scam objects on different lanes randomly Default to Middle Lane\n let randomPositionChooser = Math.floor((Math.random() * 100)); // 0 to 100 random number\n\n // if(randomPositionChooser >= 0 && randomPositionChooser < 30) {\n // positionX = -4.5; // Positining on the left\n // slideByX = -1.5;\n // } \n\n // // if(randomPositionChooser >= 20) {\n // // positionX = -0.6666; // Positining on the left\n // // }\n\n // if(randomPositionChooser >= 30) {\n // positionX = tile.position.x\n // }\n\n // // if(randomPositionChooser >= 60) {\n // // positionX = 0.6666; // Positioning on the right\n // // }\n\n // if(randomPositionChooser >= 60) {\n // positionX = 4.5; // Positioning on the right\n // slideByX = 1.5;\n // }\n let coinsNumber = 1;\n let sphere = BABYLON.Mesh.CreateCylinder(\"scam_fall_\" + Math.random() + coinsNumber + this.generatedTilesNumber, .25, 0.8, 0.8, 16, 0, this.scene);\n sphere.physicsImpostor = new BABYLON.PhysicsImpostor(sphere, BABYLON.PhysicsImpostor.SphereImpostor, { mass: 300 }, this.scene);\n sphere.material = this.level.getMaterial('hazardMaterial');\n sphere.position.x = positionX;\n sphere.position.y = 5;\n sphere.position.z = playerMesh.position.z + 20;\n sphere.rotation.x = 2;\n BABYLON.Tags.AddTagsTo(sphere, 'tilesBlock_fall tilesBlock' + this.generatedTilesBlocksNumber);\n sphere.physicsImpostor.setLinearVelocity({\n 'isNonUniform': true,\n 'x': slideByX,\n 'y': 0.001,\n 'z': 0\n });\n let dropped = false;\n setInterval(() => {\n if (!dropped) {\n if (sphere.position.y < playerMesh2.position.y) {\n sphere.dispose();\n this.player.die();\n dropped = true;\n }\n }\n }, 100);\n setTimeout(() => {\n sphere.dispose();\n }, 20000);\n\n }", "function Energy(x, y, boolean) {\n this.x = x + 10;\n this.y = y + 10;\n this.vel = 3;\n this.width = 20;\n this.height = 20;\n this.isPoint = boolean;\n if(boolean) {\n this.frames = pointsOrb;\n } else {\n this.frames = speedOrb;\n setTimeout(() => {\n deleteOrb(this);\n }, 3000);}\n this.frameCounter = 0;\n}", "function flower() {\n fill('blue');\t\n translate(100, 100);\n noStroke();\n for (let i = 0; i < 10; i ++) {\n ellipse(0, 30, 20, 80);\n rotate(PI/5);\n }\n}", "function animate() {\n updatePhysics();\n}", "function lightningGenerator() {\n\n let odds = random(0, 1);\n\n //FLASHING EFFECT//\n lightning.alpha = lightning.alpha - lightning.speed;\n lightingInside.alpha = lightingInside.alpha - lightingInside.speed;\n\n //PLAYS LIGHTNING AT ADJUSTABLE ODDS//\n if (odds > 0.998) {\n\n if (isOutside) {\n\n //EFFECTS ONLY OUTSIDE LIGHNING EFFECT//\n lightningSFX.setVolume(1);\n lightningSFX.play();\n lightning.alpha = 210;\n } else {\n\n //EFFECTS INSIDE AND OUTSIDE LIGHTNING EFFECT//\n lightningSFX.setVolume(0.3);\n lightningSFX.play();\n lightning.alpha = 210;\n lightingInside.alpha = 200;\n }\n\n }\n\n push();\n fill(lightning.color, lightning.alpha);\n rect(0, 0, width, height);\n pop();\n}", "function Particle( s ) {\n return function(x, y, mass) {\n this.position = s.createVector(x, y);\n this.velocity = s.createVector(0, 5);\n this.acceleration = s.createVector(0, 0);\n this.mass = mass;\n this.radius = massToRadius(mass);\n\n this.display = function() {\n s.noStroke();\n s.ellipse(this.position.x, this.position.y, this.radius, this.radius);\n this.position.add(this.velocity.add(this.acceleration));\n this.constrainToUniverse();\n this.acceleration.set(0,0);\n this.update();\n return this;\n }\n\n this.update = function() {\n var mousePosition = s.createVector(s.mouseX, s.mouseY);\n return this;\n }\n\n this.resetPosition = function() {\n this.position = s.createVector(width/2, height/2);\n }\n\n this.applyForce = function(force) {\n force = force.copy();\n force.div(mass);\n this.acceleration.add(force);\n }\n\n this.applyUniverse = function(constraints) {\n this.constraints = constraints;\n }\n\n this.constrainToUniverse = function() {\n var leftEdge = this.constraints.leftEdge + this.radius/2;\n var rightEdge = this.constraints.rightEdge - this.radius/2;\n var bottomEdge = this.constraints.bottomEdge - this.radius/2;\n var topEdge = this.constraints.topEdge + this.radius/2;\n\n if (this.position.x > rightEdge) { \n reverse(this.velocity, \"x\");\n this.position.x = rightEdge;\n }\n\n if (this.position.x < leftEdge) { \n reverse(this.velocity, \"x\");\n this.position.x = leftEdge;\n }\n\n if (this.position.y > bottomEdge) { \n reverse(this.velocity, \"y\");\n this.position.y = bottomEdge; \n }\n\n if (this.position.y < topEdge) { \n reverse(this.velocity, \"y\");\n this.position.y = topEdge; \n }\n }\n\n function massToRadius(mass) {\n // Volume of a circle: V = pi*r^3\n // let V = mass so we have a constant density \n // derives radius based on volume\n // Multiply by 50 so it looks reasonable in a browser\n return Math.cbrt(1/(((4/3)*Math.PI)/mass))*50;\n }\n\n function reverse(vector, axis) {\n vector[axis] *= -1;\n }\n };\n}" ]
[ "0.69548124", "0.66649985", "0.605098", "0.5933616", "0.58508927", "0.58099943", "0.5801183", "0.56325525", "0.56229573", "0.5619398", "0.5584909", "0.55843604", "0.55772096", "0.5530642", "0.55055374", "0.5504395", "0.54725903", "0.54433745", "0.54379773", "0.54284495", "0.54019076", "0.5380275", "0.5372982", "0.5356451", "0.5356026", "0.5337798", "0.5336812", "0.5317661", "0.53126675", "0.53102887", "0.52931285", "0.528447", "0.52768123", "0.5274844", "0.5266493", "0.5261725", "0.52542216", "0.5253855", "0.5223802", "0.5218506", "0.52158165", "0.5211895", "0.52098984", "0.52059275", "0.52054936", "0.5203764", "0.51993185", "0.51984835", "0.51846534", "0.51768124", "0.5173961", "0.51734203", "0.51725554", "0.51710385", "0.51624304", "0.51594096", "0.5155065", "0.5153547", "0.51524645", "0.5151461", "0.51493466", "0.5141054", "0.5136668", "0.5136569", "0.51365477", "0.5131115", "0.5124018", "0.5122383", "0.51211435", "0.51209813", "0.51192737", "0.511414", "0.5111144", "0.51093805", "0.51083016", "0.51077515", "0.51047564", "0.5103537", "0.5100438", "0.5099944", "0.5098262", "0.5097322", "0.50957155", "0.5095652", "0.50954056", "0.50912863", "0.50892866", "0.50867975", "0.5086482", "0.5084641", "0.50843626", "0.50840867", "0.508195", "0.50809616", "0.50807863", "0.5079006", "0.50726455", "0.5070619", "0.5069471", "0.5065724" ]
0.70502025
0
Runs an easing function backwards.
static out(easing) { return t => 1 - easing(1 - t) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quickBackward() {\n drone.backward(speed)\n setTimeout(function () {\n resetDroneSpeed();\n }, 500)\n}", "function backward() {\n const currProgress = parseInt(progressInp.value, 10);\n\n if ((currProgress - 2000) > 0) {\n progressInp.value = currProgress - 2000;\n } else {\n progressInp.value = 0;\n }\n\n updateDuration();\n updateReplay();\n}", "static out(easing) {\n return t => 1 - easing(1 - t);\n }", "function slideBackward() {\n if ($run.activeIndex > 0) {\n $run.activeIndex -= 1;\n } else if ($conf.cycle) {\n $run.activeIndex = ($conf.slides.length - 1);\n }\n\n alignToActiveSlide();\n }", "function animationGoBackward()\n{\n\tif(eventSliderOb != null)\n\t{\n\t\teventSliderOb.moveSliderBackward();\n\t}\n}", "function backward(stepsize, once){\r\n \t\tvar s = (stepsize ? stepsize : step);\r\n \t\t\r\n \t\tif(running === true && direction === \"forward\"){ return; } \r\n \t\t\r\n \t\t//If not circular, no need to animate endlessly\r\n \t\tif(!o.circular){\r\n \t\t\t//will the next step overtake the first image ?\r\n \t\t\tif(curr - s < 0){\r\n \t\t\t\t s = curr - 0;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tul.animate(\r\n animCss == \"left\" ? { left: -(curr - s) } : { top: -(curr - s) } , o.speed, o.easing,\r\n function() {\r\n \tcurr -= s;\r\n \t//Calculate if we cross the limit,\r\n \t//if so, put the carousel one time backward\r\n if(o.circular){\r\n\t \tif(curr <= liSize){\r\n\t \tul.css(o.vertical ? 'top' : 'left', -(curr + eltsSize));\r\n\t \tcurr += eltsSize;\r\n\t }\r\n }\r\n \r\n\t\t\t\t\tif(!once && running){\r\n\t\t\t\t\t\tbackward();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(once){\r\n\t \tif(--mousewheelN > 0){\r\n\t \t\tbackward(step, true);\r\n\t \t}\r\n\t \telse{\r\n\t \t\t running = false;\r\n\t \t\t direction = null;\r\n\t \t}\r\n \t}\r\n }\r\n );\r\n }", "async reverse() {\n this.tl.pause();\n this.angle = 100;\n this._playShieldBounceSound();\n\n await gsap.to(this, {\n x: -50,\n y: 'random(-50,50)',\n duration: 1,\n });\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "moveBackward () {\n this.update(this.deltaIndex(-1))\n }", "static inOut(easing) {\n return t => {\n if (t < 0.5) {\n return easing(t * 2) / 2;\n }\n return 1 - easing((1 - t) * 2) / 2;\n };\n }", "function easeOutQuart(t) {\n return 1 - (--t) * t * t * t;\n }", "function easeOutQuart(t) {\n return 1 - (--t) * t * t * t;\n }", "backwards(speed) {\n if (speed === undefined) {\n this._speed = -100;\n } else {\n if (speed < 0 || speed > 100) {\n throw \"Speed must be between 0 and 100\"\n }\n this._speed = -speed;\n }\n this._applySpeed();\n }", "easeOutQuart(t) {\n return 1 - --t * t * t * t;\n }", "function easeOut() {\n gsap.fromTo(\n \".ease-out\",\n { x: 0 },\n { duration: easeSlideDuration, ease: \"none\", x: \"-100%\" }\n );\n}", "static inOut(easing) {\n return t => {\n if (t < 0.5) return easing(t * 2) / 2\n return 1 - easing((1 - t) * 2) / 2\n }\n }", "function backwardStep(e) {\n setMedia();\n if (media.currentTime > trjs.param.backwardskip)\n media.currentTime = media.currentTime - trjs.param.backwardskip;\n else\n media.currentTime = 0;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n}", "function makeEaseOut(timing) {\n return function (timeFraction) {\n return 1 - timing(1 - timeFraction);\n }\n}", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "back(length = this.length) {\n // Change the direction momentarily\n this.direction -= 180;\n // Use forward to avoid repeating code\n this.forward(toInt(length));\n // Restore the direction as it was before\n this.direction += 180;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function reverseTranslate(newFrom){return $animateCss(target,{to:newFrom||from,addClass:options.transitionOutClass,removeClass:options.transitionInClass}).start();}", "easeOutCubic(t) {\n return --t * t * t + 1;\n }", "reverseInPlace() { this._bcurve.reverseInPlace(); }", "function decrease() {\n if ((seconds) > 0) {\n console.log('TRUEEEE')\n setSeconds(seconds => seconds - 1)\n\n if (isSingle) setElixir(elixir => subtract_or_min(elixir, (1 / SINGLE_RATE), 0))\n else if (isDouble) setElixir(elixir => subtract_or_min(elixir, (1 / DOUBLE_RATE), 0))\n else if (isTriple) setElixir(elixir => subtract_or_min(elixir, (1 / TRIPLE_RATE), 0))\n } else reset()\n \n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easing(t, b, c, d) {\n t /= d / 2;\n if (t < 1) return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n }", "function handleBackward(){\n audio.currentTime -= 3\n }", "function easeOutBack (t, b, c, d, s)\n {\n if (!s) \n {\n s = 1.70158;\n }\n return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;\n }", "goDown() {\n\t\tthis.setFloor(this.getFloor() - 1);\n\t}", "Reverse() {\n\n }", "easeInOutQuart(t) {\n return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;\n }", "function stepBackward() {\n $.get('/grid/back', function (data) {\n updateGrid(data);\n });\n}", "function easeOutQuart(x) {\r\n return 1 - pow(1 - x, 3);\r\n}", "function easeOutQuart(x) {\n return 1 - pow(1 - x, 4);\n}", "function subtractReverse(array) {\n //Write your code here\n}", "function transitionBack() {\n var animate = requestAnimationFrame(transitionBack);\n if (x >= 0) {\n x -= 5;\n draw();\n } else {\n cancelAnimationFrame(animate);\n }\n\n }", "function stepBackward(){\n if(index === 0){\n index = playList.length - 1\n }else{\n index--\n }\n\n box.innerHTML = `Track ${index + 1} - ${playList[index]}${ext}`;\n audio.src = dir + playList[index] + ext;\n audio.play()\n }", "easeOutQuint(t) {\n return 1 + --t * t * t * t * t;\n }", "function fadeOut() {\n transitionPlane.emit('fadeOut');\n setTimeout(setBackwards, 100);\n}", "function easing (z) {\n return 1 - Math.sqrt(z * (2 - z));\n }", "function tweenTo( value ) {\n \t\tvar speed = 0.04;\n \t\tif ( value < 0 )\n \t\t\tvalue += speed;\n \t\tif ( value > 0 )\n \t\t\tvalue -= speed;\n \t\treturn value;\n \t}", "function easeInOutQuart(t) {\n return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t;\n }", "function easeInOutQuart(t) {\n return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t;\n }", "function easeOutQuad(t) {\n return t * (2 - t);\n }", "function easeOutQuad(t) {\n return t * (2 - t);\n }", "turnRight() {\n this._currentLinearSpeed = 0;\n this._currentAngularSpeed = -this._angularSpeed;\n }", "stepDown(stepDecrement) {\n const input = this.getInput();\n input.stepDown(stepDecrement);\n this.value = input.value;\n }", "stop() {\n return this.startSpeed(0, 0);\n }", "reverse() {\n }", "function easeOutQuint(t) {\n return 1 + (--t) * t * t * t * t;\n }", "function easeOutQuint(t) {\n return 1 + (--t) * t * t * t * t;\n }", "function goBack () {\n // two right turn, make it turn back (180 degree)\n robot.turnRight()\n robot.turnRight()\n robot.move()\n // another tow right turn, make it return to its original facing direction\n robot.turnRight()\n robot.turnRight()\n }", "function quadEaseInOut(t) {\n if (t < 0.5) {\n return 2 * t * t\n }\n t -= 0.5;\n return 2 * t * (1 - t) + 0.5;\n}", "function moveBackward(distance) {\n $._move(0-(distance || 50), true);\n}", "reverse() {}", "function handleBackwardButtonClick(evt) {\n slideBackward();\n\n if ($conf.autoslide) {\n resetAutoslide();\n }\n }", "stop() {\n this._speed = 0;\n this._applySpeed();\n }", "moveBackward(){\n if (this.state.position + 800 > 0) {\n this.setState({position: 0});\n } else {\n this.setState({position: this.state.position + 800});\n }\n }", "easeOutQuad(t) {\n return t * (2 - t);\n }", "function easeInOut(i) {\n i = i % 1;\n var isFirstHalf = i < 0.5;\n var i1 = isFirstHalf ? i : 1 - i;\n i1 = i1 / 0.5;\n // make easing steeper with more multiples\n var i2 = i1 * i1;\n i2 = i2 / 2;\n return isFirstHalf ? i2 : i2 * -1 + 1;\n }", "invert() {\n this.reverse = !this.reverse;\n this._applySpeed();\n }", "function goBackward(rover) {\n switch (rover.direction) {\n case 'N':\n rover.position[0]--\n break;\n case 'E':\n rover.position[1]--\n break;\n case 'S':\n rover.position[0]++\n break;\n case 'W':\n rover.position[1]++\n break;\n };\n\t\tconsole.log(\"New Rover Position: [\" + rover.position[0] + \", \" + rover.position[1] + \"]\")\n}", "function reactionReverse () {\n direction = -direction; // Stromrichtung umkehren\n reset(); // Ausgangsstellung\n }", "function down(_la){\n if((_la.my+_la.sp)<_la.ry){\n return _la.my + _la.sp;\n }else{\n if(_la.update_quadrant)\n qx--;\n return 0;\n }\n}", "function Easing() {\n $( \"#target\" ).animate({}, 500, function() {\n $(topEdge());\n $(LeftEdge());\n $(topEdge());\n $(BottomEdge());\n $(LeftEdge());\n $(RightEdge());\n $(NudgeRight());\n $(NudgeLeft());\n $(topEdge());\n $(LeftEdge());\n $(NudgeRight());\n $(NudgeRight());\n $(LeftEdge());\n\n });\n }", "goBackwards() {\n async.parallel([\n (callback) => { gpio.write(this.motors.leftBack, true, callback)},\n (callback) => { gpio.write(this.motors.rightBack, true, callback)}\n ]);\n }", "function easeInOutQuart(t, b, c, d) {\n if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n}", "down() {\n this.y += this.speed;\n this.comprobarLimitesBarra();\n }", "easeInQuart(t) {\n return t * t * t * t;\n }", "function effect_run(element){\n if($('#'+element).css('position').length != 0){ $('#'+element).css('position','relative'); }\n\n var duration = 2000;\n var easing = 'swing'; //(linear/swing)\n\n if($('#'+element).data('effect-duration')!==undefined && $('#'+element).data('effect-duration')!=''){ duration = $('#'+element).data('effect-duration'); }\n if($('#'+element).data('effect-easing')!==undefined && $('#'+element).data('effect-easing')!=''){ easing = $('#'+element).data('effect-easings'); }\n\n\n // <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><\n\n $('#'+element).stop().animate(anim_str, duration, easing);\n\n // <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><\n}", "knockEnemyBack(v){\n this.knockEnemy = true;\n this.hero.direction ? this.knockVelocity = v : this.knockVelocity = -v; //this line is too hacky,\n this.body.velocity.y = -60 * (10*Math.random());\n this.knockBackFor = this.setDelay(this.knockbackSet);\n this.animations.play('knock');\n // console.log('knockEnemy', this.game.time.now, this.knockBackFor, this.knockVelocity, this.knockingDistance);\n }", "function easeOutQuad(t, b, c, d) {\n\t return -c * (t /= d) * (t - 2) + b;\n\t}", "function easeOutQuad(t, b, c, d) {\n return -c*(t/=d)*(t-2) + b;\n}", "function easeInOutQuart(t, b, c, d) {\n if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass\n }).start();\n\n }", "function easeOutQuad(t, b, c, d) {\r\n return -c *(t/=d)*(t-2) + b;\r\n }", "function decrement() {\n\tnumber = number -1;\n\t$(\"#timer\").html(\"<p>Time Remaining: \" + number + \" seconds</p>\");\n\tif (number === 0) {\n\t\tincorrect = incorrect + 1;\n\t\tstop();\n\t\tnumber = 30;\n\t\trun();\n\t}\n}", "function slowDown() {\n if (tritSpinningSpeed <= -1) {\n tritSpinningSpeed += 1\n }\n if (tritSpinningSpeed >= 1) {\n tritSpinningSpeed -= 1\n }\n if (tritSpinningSpeed == 0) {\n clearInterval(breaks)\n }\n console.log(\"SlowDown \" + tritSpinningSpeed);\n }", "function easeInQuart(t) {\n return t * t * t * t;\n }", "function easeInQuart(t) {\n return t * t * t * t;\n }", "function moveBackward(rover){\n switch(rover.direction) {\n case 'N' :\n if (rover.y>-5){\n goDown();\n }\n else {\n return mapLimit\n }\n break;\n case 'S' :\n if (rover.y<5) {\n goUp();\n }\n else {\n return mapLimit\n }\n break;\n case 'E':\n if (rover.x>-5) {\n goLeft();\n }\n else {\n return mapLimit\n }\n break;\n case 'W':\n if (rover.x<5) {\n goRight();\n }\n else {\n return mapLimit\n }\n travelLogPush()\n }\n displayCoor()\n}", "desaturate() {\n this.saturate(-1);\n }", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass\n }).start();\n\n }", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass\n }).start();\n\n }", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass\n }).start();\n\n }", "easeInOutQuad(t) {\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n }", "function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass,\n duration: options.duration\n }).start();\n\n }", "function easeOut(t, b, c, d) {\n var ts = (t/=d)*t;\n var tc = ts*t;\n return b+c*(tc + -3*ts + 3*t);\n }", "function backInOut(t) {\n const s = 1.70158 * 1.525;\n if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));\n return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);\n}", "stop() {\n this._currentLinearSpeed = 0;\n this._currentAngularSpeed = 0;\n }", "stopAnimation() {\n setStyle(this.slider, 'transition', '', true);\n setStyle(this.slider, 'transform', 'translateX(0%)', true);\n }" ]
[ "0.6651149", "0.6422896", "0.6380634", "0.6301122", "0.62642056", "0.6238631", "0.6104038", "0.6072428", "0.6072428", "0.6072428", "0.6072428", "0.6072428", "0.60594076", "0.6054366", "0.6026206", "0.6026206", "0.60204166", "0.5984932", "0.59749687", "0.59485316", "0.5925929", "0.589937", "0.589726", "0.58451116", "0.58451116", "0.5841606", "0.5805293", "0.5805293", "0.5772785", "0.57588226", "0.5725337", "0.5719111", "0.5699648", "0.5699648", "0.568406", "0.56701463", "0.5651505", "0.5649258", "0.56275606", "0.56098956", "0.56062704", "0.5576061", "0.55658203", "0.55310357", "0.55194837", "0.5510648", "0.55060583", "0.54798734", "0.5466626", "0.54572564", "0.54451495", "0.54451495", "0.5436717", "0.5436717", "0.54354364", "0.5433479", "0.54299664", "0.54101133", "0.5374094", "0.5374094", "0.535701", "0.5343513", "0.5340758", "0.53350574", "0.5332823", "0.532733", "0.5300274", "0.5284887", "0.5278666", "0.5276596", "0.5266994", "0.5265556", "0.52513087", "0.52394223", "0.5236618", "0.5228746", "0.5228061", "0.5222619", "0.5207263", "0.5205604", "0.5201115", "0.5194399", "0.519286", "0.51869667", "0.5183632", "0.5179076", "0.5178396", "0.5174089", "0.5174089", "0.516768", "0.51651555", "0.5157171", "0.5157171", "0.5157171", "0.5150703", "0.5129529", "0.51273024", "0.51269865", "0.5124427", "0.5095493" ]
0.6446241
1
Makes any easing function symmetrical.
static inOut(easing) { return t => { if (t < 0.5) return easing(t * 2) / 2 return 1 - easing((1 - t) * 2) / 2 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static out(easing) {\n return t => 1 - easing(1 - t)\n }", "static out(easing) {\n return t => 1 - easing(1 - t);\n }", "function easing(n) {\r\n return Math.min(0.7, Math.abs(Math.cos(n * rad))) / 0.7;\r\n }", "static inOut(easing) {\n return t => {\n if (t < 0.5) {\n return easing(t * 2) / 2;\n }\n return 1 - easing((1 - t) * 2) / 2;\n };\n }", "easeOutQuart(t) {\n return 1 - --t * t * t * t;\n }", "initEasingFunctions() {\n this.EASE_IN_EXPO = (l, r, x) => (l + (r - l) * Math.pow(2, (x - 1) * 7));\n // 0.14285714285714285 == (1 / log(2, 128))\n this.EASE_OUT_EXPO = (l, r, x) => (l + (r - l) * Math.log(x * 127 + 1) / Math.LN2 * 0.14285714285714285);\n }", "function easeInOut(i) {\n i = i % 1;\n var isFirstHalf = i < 0.5;\n var i1 = isFirstHalf ? i : 1 - i;\n i1 = i1 / 0.5;\n // make easing steeper with more multiples\n var i2 = i1 * i1;\n i2 = i2 / 2;\n return isFirstHalf ? i2 : i2 * -1 + 1;\n }", "easeOutQuad(t) {\n return t * (2 - t);\n }", "function ease(t) {\n var c = 1, d = 1, p = 0.3;\n if (t === 0) { return 0; }\n if ((t/=d)===1) { return 1; }\n var s = p/(2*Math.PI) * Math.asin (1);\n return Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p ) + 1;\n }", "function makeEaseOut(timing) {\n return function (timeFraction) {\n return 1 - timing(1 - timeFraction);\n }\n}", "easeOutCubic(t) {\n return --t * t * t + 1;\n }", "function easing (z) {\n return 1 - Math.sqrt(z * (2 - z));\n }", "function Easing() {\n $( \"#target\" ).animate({}, 500, function() {\n $(topEdge());\n $(LeftEdge());\n $(topEdge());\n $(BottomEdge());\n $(LeftEdge());\n $(RightEdge());\n $(NudgeRight());\n $(NudgeLeft());\n $(topEdge());\n $(LeftEdge());\n $(NudgeRight());\n $(NudgeRight());\n $(LeftEdge());\n\n });\n }", "function easing(t, b, c, d) {\n t /= d / 2;\n if (t < 1) return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n }", "easeInOutQuad(t) {\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n }", "SmoothTangents() {}", "easeInQuad(t) {\n return t * t;\n }", "function quadEaseInOut(t) {\n if (t < 0.5) {\n return 2 * t * t\n }\n t -= 0.5;\n return 2 * t * (1 - t) + 0.5;\n}", "easeOutQuint(t) {\n return 1 + --t * t * t * t * t;\n }", "easeInQuart(t) {\n return t * t * t * t;\n }", "function easeInQuad(x) {\n return x * x\n}", "function easeNone(t, b, c, d)\n{\n\treturn c*t/d + b;\n}", "function easeInOutQuad(t) {\n return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n }", "function easeInOutQuad(t) {\n return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n }", "function easeInQuad(t) {\n return t * t;\n }", "function easeInQuad(t) {\n return t * t;\n }", "easeInQuint(t) {\n return t * t * t * t * t;\n }", "easeInOutQuart(t) {\n return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;\n }", "function ease(t, b, c, d){\n t /= d / 2;\n if (t < 1) return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n }", "function smoothFn (v, o, f, snap){\n\t v = !v ? 0 : v;\n\t f = f === undefined ? 0.1 : f;\n\t f = Math.min(f, snap);\n\t if (f < 0) { f = v > o ? Math.abs(snap) : -f; }\n\t return f * v + (1 - f) * o;\n\t }", "slerp(q2, blend) {\n blend = Math.clamp(blend, 0, 1);\n\n // if either input is zero, return the other.\n if (this.lengthSq() === 0)\n {\n if (q2.lengthSq() === 0)\n {\n return Quaternion.identity;\n }\n return q2;\n }\n else if (q2.lengthSq() === 0)\n {\n return this;\n }\n\n\n let cosHalfAngle = this.w * q2.w + this.xyz.dot(q2.xyz);\n\n if (cosHalfAngle >= 1 || cosHalfAngle <= -1) {\n // angle = 0.0f, so just return one input.\n return this;\n }\n else if (cosHalfAngle < 0)\n {\n q2.xyz = q2.xyz.negate();\n q2.w = -q2.w;\n cosHalfAngle = -cosHalfAngle;\n }\n\n let blendA;\n let blendB;\n if (cosHalfAngle < 0.99)\n {\n // do proper slerp for big angles\n let halfAngle = Math.acos(cosHalfAngle);\n let sinHalfAngle = Math.sin(halfAngle);\n let oneOverSinHalfAngle = 1 / sinHalfAngle;\n blendA = Math.sin(halfAngle * (1 - blend)) * oneOverSinHalfAngle;\n blendB = Math.sin(halfAngle * blend) * oneOverSinHalfAngle;\n }\n else\n {\n // do lerp if angle is really small.\n blendA = 1 - blend;\n blendB = blend;\n }\n\n let resultVec3 = this.xyz.clone().multiplyScalar(blendA).add( q2.xyz.clone().multiplyScalar(blendB) );\n let resultW = blendA * this.w + blendB * q2.w;\n\n let result = new Quaternion(resultVec3.x, resultVec3.y, resultVec3.z, resultW);\n\n if (result.lengthSq() > 0) {\n return result;\n }\n else {\n return Quaternion.identity;\n }\n }", "function smoothFn (v, o, f, snap){\n v = !v ? 0 : v;\n f = f === undefined ? 0.1 : f;\n f = Math.min(f, snap);\n if (f < 0) { f = v > o ? Math.abs(snap) : -f; }\n return f * v + (1 - f) * o;\n }", "function easeInQuart(t) {\n return t * t * t * t;\n }", "function easeInQuart(t) {\n return t * t * t * t;\n }", "function ease(t, b, c, d) {\n\t\tt /= d / 2;\n\t\tif (t < 1) return (c / 2) * t * t * t + b;\n\t\tt -= 2;\n\t\treturn (c / 2) * (t * t * t + 2) + b;\n\t}", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n}", "function makeEaseInOut(timing, timeFraction) {\n\treturn function(timeFraction) {\n\t\tif (timeFraction < .5) {\n\t\t\treturn timing(2 * timeFraction) / 2;\n\t\t} else {\n\t\t\treturn (2 - timing(2 * (1 - timeFraction))) / 2;\n\t\t}\n\t}\n}", "function makeEaseInOut(timing, timeFraction) {\n\treturn function(timeFraction) {\n\t\tif (timeFraction < .5) {\n\t\t\treturn timing(2 * timeFraction) / 2;\n\t\t} else {\n\t\t\treturn (2 - timing(2 * (1 - timeFraction))) / 2;\n\t\t}\n\t}\n}", "function global_ease_in(t, b, c, d) {\n\n return -c *(t/=d)*(t-2) + b;\n\n}", "function _setUpDamping() \n{\n/* var oneIn2 = this.scale >> 1;\n var oneIn4 = oneIn2 >> 1;\n var oneIn16 = oneIn4 >> 2;\n\n this._damping = function (distance) \n {\n var dis = Math.abs(distance);\n var result;\n\n if (dis < oneIn2) {\n result = dis >> 1;\n } else if (dis < oneIn2 + oneIn4) {\n result = oneIn4 + ((dis - oneIn2) >> 2);\n } else {\n result = oneIn4 + oneIn16 + ((dis - oneIn2 - oneIn4) >> 3);\n }\n\n return distance > 0 ? result : -result;\n };\n*/ \n}", "easeInOutQuint(t) {\n return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;\n }", "function computeNextFloat (from, to, ease){\n return from + (to - from) * ease;\n}", "function easeOutQuart(x) {\r\n return 1 - pow(1 - x, 3);\r\n}", "function easeOutQuad(t) {\n return t * (2 - t);\n }", "function easeOutQuad(t) {\n return t * (2 - t);\n }", "normalizeCurve() {\n const center = this[Math.floor(this.length / 2)]\n const min = Math.min(...this) - center\n const max = Math.max(...this) - center\n\n const amp = Math.abs(max) > Math.abs(min) ? max : min\n for (let i = 0; i < this.length; i++) {\n const v = this[i]\n this[i] = (v - center) / amp\n }\n }", "function easeOutQuart(x) {\n return 1 - pow(1 - x, 4);\n}", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "constructLerpFunctions ()\n {\n\n // Quadratic\n\n // lerpStyleEaseOutQuadratic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Quadratic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutQuadratic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInQuadratic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Quadratic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInQuadratic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutQuadratic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Quadratic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutQuadratic(initial, lerpDistance, duration, currentTime);\n };\n\n // Linear\n\n // lerpStyleLinear\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Linear]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleLinear(initial, lerpDistance, duration, currentTime);\n };\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Linear]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleLinear(initial, lerpDistance, duration, currentTime);\n };\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Linear]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleLinear(initial, lerpDistance, duration, currentTime);\n };\n\n // Sine\n\n // lerpStyleEaseOutSine\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Sine]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutSine(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInSine\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Sine]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInSine(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutSine\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Sine]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutSine(initial, lerpDistance, duration, currentTime);\n };\n\n // Exponential\n\n // lerpStyleEaseOutExponential\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Exponential]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutExponential(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInExponential\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Exponential]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInExponential(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutExponential\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Exponential]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutExponential(initial, lerpDistance, duration, currentTime);\n };\n\n // Cubic\n\n // lerpStyleEaseOutCubic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Cubic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutCubic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInCubic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Cubic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInCubic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutCubic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Cubic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutCubic(initial, lerpDistance, duration, currentTime);\n };\n }", "function Tangent() {\r\n}", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "function easeInOutBack(t, b, c, d, s) {\n if (s === undefined) {\n s = 1.70158;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\n }\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\n }", "transferFunction(x) {\r\n return Math.tanh(x)\r\n }", "static LerpUnclamped() {}", "easeInCubic(t) {\n return t * t * t;\n }", "easeInOutCubic(t) {\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n }", "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "function easeInOutExpo(t, b, c, d) {\n if (t === 0) {\n return b;\n }\n if (t === d) {\n return b + c;\n }\n t /= d / 2;\n if (t < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n }\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }", "desaturate() // eslint-disable-line no-unused-vars\n {\n this.saturate(-1);\n }", "function easeOutQuart(t) {\n return 1 - (--t) * t * t * t;\n }", "function easeOutQuart(t) {\n return 1 - (--t) * t * t * t;\n }", "function tweenTo( value ) {\n \t\tvar speed = 0.04;\n \t\tif ( value < 0 )\n \t\t\tvalue += speed;\n \t\tif ( value > 0 )\n \t\t\tvalue -= speed;\n \t\treturn value;\n \t}", "function easeInOutQuart(t) {\n return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t;\n }", "function easeInOutQuart(t) {\n return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t;\n }", "function easeInQuint(t) {\n return t * t * t * t * t;\n }", "function easeInQuint(t) {\n return t * t * t * t * t;\n }", "function easeInOutQuad(t, b, c, d) {\n if ((t/=d/2) < 1) return c/2*t*t + b;\n return -c/2 * ((--t)*(t-2) -1) + b;\n}", "function easeOutQuad(t, b, c, d) {\n return -c*(t/=d)*(t-2) + b;\n}", "function easeInOutQuad(t, b, c, d) {\n\t if ((t /= d / 2) < 1) return c / 2 * t * t + b;\n\t return -c / 2 * (--t * (t - 2) - 1) + b;\n\t}", "function checkEasing(href){\n //Default to EaseOutBack, unless the target is '#Home' or '#Contact'\n //using a \"back easing function causes it to glitch out because it is going beyond the body limits\n easingEffect='easeOutBack';\n duration=1000;\n if (href==='#Home' || href==='#Contact'){\n easingEffect='easeOutQuart';\n duration=1500;\n }\n}", "static easeInOut(value, exponent) {\r\n if (typeof value !== \"number\") throw new Error(\"Animation.easeInOut: Bad argument #1: Expected a number, got \" + typeof value);\r\n if (typeof exponent !== \"number\") throw new Error(\"Animation.easeInOut: Bad argument #2: Expected a number, got \" + typeof exponent);\r\n return value < 0.5 ? (2 ** (exponent - 1)) * (value ** exponent) : 1 - ((-2 * value + 2) ** exp) / 2;\r\n }", "invert() {\n this.reverse = !this.reverse;\n this._applySpeed();\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function easeOutCubic(t) {\n return (--t) * t * t + 1;\n }", "function rotateSwap(){\n rotFactor *= -1;\n}", "function linearEasing(time, initial, change, duration) {\n return change * time / duration + initial;\n }", "function easeInOutQuart(t, b, c, d) {\n if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n}", "function symmetrical(step, index) {\n return (step <= index) ?\n linearEnter(step, index) :\n linearExit(step, index);\n}", "setInvert() {\n//--------\n// (t,r) := (-Rot(r*,t),r*) = (Rot(r*,-t),r*)\nthis._r.setInvert();\n(this._t.setNegate()).setRotate(this._r);\nreturn this;\n}", "function ease(p) {\n if(p === 0) { return 0; }\n\n var sign = (p < 0)? -1 : 1,\n abs = Math.abs(p);\n\n if(abs < 0.5) {\n return sign * 4 * Math.pow(abs, 3);\n } else {\n var f = ((2 * abs) - 2);\n return sign * (0.5 * Math.pow(f, 3) + 1);\n }\n}", "function sineMovement(double) {\r\n return 0.5*sin(double)+1;\r\n}", "function easeInOutQuad(t, b, c, d) {\n if ((t /= d / 2) < 1) return c / 2 * t * t + b;\n return -c / 2 * (--t * (t - 2) - 1) + b;\n }", "function lerp(a0, a1, w) {\n return (1.0 - w)*a0 + w*a1;\n }", "oscillate() {\n this.angle += 0.02;\n }", "function easeOutQuad(t, b, c, d) {\n\t return -c * (t /= d) * (t - 2) + b;\n\t}", "getTransitionMethod (transition) {\n\n switch (transition) {\n // ease linear\n case \"easeLinear\":\n return d3EaseLinear; \n break;\n // easeQuadIn as d3EaseQuadIn,\n case \"easeQuadIn\":\n return d3EaseQuadIn;\n break;\n // easeQuadOut as d3EaseQuadOut\n case \"easeQuadOut\":\n return d3EaseQuadOut;\n break;\n // easeQuadInOut as d3EaseQuadInOut\n case \"easeQuadInOut\":\n return d3EaseQuadInOut;\n break;\n // easeCubicIn as d3EaseCubicIn\n case \"easeCubicIn\":\n return d3EaseCubicIn;\n break;\n // easeCubicOut as d3EaseCubicOut,\n case \"easeCubicOut\":\n return d3EaseCubicOut;\n break;\n // easeCubicInOut as d3EaseCubicInOut,\n case \"easeCubicInOut\":\n return d3EaseCubicInOut;\n break;\n // easePolyIn as d3EasePolyIn,\n case \"easePolyIn\":\n return d3EasePolyIn;\n break;\n // easePolyOut as d3EasePolyOut,\n case \"easePolyOut\":\n return d3EasePolyOut;\n break;\n // easePolyInOut as d3EasePolyInOut,\n case \"easePolyInOut\":\n return d3EasePolyInOut;\n break;\n // easeSinIn as d3EaseSinIn,\n case \"easeSinIn\":\n return d3EaseSinIn;\n break;\n // easeSinOut as d3EaseSinOut,\n case \"easeSinOut\":\n return d3EaseSinOut;\n break;\n // easeSinInOut as d3EaseSinInOut,\n case \"easeSinInOut\":\n return d3EaseSinInOut;\n break;\n // easeExpIn as d3EaseExpIn,\n case \"easeExpIn\":\n return d3EaseExpIn;\n break;\n // easeExpOut as d3EaseExpOut,\n case \"easeExpOut\":\n return d3EaseExpOut;\n break;\n // easeExpInOut as d3EaseExpInOut,\n case \"easeExpInOut\":\n return d3EaseExpInOut;\n break;\n // easeCircleIn as d3EaseCircleIn,\n case \"easeCircleIn\":\n return d3EaseCircleIn;\n break;\n // easeCircleOut as d3EaseCircleOut,\n case \"easeCircleOut\":\n return d3EaseCircleOut;\n break;\n // easeCircleInOut as d3EaseCircleInOut,\n case \"easeCircleInOut\":\n return d3EaseCircleInOut;\n break;\n // easeBounceIn as d3EaseBounceIn,\n case \"easeBounceIn\":\n return d3EaseBounceIn;\n break;\n // easeBounceOut as d3EaseBounceOut,\n case \"easeBounceOut\":\n return d3EaseBounceOut;\n break;\n // easeBounceInOut as d3EaseBounceInOut,\n case \"easeBounceInOut\":\n return d3EaseBounceInOut;\n break;\n // easeBackIn as d3EaseBackIn,\n case \"easeBackIn\":\n return d3EaseBackIn;\n break;\n // easeBackOut as d3EaseBackOut,\n case \"easeBackOut\":\n return d3EaseBackOut;\n break;\n // easeBackInOut as d3EaseBackInOut,\n case \"easeBackInOut\":\n return d3EaseBackInOut;\n break;\n // easeElasticIn as d3EaseElasticIn,\n case \"easeElasticIn\":\n return d3EaseElasticIn;\n break;\n // easeElasticOut as d3EaseElasticOut,\n case \"easeElasticOut\":\n return d3EaseElasticOut;\n break;\n // easeElasticInOut as d3EaseElasticInOut,\n case \"easeElasticInOut\":\n return d3EaseElasticInOut;\n break;\n // easeElastic as d3EaseElastic,\n case \"easeElastic\":\n return d3EaseElastic;\n break;\n\n // ease elastic transition\n case \"easeElastic\":\n return d3EaseElastic; \n break;\n };\n\n }", "function easeOutQuad(t, b, c, d) {\r\n return -c *(t/=d)*(t-2) + b;\r\n }", "static slerp(q, qa, qb, T) {\nreturn this.slerpQV(q.xyzw, qa.xyzw, qb.xyzw, T);\n}", "function easeInOutQuart(t, b, c, d) {\n if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }", "function ease(elapsed, target, duration) {\n return Math.round(-target * Math.cos(elapsed / duration * (Math.PI / 2)) + target);\n }", "function alt(y) {\n return function(x) {\n return Z.alt (x, y);\n };\n }" ]
[ "0.64032596", "0.6380232", "0.627684", "0.6214854", "0.6098732", "0.60374486", "0.5991297", "0.5986912", "0.5976483", "0.5971845", "0.59415835", "0.59266376", "0.58837193", "0.5804738", "0.57271856", "0.5637966", "0.5629453", "0.56065136", "0.55933946", "0.5587587", "0.5568834", "0.5566649", "0.55405754", "0.55405754", "0.5523315", "0.5523315", "0.54569244", "0.54563224", "0.54512495", "0.54408413", "0.542602", "0.5397293", "0.5397034", "0.5397034", "0.5392952", "0.5388975", "0.53872883", "0.53872883", "0.5385386", "0.53646207", "0.5345155", "0.53410906", "0.5339918", "0.5333446", "0.5333446", "0.53094125", "0.5306772", "0.5292709", "0.5292709", "0.5290815", "0.5277503", "0.5255607", "0.5255607", "0.52522117", "0.52522117", "0.52522117", "0.52522117", "0.52522117", "0.523249", "0.522281", "0.52183104", "0.521299", "0.5194276", "0.5194276", "0.5194276", "0.5194276", "0.5194276", "0.5188151", "0.5186295", "0.5186295", "0.51619697", "0.51579493", "0.51579493", "0.51518124", "0.51518124", "0.5149956", "0.51497823", "0.5145287", "0.5142931", "0.5140083", "0.5135986", "0.51310766", "0.51310766", "0.5130153", "0.5121155", "0.5120168", "0.51196384", "0.51161647", "0.5113268", "0.5102675", "0.5102415", "0.5086568", "0.5079666", "0.5079518", "0.50747323", "0.5065413", "0.5065129", "0.5062527", "0.50486296", "0.50448155" ]
0.60866684
5
on click for dropdown content, generate a park list dropdown for that state.
function parkCodeHandler(parkData) { var parkSelect = $("#park-select").empty(); parkSelect.append($("<option>").text("---").attr("class", "dropdown-item")); $.each(parkData, function (index, value) { var parkOptions = $("<option>") .text(value.fullName) .attr("class", "dropdown-item") .attr("data-lat", value.latitude) .attr("data-lon", value.longitude); $(parkSelect).append(parkOptions); }); parkSelect.on("change", function (event) { event.stopPropagation(); var parkLoc = $(this).find(":selected").data(); lat = parkLoc.lat; lon = parkLoc.lon; nasaCall(lat, lon); weatherCall(lat, lon); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateSelectionMenu() {\n // Iterate through the river info to determine the dropdow groupings\n var selectionGroups = [];\n for(var i=0; i < riverInfo.length; i++) {\n if(i == 0) {\n selectionGroups.push(riverInfo[i].state);\n } else {\n if(selectionGroups.includes(riverInfo[i].state) == false) {\n selectionGroups.push(riverInfo[i].state);\n }\n }\n }\n\n // Iterate over each selection group, placing the group in the item-list\n for(var i=0; i < selectionGroups.length; i++) {\n var currentGroup = '<div id=\"' + abbrState(selectionGroups[i], 'abbr') + '-group\" class=\"item-group\" data-state=\"' + selectionGroups[i] + '\"></div>';\n $('.item-list').append(currentGroup);\n }\n\n // Iterate over each item in the river info list, placing each one in its appropriate dropdown group\n riverInfo.forEach((riverData, i) => {\n var selectionIDText = riverData.river.toLowerCase().split(\" \").join(\"-\") + \"-selection\";\n var currentItem = document.createElement('div');\n currentItem.id = riverData.river.toLowerCase().split(\" \").join(\"-\") + '-selection';\n currentItem.classList.add('item');\n currentItem.dataset.index = i;\n currentItem.addEventListener('click', () => selectItem(selectionIDText));\n currentItem.innerHTML = riverData.river;\n var itemGroup = '#' + abbrState(riverData.state, 'abbr') + '-group';\n $(itemGroup).append(currentItem);\n })\n}", "function selectedState() {\n $('.js-button').on('click', e => {\n $('form').submit(false);\n const stateAbbreviation = $('select').val();\n STORE.maxResults = $('.js-num-select').val();\n getParks(stateAbbreviation, STORE.maxResults);\n });\n\n}", "populate_dropdown() {\n let dropdown = $(\"#vertex-shader\");\n this.shader_lib.vertex_info.map((x, i) => {\n $('<option>')\n .val(i)\n .html(x.title)\n .appendTo(dropdown);\n });\n }", "function createDropDown(){\r\r\n\t\tvar $form = $(\"div#country-select form\");\r\r\n\t\t$form.hide();\r\r\n\t\tvar source = $(\"#country-options\");\r\r\n\t\tsource.removeAttr(\"autocomplete\");\r\r\n\t\tvar selected = source.find(\"option:selected\");\r\r\n\t\tvar options = $(\"option\", source);\r\r\n\t\t$(\"#country-select\").append('<dl id=\"target\" class=\"dropdown\"></dl>')\r\r\n\t\t$(\"#target\").append('<dt class=\"' + selected.val() + '\"><a href=\"#\"><span class=\"flag\"></span><em>' + selected.text() + '</em></a></dt>')\r\r\n\t\t$(\"#target\").append('<dd><ul></ul></dd>')\r\r\n\t\toptions.each(function(){\r\r\n\t\t\t$(\"#target dd ul\").append('<li class=\"' + $(this).val() + '\"><a href=\"' + $(this).attr(\"title\") + '\"><span class=\"flag\"></span><em>' + $(this).text() + '</em></a></li>');\r\r\n\t\t\t});\r\r\n\t}", "function createDropDown() {\n var $source = $(\"#radiusSelect\");\n var $selected = $source.find(\"option[selected]\");\n var $options = $(\"option\", $source);\n \n\n $(\"#addy_in_radius\").append('<dl id=\"target\" class=\"dropdown\"></dl>');\n var $target = $(\"#target\");\n\n $target.append('<dt><a href=\"#\">' + $selected.text() + '<span class=\"value\">' +\n $selected.val() + '</span><i class=\"icon-angle-down\"></i></a></dt>');\n\n $target.append('<dd><ul></ul></dd>');\n\n $options.each(function(){\n $(\"#target dd ul\").append('<li><a href=\"#\">' + $(this).text()\n + '<span class=\"value\">' + $(this).val() + '</span></a></li>');\n });\n\n }", "function showStatesInDropDown() {\n\tlet html = states.map(curr => \"<option value=\" + curr.code + \">\" + curr.name + \"</option>\")\n\tlet inputState = document.querySelector('#inputStateForm');\n\tinputState.insertAdjacentHTML(\"afterbegin\", html);\n}", "function generateDropdownMenu() {\n\tvar dropdownContent = document.getElementById(\"dropdown-content\");\n\tvar oldDropdownList = document.getElementById(\"dropdownList\");\n\tif (dropdownContent) {\n\t\tvar newDropdownList = document.createElement(\"ul\");\n\t\tnewDropdownList.id = \"dropdownList\";\n\t\tfor (var i = 0; i < tracks.length; i++) {\n\t\t\tvar track = tracks[i];\n\t\t\tvar trackEntry = document.createElement(\"li\");\n\t\t\ttrackEntry.id = \"trackEntry\" + i;\n\t\t\ttrackEntry.classList.add(\"dropdown-content\");\n\t\t\ttrackEntry.addEventListener(\"click\", function() {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tcurrentTrack = track;\n\t\t\t\t\tresetTime();\n\t\t\t\t\tshowFutureStrokes(currentTrack);\n\t\t\t\t}, visualDelay);\n\t\t\t});\n\t\t\tvar text = document.createTextNode(track.name);\n\t\t\ttrackEntry.appendChild(text);\n\t\t\tnewDropdownList.appendChild(trackEntry);\n\t\t}\n\t\tdropdownContent.replaceChild(newDropdownList, oldDropdownList);\n\t}\n}", "function dropDownComponents(){\n\n // loads the city into the city box\n cityList.forEach((city) => {\n \n citySelector.append(\"option\").text(`${city}`);\n });\n\n // loads the state into the state box\n stateList.forEach((state) => {\n stateSelector.append(\"option\").text(`${state}`);\n });\n\n // loads the state into the state box\n countryList.forEach((country) => {\n countrySelector.append(\"option\").text(`${country}`);\n });\n\n // loads the state into the state box\n shapeList.forEach((shape) => {\n shapeSelector.append(\"option\").text(`${shape}`);\n });\n}", "function build_dropdown() {\r\n var options = ''; //holder all the <option>Place name</option>'s we're gonna build\r\n jQuery.each(places, function(i,place) { //for each of the places ...\r\n options += '<option>' + place + '</option>'; // ... add an option ...\r\n });\r\n jQuery('#dfm-select').html(options); // ... then use jQuery to put it inside the <select> tags in index.html\r\n dropdown_built = true; //set our flag from false to true\r\n}", "function dropDown() {\n // Use list of sample names to render the select options\n Plotly.d3.json(\"/names\", function (error, response) {\n if (error) return console.warn(error);\n\n let selection = document.getElementById(\"select-dataset\");\n for (let i = 0; i < response.length; i++) {\n let selectedOption = document.createElement(\"option\");\n selectedOption.text = response[i];\n selectedOption.value = response[i];\n selection.appendChild(selectedOption);\n }\n getData(response[0], createCharts);\n });\n}", "dropdownContent() {\n return Demo.getSamplePrograms().map(program => {\n return (\n <a tabindex=\"0\" class=\"dropdown-item\" onclick={e=>this.handleDropdownClick(program)}>\n {program.name}\n </a>\n );\n })\n }", "function setSelectedListItem(e) {\n const selectedTextToAppend = document.createTextNode(e.target.innerText);\n dropdownBetreffNode.innerHTML = null;\n dropdownBetreffNode.appendChild(selectedTextToAppend);\n}", "function buildSportDropDown(sportName) {\n $('#sportName').append($('<div>')\n .addClass(\"dropdown\"+sportName)\n .append($('<button>')\n .addClass(\"dropbtn\"+sportName)\n .text(sportName.toUpperCase())\n .append($('<i>')\n .addClass(\"fa fa-caret-down\")\n )\n )\n .append($('<div>')\n .addClass(\"dropdown\"+sportName+\"-content\")\n .attr(\"id\",sportName.toLowerCase()+\"AthName\")\n )\n )\n}", "function McDropdownPanel() { }", "function clickOptiontoSelect(){\n\n}", "function PancakeDropdown(promptText) {\n /**CONSTANTS***/\n //Keys\n //Style\n var BG_COLOR = \"#FFFFFF\";\n var BORDER_COLOR = \"#c9cbcd\";\n var BG_COLOR_SELECTED = \"#f2f5f8\";\n var BORDER_COLOR_SELECTED = \"#B4B6B8\";\n var FONT_COLOR = \"#B1A9AE\";\n var FONT_COLOR_SELECTED = \"#68696b\";\n //Layout\n var DEFAULT_HEIGHT = 20;\n //Class\n var DROPDOWN_SELECT_TEXT_CLASS = \"DROPDOWN_SELECT_TEXT_CLASS\";\n\n /**Externally Set***/\n //Structure\n var externalDiv;\n //Util\n var papaIndicatorSelection;\n var optionWindowComponent;\n //Layout\n var windowWidth;\n var width;\n var height = DEFAULT_HEIGHT;\n var isAlignLeft;\n //Functions\n var externalOnOptionSelected;\n\n /**Internally Set***/\n //Structure\n var selectedP;\n var dropButton;\n var closeButton;\n var optionsWindowDiv;\n //State\n var selectedText;\n var selectedTextColor;\n //Utils\n var shapeUtil = ShapesUtil.getInstance();\n //State\n var selectedOptionData;\n var isShowFullList;\n\n /**Public Function**/\n this.setExternalDiv = function (divD3) {\n externalDiv = divD3;\n };\n\n this.setSelectedTextColor = function(color){\n selectedTextColor = color;\n };\n\n this.drawComponent = function () {\n performConstruct();\n };\n\n this.setOuterComponents = function (optionWindowComponentInput) {\n optionWindowComponent = optionWindowComponentInput;\n };\n\n this.setLayout = function (widthInput, heightInput, windowWidthInput, isAlignLeftInput) {\n width = widthInput;\n height = heightInput;\n windowWidth = windowWidthInput;\n isAlignLeft = isAlignLeftInput;\n if (!windowWidth){\n windowWidth = width;\n }\n };\n\n this.setSelectedOption = function(optionData){\n selectedOptionData = optionData;\n markAsSelected();\n };\n\n this.setFunctions = function(onOptionSelectedInput){\n externalOnOptionSelected = onOptionSelectedInput;\n };\n\n this.clearSelection = function () {\n clearSelection();\n };\n\n /***Construct***/\n function performConstruct() {\n clearSlate(externalDiv);\n\n selectedP = externalDiv.append(\"p\")\n .style({\n position: \"absolute\",\n margin: 0,\n \"font-size\": 13 + \"px\",\n top: 0 + \"px\",\n right: 0 + \"px\",\n width: width + \"px\",\n height: height + \"px\",\n border: \"1px solid\",\n \"line-height\": height + \"px\",\n \"padding-left\": 5 + \"px\",\n \"padding-right\": 20 + \"px\",\n \"border-radius\": 2 + \"px\",\n \"box-sizing\": \"border-box\",\n cursor: \"pointer\"\n })\n .classed(DROPDOWN_SELECT_TEXT_CLASS, true)\n .on(\"click\", onDropClick)\n .on(\"mousedown\", onDropMouseDown);\n\n dropButton = externalDiv.append(\"div\")\n .style({\n position: \"absolute\",\n top: 0 + \"px\",\n right: 0 + \"px\",\n width: 20 + \"px\",\n height: 20 + \"px\",\n cursor: \"pointer\",\n \"pointer-events\": \"none\"\n });\n\n var dropIcon = dropButton.append(\"div\")\n .style({\n position: \"absolute\",\n top: 6 + \"px\",\n right: 6 + \"px\",\n width: 8 + \"px\",\n height: 8 + \"px\"\n });\n shapeUtil.createTriangle(dropIcon, 8, 8, shapeUtil.DIRECTION.BOTTOM, \"#555555\");\n\n closeButton = externalDiv.append(\"div\")\n .style({\n position: \"absolute\",\n top: 0 + \"px\",\n right: 0 + \"px\",\n width: 20 + \"px\",\n height: 20 + \"px\",\n display: \"none\",\n cursor: \"pointer\",\n background: BORDER_COLOR_SELECTED\n })\n .on(\"click\", onCancelClick)\n .on(\"mousedown\", onCancelMouseDown);\n\n var closeP = closeButton.append(\"p\")\n .style({\n margin: 0,\n \"font-family\": \"sans-serif\",\n \"font-size\": 14 + \"px\",\n \"text-align\": \"center\",\n height: 20 + \"px\",\n \"line-height\": 20 + \"px\"\n })\n .text(\"X\");\n\n optionsWindowDiv = externalDiv.append(\"div\")\n .style({\n position: \"absolute\",\n top: height + 5 + \"px\",\n width: windowWidth + \"px\",\n border: \"1px solid #999999\",\n background: \"white\",\n display: \"none\",\n \"z-index\": 2\n });\n\n if (!isAlignLeft){\n optionsWindowDiv.style(\"left\", 0);\n }else{\n optionsWindowDiv.style(\"right\", 0);\n }\n\n optionWindowComponent.setFunctions(onOptionSelected);\n optionWindowComponent.setExternalDiv(optionsWindowDiv);\n optionWindowComponent.drawComponent();\n\n optionWindowComponent.hideList();\n unmarkAsSelected();\n }\n\n\n function switchToCloseButton() {\n closeButton.style(\"display\", \"\");\n dropButton.style(\"display\", \"none\");\n }\n\n function switchToDropButton() {\n closeButton.style(\"display\", \"none\");\n dropButton.style(\"display\", \"\");\n }\n\n /**Actions!**/\n function showList() {\n optionWindowComponent.showList();\n }\n\n function clearSelection() {\n selectedOptionData = undefined;\n unmarkAsSelected();\n optionWindowComponent.clearSelection();\n }\n\n function unmarkAsSelected() {\n if (!promptText){\n promptText = \"Select\";\n }\n\n selectedP.style({\n color: FONT_COLOR,\n \"border-color\": BORDER_COLOR,\n background: BG_COLOR,\n \"font-weight\": \"normal\"\n }).text(promptText);\n\n switchToDropButton();\n }\n\n function markAsSelected() {\n selectedP.style({\n color: FONT_COLOR_SELECTED,\n \"border-color\": BORDER_COLOR_SELECTED,\n background: BG_COLOR_SELECTED,\n \"font-weight\": 700\n }).text(selectedOptionData.selectedText);\n\n if (selectedTextColor){\n selectedP.style(\"color\", selectedTextColor);\n }\n\n switchToCloseButton();\n }\n\n /**Event Listener***/\n function onOptionSelected(optionData) {\n selectedOptionData = optionData;\n markAsSelected();\n if (externalOnOptionSelected) {\n externalOnOptionSelected(selectedOptionData);\n }\n }\n\n function onDropMouseDown(){\n optionWindowComponent.isOptionClicked = true;\n }\n\n function onDropClick() {\n isShowFullList = true;\n if (optionsWindowDiv.style(\"display\") == \"none\") {\n showList();\n } else {\n optionWindowComponent.hideList();\n }\n }\n\n function onCancelClick() {\n clearSelection();\n if (externalOnOptionSelected) {\n externalOnOptionSelected(undefined);\n }\n optionWindowComponent.hideList();\n }\n\n function onCancelMouseDown(){\n optionWindowComponent.isOptionClicked = true;\n }\n\n}", "sportsselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Sports').then(option => {\n cy.wrap(option).contains('Sports');\n option[0].click();\n \n })\n \n }", "function populateState() {\n\tvar stateSelect = $(\".us-states\");\n\t$.each(usStates, function() {\n\t\t// creates new option for specific state, then appends into select box\n\t\tvar optionText = \"<option value=\\\"\" + this[\"name\"] + \"\\\">\" + this[\"abbreviation\"] + \"</option>\";\n\t\tstateSelect.append(optionText);\n\t});\n\n}", "function stateClick() {\n\n\tif ($(\"#states\").hasClass(\"current-item\") == false)\n\t{\n\t\t// add class to $(\"#states\"), delete for others\n\t\t$(\"#home\").removeClass();\n\t\t$(\"#msgs\").removeClass();\n\t\t$(\"#states\").addClass(\"current-item\");\n\n\t\tshowDiv(\"state_info\");\n\t}\n\n\t// if the dropdown is not present,\n\t// create a new div and generate a dropdown menu for states\n\tif (document.getElementById('dropdown') === null)\n\t{\n\t\t// get the state_info div box\n\t\tvar stateDiv = document.getElementById('state_info');\n\n\t\t// create listbox Object\n\t\tvar div = document.createElement('div');\n\t\tdiv.id = 'dropdown';\n\t\tdiv.innerHTML = \"<h2>States browser</h2>\" + \"<p>\";\n\n\t\tif (stateDiv.firstChild)\n\t\t\tstateDiv.insertBefore(div, stateDiv.firstChild);\n\t\telse\n\t\t\tstateDiv.appendChild(div);\n\t\t\n\t\t// create dropdown box\n\t\tvar select = document.createElement('select');\n\t\tselect.id = 'stateList';\n\t\tdocument.getElementById(\"dropdown\").appendChild(select);\n\t\t\n\t\t// get the list of States in the dropdown menu\n\t\t$.ajax({\n\t url: 'http://localhost:8888/states/abbreviations',\n\t type: 'GET',\n\t success: function(data)\n\t {\n\t \t\t// will obtain list of states\n\t \t\tfor (var i = 0; i < data.length; i++) {\n\t \t\t\t// create a <option> for each one, and set its value to its state name\n\t \t\t\tvar listItem = document.createElement(\"option\");\n\t \t\t\tlistItem.setAttribute(\"value\", data[i]);\n\t \t\t\tlistItem.innerHTML = data[i];\n\n\t \t\t\tdocument.getElementById(\"stateList\").appendChild(listItem);\n\t \t\t}\n\n\t \t\t$( \"select\" ).change( displayStateInfo );\n\t \t\tdisplayStateInfo();\n\t },\n\t error: function(jqXHR, textStatus, errorThrown)\n\t {\n\t \t\talert(\"Failed to load states data!\");\n\t }\n\t\t});\n\t}\n}", "function dropDownLists(category, options){\n var description = ['Two to Six Apartments, Over 62 Years', 'Mixed commercial/residential building, 6 units or less, sq ft less than 20,000', 'Two or three story non-fireproof corridor apartments,or california type apartments, interior entrance','Two or three story non-frprf. crt. and corridor apts or california type apts, no corridors, ex. entrance','Mixed use commercial/residential with apts. above seven units or more or building sq. ft. over 20,000'];\n var street = ['JUSTINE', 'TAYLOR', 'HARRISON','POLK','LAFLIN','FILLMORE','LEXINGTON','FLOURNOY','BISHOP','LOOMIS','VAN BUREN','ROOSEVELT','GRENSHAW','ADA','THROOP','JACKSON','LYTLE','RACINE','MAY','VERNON PARK','ABERDEEN','CARPENTER','MILLER','MORGAN','17TH','18TH','19TH','21ST','CULLERTON','CERMAK','DAMEN','WOOD','ASHLAND','BLUE ISLAND','ALLPORT','WASHBURNE','MAXWELL','PEORIA','WESTERN','GRAND','HADDON','ARTESIAN','DIVISION','ARTESIAN','SACRAMENTO','GEORGE','WHIPPLE','TROY','ALBANY','KEDZIE','SUPERIOR','OHIO'];\n var resType = ['1.5 - 1.9','Two Story', 'Three Story'];\n var bldUsg = ['Multi Family'];\n var extDesc = ['Masonry','Frame','Frame/Masonry'];\n var bsmtDesc = ['Partial and Unfinished','Partial and Apartment','Slab and Unfinished','Full and Apartment','Full and Formal Rec. Room','Full and Unfinished','Craw and Formal Rec. Room'];\n var atticDesc = ['Full and Living Area','Partial and Living Area','Frame/Masonry'];\n var garDesc = ['1 Car Detached','1 1/2 Car Detached','2 Cars Detached','2 Cars Attached','2 1/2 Cars Attched','3 Cars Detached','4 Cars Detached'];\n var appealStatus = ['Appeal Review Complete'];\n var appealResult = ['Assessed Value Adjusted','Assessed Value Not Adjusted'];\n\n switch (category.value) {\n case 'CLASS_DESCRIPTION':\n options.options.length = 0;\n for (i = 0; i < description.length; i++) {\n createOption(options, description[i], description[i]);\n }\n break;\n case 'Street':\n options.options.length = 0;\n for (i = 0; i < street.length; i++) {\n createOption(options, street[i], street[i]);\n }\n break;\n case 'RES_TYPE':\n options.options.length = 0;\n for (i = 0; i < resType.length; i++) {\n createOption(options, resType[i], resType[i]);\n }\n break;\n case 'BLDG_USE':\n options.options.length = 0;\n for (i = 0; i < bldUsg.length; i++) {\n createOption(options, bldUsg[i], bldUsg[i]);\n }\n break;\n case 'EXT_DESC':\n options.options.length = 0;\n for (i = 0; i < extDesc.length; i++) {\n createOption(options, extDesc[i], extDesc[i]);\n }\n break;\n case 'BSMT_DESC':\n options.options.length = 0;\n for (i = 0; i < bsmtDesc.length; i++) {\n createOption(options, bsmtDesc[i], bsmtDesc[i]);\n }\n break;\n case 'ATTIC_DESC':\n options.options.length = 0;\n for (i = 0; i < atticDesc.length; i++) {\n createOption(options, atticDesc[i], atticDesc[i]);\n }\n break;\n case 'GAR_DESC':\n options.options.length = 0;\n for (i = 0; i < garDesc.length; i++) {\n createOption(options, garDesc[i], garDesc[i]);\n }\n break;\n case 'APPEAL_A_STATUS':\n options.options.length = 0;\n for (i = 0; i < appealStatus.length; i++) {\n createOption(options, appealStatus[i], appealStatus[i]);\n }\n break;\n case 'APPEAL_A_RESULT':\n options.options.length = 0;\n for (i = 0; i < appealResult.length; i++) {\n createOption(options, appealResult[i], appealResult[i]);\n }\n break;\n default:\n options.options.length = 0;\n break;\n }\n\n}", "function generateDropdown(str, className)\n{\n\tif(className == \"closeout\")\n\t\treturn;\n\tif(className == \"meeting\")\n\t\treturn;\n\t\n\tvar json = JSON.parse(str);\n\tvar d = document.createDocumentFragment();\n\tvar sent=true;\n\t \n\tfor (var i = 0; i < json.length; i++)\n\t{\n\t\tsent=true;\n\t\t\n\t\tvar option = document.createElement(\"option\");\n\t\tif (className == \"warehouse\")\n\t\t{\n\t\t\toption.innerHTML = json[i].city.name+\", \"+json[i].state+\" -- #\"+json[i].warehouseID;\n\t\t\toption.setAttribute(\"value\", json[i].id);\n\t\t\toption.setAttribute(\"label\", json[i].city.name+\", \"+json[i].state+\" -- #\"+json[i].warehouseID);\n\t\t}\n\t\telse if (className == \"region\")\n\t\t{\n\t\t\toption.innerHTML = json[i];\n\t\t\toption.setAttribute(\"value\", json[i]);\n\t\t\toption.setAttribute(\"label\", json[i]);\n\t\t}\n\t\telse if(className==\"stage\")\n\t\t{\n\t\t\tif(hasStage(stages, json[i].name))\n\t\t\t{\n\t\t\t\toption.innerHTML=json[i].name;\n\t\t\t\toption.setAttribute(\"value\", json[i].id);\n\t\t\t\toption.setAttribute(\"label\", json[i].name);\n\t\t\t}\n\t\t\telse\n\t\t\t\tsent=false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\toption.innerHTML = json[i].name;\n\t\t\toption.setAttribute(\"value\", json[i].id);\n\t\t\toption.setAttribute(\"label\", json[i].name);\n\t\t}\n\t\n\t\tif(sent)\n\t\t\td.appendChild(option);\n\t}\n\t\t\n\t\tif(className == 'warehouse')\n\t\t{\n\t\t\td.child\n\t\t\twarehouseOptions = d;\n\t\t}\n\t\tif(className == 'stage')\n\t\t{\n\t\t\tstageOptions = d;\n\t\t}\n\t\tif(className == 'item')\n\t\t{\n\t\t\titemOptions = d;\n\t\t}\n\t\tif(className == 'class')\n\t\t{\n\t\t\tclassOptions = d;\n\t\t}\n\t\tif(className == 'type')\n\t\t{\n\t\t\ttypeOptions = d;\n\t\t}\n\t\tif(className == 'region')\n\t\t{\n\t\t\tregionOptions = d;\n\t\t}\n\t\tif(className == 'status')\n\t\t{\n\t\t\tstatusOptions = d;\n\t\t}\n if(className == 'person')\n {\n managerOptions = d;\n }\n\t\n}", "animalvideosselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Animal Videos').then(option => {\n cy.wrap(option).contains('Animal Videos');\n option[0].click();\n })\n }", "buildSelect() {\n // Build html select\n this.select = document.createElement('select')\n this.select.classList.add(this.selectClass)\n // Create all options from li\n const items = this.element.querySelectorAll('li')\n ;[].forEach.call(items, item => {\n const option = document.createElement('option')\n option.innerText = item.innerText\n option.value = item.querySelector('a').href\n if (item.classList.contains('active')) {\n option.selected = true\n }\n this.select.appendChild(option)\n })\n // Clean parent and append select\n this.parent.innerHTML = ''\n this.parent.appendChild(this.select)\n this.select.addEventListener('change', this.handleSelectAsLink)\n }", "function generateDropdown(parentID,label,dropID,title,array) {\n //add select options\n var dropHtml = \"\";\n if (label != \"\") {\n dropHtml += '<label>' + label + '</label>'\n }\n dropHtml += '<select class=\"selectpicker show-tick\" id=\"'+ dropID +'\" title=\"'+title+'\" data-style=\"btn-default\" data-width=\"100%\" data-size=\"10\">'\n //build list, apply BREAKS or LABELS if words present in array\n for (i = 0; i < array.length; i++) {\n if (array[i] == 'BREAK'){\n dropHtml += '<option data-divider=\"true\"></option>';\n } else if (array[i].includes('LABEL=')) {\n dropHtml += '<optgroup label=\"' + array[i].replace('LABEL=','') + '\">';\n } else if (array[i].includes('ENDLABEL')) {\n dropHtml += '</optgroup>';\n }\n else {\n dropHtml += '<option>' + array[i] + '</option>';\n }\n }\n dropHtml += '</select>';\n //add to parent div\n document.getElementById(parentID).innerHTML = dropHtml;\n //initialise dropdown\n $('#'+dropID).selectpicker();\n //bind dropdown click handler\n $('#'+dropID).on('changed.bs.select', dropClickHandler);\n}", "function listSelector(event) {\n // highlight selected cat's name in dropdown list\n highlightList(event);\n // set selected cat's name in header\n setName(event);\n // hide drop-down list after selection\n hideList();\n}", "function dropDown() {\n // data route\n var url = \"/names\";\n\n var list = Plotly.d3.select(\"#sampleList\").append('select').attr(\"onchange\", \"getValue()\")\n\n Plotly.d3.json(url, function (error, namesList) {\n if (error) return console.warn(error)\n\n list.selectAll('option')\n .data(namesList)\n .enter()\n .append('option')\n .text(function (d) { return d; });\n });\n}", "function dropDown() {\n // data route\n var url = \"/names\";\n\n var list = Plotly.d3.select(\"#sampleList\").append('select').attr(\"onchange\", \"getValue()\")\n\n Plotly.d3.json(url, function (error, namesList) {\n if (error) return console.warn(error)\n\n list.selectAll('option')\n .data(namesList)\n .enter()\n .append('option')\n .text(function (d) { return d; });\n });\n}", "celebritiesselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Celebrities').then(option => {\n cy.wrap(option).contains('Celebrities');\n option[0].click();\n\n })\n \n }", "function renderMenu(){\n $.get(\"/api/masterPlants/\", function(mData){\n for (var i=0; i<mData.length; i++){\n var newOption = $(\"<option>\").text(mData[i].common_name).addClass(\"drop-down\");\n newOption.attr({\"value\":mData[i].id});\n $(\"#drop-down\").append(newOption);\n } \n })\n }", "function generateEngines(){\n for(var i = 0; i < engines.length; i++){\n $(\"#engine-list\").html($(\"#engine-list\").html()+'<a class=\"dropdown-item\" href=\"#\" onclick=\"changeEngine('+i+')\">'+engines[i].name+'</a>');\n }\n}", "updateLibraryDropdown() {\n const libList = this.appController.projectController.getProject().getBlockLibraryNames();\n for (let libName of libList) {\n $('#dropdown_libraryList').append(\n $('<option></option>').val(libName).html(libName));\n }\n }", "openStageFilter(){\n var selected = this.template.querySelector(\".selected-stage\");\n var optionsContainer = this.template.querySelector(\".options-container-stage \");\n var optionsList =this.template.querySelectorAll(\".option-stage\");\n selected.addEventListener(\"click\", () => {\n optionsContainer.classList.toggle(\"active\");\n }); \n /* optionsList.forEach(o => {\n o.addEventListener(\"click\", () => {\n selected.innerHTML = o.querySelector(\"label\").innerHTML;\n optionsContainer.classList.remove(\"active\");\n });\n }); */\n\n }", "function makeDropdownMenu({dropdownSelector,\n parentFormElement,\n city, citiesLib}) {\n const dropdown = document.querySelector(dropdownSelector),\n reg = new RegExp('\\\\b' + city + '\\\\b', 'i');\n\n dropdown.dataset.open = true;\n dropdown.style.overflowY = 'hidden';\n\n citiesLib.forEach(record => {\n if (reg.test(record.name)) {\n const item = document.createElement('li');\n item.dataset.city = record.name;\n item.dataset.country = record.country;\n item.textContent = `${record.name}, ${record.country}`\n item.classList.add('dropdown__item');\n dropdown.append(item);\n };\n });\n\n if (dropdown.children.length == 0) {\n showErrorInfo({containerSelector: '.output',\n errorMsg: 'City not found'});\n closeDropdownMenu(dropdownSelector);\n parentFormElement.reset();\n return;\n };\n\n if (dropdown.children.length > 5) {\n dropdown.style.overflowY = 'scroll';\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 }", "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 getListOfDistrict() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#statutory_districtID');\n });\n $('#statutory_districtID').trigger(\"chosen:updated\");\n $(\"#statutory_districtID\").chosen();\n}", "function dropdown(e) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<select onChange={handleSelectChange} value={displayTag}>\n\t\t\t\t\t<option value=\"Select a Category\"> -- Select a category -- </option>\n\t\t\t\t\t<option value=\"all\">All</option>\n\n\t\t\t\t\t{categories.map((item) => <option value={item}>{item}</option>)}\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t)\n\t}", "fashionselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Fashion').then(option => {\n cy.wrap(option).contains('Fashion');\n option[0].click();\n \n })\n \n }", "function baseLocation_scene(listOfDistrict) {\n\t$(\"#baselocation_id\").empty();\n loadingBaseLocationMaster(listOfDistrict);\n var selectfirst = \"<option value='0'>Select Base Location</option>\";\n $('#baselocation_id').append(selectfirst);\n $.each(baselocations, function (i, resData) {\n var baselocation = \"<option value=\" + resData.baselocationID + \">\" + resData.baselocationName + \"</option>\";\n $(baselocation).appendTo('#baselocation_id');\n });\n $('#baselocation_id').trigger(\"chosen:updated\");\n $(\"#baselocation_id\").chosen();\n\n}", "function populateSampleList(data) {\n\n data = data.sort();\n\n $.each(data, function(key, value) {\n $('#zz')\n .append($(\"<option></option>\")\n .attr(\"value\", value)\n .on(\"click\", addToList)\n .text(value));\n });\n\n\n\n $(\"#zz\").val('-- select projectRun --').trigger(\"chosen:updated\");\n $(\"#loading\").hide();\n\n}", "function dropdown(ar) { \n/*//console.log(\"dd clicked\")*/ }", "function changeState() {\n var parent = $('#city').val();\n $.ajax({\n url: '/Api/changeState',\n method: 'post',\n data: {parent: parent},\n dataType: 'json',\n success: function (data) {\n document.getElementById('state').innerHTML = '';\n for (var i = 0; i < data.length; i++) {\n var option = document.createElement('option');\n option.value = data[i]['id'];\n option.innerText = data[i]['name'];\n document.getElementById('state').appendChild(option);\n }\n }\n });\n}", "function changeState() {\n var parent = $('#city').val();\n $.ajax({\n url: '/Api/changeState',\n method: 'post',\n data: {parent: parent},\n dataType: 'json',\n success: function (data) {\n document.getElementById('state').innerHTML = '';\n for (var i = 0; i < data.length; i++) {\n var option = document.createElement('option');\n option.value = data[i]['id'];\n option.innerText = data[i]['name'];\n document.getElementById('state').appendChild(option);\n }\n }\n });\n}", "function departmentDropdownHandler(arr) {\n // loops through the given array and adds the department to the dropdown list\n for (let i = 0; i < arr.length; i++) {\n let a = document.createElement('a');\n a.classList.add('dropdown-item');\n a.href = '#';\n a.innerText = arr[i].name;\n\n departmentDropdownEl.appendChild(a);\n }\n}", "function addBoroughsToLineChartDropdown() {\n\n d3.select(\"#borough-dropdown-button\")\n .text(common.boroughs[0].name);\n\n lineChart.selectedBorough = common.boroughs[0];\n\n for (let i = 0; i<common.boroughs.length; i++) {\n d3.select(\"#borough-dropdown-menu\")\n .append(\"a\")\n .attr(\"class\", \"dropdown-item\")\n .attr(\"onclick\", 'boroughSelected(this)')\n .text(common.boroughs[i].name)\n }\n}", "function getListOfDistrict_scene() {\n $(\"#districs_id\").empty();\n $(\"#districs_id_reg\").empty();\n\n loadingDistrictsMaster();\n var selectfirst = \"<option value='0'>Select District</option>\";\n $('#districs_id').append(selectfirst);\n $('#districs_id_reg').append(selectfirst);\n $.each(district, function (i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#districs_id');\n $(districts).appendTo('#districs_id_reg');\n\n });\n $('#districs_id').trigger(\"chosen:updated\");\n $('#districs_id_reg').trigger(\"chosen:updated\");\n $('#districs_id').chosen();\n $('#districs_id_reg').chosen();\n}", "cookingselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Cooking').then(option => {\n cy.wrap(option).contains('Cooking');\n option[0].click();\n \n })\n \n }", "function populateDropdown(arr) {\n // http://www.codecademy.com/en/skills/make-an-interactive-website/topics/jquery-dom-manipulation/jquery-appendTo/1\n \n // http://stackoverflow.com/questions/11794105/set-new-value-for-a-attribute-using-jquery \n \n // fill dropdown menu with locations read off from JSON file\n var i;\n for (i = 0; i < arr.length; i++) {\n var item = $('<li>'); \n var link = $('<a>');\n \n item.attr('role', 'presentation');\n link.attr('role', 'menuitem');\n link.attr('tabindex', '-1'); \n link.attr('href', '#');\n \n link.text(arr[i].name); \n \n // when this link is clicked, it sends GMap to its location coords.\n link.attr('onclick', 'changeLocation('+arr[i].lat+','+arr[i].long+')'); // bad coding practice - is there a better way of storing values in an element? \n \n \n link.appendTo(item);\n item.appendTo('#coords-dropdown-menu'); \n \n // add locations to 'add event' dropdown form\n $('#location-select').append($('<option>').text(arr[i].name)); \n \n console.log(\"item \"+i+\", named \"+arr[i].name); \n }\n}", "function getDropDown(availableOptionArray, id) {\n let result = '';\n let word_length = $(\"#word\"+ id).outerWidth();\n result += ' <div class=\"dropdown-content\" style=\"width:' + word_length + 'px\">';\n availableOptionArray.forEach(function (p) {\n result += '<button onclick=\"tag_click(this)\" class= \"dropdown-content-block drop_down_button_'+ id+'\" style=\"background-color:' + p.color + '\">' + p.tag + '</button>';\n });\n result += '</div>';\n return result;\n}", "function backToStates() {\n //change the drop down\n button.innerText = \"Please Choose A State\"\n let eventsDiv = document.getElementById(\"events-div\")\n let optionsContainer = document.getElementById(\"options-container\")\n let citiesContainer = document.getElementById(\"cities-container\")\n // get rid of events or form\n eventsDiv.remove()\n //change options container back to states container\n optionsContainer.innerHTML = \"\"\n optionsContainer.removeAttribute(\"id\", \"options-container\")\n optionsContainer.setAttribute(\"id\", \"states-container\")\n //render the states in dropdown\n renderStates()\n}", "function changeToCitiesFromStates(e) {\n //change the drop down from states container to city container\n button.innerText = \"Please Choose A City\"\n //browser window (ooo00oooohhhh execution context is the global object)\n window.scrollTo(0, 0);\n let statesContainer = document.getElementById(\"states-container\")\n statesContainer.removeAttribute(\"id\", \"states-container\")\n statesContainer.setAttribute(\"id\", \"cities-container\")\n let citiesContainer = document.getElementById(\"cities-container\")\n citiesContainer.innerHTML = \"\"\n //setting variables to pass into fetch request\n let stateId = e.target.dataset.state\n let cityPath = stateAdapter.baseURL + `/${stateId}/cities`\n //initialize a new cityAdapter\n let cityAdapter = new CityAdapter(cityPath)\n //FETCH REQUEST #2 GET REQUEST TO CITIES INDEX\n cityAdapter.fetchCities()\n //interate over array to make cities in dropdown\n .then(function(citiesArray) {\n citiesArray.forEach((city) => {citiesContainer.innerHTML += makeCityButton(city)})\n })\n}", "render(){\n console.log('dropdown render');\n return (\n <div className='dropdown'>\n <div className='page-title'>\n <h2><span>ride</span><span style={styles.bart}>bart</span></h2>\n </div>\n <select style={styles.dropdown} onChange={(event) => this.props.onChange(event.target.value)}>\n {this.props.stations.map((e,i) => (<option key={i} value={e.abbr}>{e.name}</option>))}\n </select>\n </div>\n );\n }", "function getListOfDistrict_reg() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#reg_statutory_districtID');\n });\n $('#reg_statutory_districtID').trigger(\"chosen:updated\");\n $(\"#reg_statutory_districtID\").chosen();\n}", "function getListOfDistrict() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#district_id');\n });\n $('#district_id').trigger(\"chosen:updated\");\n $(\"#district_id\").chosen();\n}", "function OCM_dropdownMarkup() {\r\n\t\t\t\t\tvar $nectar_ocm_dropdown_func = ($('#slide-out-widget-area[data-dropdown-func]').length > 0) ? $offCanvasEl.attr('data-dropdown-func') : 'default';\r\n\t\t\t\t\tif ($nectar_ocm_dropdown_func == 'separate-dropdown-parent-link') {\r\n\t\t\t\t\t\t$('#slide-out-widget-area .off-canvas-menu-container li.menu-item-has-children').append('<span class=\"ocm-dropdown-arrow\"><i class=\"fa fa-angle-down\"></i></span>');\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function populateDropdowns() {\n}", "entertainmentselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Entertainment').then(option =>{\n cy.wrap(option).contains('Entertainment');\n option[0].click();\n })\n}", "function init_product_select()\n {\n if ( $('select#groupedProducts').length > 0 ) {\n $('select#groupedProducts').change(function() {\n var goToUrl = $(this).val();\n window.location = '/' + goToUrl;\n });\n }\n }", "function loadProvinces(){\n var provArray = [\"Ontario\", \"British Columbia\", \"Quebec\", \"Alberta\", \"Saskatchewan\", \"Nova Scotia\", \"Newfoundland and Labrador\", \"Manitoba\", \"New Brunswick\", \"Prince Edward Island\"];\n\nvar provinceOutput = \"<option value=''> - Select - </option>\";\n for(pIndex=0; pIndex<provArray.length; pIndex++) {\n provinceOutput += \"<option name= 'cbo\" + pIndex + \"' value='\" + provArray[pIndex] + \"'>\" +\n provArray[pIndex] + \"</option>\";\n\n}\n document.getElementById(\"province\").innerHTML = provinceOutput;\n\n\n }", "animalpartIIselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Animals Part II').then(option => {\n cy.wrap(option).contains('Animals Part II');\n option[0].click(); \n })\n\n }", "function showAddComponent() {\n document.getElementById('add-component-dropdown').innerHTML = `\n <select id=\"addposition\" class=\"postion-dropdown\"></select>\n <button class=\"button\" type=\"button\" onclick=\"addComponent()\">+</button>`;\n}", "celebritiesnewselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Celebrity News').then(option => {\n cy.wrap(option).contains('Celebrity News');\n option[0].click();\n\n })\n \n }", "organiccultureselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Organic Culture').then(option => {\n cy.wrap(option).contains('Organic Culture');\n option[0].click();\n \n })\n \n }", "function addAthleteToDropdown(sportName, studentName) {\n let authId = sportName+studentName;\n let years = getAthleticYears(studentName, sportName);\n let buildYear = years[years.length-1].year;\n let varsity = strVJV(studentName, sportName, years, buildYear);\n $('#'+sportName.toLowerCase()+'AthName').append($('<button>')\n .attr(\"id\",authId)\n .addClass(\"navButton\")\n .text(studentName)\n );\n $(\"#\"+authId).click(function(){\n cleanMainAside();\n build_athletic_table(studentName, sportName, years[years.length-1].year, varsity);\n build_athletic_aside_nav(studentName, sportName, years);\n });\n}", "function populateDropDown() { \r\n \r\n // select the panel to put data\r\n var dropdown = d3.select('#selDataset');\r\n jsonData.names.forEach((name) => {\r\n dropdown.append('option').text(name).property('value', name);\r\n });\r\n \r\n // set 940 as place holder ID\r\n populatedemographics(jsonData.names[0]);\r\n visuals(jsonData.names[0]);\r\n }", "function renderSetlistTitle(data){\n data.forEach( setlist => {\n\n let select = document.getElementById(\"dropdown\");\n let select2 = document.getElementById(\"dropdown-form\");\n\n let option = document.createElement(\"option\")\n let option2 = document.createElement(\"option\")\n\n option.textContent = setlist.title\n option2.textContent = setlist.title\n option.id = setlist.id\n option2.id = setlist.id\n\n option.addEventListener('click', renderSetlistSongs)\n select.appendChild(option)\n select2.appendChild(option2)\n });\n\n\n let sidebarDiv = document.getElementById(\"setlist-div\")\n let rightSideDiv = document.getElementById(\"right-panel\")\n // let h1 = document.createElement('h1')\n\n sidebarDiv.className = \"ui celled list\"\n rightSideDiv.className = \"ui celled list\"\n // h1.innerText = setlist.title\n // sidebarDiv.appendChild(h1)\n\n // h1.addEventListener('click', renderSetlistSongs )//find setlist)\n //use this function to render setlist song names to sidebar as well\n}", "function populateDatasetDropdownCurate(datasetDropdown, datasetlist) {\n removeOptions(datasetDropdown);\n\n /// making the first option: \"Select\" disabled\n addOption(datasetDropdown, \"Select dataset\", \"Select dataset\");\n var options = datasetDropdown.getElementsByTagName(\"option\");\n options[0].disabled = true;\n\n for (var myitem of datasetlist) {\n var myitemselect = myitem.name;\n var option = document.createElement(\"option\");\n option.textContent = myitemselect;\n option.value = myitemselect;\n datasetDropdown.appendChild(option);\n }\n}", "function addGardenPlantUL() {\n \n const clkdElt = event.target;\n\n //if clicked on a garden option of dropdown menu\n if (clkdElt.innerText === \"New\\xa0Garden\") {\n hideDropDown();\n addGarden( \n {\n gId:null,\n x:Math.min(svgPlace.getAttribute(\"width\"), Math.max(0, parseFloat(event.target.parentElement.style.left))),\n y:Math.min(svgPlace.getAttribute(\"height\"), Math.max(0, parseFloat(event.target.parentElement.style.top))), \n w:240,\n h:120,\n nm:\"New Garden\", \n sn:\"\\uf185\", //setting SUN value for a new garden to a sun icon\n sl:\"Soil\"\n }\n );\n } \n \n //if clicked on a 'New Plant' choice in the dropdown menu\n else if (clkdElt.innerText === \"New\\xa0Plant\") {\n addPlantMenu(\n {\n xPos: parseFloat(clkdElt.parentElement.style.left),\n yPos: parseFloat(clkdElt.parentElement.style.top),\n type: \"all\"\n }\n );\n } \n \n //if clicked on a \"Plant in MMM\" choice of dropdown menu\n else if (clkdElt.innerText.slice(0,8) === \"Plant\\xa0in\") {\n addPlantMenu(\n {\n xPos: parseFloat(clkdElt.parentElement.style.left),\n yPos: parseFloat(clkdElt.parentElement.style.top),\n type: \"timeToPlant\",\n filter: clkdElt.innerText.split(\"\\xa0\")[3].toLowerCase()\n }\n );\n }\n \n //if clicked on the left arrow of the \"Plant in MMM\" choice of dropdown menu\n else if (clkdElt.innerText.trim()=== \"<-\") {\n clkdElt.parentElement.innerHTML = clkdElt.parentElement.innerText.split(\"-\")[1].trim()===\"Jan\"?\n clkdElt.parentElement.innerHTML.replace(/<\\/span>\\w\\w\\w<span>/, \"</span>Dec<span>\"):\n clkdElt.parentElement.innerHTML.replace(/<\\/span>\\w\\w\\w<span>/, \"</span>\" + mos[mos.indexOf(clkdElt.parentElement.innerText.split(\"-\")[1].trim())-1] + \"<span>\");\n }\n //if clicked on the right arrow of the \"Plant in MMM\" choice of dropdown menu\n else if (clkdElt.innerText.trim() === \"->\") {\n clkdElt.parentElement.innerHTML = clkdElt.parentElement.innerText.split(\"-\")[1].trim()===\"Dec\"?\n clkdElt.parentElement.innerHTML.replace(/<\\/span>\\w\\w\\w<span>/, \"</span>Jan<span>\"):\n clkdElt.parentElement.innerHTML.replace(/<\\/span>\\w\\w\\w<span>/, \"</span>\" + mos[mos.indexOf(clkdElt.parentElement.innerText.split(\"-\")[1].trim())+1] + \"<span>\");\n }\n \n //if a Delete All Plants or Delete All Gardens options are clicked\n else if (clkdElt.innerText.slice(0,6) === \"Delete\") {\n \n //confirm the removal of all plants or gardens\n if (localStorage.aas_myGardenVs_warnings && !(Number(localStorage.aas_myGardenVs_warnings)))\n {\n if (!confirm(\"Would you like to \" + clkdElt.innerText + \"?\")){\n return;\n }\n }\n \n //capture plnts or grnds in a variable, based on a choice clicked\n let eltsToDelete = null;\n clkdElt.innerText[11]===\"P\"?eltsToDelete=\"plnts\":eltsToDelete=\"grdns\";\n \n //if gardens or plants exist and are stored, loop through their ls\n //counters and delete their entries from localStorage and from html\n if (localStorage.getItem(\"aas_myGardenVs_\"+eltsToDelete)) {\n let counter = localStorage.getItem(\"aas_myGardenVs_\"+eltsToDelete).split(\",\");\n for (i in counter) {\n del(svgPlace.getElementById(eltsToDelete[0] + \"_\" + counter[i]));\n }\n //remove the plant/garden counter from local storage\n localStorage.removeItem(\"aas_myGardenVs_\"+eltsToDelete);\n hideDropDown();\n }\n }\n}", "function initializeSlideDropdown() {\n var html = \"\";\n\n for (var i = 0; i < storyLength; i++) {\n html += \"<option>\" + (i+1) + \": \" + titleList[i] + \"</option>\\n\";\n }\n\n $slideDropdown.append(html);\n}", "function dropdownClick() {\n var dropdownContent = document.getElementById('pathfinding-dropdown-content');\n dropdownContent.classList.toggle('show');\n dropdownContent.style.left = \"10px\";\n}", "bindClick() {\n this.options.forEach(option => {\n option.addEventListener('click', (e) => {\n e.preventDefault();\n const portfolioResultsContainer = document.querySelector('#portfolioResultsContainer');\n\n /* Removes active class to past selected option */\n const pastSelectedOption = document.querySelector('.project__option--current');\n if (pastSelectedOption) {\n pastSelectedOption.classList.remove('project__option--current');\n }\n\n /* Then adds it to the current selected option */\n e.target.classList.add('project__option--current');\n\n /* Adds a spinner before displaying actual results */\n portfolioResultsContainer.innerHTML = `<span class=\"spinner\"></span>`;\n const projectType = option.dataset.projectType;\n\n this.displayResults(projectType);\n\n });\n });\n }", "function initPlaceSelect() {\n\tvar selectops = \"<option value=''>Worldwide</option>\";;\n\tfor(x in lockeys) {\n\t\tselectops += \"<option value='\" + lockeys[x] + \"'>\" + lockeys[x] + \"</option>\";\n\t}\n\t$(\"#select\").html(selectops);\n}", "televisionselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Television/Movies').then(option => {\n cy.wrap(option).contains('Television/Movies');\n option[0].click();\n \n })\n \n }", "openOnwerFilter(){\n\n var selected = this.template.querySelector(\".selected-owner\");\n var optionsContainer = this.template.querySelector(\".options-container-owner\");\n var optionsList =this.template.querySelectorAll(\".option-owner\");\n selected.addEventListener(\"click\", () => {\n optionsContainer.classList.toggle(\"active\");\n }); \n //selected.addEventListener(\"click\", () => {\n //});\n\n /* optionsList.forEach(o => {\n o.addEventListener(\"click\", () => {\n selected.innerHTML = o.querySelector(\"label\").innerHTML;\n optionsContainer.classList.remove(\"active\");\n });\n });\n */\n }", "function placeDropdown() {\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n\n // Constrain width\n if (options.constrain_width === true) {\n activates.css('width', origin.outerWidth());\n }\n var offset = 0;\n if (options.belowOrigin === true) {\n offset = origin.height();\n }\n\n // Handle edge alignment\n var offsetLeft = origin.offset().left;\n var width_difference = 0;\n var gutter_spacing = options.gutter;\n\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n width_difference = origin.innerWidth() - activates.innerWidth();\n gutter_spacing = gutter_spacing * -1;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + offset,\n left: origin.position().left + width_difference + gutter_spacing\n });\n\n\n\n // Show dropdown\n activates.stop(true, true).css('opacity', 0)\n .slideDown({\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutCubic',\n complete: function () {\n $(this).css('height', '');\n }\n })\n .animate({\n opacity: 1\n }, {\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutSine'\n });\n }", "onToggleLanguagesDropdown() {\n $('#select-languages').on('click', function () {\n $(this).siblings('#dropdown-languages').toggleClass('show')\n });\n }", "newmovieselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('New Movie Trailers').then(option => {\n cy.wrap(option).contains('New Movie Trailers');\n option[0].click();\n \n })\n \n }", "function droplist() {\n\t$.post(\"classlist.hrd\", function(data) {\n\t\t$(\"#classselected\").html(classlist(data));\n\t});\n\t$.post(\"universitylist.hrd\", function(data) {\n\t\t$(\"#unvselected\").html(unvlist(data));\n\t});\n}", "selectedListNode(event, index) {\n this.dropdownOpen = false;\n if (this.recentDropdownOpen) {\n this.setRecentLocation(this.queryItems[index]);\n }\n else {\n this.getPlaceLocationInfo(this.queryItems[index]);\n }\n }", "function placeDropdown() {\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n\n // Constrain width\n if (options.constrain_width === true) {\n activates.css('width', origin.outerWidth());\n }\n var offset = 0;\n if (options.belowOrigin === true) {\n offset = origin.height();\n }\n\n // Handle edge alignment\n var offsetLeft = origin.offset().left;\n var width_difference = 0;\n var gutter_spacing = options.gutter;\n\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n width_difference = origin.innerWidth() - activates.innerWidth();\n gutter_spacing = gutter_spacing * -1;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + offset,\n left: origin.position().left + width_difference + gutter_spacing\n });\n\n\n\n // Show dropdown\n activates.stop(true, true).css('opacity', 0)\n .slideDown({\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutCubic',\n complete: function() {\n $(this).css('height', '');\n }\n })\n .animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});\n }", "function print_state(state_arr) {\n var statearr = state_arr.mofluid_regions;\n var option_str1 = document.getElementById(\"states\");\n option_str1.options = \"\";\n var i = 1,\n indexj = 0;\n option_str1.options[0] = new Option(\"Select\", \"Select\");\n\n $.each(statearr, function() {\n option_str1.options[i++] = new Option(statearr[indexj].region_name, statearr[indexj].region_id);\n indexj++;\n });\n state = $(\"#state\").val();\n if ($(\"#states option[value='\" + state + \"']\").length > 0) {\n $(\"#states\").val(state);\n } else {\n $(\"#states\").val(\"Select\");\n }\n $(\"#states\").selectmenu(\"refresh\", true);\n}", "function showLanguageOption(item) {\n document.getElementById(\"dropdownLanguageOption\").innerHTML = item.innerHTML;\n}", "function Dropdown(parent_id, item = {}) {\n item.type = \"select\";\n item.id = item.id || \"{0}_{1}\".format(item.type, __SELECT++);\n item.label = item.label || item.id;\n item.needQuestion = (item.needQuestion == false) ? false : true;\n Tag.call(this, parent_id, item);\n\n this.options = item.options || [\"option1\", \"option2\", \"option3\"];\n this.option_ids = [];\n this.option_values = [];\n for (var i in this.options) {\n this.option_ids.push(\"option_{0}\".format(__OPTION++));\n this.option_values.push(this.options[i]);\n }\n\n this.value = item.value || \"\";\n this.label_id = \"label_{0}\".format(this.id);\n this.button_id = \"button_{0}\".format(this.id);\n this.dropRight = item.dropRight || false;\n this.choose_prompt = item.choose_prompt || \"Choose\";\n this._style = \"mdl-menu mdl-js-menu mdl-js-ripple-effect\" + ((this.dropRight) ? \"mdl-menu--bottom-right\" : \"mdl-menu--bottom-left\");\n\n this.html = '<div class=\"mdl-textfield mdl-js-textfield\">\\\n <input id=\"{4}\" form=\"{8}\" class=\"mdl-textfield__input\" readonly {5} {6} value=\"{7}\"><button id=\"{0}\" form=\"{8}\" style=\"right: 0;\"\\\n class=\"mdl-button mdl-js-button mdl-button--icon\">\\\n <i class=\"material-icons\">expand_more</i></button>\\\n <ul id=\"{1}\" class=\"{2}\" for=\"{0}\" form=\"{8}\">{3}</ui></div>'.format(\n this.button_id, this.id, this._style, this._option_factory(),\n this.label_id, this.required, this.disabled, this.value, this.parent_id\n );\n\n this.render();\n var option_values = this.option_values;\n var label_id = this.label_id;\n for (let i in this.option_ids) {\n document.getElementById(this.option_ids[i]).onclick = function() {\n document.getElementById(label_id).value = option_values[i];\n };\n /*$(\"#\"+this.option_ids[i]).click(function() {\n $(\"#\"+label_id).val(option_values[i]);\n })*/\n }\n}", "function change_pullDownList(selectedIdx, childListObj, childListArray ) {\n // Empty the child list\n for (i = childListObj.options.length; i >= 0; i--) {\n childListObj.options[i] = null; \n }\n\n \n if (childListArray != null) {\n j = 0\n // add new items\n for (i = 0; i < childListArray.length; i++) {\n childListObj.options[j] = new Option();\n if (childListArray[i][0] != null) {\n childListObj.options[j].value = childListArray[i][0]; \n if (childListArray[i][1] != null) {\n childListObj.options[j].text = childListArray[i][1];\n } else {\n \t childListObj.options[j].text = childListArray[i][0];\n }\n }\n j++;\n }\n\n // select first item (prompt) for sub list\n childListObj.options[0].selected = true;\n }\n}", "function openListCity(state) {\n document.getElementById(\"transparent\").style.display = state; \n document.getElementById(\"SpopupList\").style.display = state;\n }", "function regionOfficesInit(region) {\n $.each(contacts, function (index, item) {\n if (item.region == region) {\n htmlOffices = '<span class=\"js-toggle-dropdown\">'+item.offices[0].address+'</span>';\n htmlOffices += '<ul class=\"contacts-content__address-list js-dropdown-list\" style=\"display: none;\">';\n $.each(item.offices, function (index1, item1) {\n htmlOffices += '<li class=\"contacts-content__address-item\">';\n if (index1 === 0) {\n htmlOffices += '<span data-id=\"'+item1.id+'\" class=\"contacts-content__address-item-text js-dropdown-item contacts-content__address-item-text--active\" data-active=\"contacts-content__address-item-text--active\">';\n } else {\n htmlOffices += '<span data-id=\"'+item1.id+'\" class=\"contacts-content__address-item-text js-dropdown-item\" data-active=\"contacts-content__address-item-text--active\">';\n }\n htmlOffices += item1.address;\n htmlOffices += '</span>';\n htmlOffices += '</li>';\n });\n htmlOffices += '</ul>';\n }\n });\n $(\".contacts-content__address-desc\").empty();\n $(\".contacts-content__address-desc\").append(htmlOffices);\n initMapControls();\n $(\".contacts-content__address-item-text--active\").trigger(\"click\");\n}", "function init_dash() {\n dropDown();\n}", "DropDown() {}", "displaySprinklerSelect(data) {\n if (this.sprinklerSelect) {U.removeFirstChildren(this.sprinklerSelect)}\n this.sprinklerSelect = U.createSelect('sprinkler-type', 'Sprinkler Type', 'sprinkler-type', true, 'required')\n const select = this.sprinklerSelect.children[1]\n const options = U.createOptions(data, 'sprinkler-options')\n options.forEach(op => select.append(op))\n this.formHeader.insertBefore(this.sprinklerSelect, this.flowInput)\n }", "function baseLocation_specialIndent(listOfDistrict) {\n\t$(\"#baselocationId\").empty();\n loadingBaseLocationMaster(listOfDistrict);\n var selectfirst = \"<option value='0'>Select BaseLocation</option>\";\n $('#baselocationId').append(selectfirst);\n $.each(baselocations, function (i, resData) {\n var baselocation = \"<option value=\" + resData.baselocationID + \">\" + resData.baselocationName + \"</option>\";\n $(baselocation).appendTo('#baselocationId');\n\n\n });\n $('#baselocationId').trigger(\"chosen:updated\");\n $(\"#baselocationId\").chosen();\n}", "function dSurvivorMenu() {\n //console.log(\"creating survivor menu\");\n var i;\n var ourList = \"<p onclick=\" + toHTML(\"siteManager.guiRandomSurv()\") + \">Random</p>\";\n //console.log(ourList);\n for (i in survivors) {\n ourList += \"<p onClick=\" + toHTML(\"siteManager.guiSelectSurvivor(\" + i + \")\") + \">\" + survivors[i].name + \"</p>\";\n }\n document.getElementById(\"survDropdown\").innerHTML = ourList;\n}", "spanishselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Spanish').then(option =>{\n cy.wrap(option).contains('Spanish');\n option[0].click();\n })\n }", "function build_select_list(target_field_name,results,layer_name){\r\n\tvar display_html = '<select name=\"'+target_field_name+'\" id=\"'+target_field_name+'\">';\r\n\tfor(i=0;i<results.length;i++){\r\n\t\tdisplay_html = display_html + '<option value=\"'+results[i].id+'\">' + results[i].label + '<\\/option>';\r\n\t}//end for\r\n\tdocument.getElementById(layer_name).innerHTML = display_html + '<\\/select>';\r\n}", "function clickHandler(e) {\n\t\tvar $input = $(this).parents(\".dropdown\").siblings(\".location\");\n\t\t$input.val(this.textContent);\n\t\t$input.focus();\n\t\tvar $menu = $(this).parent();\n\t\t$menu.hide().empty();\n\t}", "function initPage(data) \n {\n var sel = $(\"#parent\");\n \n sel.empty();\n \n for (var i = 0; i < data.length; i++) {\n if(i === 0){\n sel.append('<option disabled selected>-- Choose Category --</option>');\n }\n \n sel.append('<option value=\"' + data[i].id + '\">' + data[i].title + '</option>');\n }\n }", "function populateStates(states) {\n let stateDropdown = document.getElementById(\"stateDropdown\");\n stateDropdown.innerHTML = ''; // Delete Children\n console.log(states);\n\n for (let i = 0; i < states.length; i++) {\n let s = document.createElement('option');\n s.innerHTML = states[i].business_state;\n s.value = states[i].business_state;\n stateDropdown.appendChild(s);\n }\n document.getElementById(\"stateDropdown\").selectedIndex = -1; // Default state is set to empty\n}", "function appendcitylist(state_selection) {\n\n // Select city dropdown menu and remove all cities\n d3.select(\"#selDataset2\").selectAll(\"option\").remove();\n\n // Read in city data\n d3.json(city_predict_url).then(function(city_data) {\n\n // Select the city dropdown menu\n var select = d3.select(\"#selDataset2\");\n\n // Append the list of cities to the dropdown menu\n for (var i=0; i<city_data.length; i++) {\n if (state_selection === city_data[i].state) {\n select.append(\"option\").text(city_data[i].city)\n }\n };\n });\n }", "function buildSequenceMenu() {\n // build a string holding the html for the select menu\n var dropdown = \"<select>\\n\";\n dropdown+=\"<option id='-1' value='-1'>Select a sequence</option>\\n\";\n for (var i=0; i < jsonData[0].sequences.length; i++) {\n dropdown += \"<option id='\"+jsonData[0].sequences[i].id+\"' value='\"+i+\"'>\"+jsonData[0].sequences[i].name+\"</option>\\n\";\n }\n dropdown += \"</select>\\n\";\n\n // modify the dom to display the values and menus that have been read\n $(\"#headerTitle\").html(jsonData[0].name);\n $(\"#dropdown\").html(dropdown);\n\n // use a callback to rebuild the task menu whenever the sequence is selected\n $(\"#dropdown\").change(buildTaskMenu);\n }", "handleInputClick() {\n\t\tthis.showDropdown();\n\t}", "musicselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Music').then(option => {\n cy.wrap(option).contains('Music');\n option[0].click();\n \n })\n \n }" ]
[ "0.61500293", "0.61412823", "0.61241835", "0.6082317", "0.6061099", "0.5978562", "0.5946666", "0.5935093", "0.5924162", "0.5910576", "0.5881092", "0.5880342", "0.5874151", "0.58704984", "0.58635503", "0.58559823", "0.5846992", "0.5830114", "0.5821193", "0.58201754", "0.5819735", "0.5814193", "0.5813779", "0.5773676", "0.5770724", "0.5758023", "0.5758023", "0.575209", "0.5733035", "0.57244664", "0.5719944", "0.5715462", "0.57078433", "0.5704566", "0.5704566", "0.57037205", "0.56676936", "0.5665006", "0.56632644", "0.56494135", "0.5642761", "0.5638055", "0.5638055", "0.56354076", "0.56313705", "0.5630002", "0.5625429", "0.56145936", "0.561221", "0.5611387", "0.56100905", "0.5597807", "0.559668", "0.5594853", "0.5592942", "0.5584563", "0.5579365", "0.5558948", "0.5551677", "0.55498284", "0.5542565", "0.55338836", "0.55328655", "0.5524927", "0.5522569", "0.5512922", "0.551036", "0.5502894", "0.5502004", "0.54995763", "0.5497684", "0.5480528", "0.5479238", "0.5474324", "0.5464968", "0.54627544", "0.5461914", "0.5454781", "0.54529124", "0.5449894", "0.54426086", "0.54423904", "0.54414815", "0.54411036", "0.5437562", "0.5434085", "0.5424628", "0.5417866", "0.5410212", "0.54076755", "0.5401766", "0.53957", "0.5394233", "0.5392984", "0.5391381", "0.539029", "0.53860575", "0.53743535", "0.53715485", "0.53688663" ]
0.5601229
51
Creates an instance of ActiveToolsMonitor.
constructor() { this.activePcos_ = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AbrirMonitor()\n{\t \n //Monitor de impresiones\n if(ventana_monitor== null)\t\t\t\n ventana_monitor=\"VentanaMonitor\";\n}", "function ActivityMonitor(options) {\n this._timer = -1;\n this._timeout = -1;\n this._isDisposed = false;\n this._activityStopped = new signaling_1.Signal(this);\n options.signal.connect(this._onSignalFired, this);\n this._timeout = options.timeout || 1000;\n }", "monitor() {\n this.init();\n }", "function initialize() {\n monitor();\n }", "function AppMonitor() {\n}", "function Monitor (params) {\n params = params || {};\n this.interval = params.interval || 60000;\n this.url = params.url || 'http://api.ihackernews.com/page';\n this.debug = params.debug || false;\n\n // Keep a signature of the last news, to compare\n this.newsSignature = '';\n\n this.timeout = null;\n this.running = false;\n}", "function Monitor(planet){\n this.planet = planet;\n}", "constructor(props) {\n super(props);\n\n this.isSystemWatch = true;\n }", "function EnhancedAutoLock (id, controller) {\r\n // Call superconstructor first (AutomationModule)\r\n EnhancedAutoLock.super_.call(this, id, controller);\r\n\r\n // Create instance variables\r\n this.timer = null;\r\n}", "function addMonitor() {\n\tif (numMonitors >= maxNumMonitors) {\n\t\talert(\"This tool has a limit of \" + maxNumMonitors + \" monitors\");\n\t} else {\n\t\t$(\"#monitorBox\" + ++numMonitors).fadeIn(400);\n\t\t$(\"#monitorBox\" + numMonitors).css(\"display\", \"inline-block\");\n\t\tdisplayTotalNumPixels();\n displayTotalWidth();\n displayTotalArea();\n displayTotalMonitorsCost();\n displayTotalSetupCost();\n\t}\n}", "constructor(scope, id, props) {\n super(scope, id, { type: CfnAppMonitor.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_rum_CfnAppMonitorProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnAppMonitor);\n }\n throw error;\n }\n cdk.requireProperty(props, 'domain', this);\n cdk.requireProperty(props, 'name', this);\n this.attrId = cdk.Token.asString(this.getAtt('Id', cdk.ResolutionTypeHint.STRING));\n this.domain = props.domain;\n this.name = props.name;\n this.appMonitorConfiguration = props.appMonitorConfiguration;\n this.customEvents = props.customEvents;\n this.cwLogEnabled = props.cwLogEnabled;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::RUM::AppMonitor\", props.tags, { tagPropertyName: 'tags' });\n }", "function calAlarmMonitor() {\n this.wrappedJSObject = this;\n this.mAlarms = [];\n\n this.mSound = Components.classes[\"@mozilla.org/sound;1\"]\n .createInstance(Components.interfaces.nsISound);\n}", "static start()\r\n {\r\n return new this();\r\n }", "constructor(){\n console.log(\"NodesWaitlist constructor\");\n\n this.NODES_WAITLIST_OBJECT_TYPE = NodesWaitlistObject.NODES_WAITLIST_OBJECT_TYPE;\n\n this.emitter = new EventEmitter();\n\n this.waitlist = [];\n this.events = [];\n this.started = false;\n\n this.MAX_CONNECTIONS = 5000;\n this.MAX_ERROR_TRIALS = 100;\n }", "function ServiceMonitor(service_id) {\n this.service_id = service_id;\n this.rules = [];\n this.healthChecks = {};\n this.serviceState = new ServiceState();\n this.serviceStateHistory = new ServiceState();\n this.heartbeatTimers = {};\n}", "function regularActivityMonitor() {\n service.user.active = true;\n service.user.action = Date.now();\n\n publish(EVENT_ACTIVITY);\n\n if (service.user.warning) {\n service.user.warning = false;\n publish(EVENT_KEEPALIVE);\n }\n }", "function create() {\n this.moveTime = 0;\n\n this.powerUps = [];\n\n resetPlayers.call(this);\n generateGrid.call(this);\n resetPowerUpTimer.call(this);\n\n this.cameras.main.setBounds(0, 0, 800, 600);\n this.cameras.main.setBackgroundColor(0x888888);\n\n // Using bind, we ensure that \"this\" refers to GAME.scene\n document.addEventListener(\"barcodeRead\", onBarcodeRead.bind(this));\n}", "start() {\n\t\t// Is OBS Studio connected?\n\t\tif (!this.obs.connected()) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treject(new Error(\"OBS Studio is not connected.\".lox()));\n\t\t\t});\n\t\t}\n\n\t\t// Is it already active?\n\t\tif (this.active) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tresolve(true);\n\t\t\t});\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.obs.call(\"obs.frontend.virtualcam.start\", (result, error) => {\n\t\t\t\tif (result !== undefined) {\n\t\t\t\t\tthis._active = result;\n\t\t\t\t\tthis._event_status();\n\t\t\t\t\tresolve(result);\n\t\t\t\t} else {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function Instance() {\n this.model = new ManagementModel(this);\n this.controller = new ManagementController(this);\n}", "function QosMonitor(scenarioName, copyToEngagement) {\n var _a;\n if (copyToEngagement === void 0) { copyToEngagement = false; }\n this._qosResultTypeValue = (_a = {},\n _a[QosResultType.Success] = 'Success',\n _a[QosResultType.Failure] = 'Failure',\n _a[QosResultType.ExpectedFailure] = 'ExpectedFailure',\n _a);\n Validate.isNonemptyString(scenarioName, 'scenarioName');\n this._id = Guid.newGuid().toString();\n if (!this._isDebugSession()) {\n QosLogger.instance.startQosMonitor(this._id, { name: scenarioName });\n }\n this._scenarioName = scenarioName;\n this._hasEnded = false;\n this._copyToEngagement = copyToEngagement;\n }", "constructor() {\n\n\t\t// base constructor\n\n\t\t// the property active is never utilized however\n\n\t\tthis.active = true;\n\t}", "function Monitoring() {\n this.filtertext = \"\";\n this.options = {\n orderby: \"\",\n orderinc: \"\",\n data: {}\n };\n \n this.variables = {\n sort: MashupPlatform.widget.getVariable(\"sort\"),\n closed: MashupPlatform.widget.getVariable(\"closed\")\n };\n if (!isValidSortingPref(this.variables.sort.get())) {\n this.variables.sort.set(\"vmsActiveNum\");\n }\n }", "static init(target) {\n\t\t// Get the default stage which has been registered with this class\n\t\tconst stage = Background.stages[0];\n\n\t\t// Return instance\n\t\tif (stage) {\n\t\t\treturn new stage(target);\n\t\t}\n\t}", "function Desktop () {\n this.activeWindow = false\n this.mouseMoveFunc = this.mouseMove.bind(this)\n this.mouseUpFunc = this.mouseUp.bind(this)\n this.windows = []\n this.clickX = 0\n this.clickY = 0\n this.serialNumber = 0\n this.zIndex = 0\n this.offsetX = 1\n this.offsetY = 1\n this.launcher = new Launcher(this)\n}", "function Tool() {\n ToolEvent.prototype.constructor.call( this )\n\n this.$prop = {}\n this.$propFilter = { constructor: false }\n this.$componentProp = {}\n this.$initializers = []\n }", "function createInstance (args)\r\n{\r\n\t__init (args); // init package identifier\r\n\r\n\treturn new StudioOneMacroPanel;\r\n}", "function DomAutomationController() {}", "constructor() { \n \n WindowsTargetDetails.initialize(this);\n }", "startPCMonitors(config) {\n if (!config.stunServers) {\n logger.warn('No stun servers configured.');\n return;\n }\n\n if (this.stopped) {\n return;\n }\n\n const getStatsIntervalMs = config.getStatsInterval || stunKeepAliveIntervalMs;\n const analyticsIntervalMs = config.analyticsInterval || getStatsIntervalMs;\n const count = Object.keys(config.stunServers).length;\n const offset = getStatsIntervalMs / count; // We delay the initialization of each PC so that they are uniformly\n // distributed across the getStatsIntervalMs.\n\n let i = 0;\n\n for (const region in config.stunServers) {\n if (config.stunServers.hasOwnProperty(region)) {\n const address = config.stunServers[region];\n this.pcMonitors[region] = new PCMonitor(region, address, getStatsIntervalMs, offset * i);\n i++;\n }\n }\n\n window.setTimeout(() => {\n if (!this.stopped) {\n this.analyticsInterval = window.setInterval(this.sendAnalytics, analyticsIntervalMs);\n }\n }, 1000);\n }", "function newEmulator1(ctor,arg) {\n\tvar instance = {};\n\tctor.call(instance,arg); //does initialization\n\treturn instance;\n}", "async createNewInstance() {\n const adapters = this.processAdapters();\n const datastores = this.api.config.models.datastores;\n const models = await this.loadModels();\n\n const ormStart = promisify(Waterline.start);\n\n this.waterline = await ormStart({\n adapters,\n datastores,\n models,\n });\n }", "function activeToCCM() {\r\n // See if MicroLMS needs to be started and setup the $$OsAdmin wsman stack\r\n settings.noconsole = true;\r\n startLms(activeToCCMEx); // TODO: Fix this so that it works even if LMS already running.\r\n}", "function Wait_WaitManager()\n{\n\t//set wait counter\n\tthis.cCounter = 0;\n\t//heavy weight\n\tthis.AssynchWait = false;\n\t//listeners\n\tthis.Listeners = [];\n}", "function DashboardManager(showAlert)\n{\n this.workpoolSetupAlert = (showAlert);\n}", "function Manager() {}", "function Manager() {}", "static create () {}", "function createAmplitude() {\n // creates p5 amplitude constructor\n // remember to call this function in setup\n amplitude = new p5.Amplitude();\n}", "create () {\n let asteroidsGroup = this.gameObjects['asteroids-group'] = new AsteroidsGroup(this.game);\n\n this.spawnAsteroids(25);\n this.setupUI();\n }", "function monitor(){\n\t\t\twakeWatch.unbind(wakeEvents, wake).bind(wakeEvents, wake);\n\t\t\tvar myCookie = e2.getCookie('lastActiveWindow');\n\t\t\tif (e2.now() - lastActive > e2.sleepAfter * 60000 ||\n\t\t\t\t(!e2.isChatterlight && myCookie && myCookie != windowId)) zzz('sleep');\n\t\t}", "init() {\n this.mouseTracker = new MouseTracker();\n }", "static create(params) {\n\t\tDebug.validateParams('Engine.create', params, [\"canvas\", \"width\", \"height\", \"preload\", \"game\"]);\n\t\t(function() {\n\t\t\tlet engine = new Engine({\n\t\t\t\tcanvas: params.canvas,\n\t\t\t\twidth: params.width,\n\t\t\t\theight: params.height\n\t\t\t});\n\t\t\twindow.addEventListener('load', function() {\n\t\t\t\tengine.init();\n\t\t\t\tparams.preload(engine);\n\t\t\t\tengine.resources.preload(params.game); // important: preload on complete calls game function\n\t\t\t\tengine.gameLoop();\n\t\t\t});\n\t\t})();\n\t}", "function xTimerMgr()\r\n{\r\n this.tmr = null;\r\n this.timers = new Array();\r\n}", "constructor() {\n super();\n this.windowControllers = new AbortController();\n this.players = [];\n this.__stickyManager = (e) => this.setStickyPlayer(e.detail);\n this.__fullscreenManager = (e) => this._handleFullscreen(e.detail);\n this.__playerLoader = (e) => this.players.push(e.detail);\n\n // sets the instance to the current instance\n if (!window.A11yMediaStateManager.instance) {\n window.A11yMediaStateManager.instance = this;\n }\n }", "function DocksMonitor() {\n IntervalMonitor.call(this, monitor);\n}", "start() {\n this.timer = _.delay.call(this, () => {\n $.trigger(Factory.eventName(IdleEvent.name()), this.detailOrId, this.target);\n Logger.log(Level.INFO, `${Factory.eventName(IdleEvent.name())} triggered${_.isNil(\n this.detailOrId) ? '' : ' for ' + this.detailOrId}.`);\n if (_.has(this, 'fireOnce') && !this.fireOnce) this.reset();\n }, this.waitTime);\n return this;\n }", "start() {\n if (this._active) {\n throw Error('task is already active');\n }\n\n this._startTimeout();\n\n return this;\n }", "function startMon(){\n\tinit();\n}", "constructor() {\n\t\tif (!instance) { instance = this }\n\n\t\treturn instance\n\t}", "initInstances() {\n // Instantiate Singletons\n Metrics.getInstance();\n MetricsManager.getInstance();\n\n setPeer(Peer.getInstance());\n\n const notificationManager = NotificationManager.getInstance();\n notificationManager.setAppTitle(this.scope['appName']);\n\n OnboardingManager.PATH = this.scope['path'];\n OnboardingManager.getInstance();\n\n const pluginManager = PluginManager.getInstance();\n pluginManager.listenOnce(GoogEventType.LOAD, this.onPluginsLoaded, false, this);\n }", "static createInstance(owner, planNumber, issueDateTime, activeDateTime, expiryDateTime, subscriberCount, totalAwards, trainerSessions, numClasses, gymAccess, poolAccess) {\n return new GymPlan({owner, planNumber, issueDateTime, activeDateTime, expiryDateTime, subscriberCount, totalAwards, trainerSessions, numClasses, gymAccess, poolAccess });\n }", "function Robot() {\n this.status = 'x';\n this.isARobot = true;\n}", "constructor(_pipeline) {\n this._pipeline = _pipeline;\n /**\n * The instant world tracking anchor.\n */\n this.anchor = {\n poseCameraRelative: mirror => this._anchorPoseCameraRelative(mirror),\n pose: (cameraPose, mirror) => this._anchorPose(cameraPose, mirror)\n };\n this._z = zappar_1.z();\n this._impl = this._z.instant_world_tracker_create(this._pipeline._getImpl());\n }", "function makeSingleInstance () {\n if (process.mas) return\n \n app.requestSingleInstanceLock();\n \n app.on('second-instance', () => {\n if (mainWindo) {\n if (mainWindo.isMinimized()) mainWindo.restore();\n mainWindo.focus();\n }\n })\n }", "function initializePolicyLockTimer() {\r\n // Create timer object\r\n objPolicyLockTimer = new policyLockTimerObj();\r\n objPolicyLockTimer.timeoutInMilliSeconds = policyLockDuration * 60 * 1000;\r\n objPolicyLockTimer.timeoutHandler = \"policyLockTimeoutHandler()\";\r\n\r\n // Start the timer\r\n if (objPolicyLockTimer.active) {\r\n objPolicyLockTimer.startTimer();\r\n }\r\n}", "function rt_connect()\r\n{\r\n console.log('** connecting rtmonitor **');\r\n rt_mon.connect();\r\n}", "constructor() {\n this.controller = new Controller();\n this.receiver = new Receiver();\n this.enabled = false;\n this.initialized = false;\n }", "init(){\n\t\tthis._active = true\n\t}", "static getInstance() {\n if (!instance) instance = new WirelessMBusMeter();\n return instance;\n }", "function main() {\n console.log('Ready!\\n');\n _hcsr04.fn.startMonitoring();\n}", "constructor( autoStart ) {\n this.autoStart = ( autoStart !== undefined ) ? autoStart : true;\n /** startTime: number;\n * When the clock is running, It holds the starttime of the clock.\n * This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.\n * @default 0\n */\n this.startTime = 0;\n /** oldTime: number\n\t * When the clock is running, It holds the previous time from a update.\n\t * This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.\n\t * @default 0\n\t */\n this.oldTime = 0;\n /** elapsedTime: number;\n * When the clock is running, It holds the time elapsed between the start of the clock to the previous update.\n * This parameter is in seconds of three decimal places.\n * @default 0\n */\n\t\tthis.elapsedTime = 0;\n\t\tthis.running = false;\n\t}", "function createPause(){\n pauseScreen = initScene();\n\n // SCENE COMPONENTS GO HERE.\n // THE ACTUAL SCENE HAS YET TO BE CREATED.\n\n // lights\n \t\tvar light = createPointLight();\n \t\tlight.position.set(0,200,20);\n \t\tpauseScreen.add(light);\n\n // camera\n \t\tpauseCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 1000 );\n \t\tpauseCam.position.set(0,50,1);\n \t\tpauseCam.lookAt(0,0,0);\n }", "function start(){\n console.log('starting');\n board = new Board({\n debug: true,\n onError: function (err) {\n console.log('TEST ERROR');\n console.log(err);\n },\n onInit: function (res) {\n if (res) {\n console.log('GrovePi Version :: ' + board.version());\n if (testOptions.digitalButton) {\n //Digital Port 3\n // Button sensor\n buttonSensor = new DigitalButtonSensor(3);\n console.log('Digital Button Sensor (start watch)');\n buttonSensor.watch();\n }\n } else\n {\n console.log('TEST CANNOT START');\n }\n }\n })\n board.init();\n }", "constructor() {\n copy(this, create());\n }", "create() {\n super.create();\n\n this.createMiniMap();\n\n // Disable auto-pause on losing focus.\n // this.game.stage.disableVisibilityChange = true;\n }", "function createMonitor(res) {\n db('#createMonitor')\n var copy = res && res.res ? [].concat(res.res) : [];\n return function(resource, failed) {\n if (failed) {\n loaded(res, fail, resource);\n return;\n }\n for (var i = 0, i_len = copy.length; i < i_len; i++) {\n if (resource == copy[i]) {\n copy = copy.slice(0, i).concat(copy.slice(i+1));\n break;\n }\n }\n if (copy.length == 0) loaded(res);\n }\n }", "createNewWorker() {\n if (this.state !== STATES.DESTROYED) {\n this.close();\n }\n this.state = STATES.INIT;\n\n this.worker = this.LitemessageWorker();\n this.worker.addEventListener('message', this.workerMessageHandler);\n // create the underlying node and join into network\n this.worker.createNode('litemessage', env.initPeerUrls);\n\n this.timers = [\n setInterval(this.syncPeers.bind(this), 10000),\n setInterval(this.broadcastPendingMsgs, 3000),\n setInterval(this.checkTimeoutMsgs, 3000),\n setInterval(this.checkSuccessMsgs, 20000),\n ];\n }", "function VMFactory() {}", "start () {\n console.log('backup start', this.dirs.length)\n\n // start monitor file changes\n this.startMonitor()\n\n // start calculation of speed and broadcast status\n this.startCalcSpeed()\n\n this.status = 'Idle'\n this.dirty = true\n this.isAborted = false\n this.run()\n }", "function timerController() {\n this.model = new timerModel();\n this.view = new timerView();\n}", "static create(params) {\n return {type: `${this.prefix}${this.name}`, _instance: new this(params)}; //eslint-disable-line\n }", "function Agent(params) {\n if (!(this instanceof Agent)) return new Agent(params);\n\n // Состояние: 0- Нет связи, 1 - связь есть, получен адрес, 2 - соединение уст-но, 3 - циклический опрос\n this.state = 0;\n\n // Номер сервисного запроса\n this.serviceReq = 0;\n\n this.assets = {\n kti: 1, // Коэф по току\n ktu: 1, // Коэф по напряжению\n ks: 1, // Коэф Кс для мгновенных мощностей, зависит от Inom, Unom\n constant: 1250, // Постоянная счетчика\n kt: (1 * 1) / (2 * 1250) // Общий коэф-т для расчета энергии\n };\n\n this.started = 0;\n\n this.address = 0; // Адрес счетчика\n this.waiting = 0; // Флаг ожидания\n this.sendTime = 0; // Время последней посылки\n}", "_construct() {\r\n\tLog.info('Dtag: Enter Diagnostic Component ')\r\n }", "function Simulator_Initialise()\n{\n\t//Create History\n\tthis.History = new History_History();\n\t//Create Camera\n\tthis.Camera = new Camera_Camera();\n\t//Want ScreenShots?\n\tif (__SCREENSHOTS_ON)\n\t{\n\t\t//initialise screenshot manager\n\t\tthis.ScreenShots = new ScreenShots_ScreenShots();\n\t}\n\t//has controller?\n\tif (__CONTROLLER)\n\t{\n\t\t//register ourselves to it\n\t\t__CONTROLLER.registerSimulator(this);\n\t}\n\t//Create Scoring Mode\n\tthis.Scores = new ScoreManager_ScoreManager();\n\t//reset the State manager (shows first state)\n\tthis.StateManager.Reset();\n\t//Exit wait mode\n\t__WAIT_MANAGER.StopWaiting();\n}", "function Tool(){}", "constructor(){\n super();\n if(!!NodeEvents.instance){\n return NodeEvents.instance;\n }\n NodeEvents.instance = this;\n return this;\n }", "function ActivityAutomation(rules) {\r\n\tvar activityModel = aa.proxyInvoker.newInstance(\"com.accela.aa.aamain.servicerequest.ActivityModel\").getOutput();\r\n\tactivityModel.setCapID(capId);\r\n\tactivityModel.setActivityName(rules.action.activityName);\r\n\tif (!isEmptyOrNull(rules.action.activityDescription))\r\n\t\tactivityModel.setActivityDescription(rules.action.activityDescription);\r\n\tif (!isEmptyOrNull(rules.action.activityDue))\r\n\t\tactivityModel.setActDueDate(getFormattedDate(rules.action.activityDue));\r\n\tif (!isEmptyOrNull(rules.action.activityUser)) {\r\n\t\tvar user = aa.person.getUser(rules.action.activityUser).getOutput();\r\n\t\tactivityModel.setAssignedStaffID(rules.action.activityUser);\r\n\t}\r\n\tif (!isEmptyOrNull(rules.action.activityDept))\r\n\t\tactivityModel.setAssignedDeptNumber(rules.action.activityDept);\r\n\r\n\tif (!isEmptyOrNull(rules.action.activityPriority))\r\n\t\tactivityModel.setPriority(rules.action.activityPriority);\r\n\tactivityModel.setActivityType(rules.action.activityType);\r\n\tactivityModel.setActStatus(rules.action.activityStatus);\r\n\tactivityModel.setStatus(rules.action.activityStatus);\r\n\tactivityModel.setActDate(getFormattedDate(rules.action.activityStart));\r\n\tactivityModel.setServiceProviderCode(aa.getServiceProviderCode());\r\n\tactivityModel.setAuditID(aa.getAuditID());\r\n\tactivityModel.setInternalOnly(\"Y\");\r\n\tvar result = aa.activity.createActivity(activityModel).getOutput();\r\n}", "init() {\n super.init();\n\n // noinspection JSUnusedGlobalSymbols\n this.interval = setInterval(function() {\n console.error('tick');\n }, 5000);\n\n // Tell the unit test that we are alive\n process.send('Reporting for duty');\n }", "function create() {\n var ariConfig = config.getAppConfig().ari;\n\n ari.getClient(ariConfig, ariConfig.applicationName)\n .then(function(client) {\n logger.debug({\n ari: {\n url: ariConfig.url,\n username: ariConfig.username\n }\n }, 'Connected to ARI');\n\n client.on('StasisStart', fsm.create);\n\n logger.info('Voicemail Main application started');\n })\n .catch(function(err) {\n logger.error({err: err}, 'Error connecting to ARI');\n throw err;\n });\n}", "constructor() {\n super();\n console.ignoredYellowBox = [\"Setting a timer\"];\n }", "function Monitor(directory, timeout) {\n this.self = this;\n this.dir = directory;\n this._files = [];\n this._timeout = timeout === undefined ? 120000 : timeout;\n}", "constructor(){\n this.airtable = new AirtableInterface;\n // button setup\n this.buttonSetup();\n\n // Loading up user's console\n this.updateNow(true);\n this.loopUpdate();\n }", "function createGui() {\n var gui = new abubujs.Gui();\n var panel = gui.addPanel();\n\n panel.add(env, 'time').listen();\n panel.add(env, 'skip');\n panel.add(env, 'period').onChange(() => {\n march0.uniforms.period.value = env.period;\n march1.uniforms.period.value = env.period;\n });\n panel.add(env, 'running');\n }", "constructor (framework) {\n this.framework = framework\n this.id = null\n this.active = true\n\n this.tracker = new OoyalaTracker()\n nrvideo.Core.addTracker(this.tracker)\n\n this.getName = function () {\n return 'newrelic'\n }\n\n this.getVersion = function () {\n return this.tracker.getTrackerVersion()\n }\n\n this.setPluginID = function (id) {\n this.id = id\n }\n\n this.getPluginID = function () {\n return this.id\n }\n\n this.init = function () {\n if (this.framework) {\n this.framework.getRecordedEvents().forEach((event) => {\n this.tracker.onEvent(event.eventName, event.params)\n })\n }\n }\n\n this.setMetadata = function (data) {}\n\n this.processEvent = function (event, params) {\n try {\n this.tracker.onEvent(event, params)\n } catch (err) {\n nrvideo.Log.error(err)\n }\n }\n\n this.destroy = function () {\n nrvideo.Core.removeTracker(this.tracker)\n delete this.tracker\n delete this.framework\n }\n }", "async created() { \n\n this.connector = new Connector({ broker: this.broker, options: this.settings });\n\n // map service names and wait for services\n this.services = { \n agents: this.settings?.services?.agents ?? \"agents\"\n };\n await this.broker.waitForServices(Object.values(this.services));\n\n }", "function createTV(roomParams) {\n var theScreen = createScreen(roomParams);\n theScreen.position.set(-tvParams.depth/1.5,0,0)\n var tvBox = new THREE.Object3D();\n var box = blackBox(tvParams.widthTV*1.25,tvParams.heightTV*1.25,tvParams.depth);\n box.rotation.y = Math.PI/2;\n tvBox.add(box);\n tvBox.add(theScreen);\n tvBox.position.set(roomParams.roomWidth/2-tvParams.depth/2,0,0)\n scene.add(tvBox);\n}", "function Launcher(desktop) {\n this.desktop = desktop;\n //the datestampoptions to use\n this.dateStampOptions = {\n year: \"numeric\", month: \"numeric\",\n day: \"numeric\"\n };\n\n //the timestampoptions to use\n this.timeStampOptions = {\n hour: \"2-digit\", minute: \"2-digit\"\n };\n}", "testBecomeActive() {\n const idleThreshold = 1000;\n const mockActivityMonitor = new MockActivityMonitor();\n const idleTimer = new IdleTimer(idleThreshold, mockActivityMonitor);\n\n clock.tick(idleThreshold + 1);\n assert('Precondition: user should be idle', idleTimer.isIdle());\n\n let onBecomeActiveCount = 0;\n const onBecomeActive = () => {\n onBecomeActiveCount += 1;\n };\n events.listen(idleTimer, IdleTimer.Event.BECOME_ACTIVE, onBecomeActive);\n\n clock.tick(idleThreshold);\n assert('The BECOME_ACTIVE event fired too early', onBecomeActiveCount == 0);\n assert('The user should still be idle', idleTimer.isIdle());\n\n mockActivityMonitor.simulateEvent();\n assert('The BECOME_ACTIVE event fired too late', onBecomeActiveCount == 1);\n assertFalse('The user should be active', idleTimer.isIdle());\n\n idleTimer.dispose();\n }", "static usingFunction( logEvent ) {\n\n\t\tvar monitor = new AbstractLoggingMonitor();\n\n\t\t// Override the abstract method, completing the implementation.\n\t\tmonitor.logEvent = logEvent;\n\n\t\treturn( monitor );\n\n\t}", "function createInstance (args)\r\n{\r\n\t__init (args); // init package identifier\r\n\r\n\treturn new MacroOrganizer;\r\n}", "function createInstance(){\n\t\tapp.debug(\"New presenter instance was created\");\n\n\t\t// Set latency to 100ms (Equal with streamer)\n\t\tpresenterInstance = new ScarletsMediaPresenter({\n\t\t\tmimeType: self.toServerSpeaker ? 'audio/wav' : undefined,\n\t\t audio:{\n\t\t channelCount:2,\n\t\t sampleRate:48000,\n\t\t echoCancellation: false\n\t\t },\n\t\t debug:true\n\t\t}, self.toServerSpeaker ? 1000 : 100);\n\n\t\tpresenterInstance.onRecordingReady = function(packet){\n\t\t app.debug(\"Recording started!\");\n\t\t app.debug(\"Header size:\", packet.data.size, 'bytes');\n\t\t app.debug('Mimetype:', presenterInstance.mediaRecorder.mimeType)\n\n\t\t self.bufferHeader = packet;\n\n\t\t\t// Immediately send to the server when presenter ready\n\t\t\tapp.debug(\"Sending bufferHeader to the server\");\n\t\t\tsocket.emit('bufferHeader', packet);\n\t\t}\n\n\t\tpresenterInstance.onBufferProcess = function(streamData){\n\t\t\tself.broadcastBytes = streamData[0].size;\n\n\t\t\tif(self.toServerSpeaker)\n\t\t\t socket.emit('bufferStream', streamData);\n\t\t\telse\n\t\t\t socket.emit('bufferToFile', streamData);\n\t\t}\n\t}", "create() {\n let guiArea = document.createElement(\"div\");\n guiArea.setAttribute(\"id\", \"guiArea\");\n guiArea.setAttribute(\"class\", \"guiArea noSelect\");\n document.body.appendChild(guiArea);\n\n let guiAreaToggle = document.createElement(\"div\");\n guiAreaToggle.setAttribute(\"id\", \"guiAreaToggle\");\n guiAreaToggle.setAttribute(\"class\", \"guiAreaToggle crossed\");\n guiAreaToggle.onclick = this.toggle.bind(this);\n document.body.appendChild(guiAreaToggle);\n }", "function dynamicActivity() {\n regularActivityMonitor();\n }", "function addNewDashboardMonitor2() {\n ctrl.newDashboardMonitor2es.push({name: '', url: ''});\n }", "static instance() {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n }", "static new() {\n let g = new this();\n g.init();\n return g;\n }", "constructor() {\n this.poeFocused = false;\n this.autoMinimize = new AutoMinimize();\n this.initialize();\n }", "function createTimer() {\n debug(\"createTimer\");\n clock = document.createElement('span');\n clock.setAttribute(\"class\", \"timer\");\n clock.innerHTML = \"0 Seconds\";\n\n document.querySelector('.score-panel').appendChild(clock);\n startTime();\n }", "_startMemoryMonitoring() {\n setTimeout(() => this._checkMemory(), this.config.memoryCheckInterval);\n }", "static getInstance(toolItem,toolManager){//单例模式\n \n this.instance=new toolItem.toolClass(toolItem,toolManager);\n return this.instance;\n }", "function createEventCollector() {\n return eventCollectorFactory(autoflow);\n }" ]
[ "0.5556235", "0.5354774", "0.52096814", "0.50967574", "0.50787073", "0.4966875", "0.49187744", "0.48538488", "0.4782886", "0.4759273", "0.47186527", "0.46846464", "0.46802112", "0.46760178", "0.46233574", "0.45929107", "0.45793873", "0.45646355", "0.45580322", "0.4535964", "0.45314193", "0.45037666", "0.44923186", "0.4484838", "0.4484196", "0.44700843", "0.4443868", "0.44342685", "0.44274366", "0.44215664", "0.44185567", "0.44054195", "0.4403903", "0.4400189", "0.43950093", "0.43950093", "0.43942726", "0.43787855", "0.4373294", "0.43705142", "0.4368052", "0.43644944", "0.43633574", "0.43630666", "0.43561095", "0.43455103", "0.4340681", "0.4339943", "0.43308297", "0.4328382", "0.43261406", "0.43196222", "0.43187034", "0.4316775", "0.43029493", "0.4297768", "0.42976478", "0.42853472", "0.42848486", "0.42752385", "0.4273209", "0.42599714", "0.42593944", "0.42582095", "0.42456517", "0.4243509", "0.42417806", "0.4237536", "0.42316294", "0.42242658", "0.4217203", "0.42156842", "0.42152926", "0.42070946", "0.42056662", "0.42054504", "0.42001173", "0.41989008", "0.4188318", "0.4186345", "0.41819698", "0.41802964", "0.41790882", "0.4178829", "0.41756818", "0.41748178", "0.41681916", "0.41585422", "0.4158313", "0.41559538", "0.41516313", "0.41513157", "0.41466105", "0.41461873", "0.41428974", "0.41362432", "0.4135858", "0.41292438", "0.4123749", "0.412301", "0.41221625" ]
0.0
-1
For each Rope Mastery level, it's 50% easier to struggle out
function StruggleLoad() { StruggleDone = false; StruggleProgress = 0; StruggleSkillBonus = PlayerGetSkillLevel("RopeMastery"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "levelUpDifficulty() {\n if (gameState.maxNumber < 900) {\n gameState.maxNumber += 5; // Increase the maximum number found in a cell.\n }\n if (gameState.expressNum < 100) {\n gameState.expressNum += 4; // Increase how much the expressions can deviate by.\n }\n }", "burrowEfficiency(speed, depth) {\n return (speed * depth);\n }", "spreadMoist() {\n if (this.hasTree()) {\n this.getSurrounds().forEach(tile => {\n if (!tile.water && !tile.moist) {\n tile.setMoist();\n tile.spreadMoist();\n }\n });\n }\n }", "_preparePokemonData(actorData) {\n const data = actorData.data;\n\n // Make modifications to data here. For example:\n data.levelUpPoints = 0;\n for (let [key, value] of Object.entries(data.stats)) {\n let sub = value[\"value\"] + value[\"mod\"] + value[\"levelUp\"];\n data.levelUpPoints -= value[\"levelUp\"];\n if(value[\"stage\"] > 0 ) {\n value[\"total\"] = Math.floor(sub * value[\"stage\"] * 0.2 + sub);\n } else {\n if(key == \"hp\") {\n value[\"total\"] = sub;\n }\n else {\n value[\"total\"] = Math.ceil(sub * value[\"stage\"] * 0.1 + sub);\n }\n }\n }\n for (let [key, skill] of Object.entries(data.skills)) {\n skill[\"rank\"] = this._getRank(skill[\"value\"]); \n }\n\n let _calcLevel = function(exp, level, json) {\n if(exp <= json[1]) {return 1;}\n if(exp >= json[100]) {return 100;}\n\n return _recursiveLevelCalc(exp, level, json);\n }\n let _recursiveLevelCalc = function(exp, level, json) {\n if(exp > json[level]) {\n return _recursiveLevelCalc(exp, ++level, json)\n }\n else {\n if(json[level] >= exp) {\n if(json[level-1] >= exp) {\n if(json[Math.max(Math.floor(level/2),1)]) {\n return _recursiveLevelCalc(exp, Math.max(Math.floor(level/2),1), json);\n }\n else {\n return _recursiveLevelCalc(exp, level-2, json);\n }\n }\n }\n }\n \n return exp == json[level] ? level : level -1;\n }\n\n let _calcBaseStats = function(specie, nature, stat) {\n let specieStat = 0;\n\n // First round, makes sure that the specie is in the DB and returns Human stats if not\n if( specie != \"\" ) {\n specieStat = _fetchSpecieStat(specie, stat);\n }else{\n return _returnHumanStats(stat);\n }\n if (specieStat == null) {return _returnHumanStats(stat)};\n \n // Second Round, nature\n specieStat += _NatureMods(nature, stat, 0);\n\n return specieStat;\n }\n\n let _fetchSpecieStat = function(specie, stat) {\n for (var i = 0; i < game.ptu.pokemonData.length; i++){\n if (game.ptu.pokemonData[i][\"_id\"] === specie.toUpperCase()){\n return game.ptu.pokemonData[i][\"Base Stats\"][stat];\n }\n }\n return null;\n }\n\n let _returnHumanStats = function(stat){\n if(stat == \"HP\") {return 10;}\n else {return 30;}\n }\n\n let _NatureMods = function(nature, stat){\n if(nature == \"\") {return 0};\n if(game.ptu.natureData[nature] == null){return 0};\n\n if(game.ptu.natureData[nature][0] == stat){\n if(stat == \"HP\") {return 1}\n else {return 2};\n } else if(game.ptu.natureData[nature][1] == stat) {\n if(stat == \"HP\") {return -1}\n else {return -2};\n } else {\n return 0;\n }\n }\n \n data.level.current = _calcLevel(data.level.exp, 50, game.ptu.levelProgression);\n\n data.health.total = 10 + data.level.current + (data.stats.hp.total * 3);\n data.health.max = data.health.injuries > 0 ? Math.trunc(data.health.total*(1-((data.modifiers.hardened ? Math.min(data.health.injuries, 5) : data.health.injuries)/10))) : data.health.total;\n if(data.health.value === null) data.health.value = data.health.max;\n\n data.health.percent = Math.round((data.health.value / data.health.max) * 100);\n\n // Stats\n data.stats.hp.value = _calcBaseStats(data.species, data.nature.value, \"HP\");\n data.stats.atk.value = _calcBaseStats(data.species, data.nature.value, \"Attack\");\n data.stats.def.value = _calcBaseStats(data.species, data.nature.value, \"Defense\");\n data.stats.spatk.value = _calcBaseStats(data.species, data.nature.value, \"Special Attack\");\n data.stats.spdef.value = _calcBaseStats(data.species, data.nature.value, \"Special Defense\");\n data.stats.spd.value = _calcBaseStats(data.species, data.nature.value, \"Speed\");\n\n data.initiative = {value: data.stats.spd.total + data.modifiers.initiative};\n\n data.levelUpPoints += data.level.current + data.modifiers.statPoints + 10;\n }", "function calcPrestigeLevel() {\n\n}", "function calculateBMR() {\n\n // Sedentary (little or no exercise): BMR x 1.2\n // Lightly active (light exercise/sports 1-3 days/week): BMR x 1.375\n // Moderately active (moderate exercise/sports 3-5 days/week): BMR x 1.55\n // Very active (hard exercise/sports 6-7 days a week): BMR x 1.725\n // Extra active (very hard exercise/sports & physical job or 2x training): BMR x 1.9 \n\n // you can simply add 0.175 to each level to get the next. but if we set this up in the database instead\n // of the actual varchar value of the level we can quickly calculate the BMR\n\n return calculateBEE() * activityLevel;\n}", "function nextLevel(){\n pizzaorder++;\n if(pizzaorder >= 5){\n pizzaorder = 5;\n }\n level++;\n for(let i = 0; i < pizzaorder; i++){\n pizzas[i] = new Rock(random(0, width), random(-height, 0), random(width/40, width/10));\n }\n}", "function evaluateHeirloomMods(loom, location, upgrade) {\n var index = loom;\n var bestUpgrade = {\n 'index': null,\n 'name': '',\n 'effect': 0\n };\n var tempEff;\n var steps;\n if(location.includes('Equipped'))\n loom = game.global[location];\n else\n loom = game.global[location][loom];\n // return loom.rarity;\n var eff = 0;\n for(var m in loom.mods) {\n var critmult = getPlayerCritDamageMult();\n var critchance = getPlayerCritChance();\n var cmb = (critmult - game.heirlooms.Shield.critDamage.currentBonus/100);\n var ccb = (critchance - game.heirlooms.Shield.critChance.currentBonus/100); \n switch(loom.mods[m][0]) {\n case 'critChance': \n tempEff = ((loom.mods[m][1]/100) * cmb)/(ccb * cmb + 1 - ccb); \n eff += tempEff;\n if(upgrade){\n if(loom.mods[m][1] >= 30) break;\n steps = game.heirlooms.Shield.critChance.steps[loom.rarity];\n tempEff = ((steps[2]/100) * critmult)/((critchance * critmult) + 1 - critchance);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'critChance';\n bestUpgrade.index = m;\n }\n }\n break;\n case 'critDamage':\n tempEff = ((loom.mods[m][1]/100) * ccb)/(cmb * ccb + 1 - ccb);\n eff += tempEff;\n if(upgrade){\n steps = game.heirlooms.Shield.critDamage.steps[loom.rarity];\n tempEff = ((steps[2]/100)* critchance)/((critchance * critmult) + 1 - critchance);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'critDamage';\n bestUpgrade.index = m;\n }\n }\n break;\n case 'trimpAttack':\n tempEff = loom.mods[m][1]/100;\n eff += tempEff;\n if(upgrade){\n steps = game.heirlooms.Shield.trimpAttack.steps[loom.rarity];\n tempEff = (steps[2]/100)/((game.heirlooms.Shield.trimpAttack.currentBonus/100) + 1);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'trimpAttack';\n bestUpgrade.index = m;\n }\n }\n break;\n case 'voidMaps':\n tempEff = loom.mods[m][1]/100;\n eff += tempEff;\n if(upgrade){\n steps = game.heirlooms.Shield.voidMaps.steps[loom.rarity];\n tempEff = (steps[2]/100)/((game.heirlooms.Shield.voidMaps.currentBonus/100) + 1);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'voidMaps';\n bestUpgrade.index = m;\n }\n }\n break;\n case 'MinerSpeed':\n tempEff = 0.75*loom.mods[m][1]/100;\n eff += tempEff;\n if(upgrade) {\n steps = game.heirlooms.defaultSteps[loom.rarity];\n tempEff = (0.75*steps[2]/100)/((game.heirlooms.Staff.MinerSpeed.currentBonus/100) + 1);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'MinerSpeed';\n bestUpgrade.index = m;\n }\n }\n break;\n case 'metalDrop':\n tempEff = 0.75*loom.mods[m][1]/100;\n eff += tempEff;\n if(upgrade) {\n steps = game.heirlooms.defaultSteps[loom.rarity];\n tempEff = (0.75*steps[2]/100)/((game.heirlooms.Staff.metalDrop.currentBonus/100) + 1);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'metalDrop';\n bestUpgrade.index = m;\n }\n }\n break;\n case 'DragimpSpeed':\n tempEff = 0.75*loom.mods[m][1]/100;\n eff += tempEff;\n if(upgrade) {\n steps = game.heirlooms.defaultSteps[loom.rarity];\n tempEff = (0.75*steps[2]/100)/((game.heirlooms.Staff.DragimpSpeed.currentBonus/100) + 1);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'DragimpSpeed';\n bestUpgrade.index = m;\n }\n }\n break; \n case 'gemsDrop':\n tempEff = 0.75*loom.mods[m][1]/100;\n eff += tempEff;\n if(upgrade) {\n steps = game.heirlooms.defaultSteps[loom.rarity];\n tempEff = (0.75*steps[2]/100)/((game.heirlooms.Staff.gemsDrop.currentBonus/100) + 1);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'gemsDrop';\n bestUpgrade.index = m;\n }\n }\n break; \n case 'FarmerSpeed':\n tempEff = 0.5*loom.mods[m][1]/100;\n eff += tempEff;\n if(upgrade) {\n steps = game.heirlooms.defaultSteps[loom.rarity];\n tempEff = (0.5*steps[2]/100)/((game.heirlooms.Staff.FarmerSpeed.currentBonus/100) + 1);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'FarmerSpeed';\n bestUpgrade.index = m;\n }\n }\n break;\n case 'LumberjackSpeed':\n tempEff = 0.5*loom.mods[m][1]/100;\n eff += tempEff;\n if(upgrade) {\n steps = game.heirlooms.defaultSteps[loom.rarity];\n tempEff = (0.5*steps[2]/100)/((game.heirlooms.Staff.LumberjackSpeed.currentBonus/100) + 1);\n tempEff = tempEff / getModUpgradeCost(loom, m);\n if(tempEff > bestUpgrade.effect) {\n bestUpgrade.effect = tempEff;\n bestUpgrade.name = 'LumberjackSpeed';\n bestUpgrade.index = m;\n }\n }\n break;\n case 'empty':\n var av;\n if(upgrade) break;\n //value empty mod as the average of the best mod it doesn't have. If it has all good mods, empty slot has no value\n if(loom.type == 'Shield') {\n if(!checkForMod('trimpAttack', index, location)){\n steps = game.heirlooms[loom.type].trimpAttack.steps[loom.rarity];\n av = steps[0] + ((steps[1] - steps[0])/2);\n tempEff = av/100;\n eff += tempEff;\n }\n else if(!checkForMod('voidMaps', index, location)){\n steps = game.heirlooms[loom.type].voidMaps.steps[loom.rarity];\n av = steps[0] + ((steps[1] - steps[0])/2);\n tempEff = (steps[2]/100);\n eff += tempEff;\n }\n else if(!checkForMod('critChance', index, location)){\n steps = game.heirlooms[loom.type].critChance.steps[loom.rarity];\n av = steps[0] + ((steps[1] - steps[0])/2);\n tempEff = (av * cmb)/(ccb * cmb + 1 - ccb);\n eff += tempEff;\n }\n else if(!checkForMod('critDamage', index, location)){\n steps = game.heirlooms[loom.type].critDamage.steps[loom.rarity];\n av = steps[0] + ((steps[1] - steps[0])/2);\n tempEff = (av * ccb)/(cmb * ccb + 1 - ccb);\n eff += tempEff;\n }\n }\n if(loom.type == 'Staff') {\n steps = game.heirlooms.defaultSteps[loom.rarity];\n av = steps[0] + ((steps[1] - steps[0])/2);\n if(!checkForMod('MinerSpeed', index, location) || !checkForMod('metalDrop', index, location) || !checkForMod('DragimpSpeed', index, location) || !checkForMod('gemsDrop', index, location)){\n eff += 0.75*av/100;\n }\n else if(!checkForMod('FarmerSpeed', index, location) || !checkForMod('LumberjackSpeed', index, location)) {\n eff += 0.5*av/100; \n }\n }\n break;\n //trimpHealth?\n }\n }\n if(upgrade) return bestUpgrade;\n return eff;\n}", "function find_speed_score() {\n\n var temp = Math.random();\n\n if (level === 1){\n if (temp <= 0.4) { //Orange Probality 0.4\n return{\n speed : 0.06,\n score : 1\n };\n }\n if (temp > 0.4 && temp <= 0.7) { //Red Prob 0.3\n return{\n speed : 0.075,\n score : 3\n };\n }\n if (temp > 0.7) { //Black Prob 0.3\n return{\n speed : 0.15,\n score : 5\n };\n }\n }\n if (level === 2){\n if (temp <= 0.4) {\n return{\n speed : 0.08,\n score : 1\n };\n }\n if (temp > 0.4 && temp <= 0.7) {\n return{\n speed : 0.1,\n score : 3\n };\n }\n if (temp > 0.7) {\n return{\n speed : 0.2,\n score : 5\n };\n }\n }\n\n}", "getPoisonChance(array){\n // we build up a sorted array to save ourselves trouble\n let arrayPlusIndex = [];\n for(let item of array){\n let retObj = {\n key: item.key,\n value: item.value,\n index: this.getCategoryNumber(item.key)\n }\n arrayPlusIndex.push(retObj);\n }\n let edibleCount = 0;\n let poisonCount = 0;\n for(let row of mushroom.data){\n // this tracks if we pass all tests\n let passed = true;\n for(let item of arrayPlusIndex){\n if(row[item.index] !== item.value){\n passed = false;\n }\n }\n if(passed){\n if(row[0] === 'p'){\n poisonCount++;\n }\n else{\n edibleCount++;\n }\n }\n }\n // the case in which we have no data\n if(edibleCount === 0 & poisonCount === 0){\n return -1;\n }\n // the normal case\n else{\n return (edibleCount/(edibleCount + poisonCount));\n }\n }", "function sethp(newLevel) {\n // if (flg) {\n // for (var i = 0; i < MAXY; i++) {\n // for (var j = 0; j < MAXX; j++) {\n // var monster = player.level.monsters[j][i];\n // if (monster)\n // monster.awake = false;\n // }\n // }\n // }\n\n /* if teleported and found level 1 then know level we are on */\n if (level == 0) {\n player.TELEFLAG = 0;\n return;\n }\n\n var nummonsters;\n if (newLevel) {\n nummonsters = rnd(12) + 2 + (level >> 1);\n } else {\n nummonsters = (level >> 1) + 1;\n }\n\n for (let i = 0; i < nummonsters; i++) {\n fillmonst(makemonst(level));\n }\n\n if (ULARN && newLevel && !DEBUG_NO_MONSTERS) {\n /*\n ** level 11 gets 1 demon lord\n ** level 12 gets 2 demon lords\n ** level 13 gets 3 demon lords\n ** level 14 gets 4 demon lords\n ** level 15 gets 5 demon lords\n */\n var numdemons = 0;\n if ((level >= MAXLEVEL - 5) && (level < MAXLEVEL)) {\n numdemons = level - 10;\n for (let j = 1 ; j <= numdemons ; j++) {\n if (!fillmonst(DEMONLORD + rund(7))) {\n j--;\n }\n }\n }\n /*\n ** level V1 gets 1 demon prince\n ** level V2 gets 2 demon princes\n ** level V3 gets 3 demon princes\n ** level V4 gets 4 demon princes\n ** level V5 gets 5 demon princes\n */\n else if (level >= MAXLEVEL) {\n numdemons = level - MAXLEVEL + 1;\n for (let j = 1 ; j <= numdemons ; j++){\n if (!fillmonst(DEMONPRINCE)) {\n j--;\n }\n }\n }\n }\n\n}", "determinize(battleside) {\n\n _.each(battleside.pokemon, function(pokemon) {\n if(!!pokemon.set.probabilities) {\n var set = pokemon.set\n\n set.item = sample_from(set.probabilities.items, function(e){return e[1]})[0]\n set.evs = _.sample(set.probabilities.evs)\n //set.moves = pokemon.trueMoves + _.map(_.sampleSize(set.probabilities.moves, 4-pokemon.trueMoves.length), function(m){return m[0]})\n\n // Create the new pokemon\n var new_pokemon = new BattlePokemon(set, battleside);\n new_pokemon.trueMoves = pokemon.trueMoves\n new_pokemon.nickname = pokemon.nickname\n pokemon.position = pokemon.position;\n battleside.pokemon[pokemon.position] = new_pokemon;\n\n if (pokemon.position === 0) {\n battleside.active = [new_pokemon];\n new_pokemon.isActive = true;\n }\n }\n })\n \n\n battleside.pokemon = _.sortBy(battleside.pokemon, function(pokemon) { return pokemon.isActive ? 0 : 1 });\n for(var i = 0; i < 6; i++) {\n battleside.pokemon[i].position = i\n }\n }", "function levelUp(){\n collectedFruit = collectedFruit.concat(pickedFruit); // fruit is secured to player score\n pickedFruit = [];\n allFruit = [];\n player.runs -= 1; // one less go for the player now\n if (player.runs < 1){\n endGame(); // end of game reached?\n } else {\n createFruit(); // new fruit\n\n // update game Level for more & faster snails, 3 is max\n if (gameLevel === 3){\n updateInfo();\n } else {\n gameLevel ++;\n createEnemies(1);\n updateInfo();\n }\n }\n}", "computePhandoryss(remainingAncientSouls) {\n const table = [\n {level: 1, as: 3},\n {level: 2, as: 10},\n {level: 3, as: 21},\n {level: 4, as: 36},\n {level: 5, as: 54},\n {level: 6, as: 60},\n {level: 7, as: 67},\n {level: 8, as: 75},\n {level: 9, as: 84},\n {level: 10, as: 94},\n {level: 11, as: 104},\n {level: 12, as: 117},\n {level: 14, as: 129},\n {level: 13, as: 143},\n {level: 15, as: 158},\n {level: 16, as: 174},\n {level: 17, as: 190},\n {level: 18, as: 208},\n {level: 19, as: 228}\n ];\n\n return table.filter(e => e.as <= remainingAncientSouls).pop().level;\n }", "function glance(members) {\n for (var i = 0; i < members.length; i++) {\n if (members[i].party == \"D\") {\n statistics.Democrats.n_reps += 1;\n }\n }\n for (var i = 0; i < members.length; i++) {\n if (members[i].party == \"R\") {\n statistics.Republicans.n_reps += 1;\n }\n }\n for (var i = 0; i < members.length; i++) {\n if (members[i].party == \"I\") {\n statistics.Independents.n_reps += 1;\n }\n }\n\n statistics.Total.n_reps =\n statistics.Independents.n_reps +\n statistics.Republicans.n_reps +\n statistics.Democrats.n_reps;\n\n var votesWPT = 0;\n\n for (var i = 0; i < members.length; i++) {\n votesWPT = votesWPT + members[i].votes_with_party_pct;\n statistics.Total.vote_w_party =\n (votesWPT / statistics.Total.n_reps).toFixed(2) + \"%\";\n }\n\n var votesWPD = 0;\n\n for (var i = 0; i < members.length; i++) {\n if (members[i].party == \"D\") {\n votesWPD = votesWPD + members[i].votes_with_party_pct;\n statistics.Democrats.vote_w_party =\n (votesWPD / statistics.Democrats.n_reps).toFixed(2) + \"%\";\n }\n }\n\n var votesWPR = 0;\n\n for (var i = 0; i < members.length; i++) {\n if (members[i].party == \"R\") {\n votesWPR = votesWPR + members[i].votes_with_party_pct;\n statistics.Republicans.vote_w_party =\n (votesWPR / statistics.Republicans.n_reps).toFixed(2) + \"%\";\n }\n }\n\n var votesWPI = 0;\n\n for (var i = 0; i < members.length; i++) {\n if (members[i].party == \"I\") {\n votesWPI = votesWPI + members[i].votes_with_party_pct;\n statistics.Independents.vote_w_party =\n (votesWPI / statistics.Independents.n_reps).toFixed(2) + \"%\";\n }\n }\n\n //For with an Object to add .js to .html:\n\n var glance = document.getElementById(\"glance\");\n\n for (var party in statistics) {\n var row = document.createElement(\"tr\");\n var partyCell = document.createElement(\"td\");\n partyCell.innerHTML = party;\n var repsCell = document.createElement(\"td\");\n repsCell.innerHTML = statistics[party].n_reps;\n var voteCell = document.createElement(\"td\");\n voteCell.innerHTML = statistics[party].vote_w_party;\n row.append(partyCell, repsCell, voteCell);\n glance.appendChild(row);\n }\n}", "function makeRope()\n\t\t\t{\n\t\t\t\tbranchBank -= 5;\n\t\t\t\tleafBank -= 5;\n\t\t\t\tropeBank++;\n\t\t\t\taction(1,1,1);\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "function levelSet(p_re, p_im, c_re, c_im)\n{\n\tvar z_re = p_re;\n\tvar z_im = p_im;\n\tvar iteration = 0;\n\tvar tmp_re, tmp_im;\n\n\tdo\n\t{\n\t\ttmp_re = z_re*z_re - z_im*z_im + c_re;\n\t\ttmp_im = 2*z_re*z_im + c_im;\n\t\tz_re = tmp_re;\n\t\tz_im = tmp_im;\n\t\titeration++;\t\t\n\t} while ((z_re*z_re+z_im*z_im) < 4 && iteration < levelNum);\n\n\treturn iteration;\n}", "scaleDificulty() {\n\n var result = []; //The result array.\n var numThorns = 0; //The number of thorns in a level.\n var numWalls = 0; //The number of wall objects in a level.\n var numFoods = 0; //The number of food items in a level.\n var numRegZombs = 0; //The number of regular zombies in a level.\n var numSupZombs = 0;\n\n if (this.currentLevel <= 3) {\n\n numThorns = this.getRand(2, 6);\n numWalls = this.getRand(2, 4);\n numFoods = 4;\n numRegZombs = 1;\n numSupZombs = 0;\n\n } else if (this.currentLevel >= 4 && this.currentLevel <= 8) {\n\n numThorns = this.getRand(4, 7);\n numWalls = this.getRand(3, 5);\n numFoods = this.getRand(2, 3);\n numRegZombs = 2;\n numSupZombs = this.getRand(0, 1);\n\n } else if (this.currentLevel >= 9 && this.currentLevel <= 13) {\n numThorns = this.getRand(5, 9);\n numWalls = this.getRand(4, 6);\n numFoods = this.getRand(1, 2);\n numRegZombs = this.getRand(1, 2);\n numSupZombs = this.getRand(1, 2);\n } else {\n numThorns = this.getRand(7, 9);\n numWalls = this.getRand(6, 7);\n numFoods = this.getRand(1, 2);\n numRegZombs = this.getRand(1, 2);\n numSupZombs = this.getRand(2, 4);\n\n }\n\n result[0] = numThorns;\n result[1] = numWalls;\n result[2] = numFoods;\n result[3] = numRegZombs;\n result[4] = numSupZombs;\n\n return result;\n\n }", "calculateDamage(isWeaker) {\n let useLevel = this.level;\n if(isWeaker){\n useLevel++;\n }\n let num = Math.floor(Math.random() * useLevel) + 1;\n return num;\n }", "getHarvestMultiplier() {\n let multiplier = 1;\n if (this.mulch === MulchType.Rich_Mulch) {\n multiplier = GameConstants.RICH_MULCH_MULTIPLIER;\n }\n else if (this.mulch === MulchType.Amaze_Mulch) {\n multiplier = GameConstants.AMAZE_MULCH_PRODUCE_MULTIPLIER;\n }\n multiplier *= this.auraHarvest();\n return multiplier;\n }", "getPartialResistMultiplier (resist) {\n return 1 - ((75 * resist) / (this.level * 5)) / 100\n }", "function calculateDotRarity() {\n for (i = 0; i < tilesList.length; i++) {\n if (tilesList[i].mat == 6) {\n tilesList[i].dotRarity = 0\n }\n else {\n tilesList[i].dotRarity = tilesList[i].dot / getTotalDots(tilesList[i].mat)\n }\n }\n}", "makemonster(level)\n {\n this.defalt_x = level.monster[0].position_x-(level.monster[0].row*MONSTERDISTANCE);\n this.defalt_y = level.monster[0].position_y-(level.monster[0].column*MONSTERDISTANCE);\n\n if(this.move == false)\n {\n level.stiffen = true\n level.monster[this.UFOsquidvalue].position_y +=2;\n if(level.monster[this.UFOsquidvalue].position_y >=this.defalt_y)\n {\n level.monster[this.UFOsquidvalue].position_y = this.defalt_y\n level.stiffen = false;\n this.move = true;\n } \n }\n else{\n for(var i = 0; i < level.behindmonsterdata.length;i++)\n {\n if(this.position_x == this.defalt_x + (MONSTERDISTANCE*i) && level.behindmonsterdata[i]==0 && this.position_x > MONSTERDISTANCE*2&& this.position_x < play_scene_maximumX - (MONSTERDISTANCE*2))\n {\n this.move = false;\n level.stiffen = true;\n\n var nextmonsternumber =0;\n var itislast = true; \n\n for(var j = i; j < level.behindmonsterdata.length;j++)\n {\n if(level.behindmonsterdata[j]==1)\n {\n itislast=false;\n for(var k=0;k<level.monster.length;k++)\n\n {\n if(level.monster[k].column == 0 && level.monster[k].row == j)\n {\n nextmonsternumber = j\n break;\n }\n }\n break;\n }\n }\n\n if(itislast)\n {\n this.move = false;\n level.monster.push(level.makeUFOsquid(this.defalt_x + (MONSTERDISTANCE*i),this.position_y,i))\n level.behindmonsterdata[i]=1;\n this.UFOsquidvalue = level.monster.length-1\n }\n\n else{\n this.move = false;\n this.UFOsquidvalue = nextmonsternumber\n level.monster.splice(nextmonsternumber,0,level.makeUFOsquid(this.defalt_x + (MONSTERDISTANCE*i),this.position_y,i))\n if(level.monstercount>nextmonsternumber)\n {\n level.monstercount+=1\n }\n level.behindmonsterdata[i]=1;\n }\n }\n }\n}\n}", "function displace(level) {\n var d = (2 * maxDisplacement) / pow(roughness,level);\n return d - random(2 * d);\n}", "getOverallRepairLevel(){\n var repairLevel = 0;\n var fullyRepaired = 500;\n repairLevel = this.parts[\"engine\"] +\n this.parts[\"hull\"] +\n this.parts[\"shields\"] +\n this.parts[\"thrusters\"] +\n this.parts[\"life-support systems\"];\n return repairLevel / fullyRepaired;\n }", "function getLewis() {\n let jump_reach_score = jump_height / 100;\n average_power = Math.sqrt(4.9) * body_mass * Math.sqrt(jump_reach_score) * 9.81;\n }", "function diffToLevel() {\n\treturn (6.188*(difficulty-1)*(difficulty-1)+1) | 0;\n}", "levelBump() {\n // increment level (aka score)\n level++;\n\n if(level % 5 == 0) {\n // RANDOM numbers\n let chanceToSpawnGlasses = Phaser.Math.Between(1, 3);\n console.log(chanceToSpawnGlasses);\n }\n\n if(level == 15) {\n this.addBullet();\n }\n // if(level % 5 == 0 ) {\n // console.log(\"here\");\n // this.addSunGlasses();\n // }\n // set EXTREME mode\n if(level == 75) {\n //paddle.scaleY = 0.5;\n this.extremeMODE = true;\n }\n }", "function checkLevel(){\r\n let r = Math.floor(lines / 10) + 1\r\n if(r > level) {\r\n level = r\r\n }\r\n adjustDropSpeed()\r\n}", "getActionsScore() {\n const actions_score = [];\n const nbr_of_trees = this.getNumberOfTrees();\n\n\n // COMPLETE\n if(nbr_of_trees[3] > 0 && this.sun >= 4){\n if(this.play_index === -1){\n for (let i = 0; i < this.trees.length; i += this.treeI) {\n if (this.trees[i+1] === 3 && this.trees[i+2] && !this.trees[i+3]){\n let score = this.score_of_previous_round + (Math.exp(this.cells[this.trees[i]*this.cellI+1] * this.mulA) \n + Math.exp(nbr_of_trees[3]*this.mulB) + Math.exp(this.cells[this.trees[i]*this.cellI+8]*this.mulC)) * this.complete_mul / this.iter;\n if(this.change_commplete){\n score = this.score_of_previous_round + (Math.exp(this.cells[this.trees[i]*this.cellI+1]) * 2) / this.iter;\n }\n actions_score.push([this.play_index, score, COMPLETE, this.trees[i], -1, ...this.last_action.slice(5)]);\n }\n }\n }else{\n const bestTree = {\n score:-9999,\n tree:-1,\n }\n for (let i = 0; i < this.trees.length; i += this.treeI) {\n if (this.trees[i+1] === 3 && this.trees[i+2] && !this.trees[i+3] && this.cells[this.trees[i] * this.cellI + 8] * this.cells[this.trees[i] * this.cellI + 1] > bestTree.score){\n bestTree.score = this.cells[this.trees[i] * this.cellI + 8] * this.cells[this.trees[i] * this.cellI + 1];\n bestTree.tree = this.trees.slice(i,i+this.treeI);\n }\n }\n if(bestTree.tree !== -1){\n let score = this.score_of_previous_round + (Math.exp(this.cells[bestTree.tree[0] * this.cellI + 1]*this.mulA)\n + Math.exp(nbr_of_trees[3]*this.mulB) + Math.exp(this.cells[bestTree.tree[0]*this.cellI+8] * this.mulC)) * this.complete_mul / this.iter;\n if(this.change_commplete){\n score = this.score_of_previous_round + ( Math.exp(this.cells[bestTree.tree[0]*this.cellI+1]) * 2) / this.iter;\n }\n actions_score.push([this.play_index, score, COMPLETE, bestTree.tree[0], -1, ...this.last_action.slice(5)]);\n }\n }\n }\n\n\n // SEED\n if(this.sun >= nbr_of_trees[0] && this.rday < 20){\n if(nbr_of_trees[4] - nbr_of_trees[3] < this.max_tree){\n let mul = 1;\n if(nbr_of_trees[0] === 0){\n mul = this.seed_mul;\n }else if (this.rday < this.seed_2_phase_day){\n mul = this.start_seed_mul;\n }\n const bestTree = {\n score: 9999,\n tree: -1,\n spot: -1,\n }\n\n if(bestTree.tree === -1) {\n for (let i = 0; i < this.trees.length; i += this.treeI) {\n if (this.trees[i+2] && this.trees[i+1] > 1 && !this.trees[i+3]){\n let cells_to_check = [this.trees[i]];\n for (let j = 0; j < this.trees[i+1]; j++) {\n let new_cells = [];\n cells_to_check.forEach(cell =>{\n this.cells.slice(cell * this.cellI + 2, cell * this.cellI + 8).forEach(spot => {\n if (spot !== -1 ){\n new_cells.push(spot);\n let div = this.cells[spot * this.cellI + 1];\n if(this.rday < this.seed_2_phase_day ){\n div = 1 + this.cells[spot * this.cellI + 1]/10;\n }\n if (this.cells[spot * this.cellI + 8] / div < bestTree.score && this.cells[spot * this.cellI + 1] > 0 && !this.isOccupied(spot)){\n bestTree.score = this.cells[spot * this.cellI + 8] / div;\n bestTree.tree = this.trees.slice(i, i+this.treeI);\n bestTree.spot = spot;\n }\n }\n });\n });\n cells_to_check = new_cells;\n }\n }\n }\n }\n if (bestTree.tree !== -1){\n actions_score.push([\n this.play_index,\n this.score_of_previous_round + (mul * this.cells[bestTree.spot * this.cellI + 1] / this.cells[bestTree.spot * this.cellI + 8]) / this.iter,\n SEED, bestTree.tree[0], bestTree.spot, ...this.last_action.slice(5)\n ]);\n }\n }\n }\n\n\n // GROW\n if (this.sun >= 1 && nbr_of_trees[4] > nbr_of_trees[3]){\n if(this.play_index === -1){\n for (let i = 0; i < this.trees.length; i += this.treeI) {\n if (this.rday <= 20 + this.trees[i+1] && this.trees[i+1] < 3 && this.trees[i+2] && !this.trees[i+3]){\n let needed_sun;\n switch (this.trees[i+1]) {\n case 0:\n needed_sun = 1 + nbr_of_trees[1];\n break;\n case 1:\n needed_sun = 3 + nbr_of_trees[2];\n break;\n case 2:\n needed_sun = 7 + nbr_of_trees[3];\n break;\n }\n if (this.sun >= needed_sun){\n actions_score.push([\n this.play_index,\n this.score_of_previous_round + (this.cells[this.trees[i] * this.cellI + 1] * this.grow_mul[this.trees[i+1]] / this.cells[this.trees[i] * this.cellI + 8])/this.iter,\n GROW, this.trees[i], -1, ...this.last_action.slice(5)\n ]);\n }\n }\n }\n }else{\n const bestTree = {\n score:[9999, 9999, 9999],\n tree:[-1, -1, -1],\n }\n for (let i = 0; i < this.trees.length; i += this.treeI) {\n if (this.rday <= 20 + this.trees[i+1] && this.trees[i+1] < 3 && this.trees[i+2] && !this.trees[i+3] && this.cells[this.trees[i] * this.cellI + 8] / this.cells[this.trees[i] * this.cellI + 1] < bestTree.score[this.trees[i+1]]){\n let needed_sun;\n switch (this.trees[i+1]) {\n case 0:\n needed_sun = 1 + nbr_of_trees[1];\n break;\n case 1:\n needed_sun = 3 + nbr_of_trees[2];\n break;\n case 2:\n needed_sun = 7 + nbr_of_trees[3];\n break;\n }\n if (this.sun >= needed_sun){\n bestTree.score[this.trees[i+1]] = this.cells[this.trees[i] * this.cellI + 8] / this.cells[this.trees[i] * this.cellI + 1];\n bestTree.tree[this.trees[i+1]] = this.trees.slice(i,i+this.treeI);\n }\n }\n }\n for (let i = 0 ; i< 3; i++){\n if(bestTree.tree[i] !== -1){\n actions_score.push([\n this.play_index,\n this.score_of_previous_round + (this.cells[bestTree.tree[i][0] * this.cellI + 1] * this.grow_mul[bestTree.tree[i][1]] / this.cells[bestTree.tree[i][0] * this.cellI + 8])/this.iter,\n GROW, bestTree.tree[i][0], -1, ...this.last_action.slice(5)\n ]);\n }\n }\n }\n }\n\n\n //WAIT\n actions_score.push([this.play_index, this.score_of_previous_round - (this.sun * this.wait_mul) / this.iter, WAIT, -1, -1, ...this.last_action.slice(5)]);\n\n if(this.play_index === -1){\n actions_score.map((val, i) => {\n val[0] = i;\n return val;\n });\n }\n\n return actions_score;\n }", "function herbalism() {\n\n // select potion elementt\n let potion = document.querySelector('#potion');\n\n // empty potion image properties\n let img = document.createElement('img');\n img.style.height = '150px';\n img.style.width = '150px';\n img.id = 'beaker';\n img.src = 'beaker/beaker-default.png';\n // img.src = 'beaker-default-white.png';\n\n // append potion image to potion HTML element\n potion.appendChild(img);\n\n // un ordered list items\n let items = document.querySelectorAll('.items');\n\n // for each [ items ]\n items.forEach(element => {\n\n // workbench beaker image icon\n let beaker = document.querySelector('#beaker');\n\n // workbench recipe name selector\n let name = document.querySelector('#name');\n\n // workbench mixing button selector\n let mix = document.querySelector('#mix');\n\n // workbench button percentages\n let percent50 = document.querySelector('.percent50');\n let percent100 = document.querySelector('.percent100');\n\n // element [ items ] click event\n element.addEventListener('click', ()=> {\n\n // after a recipe has been completed\n if (beaker.src != 'beaker/beaker-default.png') {\n \n // reset the beaker to default\n beaker.src = 'beaker/beaker-default.png';\n\n // also reset the name of the potion to an empty string\n name.innerHTML = '';\n }\n if (herb1 === '') {\n\n // assign element id to herb 1\n herb1 = element.id;\n \n if (element.id === liferoot.id) {\n\n // assign left image source to liferoot source\n left.src = liferoot.src;\n \n // test\n console.log('herb left : liferoot');\n \n }\n if (element.id === wildvine.id) {\n \n // assign left image source to wildvine source\n left.src = wildvine.src;\n\n // test\n console.log('herb left : wildvine');\n }\n if (element.id === sungrass.id) {\n \n // assign left image source to sungrass source\n left.src = sungrass.src;\n\n // test\n console.log('herb left : sungrass');\n }\n\n percent50.style.background = 'green';\n\n // test\n console.log('herb 1 : ' + herb1);\n }\n // validate herb1 is not empty & is not already the same id\n if (herb1 != '' && herb1 != element.id || herb1 != '' && herb2 != '') {\n \n // assign element id to herb 2\n herb2 = element.id;\n\n if (herb2 === liferoot.id) {\n\n // assign right image source to liferoot source\n right.src = liferoot.src;\n\n // test\n console.log('herb right : liferoot');\n \n }\n if (herb2 === wildvine.id) {\n\n // assign right image source to wildvine source\n right.src = wildvine.src;\n\n // test\n console.log('herb right : wildvine');\n }\n if (herb2 === sungrass.id) {\n // assign right image source to sungrass source\n right.src = sungrass.src;\n\n // test\n console.log('herb right : sungrass');\n }\n if (herb1 === herb2) {\n alert('Cannot use same herb in potion. Please choose a different herb');\n }\n // test\n console.log('herb 2 : ' + herb2);\n\n // test mix path\n console.log('mix : ' + herb1 + ' + ' + herb2); \n\n\n percent100.style.background = 'green';\n }\n\n \n \n });\n \n });\n}", "newPowerLevel(heat) {\n let base = Math.ceil((1 + Math.random()) * 100);\n let level = Math.pow(base, 1 + heat / 1200);\n if(level > 1000000000000000000) level = 1000000000000000000; // JS craps out if we go higher than this\n return level;\n\t}", "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}", "function build_level_one(){\n var fudge = 0;\n for(x in mouse_path){\n\tif(fudge > 5){\n\tif(mouse_path[x].x == 0 && mouse_path[x].y == 0){\n\t}\n\telse if(((mouse_path[x-1].x < 0 && mouse_path[x].x >= 0)||(mouse_path[x-1].x > 0 && mouse_path[x].x <= 0)) && mouse_path[x].y > 0)\n\t {\n\t\tlevel_one[0] = level_one[0] + 1;\n\t}\n else if(((mouse_path[x-1].y < 0 && mouse_path[x].y >= 0)||(mouse_path[x-1].y > 0 && mouse_path[x].y <= 0)) && mouse_path[x].x > 0)\n\t {\n\t level_one[1] = level_one[1] + 1;\n\t}\n else if(((mouse_path[x-1].x < 0 && mouse_path[x].x >= 0)||(mouse_path[x-1].x > 0 && mouse_path[x].x <= 0)) && mouse_path[x].y < 0)\n\t {\n\t level_one[2] = level_one[2] + 1;\n\t}\n\telse if(((mouse_path[x-1].y < 0 && mouse_path[x].y >= 0)||(mouse_path[x-1].y > 0 && mouse_path[x].y <= 0)) && mouse_path[x].x < 0)\n\t {\n\t\tlevel_one[3] = level_one[3] + 1;\n\t}\n\t}\n\tfudge = fudge + 1;\n }\n //Call compare_level_one on the newly built level one array\n // console.log(compare_level_one(level_one));\n // console.log(level_one);\n}", "function uppdateraAllaKlossar() {\n /* Skapa rader */\n for (let j = 1; j < 6; j++) {\n /* Skapa klossar */\n for (let i = 0; i < 6; i++) {\n if (!klossar[j][i].hit) {\n ritaKlossar(45 + i * 120, j * 50);\n }\n }\n }\n }", "function nextLevel() {\r\n let nextRand = Math.floor(Math.random() * 4);\r\n nextRand = animStarter(nextRand)\r\n levelCounter++;\r\n $('#level-title').html('level ' + levelCounter);\r\n steps.push(nextRand);\r\n copyOfSteps = []\r\n for (var i = steps.length; i > 0; i--) {\r\n copyOfSteps.push(steps[i - 1]);\r\n }\r\n}", "levelExpNeeded(level) {\n return (level - 1) * 100;\n }", "function topple() {\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n nextpiles[x][y] = sandpiles[x][y];\n }\n }\n\n // adjust the critical height if needed\n criticalHeight = 4;\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n let num = sandpiles[x][y];\n if (num >= criticalHeight) {\n nextpiles[x][y] -= 4;\n if (x + 1 < width)\n nextpiles[x + 1][y]++;\n if (x - 1 >= 0)\n nextpiles[x - 1][y]++;\n if (y + 1 < height)\n nextpiles[x][y + 1]++;\n if (y - 1 >= 0)\n nextpiles[x][y - 1]++;\n }\n }\n }\n\n let tmp = sandpiles;\n sandpiles = nextpiles;\n nextpiles = tmp;\n}", "function uppdateraAllaKlossar() {\n /* Skapa rader */\n for (let j = 1; j < 5; j++) {\n /* Skapa klossar */\n for (let i = 0; i < 6; i++) {\n if (!klossar[j][i].hit) {\n ritaKloss(40 + i * 120, j * 50);\n }\n }\n }\n }", "getGrowthMultiplier() {\n var _a;\n let multiplier = (_a = {\n [MulchType.Boost_Mulch]: GameConstants.BOOST_MULCH_MULTIPLIER,\n [MulchType.Amaze_Mulch]: GameConstants.AMAZE_MULCH_GROWTH_MULTIPLIER,\n [MulchType.Freeze_Mulch]: GameConstants.FREEZE_MULCH_MULTIPLIER,\n }[this.mulch]) !== null && _a !== void 0 ? _a : 1;\n if (this.stage() !== PlotStage.Berry) {\n multiplier *= this.auraGrowth();\n }\n else {\n multiplier *= this.auraDecay();\n // Handle Death Aura\n if (this.berry !== BerryType.Kasib) {\n multiplier *= this.auraDeath();\n }\n }\n return multiplier;\n }", "levelUp() {\n return this.merge({strength: this.level + 1});\n }", "twistMR() {\n this.fourCycle(this.edgeLoc, 3, 9, 11, 5, this.edgeOrient, 1, 1, 1, 1, 2);\n this.fourCycle(this.sideLoc, 2, 4, 5, 1, this.sideOrient, 2, 3, 2, 1, 4);\n }", "function percentCheck(percentChange) {\n\n var goodMeme =\n {\n goodImg: [\"Cool-Obama\", \"Buddy-Christ\", \"Chuck-Norris-Approves\", \"Metal-Jesus\", \"Gangnam-Style-PSY\", \"Fast-Furious-Johnny-Tran\", \"Ghetto-Jesus\"],\n topT: [\"Your Investing\", \"Right On\", \"Because\", \"You\", \"OPA\", \"Money is\", \"Draaank\"],\n bottomT: [\"In the Right Shit\", \"Buddy\", \"Chuck Norris said so\", \"rock!\", \"Gangnam style\", \"own my mind\", \"Is on Me!\"]\n };\n\n var badMeme =\n {\n badImg: [\"Booty-Warrior\", \"Burn-Kitty\", \"Bitch-Please\", \"Angry-Baby\", \"Aaaaand-Its-Gone\", \"Criana\", \"Dave-Chappelle\", \"Ill-Have-You-Know-Spongebob\"],\n topT: [\"Cant you read\", \"Burn\", \"your money\", \"Get your\", \"Aaaaand\", \"We not making\", \"Can I Have\", \"I Mean\"],\n bottomT: [\"before you invest\", \" \", \"is screwed\", \"Shit together\", \"Its-Gone\", \"No Money!\", \"A Dollar\", \"Its Whatever\"],\n };\n\n var greaterMeme =\n {\n greaterImg: [\"Deadpool-Surprised\", \"Deadpool-Pickup-Lines\", \"Derp\", \"Drunk Baby\", \"Hora-Extra\"],\n topT: [\"Omg Omg Omg\", \"Life is\", \"I Can\", \"Im Not\", \"Just\"],\n bottomT: [\"Thats Awesome\", \"Good\", \"See The Future\", \"Worried At All\", \"Wait on it\"],\n };\n var horribleMeme =\n {\n horribleImg: [\"Determined-Guy-Rage-Face\", \"Disappointed-Tyson\", \"Dont-You-Squidward\", \"FFFFFFFUUUUUUUUUUUU\", \"Kevin-Hart-The-Hell\"],\n topT: [\"Wtf\", \"I told you\", \"You\", \"You Know What\", \"Help\"],\n bottomT: [\"Shut it Down\", \"Plan B MF\", \"Big Mad!\", \"F*** It\", \"Meee!!!\"],\n };\n\n\n var apiUrl = \"https://ronreiter-meme-generator.p.mashape.com/meme\";\n var font = \"Impact\";\n var fontSize = \"50\";\n var topText;\n var bottomText;\n var meme;\n var i = 0;\n\n if (percentChange < 0) {\n\n if (percentChange < -3) {\n i = Math.floor(Math.random() * horribleMeme.horribleImg.length);\n console.log(i);\n meme = horribleMeme.horribleImg[i];\n topText = horribleMeme.topT[i];\n bottomText = horribleMeme.bottomT[i];\n\n } else {\n i = Math.floor(Math.random() * badMeme.badImg.length);\n console.log(i);\n meme = badMeme.badImg[i];\n topText = badMeme.topT[i];\n bottomText = badMeme.bottomT[i];\n }\n\n } else {\n\n if (percentChange > 3) {\n i = Math.floor(Math.random() * greaterMeme.greaterImg.length);\n console.log(i);\n meme = greaterMeme.greaterImg[i];\n topText = greaterMeme.topT[i];\n bottomText = greaterMeme.bottomT[i];\n\n } else {\n i = Math.floor(Math.random() * goodMeme.goodImg.length);\n console.log(i);\n meme = goodMeme.goodImg[i];\n topText = goodMeme.topT[i];\n bottomText = goodMeme.bottomT[i];\n }\n }\n\n var queryURL = apiUrl + \"?bottom=\" + bottomText + \"&font=\" + font + \"&font_size=\" + fontSize + \"&meme=\" + meme + \"&top=\" + topText;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n headers: {\n \"X-Mashape-Key\": \"jCuQ07buCmmshB86bfe7bGRUwQOEp1TxvzWjsnsnNSN16soTiH\",\n \"Accept\": \"text/plain\"\n },\n }).then(function (response) {\n // console.log(response);\n $(\"#cMeme\").html(\"<img src = 'http://apimeme.com/meme?meme=\" + meme + \"&top=\" + topText + \"&bottom=\" + bottomText + \"&test=1'>\")\n\n });\n}", "getSynergy(){\n return 0.25 + 0.75 * (this.getActivePlayingPlayers().length / 11) ** 2;\n }", "function autoLevelEquipment() {\n //if((game.jobs.Miner.locked && game.global.challengeActive != 'Metal') || (game.jobs.Scientist.locked && game.global.challengeActive != \"Scientist\"))\n //return;\n var Best = {\n 'healthwood': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n },\n 'healthmetal': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n },\n 'attackmetal': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n },\n 'blockwood': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n }\n };\n var enemyDamage = getEnemyMaxAttack(game.global.world + 1, 30, 'Snimp', .85);\n var enemyHealth = getEnemyMaxHealth(game.global.world + 1);\n \n //below challenge multiplier not necessarily accurate, just fudge factors\n if(game.global.challengeActive == \"Toxicity\") {\n //ignore damage changes (which would effect how much health we try to buy) entirely since we die in 20 attacks anyway?\n if(game.global.world < 61)\n enemyDamage *= 2;\n enemyHealth *= 2;\n }\n if(game.global.challengeActive == 'Lead') {\n enemyDamage *= 2.5;\n enemyHealth *= 7;\n }\n //change name to make sure these are local to the function\n var enoughHealthE = !(doVoids && voidCheckPercent > 0) && (baseHealth * 4 > 30 * (enemyDamage - baseBlock / 2 > 0 ? enemyDamage - baseBlock / 2 : enemyDamage * 0.2) || baseHealth > 30 * (enemyDamage - baseBlock > 0 ? enemyDamage - baseBlock : enemyDamage * 0.2));\n var enoughDamageE = (baseDamage * 4 > enemyHealth);\n \n if (game.global.world == 200) { //&& ((new Date().getTime() - game.global.zoneStarted) / 1000 / 60) > 10 && ((new Date().getTime() - game.global.zoneStarted) / 1000 / 60) < 20){\t\t\n enoughHealthE = false;\t\t\n enoughDamageE = false;\t\t\n }\n\n for (var equipName in equipmentList) {\n var equip = equipmentList[equipName];\n // debug('Equip: ' + equip + ' EquipIndex ' + equipName);\n var gameResource = equip.Equip ? game.equipment[equipName] : game.buildings[equipName];\n // debug('Game Resource: ' + gameResource);\n if (!gameResource.locked) {\n document.getElementById(equipName).style.color = 'white';\n var evaluation = evaluateEquipmentEfficiency(equipName);\n // debug(equipName + ' evaluation ' + evaluation.Status);\n var BKey = equip.Stat + equip.Resource;\n // debug(equipName + ' bkey ' + BKey);\n\n if (Best[BKey].Factor === 0 || Best[BKey].Factor < evaluation.Factor) {\n Best[BKey].Factor = evaluation.Factor;\n Best[BKey].Name = equipName;\n Best[BKey].Wall = evaluation.Wall;\n Best[BKey].Status = evaluation.Status;\n }\n\n document.getElementById(equipName).style.borderColor = evaluation.Status;\n if (evaluation.Status != 'white' && evaluation.Status != 'yellow') {\n document.getElementById(equip.Upgrade).style.color = evaluation.Status;\n }\n if (evaluation.Status == 'yellow') {\n document.getElementById(equip.Upgrade).style.color = 'white';\n }\n if (evaluation.Wall) {\n document.getElementById(equipName).style.color = 'yellow';\n }\n\n //Code is Spaced This Way So You Can Read It:\n if (\n evaluation.Status == 'red' &&\n (\n ( getPageSetting('BuyWeaponUpgrades') && equipmentList[equipName].Stat == 'attack' ) \n ||\n ( getPageSetting('BuyWeaponUpgrades') && equipmentList[equipName].Stat == 'block' )\n ||\n ((getPageSetting('BuyArmorUpgrades') && ((equipmentList[equipName].Resource != 'metal')\n || ((gameResource.prestige+5 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 50 && armorTempValue < 100)|| armorValue < 1000))\n || (gameResource.prestige+4 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 20 && armorTempValue < 50)|| armorValue < 500))\n || (gameResource.prestige+3 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 10 && armorTempValue < 20)|| armorValue < 200))\n || (gameResource.prestige+2 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 1 && armorTempValue < 10)|| armorValue < 100)))\n || gameResource.prestige < 5 || game.global.world == 200 ) && (equipmentList[equipName].Stat == 'health'))\n && \n //Only buy Armor prestiges when 'DelayArmorWhenNeeded' is on, IF:\n (\n (game.global.world == 200) // not in level 200\n ||\n\t\t\t(getPageSetting('DelayArmorWhenNeeded') && !shouldFarm) // not during \"Farming\" mode \n || // or\n (getPageSetting('DelayArmorWhenNeeded') && enoughDamage) // has enough damage (not in \"Wants more Damage\" mode)\n || // or \n (getPageSetting('DelayArmorWhenNeeded') && !enoughDamage && !enoughHealth) // if neither enough dmg or health, then tis ok to buy.\n || \n (getPageSetting('DelayArmorWhenNeeded') && equipmentList[equipName].Resource == 'wood')\n || \n !getPageSetting('DelayArmorWhenNeeded') //or when its off.\n )\n )\n )\n ) \n {\n var upgrade = equipmentList[equipName].Upgrade;\n if (upgrade != \"Gymystic\")\n debug('Upgrading ' + upgrade + \" - Prestige \" + game.equipment[equipName].prestige, '*upload');\n else\n debug('Upgrading ' + upgrade + \" # \" + game.upgrades[upgrade].allowed, '*upload');\n buyUpgrade(upgrade, true, true);\n }\n }\n }\n preBuy();\n game.global.buyAmt = 1;\n for (var stat in Best) {\n if (Best[stat].Name !== '') {\n var eqName = Best[stat].Name;\n var DaThing = equipmentList[eqName];\n document.getElementById(Best[stat].Name).style.color = Best[stat].Wall ? 'orange' : 'red';\n //If we're considering an attack item, we want to buy weapons if we don't have enough damage, or if we don't need health (so we default to buying some damage)\n if (getPageSetting('BuyWeapons') && DaThing.Stat == 'attack' && (!enoughDamageE || enoughHealthE)) {\n if (DaThing.Equip && !Best[stat].Wall && canAffordBuilding(eqName, null, null, true)) {\n debug('Leveling equipment ' + eqName, '*upload3');\n buyEquipment(eqName, null, true);\n }\n }\n //If we're considering a health item, buy it if we don't have enough health, otherwise we default to buying damage\n if (getPageSetting('BuyArmor') && (DaThing.Stat == 'health' || DaThing.Stat == 'block') && !enoughHealthE) {\n if (DaThing.Equip && !Best[stat].Wall && canAffordBuilding(eqName, null, null, true)) {\n debug('Leveling equipment ' + eqName, '*upload3');\n buyEquipment(eqName, null, true);\n }\n }\n if (getPageSetting('BuyArmor') && (DaThing.Stat == 'health') && getPageSetting('AlwaysArmorLvl2') && game.equipment[eqName].level < 2){\n if (DaThing.Equip && !Best[stat].Wall && canAffordBuilding(eqName, null, null, true)) { \n debug('Leveling equipment ' + eqName + \" (AlwaysArmorLvl2)\", '*upload3');\n buyEquipment(eqName, null, true);\n } // ??idk?? && (getPageSetting('DelayArmorWhenNeeded') && enoughDamage)\n }\n }\n }\n postBuy();\n}", "getLevel() {\n let levelData = [\n {nbLine: 1, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 500, moveSpd: 80}, // not used\n {nbLine: 1, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 500, moveSpd: 80}, // 1\n {nbLine: 10, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 450, moveSpd: 80}, // 2\n {nbLine: 15, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 400, moveSpd: 80}, // 3\n {nbLine: 20, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 350, moveSpd: 80}, // 4\n {nbLine: 25, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 300, moveSpd: 80}, // 5\n {nbLine: 30, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 250, moveSpd: 80}, // 6\n {nbLine: 35, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 200, moveSpd: 80}, // 7\n {nbLine: 40, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 150, moveSpd: 80}, // 8\n {nbLine: 45, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 100, moveSpd: 80}, // 9\n {nbLine: 999, maxTime: Number.MAX_SAFE_INTEGER, dropSpd: 50, moveSpd: 80} // 10\n ];\n\n if (this.mode === 'sprint') {\n levelData = [\n {nbLine: 5, maxTime: 30000, dropSpd: 500, moveSpd: 100}, // index 0 is not used\n {nbLine: 5, maxTime: 30000, dropSpd: 500, moveSpd: 100},\n {nbLine: 10, maxTime: 30000, dropSpd: 450, moveSpd: 100},\n {nbLine: 15, maxTime: 30000, dropSpd: 400, moveSpd: 100},\n {nbLine: 20, maxTime: 30000, dropSpd: 350, moveSpd: 100},\n {nbLine: 25, maxTime: 30000, dropSpd: 300, moveSpd: 100},\n {nbLine: 30, maxTime: 30000, dropSpd: 250, moveSpd: 100},\n {nbLine: 35, maxTime: 30000, dropSpd: 200, moveSpd: 100},\n {nbLine: 40, maxTime: 30000, dropSpd: 150, moveSpd: 100},\n {nbLine: 45, maxTime: 30000, dropSpd: 100, moveSpd: 100},\n {nbLine: 999, maxTime: 30000, dropSpd: 50, moveSpd: 100}\n ];\n }\n\n return levelData[this.level];\n }", "function marcsCakewalk(calorie) {\n // Complete this function\n\n calorie.sort((a, b) => b - a);\n\n var miles = 0;\n\n for (var i = 0; i < calorie.length; i++) {\n miles = miles + calorie[i] * Math.pow(2, i);\n }\n\n return miles;\n}", "function C012_AfterClass_Jennifer_PleasurePlayer() {\n\t\n\t// The more it progresses, the faster Jennifer must go\n\tCurrentTime = CurrentTime + 50000;\n\tvar StartCount = C012_AfterClass_Jennifer_PleasurePlayerCount;\n\tif ((C012_AfterClass_Jennifer_PleasurePlayerCount >= 0) && (C012_AfterClass_Jennifer_PleasurePlayerCount <= 1) && (C012_AfterClass_Jennifer_PleasurePlayerSpeed == 0)) C012_AfterClass_Jennifer_PleasurePlayerCount++;\n\tif ((C012_AfterClass_Jennifer_PleasurePlayerCount >= 2) && (C012_AfterClass_Jennifer_PleasurePlayerCount <= 3) && (C012_AfterClass_Jennifer_PleasurePlayerSpeed == 1)) C012_AfterClass_Jennifer_PleasurePlayerCount++;\n\tif ((C012_AfterClass_Jennifer_PleasurePlayerCount >= 4) && (C012_AfterClass_Jennifer_PleasurePlayerCount <= 9) && (C012_AfterClass_Jennifer_PleasurePlayerSpeed == 2)) C012_AfterClass_Jennifer_PleasurePlayerCount++;\n\t\n\t// At 6 counts, an orgasm is achieved, the next one will be slower\n\tif (C012_AfterClass_Jennifer_PleasurePlayerCount >= 6) {\n\t\tOverridenIntroText = GetText(\"OrgasmFromJenniferPleasure\");\n\t\tActorAddOrgasm();\n\t\tGameLogSpecificAddTimer(CurrentChapter, \"Player\", \"NextPossibleOrgasm\", PlayerHasLockedInventory(\"VibratingEgg\") ? CurrentTime + 1800000 : CurrentTime + 3600000);\n\t\tif (ActorIsChaste()) OverridenIntroImage = \"JenniferPleasurePlayerChastityOrgasm.jpg\";\n\t\telse OverridenIntroImage = \"JenniferPleasurePlayerOrgasm.jpg\";\n\t\tC012_AfterClass_Jennifer_CurrentStage = 634;\n\t\tC012_AfterClass_Jennifer_PleasurePlayerCount = 0;\n\t\tC012_AfterClass_Jennifer_PleasurePlayerSpeed = 0;\n\t} else {\n\t\tif (StartCount == C012_AfterClass_Jennifer_PleasurePlayerCount) OverridenIntroText = GetText(\"PleasureFromJenniferNoProgress\");\n\t}\n\t\n}", "function beetle_lvl5() {}", "function collectEggs() {\n if (gameData.eggs + gameData.eggcollectorNum <= gameData.storage) {\n gameData.eggs += (gameData.eggcollectorNum);\n duckUpdate();\n } else if (gameData.eggs + gameData.eggcollectorNum > gameData.storage) {\n gameData.eggs = gameData.storage;\n duckUpdate();\n }\n if (gameData.eggs + (gameData.roboteggcollectorNum * 5) <= gameData.storage) {\n gameData.eggs += (gameData.roboteggcollectorNum * 5);\n duckUpdate();\n } else if (gameData.eggs + (gameData.roboteggcollectorNum * 5) > gameData.storage) {\n gameData.eggs = gameData.storage;\n duckUpdate();\n }\n\n}", "function GoJudgement(boardSize, stoneArray) {\r\n\tthis.BoardSize = boardSize; // default 19*19\r\n\tthis.KoI = 19; // 设置劫争点为(19,19), 即此点目前不存在\r\n\tthis.KoJ = 19;\r\n\r\n\tthis.StoneArray = stoneArray; // 棋盘上的棋子数组: 1 black, -1 white, 0 space\r\n\tthis.LibertyArray = new Array(); // 棋盘上的棋子拥有的气数组: 0,1,2,3,4\r\n\tthis.LibertyFlagArray = new Array(); // 气已经计算完毕,不必重复计算此子了\r\n\tthis.AroundCountArray = new Array(); // 某棋子周围棋子个数, 边缘、异色++\r\n\tthis.SelfPonnukiArray = new Array(); // 临时存储提子的数组\r\n\tthis.PonnukiArray = new Array(); // 存储提子的数组\r\n}", "lifeExpectancyJupiter() {\n let jovianLifeExpectancy = Math.floor(this.lifeExpectancy/11.86);\n return jovianLifeExpectancy;\n }", "function brzycki(weight, reps) {\n\treturn weight/((37/36)-(reps/36));\n}", "lifeExpectancyMars() {\n let martianLifeExpectancy = Math.floor(this.lifeExpectancy/1.88);\n return martianLifeExpectancy;\n }", "function calculateResourceRarity() {\n for (i = 0; i < positions.length; i++) {\n var sum = 0;\n for (x = 0; x < positions[i].tiles.length; x++) {\n sum += positions[i].tiles[x].dotRarity\n }\n positions[i].resourceRarityScore = sum\n }\n}", "levelUp(powerUp) {\n if (powerUp.anim == \"red\") {\n this.power++;\n } else {\n this.updateLives(this.scene, 1);\n }\n\n }", "function setup_level(level) {\n switch (level) {\n case 1:\n game_level_score = level1.score;\n set_game_level_score(game_level_score);\n drop_gifts(level1.items());\n break;\n case 2:\n game_level_score = level2.score;\n set_game_level_score(game_level_score);\n drop_gifts(level2.items());\n break;\n case 3:\n game_level_score = level3.score;\n set_game_level_score(game_level_score);\n drop_gifts(level3.items());\n break;\n default:\n console.log(\"Levels exhausted. Sorry!\");\n }\n}", "function CheckForLevelup (flower:GameObject) : int {\n\t\n\n\tvar owner:GameObject = flower.GetComponent(FlowerScript).m_Owner;\n\tif(flower.GetComponent(FlowerScript).m_NumBees == 1)\n\t{\n\t\tfor(var child:Transform in transform)\n\t\t{\n\t\t\tif(child.GetComponent(FlowerScript).m_NumBees < 1 || child.GetComponent(FlowerScript).m_Owner != owner)\n\t\t\t\treturn 0;\n\t\t}\n\t\treturn 1;\n\t}\n\t\n\tif(flower.GetComponent(FlowerScript).m_NumBees == 2)\n\t{\n\t\tfor(var child:Transform in transform)\n\t\t{\n\t\t\tif(child.GetComponent(FlowerScript).m_NumBees < 2 || child.GetComponent(FlowerScript).m_Owner != owner)\n\t\t\t\treturn 0;\n\t\t}\n\t\treturn 2;\n\t}\n\t\n\tif(flower.GetComponent(FlowerScript).m_NumBees == 3)\n\t{\n\t\tfor(var child:Transform in transform)\n\t\t{\n\t\t\tif(child.GetComponent(FlowerScript).m_NumBees < 3 || child.GetComponent(FlowerScript).m_Owner != owner)\n\t\t\t\treturn 0;\n\t\t}\n\t\treturn 3;\n\t}\n\treturn 0;\n}", "function checkCheat(player, rival) {\n/*\tif (player.Name == \"cheat\") {\n\t\tif (rival.Name == \"code\") {\n\t\t\tfor (i=0; i<151; i++) {\n\t\t\t\t// getPokemonName\n\t\t\t\tvar pokemonNumber = i + 1;\n\t\t\t\tvar pokemonLevel = 1; // change to 100 // will this work if level 1 is set for all pokemon in var pokemonStats (FR_PKMN.js)?\n\t\t\t\tif (pokemonNumber < 10) {\n\t\t\t\t\tpokemonNumber = \"00\" + pokemonNumber;\n\t\t\t\t} else if (pokemonNumber < 100) {\n\t\t\t\t\tpokemonNumber = \"0\" + pokemonNumber;\n\t\t\t\t};\n\t\t\t\tpokemonNumber = String(pokemonNumber);\n\t\t\t\tvar pokemonName = getPokemonName(pokemonNumber);\n\t\t\t\tvar pokemon = new createPokemonWithNameLevel(pokemonName, pokemonLevel);\n\t\t\t\t// set pokemon as caught\n\t\t\t\tif (player.pokemonCaught[pokemon.Name] == 0) {\n\t\t\t\t\tplayer.pokemonCaught[pokemon.Name] = 1;\n\t\t\t\t};\n\t\t\t\t// Add pokemon to the pokedex counter\n\t\t\t\tsetPokemonCaught(player);\n\t\t\t};\n\t\t\t// add specific pokemon as activePokemon\n\t\t\tfor (i=0; 0<5; i++) {\n\t\t\t\tvar activePokemonNumber = i + 1;\n\t\t\t\tvar activePokemonCall = \"activePokemon\" + activePokemonNumber;\n\t\t\t\tif (activePokemonNumber == 1) {\n\t\t\t\t\t// Create Pokemon\n \t\t\t\t\t\t// C: Cloyster (/ Cubone/ Chansey/ Charizard)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t} else if (activePokemonNumber == 2) {\n\t\t\t\t\t// Create Pokemon\n\t\t\t\t\t\t// H: Hitmonlee (/ Horsea/ Haunter/ Hitmonchan/ Hypno)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t} else if (activePokemonNumber == 3) {\n\t\t\t\t\t// Create Pokemon\n\t\t\t\t\t\t// E: Electabuzz (/ Exeggutor/ Electrode)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t} else if (activePokemonNumber == 4) {\n\t\t\t\t\t// Create Pokemon\n\t\t\t\t\t\t// A: Arcanine (/ Articuno)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t} else if (activePokemonNumber == 5) {\n\t\t\t\t\t// Create Pokemon\n\t\t\t\t\t\t// T: Tangela (/ Tauros)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t};\n\t\t\t\tsetActivePokemonText(player);\n\t\t\t};\t\t\t\t\t\n\t\t};\n\t};*/\n}", "lifeExpectancyMercury() {\n let mercurianLifeExpectancy = Math.floor(this.lifeExpectancy/0.24);\n return mercurianLifeExpectancy;\n }", "CalcPowerScore() { \n\t\tthis.score = 0;\n\t\t\n\t\t// planets\n\t\tlet planet_score = 0;\n\t\tfor ( let p of this.planets ) { \n\t\t\tplanet_score += p.score;\n\t\t\tplanet_score += p.total_pop * 0.1;\n\t\t\t// TODO local economy\n\t\t\t}\n\t\t\t\n\t\t// ships\n\t\tlet ship_score = 0;\n\t\tfor ( let f of this.fleets ) { \n\t\t\tif ( !f.killme ) { \n\t\t\t\tship_score += f.milval;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t// troops\n\t\tlet ground_score = 0;\n\t\tfor ( let p of this.planets ) { \n\t\t\tground_score += p.troops.length;\n\t\t\t}\n\t\tfor ( let f of this.fleets ) { \n\t\t\tground_score += f.troops;\n\t\t\t}\n\t\t\n\t\t// tech level\n\t\tlet tech_score = 0;\n\t\tfor ( let t of this.tech.compl ) { \n\t\t\ttech_score += t.node.rp;\n\t\t\t}\n\t\t\t\n\t\tthis.power_score = Math.round( \n\t\t\t ( planet_score * 20.0 )\n\t\t\t+ ( ship_score * 0.02 )\n\t\t\t+ ( ground_score * 2.0 )\n\t\t\t+ ( tech_score * 0.1 )\n\t\t\t+ ( this.resources.$ * 0.001 )\n\t\t\t);\n\t\t\t\n\t\treturn this.power_score;\n\t\t}", "function cellNumber(difficoltLevel) {\n let risultato\n\n if (difficoltLevel === \"easy\") {\n risultato = 100\n } else if (difficoltLevel === \"medium\") {\n risultato = 81\n } else(\n risultato = 49\n )\n\n return risultato\n\n}", "function cellNumber(difficoltLevel) {\n let risultato\n\n if (difficoltLevel === \"easy\") {\n risultato = 100\n } else if (difficoltLevel === \"medium\") {\n risultato = 81\n } else(\n risultato = 49\n )\n\n return risultato\n\n}", "function recursiveMouvementRight(i,j,tile)\n\t\t{\n\t\t\t// !!! Verifier si colone full !!!\n\t\t\tvar tileNext = $('body').find('[data-x='+(j+1)+'][data-y='+(i)+']');\n\t\t\tvar value =$(tile).find('.tile-inner').text();\n\t\t\tvar valueNext = $(tileNext).find('.tile-inner').text();\n\t\t\tif( tileNext.length == 0 && j<4)\n\t\t\t{\n\t\t\t\tconsole.log('on avance');\n\t\t\t\t\tsetClass($(tile), j+1);\n\t\t\t\t\trecursiveMouvementRight(i,j+1,tile);\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( value == valueNext){\n\t\t\t\t\tsetClass($(tile), j-1);\n\t\t\t\t\tfusion(tile,tileNext, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function percentageOfWorld1(populations){\n return populations / 7900 * 100;\n }", "function optimal_compos_golden(adr)//mam sklad 7, szukam czy ktos na lawce sie nadaje//szukanie lepszego perfo-nie roz problem\n{\n if(adr==1)\n {\n \ttea = team1;//z tempo odczyt, a do tempz zapisuje;\n }\n else \n {\n \ttea = team2;//z tempo odczyt, a do tempz zapisuje;\n }\n//console.log(changes);\n var all_lawka = [];\n var item1 = [];\n var item2 = [];\n var item3 = [];\n var item4 = [];\n for(var i=1;i<=6;i++)//mam gwaracje, że przejdzie przez każdego R na ławce, ale dalej zawsze wybierze najlepszego\n {\t\n tea[0]=Array(0,0,0,0,0,0,0,0,0,0,0,0);\n item1 = [];item2 = [];item3 = [];item4 = [];\n\t\t\tfor(var j=8;j<=12;j++)\n\t\t\t{\n\t\t\t //item = [];\n if(tea[j][4]==\"R\" && i == 1)// i = 1 - sprawdzam każdego z ławki konkretnie za R\n\t\t\t {\n\t\t\t \tif(tea[j][11] > (tea[i][11]+1))\n {\n nadwyzka = tea[j][11] - tea[i][11];nadwyzka = zaokr(nadwyzka); \n item1 = [j, i, nadwyzka];\n all_lawka.unshift(item1);// \n }\n\t\t\t }\n if(tea[j][4]==\"A\" && i == 4)// i = 4\t\n\t\t\t {\n\t\t\t \tif(tea[j][6] > (tea[i][6]+1))\n {\n nadwyzka = tea[j][6] - tea[i][6];nadwyzka = zaokr(nadwyzka);\n item2 = [j, i, nadwyzka];\n all_lawka.unshift(item2);// \n }\n\t\t\t }\n item3 =[];\n if(tea[j][4]==\"P\" && (i == 2 || i == 5))// i = 2; i =5;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][7])/2 > ((tea[i][6]+tea[i][7])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][7])/2 - ((tea[i][6]+tea[i][7])/2);nadwyzka = zaokr(nadwyzka);\n item3=[];\n item3 = [j, i, nadwyzka];\n test = all_lawka.unshift(item3);//\n //alert(\"test-length: \"+test+\" item: \"+item3);\n }\n\t\t\t }\n if(tea[j][4]==\"S\" && (i == 3 || i == 6))// i = 3; i =6;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][9])/2 > ((tea[i][6]+tea[i][9])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][9])/2 - ((tea[i][6]+tea[i][9])/2);nadwyzka = zaokr(nadwyzka);\n item4 = [j, i, nadwyzka];\n all_lawka.unshift(item4);// \n }\n\t\t\t }\n } //end of for j=8..12\n //console.log(all_lawka);\n }//end of for i=1..6\n //sortowanie\n for(u=0; u<all_lawka.length; u++)\n {\n for(w=1; w<all_lawka.length; w++)\n {\n if(all_lawka[w][2] > all_lawka[w-1][2])\n {\n temp = all_lawka[w-1];\n all_lawka[w-1] = all_lawka[w];\n all_lawka[w] = temp;\n }\n }\n }\n //próba wykoanania zmiany\n for(u=0; u<all_lawka.length; u++)\n {\n out_id = all_lawka[u][1];\n in_id = all_lawka[u][0];\n out_nr = tea[out_id][3]; //na indeksie 1 mam wyznaczonego do zejścia - nr dla funkcji possible_change\n in_nr = tea[in_id][3]; //\n if(adr == 1)\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen3\").innerHTML;\ndocument.getElementById(\"screen3\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info1\").innerHTML;\ndocument.getElementById(\"change_info1\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change1(out_id,in_id); flag_golden1 = 1; return 0;\n }\n }\n else\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen6\").innerHTML;\ndocument.getElementById(\"screen6\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info2\").innerHTML;\ndocument.getElementById(\"change_info2\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change2(out_id,in_id); flag_golden2 = 1; return 0;\n }\n }\n }\n\n\n if(adr==1)\n {\n team1 = tea;\n }\n else \n {\n team2 = tea;\n }\n\n banch_ins();\n return 1;\n}", "function question5 () {\n // Answer:\n // Qty of 2 Groomsmen Gift - Stainless Steel Personalized Bottle Opener - NO Capcatcher has 9 materials:\n // - wall mount bottle opener\n // - wedding\n // - man cave\n // - christmas gift\n // - guy gift\n // - fathers day\n // - home bar\n // - beer\n // - bar\n // The Three Broomsticks Customizable Beer Stein Mug, Harry Potter Inspired, hogsmeade village, harry potter gift, three broomsticks mug has 13 materials:\n // - glass\n // - sandblast cabinet\n // - vinyl\n // - beer glass\n // - pint glass\n // - etched pint glass\n // - etched glass\n // - etched beer glass\n // - 16 oz pint\n // - beer gift\n // - etched harry potter glass\n // - the three broomsticks glass\n // - personalized harry potter glass\n\n //\n //console.log name, number of items, the items it is made of\n //Iterate through data.materials array, display if <= 8\n\n for (var i = 0; i < data.length; i++) {\n if (data[i].materials.length > 8) {\n console.log(data[i].title + ' has ' + data[i].materials.length + ' materials: ');\n for (var j = 0; j < data[i].materials.length; j++) {\n console.log('-' + data[i].materials[j]);\n }\n }\n }\n}", "function checkPowerUps() {\n if (player.animating) {\n return;\n }\n checkGoal();\n var rect2 = null, rect1 = player.getBounds();\n\n /* Touching a gem will give you 1 extra score */\n if (collectibles.gem) {\n rect2 = collectibles.gem.getBounds();\n if (Helpers.rectCollision(rect1, rect2)) {\n score += 1;\n collectibles.gem = false;\n }\n }\n /* Touching a star will give you 2 extra score and 1 extra life */\n if (collectibles.life) {\n rect2 = collectibles.life.getBounds();\n if (Helpers.rectCollision(rect1, rect2)) {\n lives++;\n if (lives > 3) {\n lives = 3;\n }\n score += 2;\n collectibles.life = false;\n }\n }\n /* Touching a key will give you 2 extra score and the grid row\n * will change in the next level.\n */\n if (collectibles.key) {\n rect2 = collectibles.key.getBounds();\n if (Helpers.rectCollision(rect1, rect2)) {\n changeRows = true;\n score += 2;\n collectibles.key = false;\n }\n }\n }", "function calculateWinners(snapshot, penguins) {\n let rank = snapshot.replace(/~/g, '--').match(/p-*/gi).map((dist, i) => [ dist.length, penguins[i] ]).sort((a, b) => a[0] - b[0]).map(p => p[1]);\n return `GOLD: ${rank[0]}, SILVER: ${rank[1]}, BRONZE: ${rank[2]}`;\n}", "function calculateResourcePlenty() {\n for (i = 0; i < positions.length; i++) {\n var sum = 0;\n for (x = 0; x < positions[i].tiles.length; x++) {\n sum += positions[i].tiles[x].dotWeight\n }\n positions[i].resourcePlentyScore = sum\n }\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 updateWorkload (musclesFatigue, exercises) {\n exercises.forEach((exercise) => {\n exercise.muscles.forEach(m => {\n console.log(m);\n console.log(musclesFatigue[m.id])\n musclesFatigue[m.id] = musclesFatigue[m.id] + exercise.sets.length\n })\n exercise.muscles_secondary.forEach(m => musclesFatigue[m.id] = musclesFatigue[m.id] + exercise.sets.length/2)\n if((exercise.muscles.concat(exercise.muscles_secondary)).length < 1) {\n exerciseCategory[exercise.category.name].muscleIds.forEach(muscleId =>\n musclesFatigue[muscleId] = musclesFatigue[muscleId] + exercise.sets.length/2\n )\n }\n })\n}", "function levelThreshhold(level) {\n return Math.pow(level, 2) * 100;\n}", "apportion(node, level) {\n let firstChild = node.firstChild();\n let firstChildLeftNeighbor = firstChild.leftNeighbor();\n let compareDepth = 1;\n const depthToStop = this.cfg.maxDepth - level;\n\n while (firstChild && firstChildLeftNeighbor && compareDepth <= depthToStop) {\n // calculate the position of the firstChild, according to the position of firstChildLeftNeighbor\n\n let modifierSumRight = 0;\n let modifierSumLeft = 0;\n let leftAncestor = firstChildLeftNeighbor;\n let rightAncestor = firstChild;\n\n for (let i = 0; i < compareDepth; i += 1) {\n leftAncestor = leftAncestor.parent();\n rightAncestor = rightAncestor.parent();\n modifierSumLeft += leftAncestor.modifier;\n modifierSumRight += rightAncestor.modifier;\n\n // all the stacked children are oriented towards right so use right variables\n if (rightAncestor.stackParent !== undefined) {\n modifierSumRight += rightAncestor.size() / 2;\n }\n }\n\n // find the gap between two trees and apply it to subTrees\n // and matching smaller gaps to smaller subtrees\n\n let totalGap =\n firstChildLeftNeighbor.prelim +\n modifierSumLeft +\n firstChildLeftNeighbor.size() +\n this.cfg.subTeeSeparation -\n (firstChild.prelim + modifierSumRight);\n\n if (totalGap > 0) {\n let subtreeAux = node;\n let numSubtrees = 0;\n\n // count all the subtrees in the LeftSibling\n while (subtreeAux && subtreeAux.id !== leftAncestor.id) {\n subtreeAux = subtreeAux.leftSibling();\n numSubtrees += 1;\n }\n\n if (subtreeAux) {\n let subtreeMoveAux = node;\n const singleGap = totalGap / numSubtrees;\n\n while (subtreeMoveAux.id !== leftAncestor.id) {\n subtreeMoveAux.prelim += totalGap;\n subtreeMoveAux.modifier += totalGap;\n\n totalGap -= singleGap;\n subtreeMoveAux = subtreeMoveAux.leftSibling();\n }\n }\n }\n\n compareDepth += 1;\n\n firstChild =\n firstChild.childrenCount() === 0\n ? node.leftMost(0, compareDepth)\n : (firstChild = firstChild.firstChild());\n\n if (firstChild) {\n firstChildLeftNeighbor = firstChild.leftNeighbor();\n }\n }\n }", "function regionspeeds() {\n \n if(currentbeat > (part1 + part2 +part3 +part4 + part5 + part6)){\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n } else if(currentbeat > (part1 + part2 +part3 +part4 + part5 +part6 - 4)){\n huegreen = true;\n }else if(currentbeat > (part1 + part2 +part3 +part4 + part5)){\n huered = false;\n huegreen = false;\n bpm = obpm * 1.25;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > (part1 + part2 +part3 +part4 + part5 -4)){\n huered = true;\n }else if(currentbeat > (part1 + part2 +part3 +part4 )){\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > (part1 + part2 +part3 +part4 - 4)){\n huegreen = true;\n }else if(currentbeat > (part1 + part2 +part3)){\n huered = false;\n huegreen = false;\n bpm = obpm * 1.25;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > (part1 + part2 +part3 - 4)){\n huered = true;\n }else if(currentbeat > (part1 + part2)){\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n //#b00035\n }else if(currentbeat > (part1 + part2 - 4)){\n huegreen = true;\n }else if(currentbeat > part1){\n huered = false;\n huegreen = false;\n bpm = obpm * 1.25;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > part1 - 4){\n huered = true\n }else {\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }\n}", "function LegoPile() {\n this.dict = {\n \"red\" : new BST(),\n \"green\" : new BST(),\n \"blue\" : new BST(),\n \"yellow\" : new BST(),\n \"black\" : new BST(),\n \"white\" : new BST(),\n };\n this.insert = function(brick){\n for (var key in this.dict) {\n if (brick.color === key) {\n this.dict[key].insert(brick);\n break;\n }\n }\n };\n this.hasBrick = hasBrick;\n this.count = function() {\n var totalBricks = 0;\n for (var key in this.dict) {\n totalBricks += this.dict[key].count();\n }\n return totalBricks;\n };\n}", "function increaseLevel(){\r\n\torderMaxNum++;\r\n\tif(orderMaxNum > ingredients_arr.length-1){\r\n\t\tplayerData.time -= totalTimePerIngredientDecrease;\r\n\t}\r\n\torderMaxNum = orderMaxNum > (ingredients_arr.length-1) ? (ingredients_arr.length-1) : orderMaxNum;\r\n}", "getReplantMultiplier() {\n let multiplier = 1;\n if (this.mulch === MulchType.Rich_Mulch) {\n multiplier = GameConstants.RICH_MULCH_MULTIPLIER;\n }\n else if (this.mulch === MulchType.Amaze_Mulch) {\n multiplier = GameConstants.AMAZE_MULCH_PRODUCE_MULTIPLIER;\n }\n multiplier *= this.auraReplant();\n return multiplier;\n }", "get stealChance() {\n return (this.Dexterity + this.Intelligence + this.Luck)/2\n }", "generateVoicings() {\n this.#chords.forEach((chord, i) => {\n if(i<this.#chords.length-2){\n if (chord.getGrade() == 2\n && this.#chords[i+1].getGrade() == 5\n && this.#chords[i+2].getGrade() == 1 ){\n let root = this.#chords[i].getRoot().getMidiNote();\n let pitches = [root + 3, root + 7, root + 10, root + 14];\n\n //Open position\n if (pitches[3] < 77) {\n this.#chords[i].changeNotes(pitches);\n pitches[2] = pitches[2] - 1\n this.#chords[i+1].changeNotes(pitches);\n pitches[0] = pitches[0] - 1\n pitches[1] = pitches[1] - 2\n pitches[3] = pitches[3] - 2\n this.#chords[i+2].changeNotes(pitches);\n }\n\n //Close position\n else {\n pitches[2] = pitches[2] - 12\n pitches[3] = pitches[3] - 12\n this.#chords[i].changeNotes(pitches);\n pitches[0] = pitches[0] - 1\n this.#chords[i+1].changeNotes(pitches);\n pitches[1] = pitches[1] - 2\n pitches[2] = pitches[2] - 1\n pitches[3] = pitches[3] - 2\n this.#chords[i+2].changeNotes(pitches);\n }\n i = i + 2\n }\n }\n })\n }", "nextGeneration() {\n let nextGeneration = [];\n this.generationCounter++;\n\n const survivors = Math.round(this.options.phenotypePerGeneration * this.options.repartition[0]);\n const childrens = Math.round(this.options.phenotypePerGeneration * this.options.repartition[1]);\n const randoms = Math.round(this.options.phenotypePerGeneration * this.options.repartition[2]);\n\n for (let i = 0; i < survivors; i++) {\n nextGeneration = [...nextGeneration, this.generation[this.options.phenotypePerGeneration - 1 - i]]\n }\n\n for (let i = survivors; i < survivors + childrens; i++) {\n nextGeneration = [...nextGeneration, this.makeChildren()]\n }\n for (let i = survivors + childrens; i < this.options.phenotypePerGeneration; i++) {\n let phenotype = new Phenotype(this.modelData, this.options.genotypePerPhenotype, this.genomOptions);\n phenotype.random();\n nextGeneration = [...nextGeneration, phenotype]\n }\n\n this.generation = nextGeneration;\n \n for (let i = survivors; i < this.options.phenotypePerGeneration; i++) {\n this.generation[i].similarityRatio = imgUtils.similarityBtwImageData(this.minifyModelData, this.generation[i].generate())\n }\n\n this.generation.sort((a, b) =>\n (a.similarityRatio - b.similarityRatio)) // Baddest to Best\n \n this.drawExample()\n\n let total = 0;\n for (let i = 0; i < this.options.phenotypePerGeneration; i++) {\n total += this.generation[i].similarityRatio\n }\n /** \n console.log(\"Generation n°\" + this.generationCounter \n + \" Best : \" + this.generation[this.options.phenotypePerGeneration - 1].similarityRatio \n + \", total : \" + total/this.options.phenotypePerGeneration);\n */\n }", "function pieWalk(WonderGums) {\n\trandom_index = Math.floor(Math.random() * (vid_array.length-1)) + 1;\n\tswitchToVideo(random_index);\n}", "function PercentToNewLevel(xp) {\n\t//find closest matching lvl xp\n\tfor (i = 0 ; i < experienceArray.length ; i++) {\n\t\tif (xp > experienceArray[i]) {\n\t\t\tcontinue;\n\t\t}\n\t\telse {\n\t\t\t//Check if exp is equal to the exact lvl experience\n\t\t\tif (xp === experienceArray[i]) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//Current experience minus the previous lvl experience to get the current % repeat for next lvl\n\t\t\t\t//To get the % to next level from the current experience instead of % to next level from total experience\n\t\t\t\treturn ((xp - experienceArray[i-1]) / (experienceArray[i] - experienceArray[i-1]) * 100).toFixed(2);\n\t\t\t}\n\t\t}\n\t}\n}", "similarLevelCalc(Rank) {\n if (this.rank === Rank) {\n this.progUp = 3;\n }\n if (this.rank === (this.Rank - 1)) {\n this.progUp = 1;\n }\n return this.levelProgressCalc();\n }", "check_max_eff(){\n\n\t\tlet wspitems_needed = [];\n\t\tlet wspitems_needed_lvl_now_eff = [];\n\t\t// wspitems_needed_lvl_now_eff = [];\n\n\t\tfor(let i=0; i<this.need.length; i++){\n\t\t\t\n\t\t\tfor(let j=0; j<wspitems.length; j++){\n\t\t\t\t\n\t\t\t\tif(this.need[i] === wspitems[j].lvl_tag && wspitems[j].lvl === 1){\n\n\t\t\t\t\twspitems_needed.push(wspitems[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(let i=0; i<wspitems_needed.length; i++){\n\n\t\t\tif(wspitems_needed[i].lvl === 1){\n\n\t\t\t\twspitems_needed_lvl_now_eff.push(wspitems_needed[i].lvls[wspitems_needed[i].lvl_now-2].max_eff);\n\t\t\t}\n\n\t\t\tif(this.need.length <= 1){\n\t\t\t\tthis.max_eff_of_needed = wspitems_needed[0].lvls[wspitems_needed[0].lvl_now-2].max_eff;\n\t\t\t} else {\n\n\t\t\t\tthis.max_eff_of_needed = wspitems_needed_lvl_now_eff[0];\n\t\t\t\t\n\t\t\t\tfor(let j=0; j<wspitems_needed_lvl_now_eff.length; j++){\n\n\t\t\t\t\tconst cur = wspitems_needed_lvl_now_eff[j];\n\n\t\t\t\t\tif(cur < this.max_eff_of_needed){\n\t\t\t\t\t\tthis.max_eff_of_needed = cur;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.c_max_eff.innerHTML = this.max_eff_of_needed;\n\t}", "function enemyMortgage() {\n function mortgageUcards(obj) {\n if(obj.type == \"uCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toMortgageU = propertyCards.filter(mortgageUcards);\n\n function mortgageVcards(obj) {\n if(obj.type == \"vCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toMortgageV = propertyCards.filter(mortgageVcards);\n\n\n function mortgagePcards2(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\" && obj.numberOwnedOfSet == 1 ){\n if(obj.color == \"darkblue\" || obj.color == \"purple\"){\n return true\n }\n }\n }\n var toMortgageP2 = propertyCards.filter(mortgagePcards2);\n\n\n function mortgagePcards3(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\" && obj.numberOwnedOfSet == 1 ){\n if(obj.color !== \"darkblue\" || obj.color !== \"purple\"){\n return true\n }\n }\n }\n var toMortgageP3 = propertyCards.filter(mortgagePcards3);\n\n function mortgagePcards1(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\" && obj.numberOwnedOfSet == 2 ){\n if(obj.color !== \"darkblue\" || obj.color !== \"purple\"){\n return true\n }\n }\n }\n var toMortgageP1 = propertyCards.filter(mortgagePcards1);\n\n function mortgagePcardsRest(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toMortgagePRest = propertyCards.filter(mortgagePcardsRest);\n\n if(toMortgageU.length>0){\n for(var i =0; i<toMortgageU.length; i++){\n toMortgageU[i].inPlay = \"no\";\n enemyCash += toMortgageU[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageU[i].name)\n }\n }else if(toMortgageV.length>0){\n for(var i =0; i<toMortgageU.length; i++){\n toMortgageV[i].inPlay = \"no\";\n enemyCash += toMortgageV[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageV[i].name)\n }\n }else if (toMortgageP2.length>0){\n for(var i =0; i<toMortgageP2.length; i++){\n toMortgageP2[i].inPlay = \"no\";\n enemyCash += toMortgageP2[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageP2[i].name)\n }\n }else if (toMortgageP3.length>0){\n for(var i =0; i<toMortgageP3.length; i++){\n toMortgageP3[i].inPlay = \"no\";\n enemyCash += toMortgageP3[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageP3[i].name)\n }\n }else if (toMortgageP1.length>0){\n for(var i =0; i<toMortgageP1.length; i++){\n toMortgageP1[i].inPlay = \"no\";\n enemyCash += toMortgageP1[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageP1[i].name)\n }\n }else if (toMortgagePRest.length>0){\n for(var i =0; i<toMortgagePRest.length; i++){\n toMortgagePRest[i].inPlay = \"no\";\n enemyCash += toMortgagePRest[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgagePRest[i].name)\n }\n }\n}", "gainMult() {\n let mult = D(1)\n if(player.grindless)mult=mult.times(3)\n return mult // Factor in any bonuses multiplying gain here.\n }", "function newLevel() {\n\t\tlevel += 1;\n\t\tscore += (100 * level);\n\t\tplayerInterval -= (8);\n\n\t\t// create a new food randomly\n\t\t// TODO: dont place a food anywhere on the snake\n\t\tfood = [\n\t\t\tMath.floor((Math.random() * (canvas.width / scale)) + 1) -1, \n\t\t\tMath.floor((Math.random() * (canvas.width / scale)) + 1) -1\n\t\t];\n\t}", "function getItemReforgedStats(gear) {\n\n if (module.exports.isReforgeable(gear)) {\n if (gear.alreadyPredictedReforge) {\n return;\n }\n\n if (!gear.substats) {\n Notifier.error(i18next.t(\"Cannot calculate reforged stats. Find the item and fix it: \") + JSON.stringify(gear));\n return;\n }\n\n gear.main.reforgedValue = mainStatValuesByStatType[gear.main.type]\n const length = gear.substats.length;\n\n for (var i = 0; i < length; i++) {\n const substat = gear.substats[i];\n const value = substat.value;\n if (plainStats.includes(substat.type)) {\n substat.max = Math.floor(value/4)\n substat.min = Math.ceil(value/8)\n substat.multi = 6;\n }\n if (substat.type == \"CriticalHitChancePercent\") {\n substat.max = Math.floor(value/3)\n substat.min = Math.ceil(value/5)\n substat.multi = 4;\n }\n if (substat.type == \"CriticalHitDamagePercent\") {\n substat.max = Math.floor(value/4)\n substat.min = Math.ceil(value/7)\n substat.multi = 5.5;\n }\n if (substat.type == \"Attack\") {\n substat.max = Math.round(value/39)\n substat.min = substat.max;\n substat.multi = 39;\n }\n if (substat.type == \"Defense\") {\n substat.max = Math.round(value/31)\n substat.min = substat.max;\n substat.multi = 31;\n }\n if (substat.type == \"Health\") {\n substat.max = Math.round(value/174)\n substat.min = substat.max;\n substat.multi = 174;\n }\n if (substat.type == \"Speed\") {\n substat.max = Math.round(value/2);\n substat.min = Math.ceil(value/4);\n substat.multi = 3;\n }\n }\n\n if (gear.enhance == 15) {\n if (gear.rank == \"Heroic\") {\n gear.substats[3].max = Math.min(2, gear.substats[3].max);\n } else if (gear.rank == \"Rare\") {\n gear.substats[2].max = Math.min(2, gear.substats[2].max);\n gear.substats[3].max = Math.min(2, gear.substats[3].max);\n } else if (gear.rank == \"Good\") {\n gear.substats[1].max = Math.min(2, gear.substats[1].max);\n gear.substats[2].max = Math.min(2, gear.substats[2].max);\n gear.substats[3].max = Math.min(2, gear.substats[3].max);\n } else if (gear.rank == \"Normal\") {\n gear.substats[0].max = Math.min(2, gear.substats[0].max);\n gear.substats[1].max = Math.min(2, gear.substats[1].max);\n gear.substats[2].max = Math.min(2, gear.substats[2].max);\n gear.substats[3].max = Math.min(2, gear.substats[3].max);\n }\n } else if (gear.enhance >= 12) {\n if (gear.rank == \"Heroic\") {\n gear.substats[3].max = Math.min(1, gear.substats[3].max);\n } else if (gear.rank == \"Rare\") {\n gear.substats[2].max = Math.min(1, gear.substats[2].max);\n gear.substats[3].max = Math.min(1, gear.substats[3].max);\n } else if (gear.rank == \"Good\") {\n gear.substats[1].max = Math.min(1, gear.substats[1].max);\n gear.substats[2].max = Math.min(1, gear.substats[2].max);\n gear.substats[3].max = Math.min(1, gear.substats[3].max);\n } else if (gear.rank == \"Normal\") {\n gear.substats[0].max = Math.min(1, gear.substats[0].max);\n gear.substats[1].max = Math.min(1, gear.substats[1].max);\n gear.substats[2].max = Math.min(1, gear.substats[2].max);\n gear.substats[3].max = Math.min(1, gear.substats[3].max);\n }\n } else if (gear.enhance >= 9) {\n if (gear.rank == \"Heroic\") {\n\n } else if (gear.rank == \"Rare\") {\n gear.substats[2].max = Math.min(1, gear.substats[2].max);\n } else if (gear.rank == \"Good\") {\n gear.substats[1].max = Math.min(1, gear.substats[1].max);\n gear.substats[2].max = Math.min(1, gear.substats[2].max);\n } else if (gear.rank == \"Normal\") {\n gear.substats[0].max = Math.min(1, gear.substats[0].max);\n gear.substats[1].max = Math.min(1, gear.substats[1].max);\n gear.substats[2].max = Math.min(1, gear.substats[2].max);\n }\n } else if (gear.enhance >= 6) {\n if (gear.rank == \"Heroic\") {\n\n } else if (gear.rank == \"Rare\") {\n\n } else if (gear.rank == \"Good\") {\n gear.substats[1].max = Math.min(1, gear.substats[1].max);\n } else if (gear.rank == \"Normal\") {\n gear.substats[0].max = Math.min(1, gear.substats[0].max);\n gear.substats[1].max = Math.min(1, gear.substats[1].max);\n }\n } else if (gear.enhance >= 3) {\n if (gear.rank == \"Heroic\") {\n\n } else if (gear.rank == \"Rare\") {\n\n } else if (gear.rank == \"Good\") {\n\n } else if (gear.rank == \"Normal\") {\n gear.substats[0].max = Math.min(1, gear.substats[0].max);\n }\n }\n\n var rolls = 0\n for (var substat of gear.substats) {\n const value = substat.value;\n\n substat.scaledDiff = 0;\n if (substat.rolls == undefined || substat.rolls == null) {\n substat.rolls = substat.min;\n }\n rolls += substat.rolls;\n }\n\n const maxRolls = getMaxRolls(gear.rank, gear.enhance);\n\n if (rolls != maxRolls) {\n var missingRolls = maxRolls - rolls;\n\n for (var i = 0; i < missingRolls; i++) {\n for (var substat of gear.substats) {\n if (substat.rolls + 1 > substat.max) {\n substat.minExpectedValue = 0;\n substat.scaledDiff = 0;\n continue;\n };\n\n const value = substat.value;\n substat.minExpectedValue = substat.rolls * substat.multi;\n substat.scaledDiff = (value - substat.minExpectedValue) / substat.multi;\n }\n\n const maxSubstat = gear.substats.reduce((prev, curr) => (prev.scaledDiff > curr.scaledDiff) ? prev : curr);\n maxSubstat.rolls += 1;\n maxSubstat.bonus = true;\n }\n }\n\n\n for (var substat of gear.substats) {\n const type = substat.type;\n const value = substat.value;\n\n calculateReforgeValues(substat);\n\n\n }\n } else {\n\n }\n}", "function k538(matches) { return 250 / Math.pow(matches + 5, .4); }", "function computeWinner() {\n\n // TODO: Compare date numerology with the active roster\n // TODO: Push numerology values to the json object file.\n var num = Math.floor(Math.random() * 2);\n if(num === 0) {\n return 0;\n } else if(num === 1) {\n return 1;\n }\n}", "function calculateRank (data) {\n var rankABottomLine = { '6': 4\n , '5': 3\n , '4': 2\n , '3': 2\n , '2': 1\n , '1': 7\n }\n , enemySunk = data.enemy.ships.reduce(function (count, ship) {\n var endHp = (ship.end_hp? ship.end_hp: ship.end_hp)\n if (endHp == 0) count++\n return count\n }, 0)\n\n , friendlySunk = data.friendly.ships.reduce(function (count, ship) {\n var endHp = (ship.end_hp? ship.end_hp: ship.end_hp)\n if (endHp == 0) count++\n return count\n }, 0)\n\n , friendlyCasualty = data.friendly.casualty\n , enemyCasualty = data.enemy.casualty\n\n , enemyFlagSunk = (data.enemy.ships[0].end_hp == 0)\n , shipLost = (friendlySunk > 0)\n , rankA = (enemySunk >= rankABottomLine[data.enemy.ships.length])\n , moreDamage = (enemyCasualty * 2.5 > friendlyCasualty)\n\n if (enemySunk == data.enemy.ships.length) {\n if (friendlyCasualty == 0) return 'SS'\n if (shipLost) return 'B'\n return 'S'\n }\n\n if (rankA && !shipLost) return 'A'\n if (enemyFlagSunk && !shipLost) return 'B'\n if (friendlyCasualty == 0 && enemyCasualty > 0) return 'B'\n if (moreDamage && !shipLost) return 'B'\n if (shipLost && rankA && moreDamage) return 'B'\n if (shipLost && enemySunk > friendlySunk && enemyFlagSunk) return 'B'\n if (enemyCasualty > 0) return 'C'\n if (!enemyFlagSunk && !moreDamage) return 'C'\n if (shipLost && enemyFlagSunk && enemySunk <= friendlySunk) return 'C'\n\n return 'D'\n}", "nextRound() {\n let self = this;\n\n function repairSubmodule() {\n let assignedSubmodule = self.crew.engineer.assignedSubmodule;\n if (assignedSubmodule) {\n self.submodules[assignedSubmodule].status = self.submodules[assignedSubmodule].status === 'DESTROYED' ? 'DAMAGED' : 'OK';\n }\n }\n\n function regenerateShield() {\n if (self.submodules.shield.status === 'DESTROYED') {\n return;\n }\n\n let lowestQuadrant, lowestQuadrantKey = null;\n let quadrantKeys = Object.keys(SHIELD_QUADRANTS);\n\n for (let i = 0; i < quadrantKeys.length; i++) {\n let quadrantKey = quadrantKeys[i];\n let quadrant = self.submodules.shield[quadrantKey];\n\n if (quadrant.broken) {\n lowestQuadrant = quadrant;\n lowestQuadrantKey = quadrantKey;\n break;\n }\n\n if (!lowestQuadrant || (quadrant.hitpoints < lowestQuadrant.hitpoints && quadrant.hitpoints < SHIELD_QUADRANTS[quadrantKey].MAX)) {\n lowestQuadrant = quadrant;\n lowestQuadrantKey = quadrantKey;\n\n if (lowestQuadrant.hitpoints === 0) {\n // Broken shield, continue to heal until full.\n lowestQuadrant.broken = true;\n }\n }\n }\n\n if (lowestQuadrant) {\n let hitpointsToRegen = self.submodules.shield.status === 'OK' ? 10 : 5;\n let quadrantMax = SHIELD_QUADRANTS[lowestQuadrantKey].MAX;\n lowestQuadrant.hitpoints = Math.min(lowestQuadrant.hitpoints + hitpointsToRegen, quadrantMax);\n\n if (lowestQuadrant.hitpoints === quadrantMax) {\n // Release broken quadrant if fully healed.\n delete lowestQuadrant.broken;\n }\n }\n }\n\n function moveMissiles() {\n let targets = self.submodules.missileLauncher.targets;\n for (let i = 0; i < targets.length; i++) {\n let target = targets[i];\n if (target && --target.distance === 0) {\n targets[i] = null;\n if (target.hit()) {\n // Target has been destroyed, remove all other missiles targeting the same enemy.\n for(let t = 0; t < targets.length; t++) {\n if (targets[t] && targets[t].id === target.id) {\n targets[t] = null;\n }\n }\n }\n }\n }\n _.pull(targets, null);\n }\n\n repairSubmodule();\n regenerateShield();\n moveMissiles();\n\n this.crew.engineer.assignedThisRound = false;\n }", "weighdown() {\n if(this.type === Node.TARGET || this.type === Node.START) return;\n if(this.type === Node.WALL) this.makeNormal();\n this.pweighted = true;\n this.psquare.classList.add('square--weighted');\n }", "function upgradeSickle()\n\t\t\t{\n\t\t\t\tif (sickleTier == 0)\n\t\t\t\t{\n\t\t\t\t\tsharpStoneBank--;\n\t\t\t\t\tsmoothBranchBank--;\n\t\t\t\t\tropeBank--;\n\t\t\t\t}\n\t\t\t\tsickleTier++;\n\t\t\t\taction(1,1,1);\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "function graveRobber (gameData, helpers) {\n var direction;\n var myHero = gameData.activeHero;\n \n var grave = nearestTile(gameData, {\n subType: \"Bones\",\n });\n \n if (grave) {\n return grave.direction;\n }\n}", "function evaporate() {\n for (let i = 0; i < Math.ceil(w / pheromones_resolution); i++) {\n for (let j = 0; j < Math.ceil(h / pheromones_resolution); j++) {\n if (pheromones.home_pheromones[i][j] > 0) {\n pheromones.home_pheromones[i][j]--;\n }\n if (pheromones.food_pheromones[i][j] > 0) {\n pheromones.food_pheromones[i][j]--;\n }\n }\n }\n}", "function plasserUtMat() {\n for (let i = 0; i < 5; i++) {\n const x = Math.trunc(Math.random() * 60);\n const y = Math.trunc(Math.random() * 60);\n ruter[x][y] = 1;\n const div = document.createElement(\"div\");\n div.className = \"gul ting\";\n divBrett.append(div);\n const banan = new Ting(div, x, y);\n banan.render();\n mat.push(banan);\n }\n for (let i = 0; i < 5; i++) {\n let ledig = false;\n let x; let y;\n while (!ledig) {\n x = Math.trunc(Math.random() * 60);\n y = Math.trunc(Math.random() * 60);\n ledig = ruter[x][y] === 0;\n }\n ruter[x][y] = 1;\n const div = document.createElement(\"div\");\n div.className = \"roed ting\";\n divBrett.append(div);\n const banan = new Ting(div, x, y);\n banan.render();\n mat.push(banan);\n }\n }", "function recallraidl100(){\n// var troops = cotg.city.troops();\n var loot;\n var total;\n var total_number=0;\n var total_lootz=0;\n var i=0;\n\n for(var x in citytc) {\n total=Number(citytc[x]);\n total_number+=total*Number(TS_type[i]);\n total_lootz+=total*Number(ttloot[i]);\n i+=1;\n if (i === 17) { break; }\n }\n var lootpertroop=total_lootz/total_number;\n var l=1;\n var m=Number($(\"#commandtable tbody\").length);\n function loop(){\n var trlist = $(\"#commandtable tbody tr:nth-child(\"+l+\")\");\n var lvlprog=$(trlist).find(\".commandinntabl tbody tr:nth-child(3) td:nth-child(1) span:nth-child(1)\").text();//td:nth-child(1) span:nth-child(1)\n var splitlp=lvlprog.split(\"(\");\n var Dungeon_lvl=Number(splitlp[0].match(/\\d+/gi));\n var Dungeion_prog=Number(splitlp[1].match(/\\d+/gi));\n var dungeon=splitlp[0].substring(0,splitlp[0].indexOf(','));\n if(dungeon===\"Mountain Cavern\"){loot=mountain_loot;}\n else{loot=other_loot;}\n var total_loot_c= Math.ceil(loot[Number(Dungeon_lvl)-1] * ((1-Number(Dungeion_prog)/100)+1));\n var Unitno=$(trlist).find(\".commandinntabl tbody tr:nth-child(1) td:nth-child(2) span\").text();//td:nth-child(1) span:nth-child(1)\n var temp7=Unitno.match(/[\\d,]+/g);\n var Units_raiding=Number(temp7[0].replace(',', ''));\n var lootperraid=lootpertroop*Units_raiding;\n var percentage_ofloot=Math.ceil((lootperraid/total_loot_c)*100);\n if(Number(percentage_ofloot)<90){\n jQuery(trlist).find(\".commandinntabl tbody tr:nth-child(2) td:nth-child(1) table tbody tr td:nth-child(2)\")[0].click(); // table tbody tr td:nth-child(2)\n $(\"#raidrettimesela\").val(1).change();\n setTimeout(function() {\n jQuery(\"#doneOG\")[0].click();\n },300);\n setTimeout(function() {\n $(\"#outgoingPopUpBox\").hide();\n },500);\n }\n l++;\n if(l<m){\n setTimeout(loop,1000);\n }\n }\n loop();\n }", "function kruskal() {\n\t\t// start of with each cell in it's own set\n\t\tconst sets = new Map();\n\t\tfor(let y = 0; y < maze.board_height; y++)\n\t\t\tfor(let x = 0; x < maze.board_width; x++)\n\t\t\t\tsets.set(maze.board[y][x], maze.board[y][x]);\n\n\t\t// get and flatten the cell's head\n\t\tfunction getHead(cell) {\n\t\t\tif(sets.get(cell) === cell) {\n\t\t\t\t// if it points to itself\n\t\t\t\treturn cell; // then this is the head\n\t\t\t} else {\n\t\t\t\t// if it points to something else\n\t\t\t\tconst head = getHead(sets.get(cell)); // get the head of that\n\t\t\t\tsets.set(cell, head); // flatten\n\t\t\t\treturn head; // return that head\n\t\t\t}\n\t\t}\n\n\t\t// start with every single door we could possibly knock down\n\t\tconst doors = [];\n\t\tfor(let y = 0; y < maze.board_height; y++)\n\t\t\tfor(let x = 0; x < maze.board_width-1; x++)\n\t\t\t\tdoors.push([maze.board[y][x], 'e', maze.board[y][x+1]]);\n\t\tfor(let y = 0; y < maze.board_height-1; y++)\n\t\t\tfor(let x = 0; x < maze.board_width; x++)\n\t\t\t\tdoors.push([maze.board[y][x], 's', maze.board[y+1][x]]);\n\n\t\treturn nextPromiseTimeout((next, resolve) => {\n\t\t\tlet [cell, dir, other] = pullRand(doors);\n\n\t\t\t// keep pulling off items that are attached\n\t\t\t// (we don't want a MAZE_DOOR_DELAY where we do nothing)\n\t\t\twhile(getHead(cell) === getHead(other) && doors.length) {\n\t\t\t\t[cell, dir, other] = pullRand(doors);\n\t\t\t}\n\n\t\t\t// attach\n\t\t\tif(getHead(cell) !== getHead(other)) {\n\t\t\t\tmaze.door(cell, dir, other);\n\t\t\t\tsets.set(getHead(cell), other);\n\t\t\t}\n\n\t\t\tif(doors.length) next().then(resolve);\n\t\t\telse resolve();\n\t\t}, MAZE_DOOR_DELAY);\n\t}", "levelUp() {\n // Have a bit of a pause so that the player can notice the new criteria up top.\n this.showReadyPrompt();\n sfx.levelup.play();\n gameState.level++;\n let flip = Math.random() > 0.5 ? true : false; // coin flip for some random variety in stage types.\n // Levels have a specific setup, with some having randomization (e.g. inequality/equality)\n switch(gameState.level) {\n case 2: // Multiples 6-11\n gameState.currentLevelType = levelType.MULTIPLE;\n this.setCriteria(6, 11);\n break;\n case 3: // Factors 3-25\n gameState.currentLevelType = levelType.FACTOR;\n this.setCriteria(3, 25);\n break;\n case 4: // Breather level, X2 or X5\n gameState.currentLevelType = levelType.MULTIPLE;\n if (flip) { this.setCriteria(2, 2); }\n else { this.setCriteria(5, 5); }\n break;\n case 5: // Either Factors 10-M or Primes \n if (flip) { \n gameState.currentLevelType = levelType.FACTOR \n this.setCriteria(10, gameState.maxNumber);\n }\n else { \n gameState.currentLevelType = levelType.PRIME; \n this.setCriteria(10, gameState.maxNumber); // numbers unused, but still need to update UI\n }\n break;\n case 6: // FActors 6-Max or Multiples 9-15\n if (flip) { \n gameState.currentLevelType = levelType.FACTOR \n this.setCriteria(6, gameState.maxNumber);\n }\n else { \n gameState.currentLevelType = levelType.MULTIPLE; \n this.setCriteria(9, 15);\n }\n break;\n case 7: // (in)equality 1-10\n if (flip) { gameState.currentLevelType = levelType.EQUALITY }\n else { gameState.currentLevelType = levelType.INEQUALITY; }\n this.setCriteria(1, 10);\n break;\n case 8:// (in)equality 1-24\n if (flip) { gameState.currentLevelType = levelType.EQUALITY }\n else { gameState.currentLevelType = levelType.INEQUALITY; }\n this.setCriteria(1, 24);\n break;\n case 9: // Breather level, X10 or X5\n gameState.currentLevelType = levelType.MULTIPLE;\n if (flip) { this.setCriteria(10, 10); }\n else { this.setCriteria(5, 5); }\n break;\n default: // beyond stage 9\n if ((gameState.level - 9) % 5 == 0) { // Type A: Multiples 9-(M/3)\n gameState.currentLevelType = levelType.MULTIPLE;\n this.setCriteria(9, parseInt(gameState.maxNumber / 3), true);\n } else if ((gameState.level - 9) % 5 == 1) { // Type B: (in)equality from 1-(M/2)\n if (flip) { gameState.currentLevelType = levelType.EQUALITY }\n else { gameState.currentLevelType = levelType.INEQUALITY; }\n this.setCriteria(1, parseInt(gameState.maxNumber / 2), true);\n } else if ((gameState.level - 9) % 5 == 2) { // Type C: either Factors 10-M or Primes 1-M\n if (flip) { \n gameState.currentLevelType = levelType.FACTOR;\n this.setCriteria(10, gameState.maxNumber, true); \n }\n else { \n gameState.currentLevelType = levelType.PRIME; \n this.setCriteria(1, gameState.maxNumber, true); \n }\n } else if ((gameState.level - 9) % 5 == 3) { // Type D: (in)equality from 1-M\n if (flip) { gameState.currentLevelType = levelType.EQUALITY }\n else { gameState.currentLevelType = levelType.INEQUALITY; }\n this.setCriteria(1, gameState.maxNumber, true);\n } else { // Type E: Breather level, X10, X15, X20, or X25. Easier material.\n gameState.currentLevelType = levelType.MULTIPLE;\n let rand = Math.random();\n if (rand < 1/4) { this.setCriteria(10, 10, true) }\n else if (rand < 2/4) { this.setCriteria(15, 15, true) }\n else if (rand < 3/4) { this.setCriteria(20, 20, true) }\n else { this.setCriteria(25, 25, true); }\n }\n break;\n }\n console.log(\"Level Up to \" + gameState.level + \"! gameState.currentLevelType: \" + gameState.currentLevelType);\n // Keeping both colorFlavor and modifier indices in bounds (Modifiers show up after exhausting all flavors; start back at vanilla.)\n gameState.colorFlavorIndex++;\n if (gameState.colorFlavorIndex > gameState.FLAVORS.length - 1) {\n gameState.colorFlavorIndex = 0;\n if (gameState.modifierIndex < gameState.MODIFIERS.length - 1) { gameState.modifierIndex++;} \n } \n if (gameState.modifierIndex >= 0) { // Print level name with modifier. We start the mod at -1 to avoid printing it the first go-around.\n gameState.levelText.setText(`LV. ${gameState.level}: ${gameState.MODIFIERS[gameState.modifierIndex]} ${gameState.FLAVORS[gameState.colorFlavorIndex]}`);\n } else { // Without modifier.\n gameState.levelText.setText(`LV. ${gameState.level}: ${gameState.FLAVORS[gameState.colorFlavorIndex]}`);\n }\n \n gameState.levelText.setTint(gameState.COLOR_HEXS[gameState.colorFlavorIndex]);\n this.levelUpDifficulty();\n this.resetGrid();\n }" ]
[ "0.60184175", "0.5972246", "0.5856036", "0.5744213", "0.5738829", "0.57236266", "0.5716391", "0.5696801", "0.5663769", "0.5652101", "0.5608829", "0.56039137", "0.55734634", "0.557206", "0.55588865", "0.55461144", "0.55424386", "0.55240273", "0.55217904", "0.5487709", "0.548113", "0.54572225", "0.5454462", "0.5436844", "0.5429769", "0.54119146", "0.5405014", "0.5404931", "0.540165", "0.53988963", "0.53889686", "0.53884774", "0.53833574", "0.5359079", "0.53553456", "0.5354332", "0.53493685", "0.5346611", "0.5344167", "0.53348815", "0.5333781", "0.5331414", "0.53292096", "0.53291476", "0.5328746", "0.5323931", "0.5322257", "0.5315157", "0.53082263", "0.5308126", "0.53068125", "0.53014004", "0.52887017", "0.5286213", "0.52850825", "0.5283344", "0.52740467", "0.5272923", "0.5271907", "0.5266761", "0.52664214", "0.52649415", "0.52649415", "0.52563035", "0.5244466", "0.52321094", "0.5228616", "0.52257645", "0.52248555", "0.5223657", "0.5222329", "0.5214344", "0.5213309", "0.52120167", "0.5202465", "0.52006274", "0.5199579", "0.51993895", "0.5199303", "0.51914257", "0.5187981", "0.51777786", "0.51748323", "0.5174236", "0.5171853", "0.51697254", "0.51686543", "0.51677746", "0.5158969", "0.51562184", "0.51543635", "0.5150281", "0.5147775", "0.5147423", "0.51407844", "0.5133079", "0.51323277", "0.51309943", "0.51267123", "0.5124061", "0.5122282" ]
0.0
-1
The next tick to lower the struggle time comes faster with harder levels
function StruggleGetNextTick() { if ((StruggleDifficulty == "Easy") && (StruggleProgress <= 33)) StruggleNextTick = CurrentTime + 600; if ((StruggleDifficulty == "Easy") && (StruggleProgress > 33) && (StruggleProgress <= 66)) StruggleNextTick = CurrentTime + 450; if ((StruggleDifficulty == "Easy") && (StruggleProgress > 66)) StruggleNextTick = CurrentTime + 300; if ((StruggleDifficulty == "Normal") && (StruggleProgress <= 33)) StruggleNextTick = CurrentTime + 400; if ((StruggleDifficulty == "Normal") && (StruggleProgress > 33) && (StruggleProgress <= 66)) StruggleNextTick = CurrentTime + 325; if ((StruggleDifficulty == "Normal") && (StruggleProgress > 66)) StruggleNextTick = CurrentTime + 250; if ((StruggleDifficulty == "Hard") && (StruggleProgress <= 33)) StruggleNextTick = CurrentTime + 300; if ((StruggleDifficulty == "Hard") && (StruggleProgress > 33) && (StruggleProgress <= 66)) StruggleNextTick = CurrentTime + 225; if ((StruggleDifficulty == "Hard") && (StruggleProgress > 66)) StruggleNextTick = CurrentTime + 150; if ((StruggleDifficulty == "Impossible") && (StruggleProgress <= 33)) StruggleNextTick = CurrentTime + 250; if ((StruggleDifficulty == "Impossible") && (StruggleProgress > 33) && (StruggleProgress <= 66)) StruggleNextTick = CurrentTime + 125; if ((StruggleDifficulty == "Impossible") && (StruggleProgress > 66)) StruggleNextTick = CurrentTime + 10; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNextTick(){tick = tick +1;return tick;}", "function tickTimer() {\n\ttimer = (timer >= speed) ? 0 : timer + 1;\n}", "slowGameTime()\n {\n this.clockTick = this.clockTick / 6;\n if (this.timeIsSlowed)\n {\n this.specialEffects.prepareCanvasLayersForEffects();\n console.log(\"Slowing\");\n this.specialEffects.performSlowTimeSpecialEffects();\n }\n }", "function makeHarder() {\n time = time * timeMod;\n if (time < 100) {\n time = 100;\n }\n if (speed > minSpeed) {\n speed -= speedMod;\n }\n}", "function slower() {\n if (stepDelay >= MAX_DELAY) { return; }\n stepDelay *= 2;\n }", "hurryTick() {\n this.requestedDelay -= this.options.delay;\n }", "function slowDown() {\n if (tritSpinningSpeed <= -1) {\n tritSpinningSpeed += 1\n }\n if (tritSpinningSpeed >= 1) {\n tritSpinningSpeed -= 1\n }\n if (tritSpinningSpeed == 0) {\n clearInterval(breaks)\n }\n console.log(\"SlowDown \" + tritSpinningSpeed);\n }", "function Toss() {\r\n if (Math.random() < 0.5) {\r\n traces.push(\"H\");\r\n } else {\r\n traces.push(\"T\");\r\n }\r\n }", "_tick() {\n let v = this.state.value\n let d = this.state.direction\n\n v += step * d\n\n if(v <= low) {\n v = low\n d = 1\n }\n\n if(v >= high) {\n v = high\n d = -1\n }\n\n this.setState({\n value: v,\n direction: d\n })\n }", "function timeTrack() {\r\n tracker++;\r\n time = tracker / 50;\r\n}", "function doubleCritDmg() {setTimeout(() => {critDmgMultiplier *= 2;}, 5000);}", "function speedBoostTime(){\r\n if(speedBoostOn) if(speedCD < 3){\r\n speedCD++;\r\n }else{\r\n clase.maxSpeed = clase.resetSpeed;\r\n speedCD = 0;\r\n }\r\n}", "forceTickRate(tickStartTime){\n // If the game is over, do not force another tick\n if( this.gameState == STATE_GAME_OVER ){\n return;\n }\n var tickTime = new Date().getTime() - tickStartTime;\n if(tickTime < 0){\n tickTime = 0;\n }\n var game = this;\n if(tickTime > tickLength){\n console.log(\"Dropping Frame\");\n setTimeout(this.tickCaller,(Math.floor(tickTime/tickLength)+1)*tickLength-tickTime, game);\n }else{\n setTimeout(this.tickCaller, tickLength-tickTime, game);\n }\n }", "scheduleNextTick() {\n let delay;\n if (this.cassetteMotorOn || this.keyboard.keyQueue.length > 4) {\n // Go fast if we're accessing the cassette or pasting.\n this.clocksPerTick = 100000;\n delay = 0;\n }\n else {\n // Delay to match original clock speed.\n const now = Date.now();\n const actualElapsed = now - this.startTime;\n const expectedElapsed = this.tStateCount * 1000 / this.clockHz;\n let behind = expectedElapsed - actualElapsed;\n if (behind < -100 || behind > 100) {\n // We're too far behind or ahead. Catch up artificially.\n this.startTime = now - expectedElapsed;\n behind = 0;\n }\n delay = Math.round(Math.max(0, behind));\n if (delay === 0) {\n // Delay too short, do more each tick.\n this.clocksPerTick = Math.min(this.clocksPerTick + 100, 10000);\n }\n else if (delay > 1) {\n // Delay too long, do less each tick.\n this.clocksPerTick = Math.max(this.clocksPerTick - 100, 100);\n }\n }\n // console.log(this.clocksPerTick, delay);\n this.cancelTickTimeout();\n this.tickHandle = window.setTimeout(() => {\n this.tickHandle = undefined;\n this.tick();\n }, delay);\n }", "function step() {\n DateChange(x.invert(currentValue));\n granularitiy = (targetValue/1501)\n currentValue = currentValue + granularitiy; // Granularity\n if (currentValue >= targetValue + granularitiy) {\n moving = false;\n currentValue = 0;\n clearInterval(timer);\n playButton.text(\"Play\");\n }\n if(currentValue < 0)\n currentValue = 0;\n}", "function nextLevel() {\r\n\tlet d = new Date();\r\n\tlet timeElapsed = d.getTime() - n - instructionDisplayTime;\r\n\t\r\n\tif (timeElapsed > (levelTime + 1) + curretLevels*(levelTime + waitLevelTime)) {\t\t\r\n\t\tcurretLevels += 1;\r\n\t\t\r\n\t\t// increase difficulty\r\n\t\tballNumber += 1;\r\n\t\tballRadius += 1;\r\n\t\t\r\n\t\tapp.ticker.stop();\r\n\t\t\r\n\t\t// stop for waitLevelTime milliseconds\r\n\t\tlet dd = new Date();\r\n\t\tlet timer = dd.getTime() - d.getTime();\r\n\t\twhile (timer < waitLevelTime) {\r\n\t\t\tlet dd = new Date();\r\n\t\t\ttimer = dd.getTime() - d.getTime();\r\n\t\t}\r\n\t\t\r\n\t\t// clean the screen\r\n\t\tfor (let i = app.stage.children.length - 1; i >= 0; i--) {\r\n\t\t\tapp.stage.removeChild(app.stage.children[i]);\r\n\t\t};\r\n\t\t\r\n\t\tapp.ticker.start();\r\n\t\t\r\n\t\t// make levelInfoText invisible during the game\r\n\t\tlevelText.alpha = 0;\r\n\t\trepeat();\r\n\t};\r\n}", "function userTick(delta, time) {\n}", "function faster() {\n if (stepDelay <= MIN_DELAY) { return; }\n stepDelay /= 2;\n }", "function physics_hanlder() {\r\n\tvar currentTime = (new Date).getTime();\r\n\ttimeElapsed = currentTime - startTime;\r\n\tvar dt = lastTime ? (timeElapsed - lastTime) / 1000 : 0;\r\n dt = Math.min(1 / 10, dt);\r\n world.step(timeStep);\r\n}", "incrementTroops(tickStartTime){\n //Adds troops based on time not tick\n var troopsToAdd = 0;\n if(tickStartTime - this.lastTroopIncTime >= 500){\n troopsToAdd = Math.floor((tickStartTime -this.lastTroopIncTime)/100); //return to 500\n this.lastTroopIncTime = tickStartTime - (tickStartTime%500);\n }\n\n if(troopsToAdd > 0){\n\n for(var i = 0; i < this.playerPool.activePlayers.length; i++) {\n this.playerPool.activePlayers[i].incrementArmies(troopsToAdd, this.center, this.radius);\n }\n }\n }", "function timerTick() {\n\n\t\t\tif ($scope.delta > 0) {\n\t\t\t\tvar factor = $scope.delta / 100 * 3;\n\t\t\t\t$scope.delta -= (1 + factor);\n\t\t\t\tif ($scope.delta < 0) $scope.delta = 0;\n\t\t\t}\n\t\t\t\n\t\t\t// Check stats\n\t\t\tif ($scope.delta > 70 && $scope.userLevel.stars < 3) {\n\t\t\t\t$scope.userLevel.stars = 3;\n\t\t\t\tconsole.log(\"Gold medal awarded\");\n\t\t\t}\n\t\t\tif ($scope.delta > 50 && $scope.userLevel.stars < 2) {\n\t\t\t\t$scope.userLevel.stars = 2;\n\t\t\t\tconsole.log(\"Silver medal awarded\");\n\t\t\t}\n\t\t\tif ($scope.delta > 30 && $scope.userLevel.stars < 1) {\n\t\t\t\t$scope.userLevel.stars = 1;\n\t\t\t\tconsole.log(\"Bronze medal awarded\");\n\t\t\t}\n\t\t\tconsole.log(\"Timer... delta: \" + $scope.delta);\n\n\n\t\t}", "function litres(time) {\n return Math.floor(time*.5)\n\n}", "function litres(time) {\n var litre=.5;\n return Math.floor(time*litre); ;\n}", "getLastTick() {\n\t\tlet lastTick = 0;\n\t\tconst check = (tick) => { if(lastTick < tick) lastTick = tick; }\n\t\tconst checkTree = (tree) => { const last = tree.last(); if(last) check(last.y+last.l); };\n\n\t\tif(this.note){\n\t\t\tif(this.note.bt) this.note.bt.map(checkTree);\n\t\t\tif(this.note.fx) this.note.fx.map(checkTree);\n\t\t\tif(this.note.laser) this.note.laser.map(checkTree);\n\t\t}\n\n\t\tif(this.beat) {\n\t\t\tcheckTree(this.beat.bpm);\n\n\t\t\tif(this.beat.time_sig && this.beat.time_sig.length > 0) {\n\t\t\t\tconst tickPerWhole = (this.beat.resolution || 240) * 4\n\t\t\t\tlet measureTick = 0;\n\t\t\t\tlet prevMeasureInd = 0;\n\t\t\t\tlet prevMeasureLen = tickPerWhole\n\n\t\t\t\tthis.beat.time_sig.forEach((sig) => {\n\t\t\t\t\tmeasureTick += (sig.idx - prevMeasureInd) * prevMeasureLen;\n\t\t\t\t\tprevMeasureInd = sig.idx;\n\t\t\t\t\tprevMeasureLen = sig.v.n * tickPerWhole / sig.v.d;\n\t\t\t\t});\n\n\t\t\t\tcheck(measureTick);\n\t\t\t}\n\n\t\t\tif(this.beat.scroll_speed && this.beat.scroll_speed.length > 0) {\n\t\t\t\t// TODO: check scroll speed\n\t\t\t}\n\t\t}\n\n\t\treturn lastTick;\n\t}", "powerUpScoreTimes2() {\r\n if (this.powerUps.isActive(ScoreTimes2) && this.powerUps.hitPaddle) {\r\n let tempColor = '#ffffff';\r\n\r\n if (this.ball.time < 6) {\r\n tempColor = '#e84833';\r\n }\r\n\r\n this.systemG.displayTimerScore2X(tempColor, this.ball.time, this.ball.pos);\r\n\r\n if (frameCount % 30 == 0) {\r\n this.ball.time--;\r\n }\r\n\r\n if (this.ball.time < 0) {\r\n this.ball.time = 15;\r\n this.powerUps.setPowerUp(ScoreTimes2, false);\r\n }\r\n }\r\n }", "function litres(time) {\n return Math.floor(time * 0.5)\n}", "function tick() {\n\n\n\n}", "function speedier() {\n //if (distance % 200 == 0 && distance != 0 && frameCount % 20 == 0) {\n if (meteorFrequency > 18) {\n meteorFrequency = round(meteorFrequency*.82);\n }\n //console.log(\"adding speed\");\n //console.log(\"Meteor Frequency: \" + meteorFrequency)\n //}\n}", "slowDown() {\n this.mag -= 1;\n }", "function startTimer() {\n setInterval(() => {\n // will make all powers slowly rise\n game.clickPower += game.clickPower.toFixed() * game.passivePower;\n game.comboPower += game.comboPower.toFixed() * game.passivePower;\n //game.passivePower += game.passivePower * game.passivePower / 2;\n clickPower.textContent = game.clickPower.toFixed();\n comboPower.textContent = game.comboPower.toFixed();\n //passivePower.textContent = Math.round(game.passivePower);\n }, 1000);\n}", "function inc_speed()\n{\n if(speed == speed_normal)\n speed = speed_fast;\t\n}", "function firstTick(context)\n {\n if (secsRemaining == 0)\n {\n secsRemaining = SECS_IN_COMPLETE_CYCLE;\n }\n if (secsRemaining <= SECS_IN_LOBBY)\n {\n firstLobbyTick(context);\n }\n else\n {\n firstPlayTick(context);\n }\n logNow('firstTick():\\ttimer: ' + currentTimerInterval + 'ms\\t' + secsRemaining + '\\t');\n secsRemaining--;\n }", "function timeTick() {\t\n\tif (messagetime != 0) {\n\t\tmessagetime--;\n\t}else{\n\t\tdocument.getElementById(\"fightmess\").innerHTML = \"\";\n\t}\n\tif (manualmessagetime != 0) {\n\t\tmanualmessagetime--;\n\t}else{\n\t\tdocument.getElementById(\"action\").innerHTML = \"&nbsp; <br> &nbsp;\";\n\t}\n\tif (deadmonsterflag == false){\n\t\tcalculatePower();\n\t\tif (power > 0)\n\t\t\tfightmonster();\t\t\t\n\t} else { power = 0; }\n\tupdatesaves();\n\tprintall();\t\n\tsetupHeroes();\n \ttickCount++;\t\t\n}", "function regionspeeds() {\n \n if(currentbeat > (part1 + part2 +part3 +part4 + part5 + part6)){\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n } else if(currentbeat > (part1 + part2 +part3 +part4 + part5 +part6 - 4)){\n huegreen = true;\n }else if(currentbeat > (part1 + part2 +part3 +part4 + part5)){\n huered = false;\n huegreen = false;\n bpm = obpm * 1.25;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > (part1 + part2 +part3 +part4 + part5 -4)){\n huered = true;\n }else if(currentbeat > (part1 + part2 +part3 +part4 )){\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > (part1 + part2 +part3 +part4 - 4)){\n huegreen = true;\n }else if(currentbeat > (part1 + part2 +part3)){\n huered = false;\n huegreen = false;\n bpm = obpm * 1.25;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > (part1 + part2 +part3 - 4)){\n huered = true;\n }else if(currentbeat > (part1 + part2)){\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n //#b00035\n }else if(currentbeat > (part1 + part2 - 4)){\n huegreen = true;\n }else if(currentbeat > part1){\n huered = false;\n huegreen = false;\n bpm = obpm * 1.25;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > part1 - 4){\n huered = true\n }else {\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }\n}", "overTime(){\n\t\t//\n\t}", "function UNIVERSAL_LINEAR (plank_duration) {\n return plank_duration + UNIVERSAL_CONSTANT(plank_duration); // electron, qubit, super_plank stars, (1d projection into 2d spacetime)\n } // \"I want to build a Taj Mahal that will never get its last tile.\"", "updateLevel() { \n let result = Math.floor(this.score / 100);\n if (result > this.level) {\n this.level = result;\n document.querySelector('.display-level h1').innerHTML = this.level; \n\n if (this.currentSpeed != 100) {\n this.currentSpeed -= 100;\n }\n clearInterval(this.interval);\n this.interval = window.setInterval(() => {main()}, this.currentSpeed); \n console.log(this.currentSpeed); \n }\n }", "tick () {\n this.lookAhead();\n // here we need to look ahead a small ? amount of time and schedule the next few sounds\n this.time = this.audioContext.currentTime;\n this.position = this.time - this.barStartTime;\n if (this.position > this.secondsPerBar) {\n // start a new bar\n this.position = this.position - this.secondsPerBar;\n this.barStartTime = this.time - this.position;\n }\n //console.log(this.time, this.position, this.secondsPerBar);\n this.to = setTimeout(this.tick.bind(this), 10);\n }", "function adjustTicks(evt, obj) {\n //Using adjustTM attribute to adjust the \n //number of major ticks to a best feasible value\n if(adjustTickCB.checked) {\n cpuGauge.setChartAttribute('adjustTM', 1);\n }\n else{\n cpuGauge.setChartAttribute('adjustTM', 0);\n }\n }", "judgeHolds(delta, currentAudioTime, beat, tickCounts) {\n\n\n this.activeHolds.cumulatedHoldTime += delta ;\n\n\n this.activeHolds.timeCounterJudgmentHolds += delta ;\n\n const secondsPerBeat = 60 / this.composer.bpmManager.getCurrentBPM() ;\n\n const secondsPerKeyCount = secondsPerBeat/ tickCounts ;\n\n const numberOfHits = Math.floor(this.activeHolds.timeCounterJudgmentHolds / secondsPerKeyCount ) ;\n\n\n // console.log(numberOfPerfects) ;\n\n\n if ( numberOfHits > 0 ) {\n\n\n let aux = this.activeHolds.timeCounterJudgmentHolds ;\n const remainder = this.activeHolds.timeCounterJudgmentHolds % secondsPerKeyCount;\n this.activeHolds.timeCounterJudgmentHolds = 0 ;\n\n\n const difference = Math.abs((this.activeHolds.lastAddedHold.beginHoldTimeStamp) - currentAudioTime) ;\n // case 1: holds are pressed on time\n if (this.areHoldsBeingPressed()) {\n\n this.composer.judgmentScale.animateJudgement('p', numberOfHits);\n this.composer.animateTapEffect(this.activeHolds.asList());\n // case 2: holds are not pressed. we need to give some margin to do it\n } else if (this.activeHolds.beginningHoldChunk && difference < this.accuracyMargin ) {\n\n this.activeHolds.timeCounterJudgmentHolds += aux -remainder ;\n\n // case 3: holds are not pressed and we run out of the margin\n } else {\n // TODO: misses should not be in the same count.\n this.composer.judgmentScale.miss() ;\n this.activeHolds.beginningHoldChunk = false ;\n }\n\n\n this.activeHolds.timeCounterJudgmentHolds += remainder;\n\n }\n\n\n }", "maxOutTimeTicker() {\r\n this.timeTicker = this.maxTime - 1;\r\n }", "timeDilation(){\r\n if(game.global.timeDilation > 0){\r\n console.log(\"Beginning time dilation!\");\r\n game.global.timeDilation += 0.1;\r\n console.log(game.global.timeDilation);\r\n } else {\r\n console.log(\"Max time dilation reached!\");\r\n }\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}", "function gameSlow() {\n setInterval(oneFrame, 300);\n setInterval(buff6s, 12000);\n}", "function circleFaster(){\n zoffChange = zoffChange + 0.005;\n}", "function addTicks() {\n\t\t// Add a tick for preparation time\n\t\tif ( times[0].time > 0 && elapsed < times[0].time ) {\n\t\t\tdrawTick( times[0].time );\n\t\t}\n\t\tif ( times[2].time > 0 && elapsed < (totalTime - times[2].time) ) {\n\t\t\tdrawTick( totalTime - times[2].time );\n\t\t}\n\t}", "increaseSpeedFall(){\n\t\t// if(this.breakedLine >= NB_OF_LINES_TO_BREAK_TO_SPEED_UP){\n\t\t// \tthis.speedPoint++;\n\t\t// \tthis.breakedLine-= NB_OF_LINES_TO_BREAK_TO_SPEED_UP;\n\t\t// }\n\n\t\tthis.speedPoint = Math.trunc(this.breakedLine/NB_OF_LINES_TO_BREAK_TO_SPEED_UP);\n\n\t\ttrace(\"SPEED POINT\", this.speedPoint);\n\n\t\t//this.mvc.controller.tick = STARTING_TICK - (this.speedPoint*10);\n\n\t\tthis.mvc.controller.tick = STARTING_TICK * 1/(this.speedPoint + 1);\n\n\t\ttrace(\"this.mvc.controller.tick\", this.mvc.controller.tick);\n\t}", "function timePenalty() {\n timeRem =- 5;\n}", "function speedUpdate() {\n\tvar r = this.rotation;\n\tif (r < 0) {\n\t\tspeed = 1+(r/150);\n\t} else {\n\t\tspeed = (r/25)+1;\n\t} \n\ttl.timeScale(speed.toFixed(2));\n}", "tick() {\n \n }", "function GenerateSpeed(link, oldLink, yaxis) {\n\n//console.log(link, oldLink, yaxis);\n\n\n\n\t\tfunction difference(a, b) {\n\t\t return (a - b);\n\t\t}\n\t\tfunction difference2(a, b) {\n\t\t return (b - a);\n\t\t}\n\t\t//console.log(\" - - - - - - \" +\n\t //\t\t\t\"oldLink \"+\toldLink\n\t //\t\t\t);\n\t if ( link === oldLink) {\n\t //console.log(\"same\");\n\n\t \tstopMotionVideo();\n\t \tbackToMotionMain();\n\t \tbackToInteractiveMain();\n\n\t return false;\n\t } //else\n\t if ( difference(oldLink, link) == 1 ) {\n\t speed = time*2;\n\t easy = Power3.easeInOut;\n\t //console.log(\"DOWN\");\n\t } else\n\t if ( difference2(oldLink, link) == 1 ) {\n\t speed = time;\n\t easy = Power1.easeInOut;\n\t if ( link >= 1 ){\n\t \t\tspeed = 2 + (0.75*link);\n\t \teasy = Power2.easeInOut;\n\t \t} \n\t //console.log(\"UP\");\n\t } //else\n\n\t if ( difference(oldLink, link) == 2 ) {\n\t speed = time*3;\n\t easy = Power3.easeInOut;\n\t } else\n\t if ( difference2(oldLink, link) == 2 ) {\n\t speed = time*2;\n\t easy = Power1.easeInOut;\n\t if ( link >= 2 ){\n\t \t\tspeed = 3 + (0.75*link);\n\t \teasy = Power2.easeInOut;\n\t \t} \n\t } //else\n\n\n\n\t if ( difference(oldLink, link) == 3 ) {\n\t speed = time*4;\n\t easy = Power3.easeInOut;\n\t } else\n\t if ( difference2(oldLink, link) == 3 ) {\n\t speed = time*3;\n\t easy = Power1.easeInOut;\n\t if ( link >= 3 ){\n\t \t\tspeed = time*4 + (0.75*link);\n\t \teasy = Power2.easeInOut;\n\t \t} \n\t } //else\n\n\t if ( difference(oldLink, link) == 4 ) {\n\t speed = time*5;\n\t easy = Power3.easeInOut;\n\t } else\n\t if ( difference2(oldLink, link) == 4 ) {\n\t speed = time*4;\n\t easy = Power1.easeInOut;\n\t if ( link >= 4 ){\n\t \t\tspeed = time*5 + (0.75*link);\n\t \teasy = Power2.easeInOut;\n\t \t} \n\t } //else\n\n\t if ( difference(oldLink, link) == 5 ) {\n\t speed = time*6;\n\t easy = Power3.easeInOut;\n\t } else\n\t if ( difference2(oldLink, link) == 5 ) {\n\t speed = time*5;\n\t easy = Power1.easeInOut;\n\t if ( link >= 4 ){\n\t \t\tspeed = time*6 + (0.75*link);\n\t \teasy = Power2.easeInOut;\n\t \t} \n\t }\n\n\t // Test the variables\n\t // console.log(\" - - - - - - \" +\n\t // \t\t\t\"link \" +\tlink, \n\t // \t\t\t\", speed \"+\tspeed, \n\t // \t\t\t\", yaxis \"+\tyaxis,\n\t // \t\t\t\", ease \"+\teasy\n\t // \t\t\t);\n\n\t GoToLink(link, speed, yaxis, easy);\n\t metroClick(link, speed);\n\t}", "calcTime () {\n this.time = Math.max(0.1, Math.min(Math.abs(this.scrollY - this.scrollTargetY) / this.speed, 0.8))\n }", "function timeUpdate() {\n timeEngaged += delta();\n}", "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin)}return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}", "function reduceTime() {\n timeLeft = timeLeft - 10;\n}", "function getScore2(t) {\n var nextfrompressed = lastPressed + tempo_ms;\n var halftemp = tempo_ms/2.0;\n var leftmin = nextfrompressed - halftemp;\n var rightmin = nextfrompressed + halftemp;\n if(t <= nextfrompressed) {\n var x = t - leftmin;\n var slope = 1.0/halftemp;\n var rv = Math.max(0, x*slope);\n console.log('before optimal, rv is ' + rv);\n return rv;\n } else {\n var x = t - rightmin;\n var slope = -1.0/halftemp;\n var rv = Math.max(0, x*slope);\n console.log('after optimal, rv is ' + rv);\n return rv;\n }\n}", "function gameSpeed(level)\n{\n return 300-(12 * level);\n}", "bhv_flank() {\n if (this.bhv_time == 1) {\n console.log(\"flank\");\n this.dash_dist = Math.abs(this.pos[0] - playerInstance.pos[0]);\n }\n this.accel = this.dash_dist * 0.03;\n\n\n if (this.bhv_time >= 17) {\n this.behavior = this.bhv_normal;\n this.bhv_time = Math.floor( 31 + Math.random() * 10 );\n }\n }", "function adapt(delta, numPoints, firstTime) {\n \t\t\t\tvar k = 0;\n \t\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n \t\t\t\tdelta += floor(delta / numPoints);\n \t\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n \t\t\t\t\tdelta = floor(delta / baseMinusTMin);\n \t\t\t\t}\n \t\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n \t\t\t}", "function get_MET(speed) {\n if ( 1 <= speed && speed < 3) {\n return 2;\n } else if ( 3 <= speed && speed < 4.1) {\n return 2.5;\n } else if ( 4.1 <= speed && speed < 5.1) {\n return 3.2;\n } else if ( 5.2 <= speed && speed < 6.4) {\n return 4.4;\n } else if ( 6.5 <= speed && speed < 7.2) {\n return 5.2;\n } else if ( 7.3 <= speed && speed < 8) {\n return 7;\n } else if ( 8.1 <= speed && speed < 9.6) {\n return 9;\n } else if ( 9.7 <= speed && speed < 10.7) {\n return 10.5;\n } else if ( 10.8 <= speed && speed < 11.2){\n return 11;\n } else if ( 11.3 <= speed && speed < 12.8){\n return 11.6;\n } else if ( 12.9 <= speed && speed < 13.8){\n return 12.3; \n } else if ( 13.9 <= speed && speed < 14.4){\n return 12.8; \n } else if ( 14.5 <= speed && speed < 16){\n return 14.5; \n } else if ( 16.1 <= speed && speed < 17.7){\n return 16; \n } else if ( 17.8 <= speed && speed < 19.3){\n return 19;\n } else if ( 19.4 <= speed && speed < 20.9){\n return 19.8; \n } else if ( 21 <= speed && speed < 22.5){\n return 23; \n } else {\n return 1;\n }\n}", "function LevelSystem(){\n level = Math.floor(lineCounter/ 5) + 1;\n if(artAgent ==false){\n originalTimeStep = 0.3 - ((level -1) * 0.05);\n }\n evaluateMove(\"line\");\n}", "function circleSlower(){\n zoffChange = zoffChange - 0.005;\n}", "gainEnergy() {\n setInterval(() => {\n this.energy += this.tickEnergy;\n const rand = Math.random() * 100;\n if (rand > 97 && this.tickEnergy === 5) {\n this.energy += 20;\n }\n }, 750);\n }", "function tickPlayerFireRate(dt)\n\t{\n\t\tpPFireRateCounter -= dt;\n\t\tif(pPFireRateCounter < 0)\n\t\t{\n\t\t\tpPFireRateCounter = 0;\n\t\t}\n\t}", "function nextLevelXP() {\n if( character.level < 11 ) {\n return ( 40 * character.level * character.level ) + ( 360 * character.level );\n }\n if( character.level >= 11 ) {\n return ( 0.4 * character.level * character.level * character.level )\n + ( 40 * character.level * character.level )\n + ( 396 * character.level );\n }\n }", "function tick() {\r\n now = window.performance.now();\r\n delta = (now-last); // in milliseconds\r\n if(t_cooldown>0) {\r\n t_cooldown -= delta*dcd;\r\n } else {\r\n t -= delta*dt;\r\n }\r\n t = t<0 ? 0 : t;\r\n last = now;\r\n\r\n // Update fps counter\r\n fhStart = (fhStart+1)%100;\r\n fhEnd = (fhEnd+1)%100;\r\n frameHistory[fhEnd] = now;\r\n fpsElement.textContent = Math.ceil( 1000.0*frameHistory.length/(now-frameHistory[fhStart]) )\r\n }", "function damageToTime(damage) {\n damage += 1;\n return (Math.log(Math.log(damage)) / Math.E + 1) / 2;\n}", "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(; /* no initialization */delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}", "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(; /* no initialization */delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}", "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(; /* no initialization */delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}", "function timersweep() {\n let t0, t1 = timerqueueHead, time = Infinity;\n\n while (t1) {\n if (t1.f) {\n t1 = t0 ? t0.n = t1.n : timerqueueHead = t1.n;\n } else {\n if (t1.t < time) {\n time = t1.t;\n }\n t1 = (t0 = t1).n;\n }\n }\n timerqueueTail = t0;\n return time;\n}", "tick() {\n (this._HEALTH_LEVEL += 6), (this._BLOOD_LEVEL += 6);\n if (this._HEALTH_LEVEL >= 100) this._HEALTH_LEVEL = 100;\n if (this._BLOOD_LEVEL >= 100) this._BLOOD_LEVEL = 100;\n }", "function msPerTick(speed) {\n return 1000.0/speed;\n }", "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;/* no initialization */delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}", "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;/* no initialization */delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}", "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;/* no initialization */delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}", "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;/* no initialization */delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}", "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;/* no initialization */delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}", "_calculateElapsedTimeFromLevel() {\n\t\tif (this.level < 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this.level >= 0 && this.level <= 18) {\n\t\t\treturn this.timePerAnimation[this.level];\n\t\t}\n\t\telse if (this.level >= 19 && this.level <= 28) {\n\t\t\treturn this.timePerAnimation[19];\n\t\t}\n\t\telse {\n\t\t\treturn this.timePerAnimation[29];\n\t\t}\n\t}", "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (\n ;\n /* no initialization */ delta > (baseMinusTMin * tMax) >> 1;\n k += base\n ) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + ((baseMinusTMin + 1) * delta) / (delta + skew));\n }", "delay(ctx) {\n if (ctx.type !== \"data\" || ctx.xStarted) {\n return 0;\n }\n ctx.xStarted = true;\n return ctx.index * delayBetweenPoints;\n }", "function increase() {\n setSeconds(seconds => seconds + 1)\n if (isSingle) setElixir(elixir => add_or_max(elixir, (1 / SINGLE_RATE), 10))\n else if (isDouble) setElixir(elixir => add_or_max(elixir, (1 / DOUBLE_RATE), 10))\n else if (isTriple) setElixir(elixir => add_or_max(elixir, (1 / TRIPLE_RATE), 10))\n }", "function Update () {\n\tif(currHealth < health && Time.time > healthTime)\n\t{\n\t\tcurrHealth++;\n\t\thealthTime = Time.time + healthRate;\n\t}\n}", "function handleTick() \r\n\t{\t// This function is called at FPS speed. i.e. 60FPS (60 times per second)\r\n\t\t// All processing done here is critical\r\n\t\tif (!pause)\r\n\t\t{\t\r\n\t\t\tsoundOne.drawThis(); // Get analyzer data from the audio object\r\n\t\t\tline.graphics.clear(); // Clear previous line\r\n\t\t\tline.graphics.setStrokeStyle(1); // Set line width attribute\r\n\t\t\tline.graphics.beginStroke('rgba(255, 255, 255, 0.15)'); // set line color\r\n\t\t\tline.graphics.moveTo (25, 75 + (225 / 2)); // Place the line in some point of the canvas\r\n\r\n\t\t\tif (firstDraw)\r\n\t\t\t{\t\r\n\t\t\t\ttargetArray.fill(0);\r\n\t\t\t\tcontrolArray.fill(0);\r\n\r\n\t\t\t\tfirstDraw = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (++Ncounter > 4)\r\n\t\t\t{\t\r\n\t\t\t\tfor (var i = 0; i < soundOne.dataArray.length; ++i)\r\n\t\t\t\t{\r\n\t\t\t\t\tcontrolArray[i] = (soundOne.dataArray[i] - targetArray[i]) / 5;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tNcounter = 0;\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i = 25; i < (890 + 25); i ++) // Draw ponint to point\r\n\t\t\t{\t\r\n\t\t\t\ttargetArray[i] += controlArray[i];\r\n\t\t\t\tvar nValue = ((targetArray[i] - 128) * 1.3);\r\n\t\t\t\tif (nValue > 113){nValue = 113;}\r\n\t\t\t\telse if(nValue < -111){nValue = -111}\r\n\r\n\t\t\t\tline.graphics.lineTo (i, ((225 / 2) + 75) + nValue);\r\n\t\t\t}\r\n\t\t\tstage.update();\t\r\n\t\t}\r\n\t}", "tick() {\n }", "function adapt(delta, numPoints, firstTime) {\n var k = 0\n delta = firstTime ? floor(delta / damp) : delta >> 1\n delta += floor(delta / numPoints)\n for (\n ;\n /* no initialization */ delta > (baseMinusTMin * tMax) >> 1;\n k += base\n ) {\n delta = floor(delta / baseMinusTMin)\n }\n return floor(k + ((baseMinusTMin + 1) * delta) / (delta + skew))\n}", "function speedIncrease() {\n if (score < 2500 && cnvsWidth < 600) {\n speed += 0.002;\n } else if (score < 2500 && cnvsWidth < 1200) {\n speed += 0.005;\n } else if (score < 2500) {\n speed += 0.007;\n } else if (score < 5000 && cnvsWidth < 600) {\n speed += 0.001;\n } else if (score < 5000 && cnvsWidth < 1200) {\n speed += 0.002;\n } else if (score < 5000) {\n speed += 0.002;\n } else if (score < 7500 && cnvsWidth < 600) {\n speed += 0.0005;\n } else if (score < 7500 && cnvsWidth < 1200) {\n speed += 0.0002;\n } else if (score < 7500) {\n speed += 0.001;\n }\n}", "function litres(time) {\n return Math.floor(time / 2)\n}", "update(timestep, dt) {\n this.pushBar.clear()\n //lost of energy===>\n this.energy-=this.lost_factor*dt/1000\n\n //correction of energy ever >=0\n if(this.energy<=0){\n this.energy=0\n }\n //lost of energy===>\n \n let efactor=this.energy*320/100\n\n //update position of hammer in function of energy\n this.hammer.x=this.x\n this.hammer.y= this.y-efactor\n\n this.pushBar.fillStyle(0x990099, 0.8);\n this.pushBar.fillRect(this.x-24, this.y-efactor,48,efactor);\n }", "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "function checkTime() {\n self.time--;\n $('.time .value').html(self.time);\n if (self.time<=0) {\n console.log(self.intervalID);\n self.progress+=10;\n self.lives--;\n $('canvas').css('background-color','rgba(233, 72, 88, 0.1)');\n setTimeout(function() { self.nextTurn(); }, 300);\n }\n }", "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (;delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "undot() {\n\t\tthis._ticks = Math.floor(\n\t\t\t(this.beats - (this.beats/2)) * Duration.TICKS_PER_BEAT\n\t\t);\n\t\treturn this.beats;\n\t}", "function checkOnTick(event, tp, wp, EP, radStart){\n // this function checks the logic loop every MSTICK seconds\n // only checks timing things - interaction with objects should be\n // added with addEventListener in a easeljs object's construction\n if (wp.trialSection==='goToStart'){\n var pxMouse = stage.mouseX;\n var pyMouse = stage.mouseY;\n var inStartPoint = withinRad(pxMouse, pyMouse, tp.pxStart, tp.pyStart,\n radStart);\n if(inStartPoint){\n var tNow = getTime();\n if(tNow - wp.tInStart > EP.MSMINTIMEINSTART){\n setup_makeChoice();\n }\n }\n } // end goToStart\n else if (wp.trialSection==='makeChoice'){\n if(EP.MSMAXTIMETOCHOICE !== null){ // if choice time constraint\n var tNow = getTime();\n if(tNow - wp.tChoiceStarted > EP.MSMAXTIMETOCHOICE){\n setup_tooSlow();\n }\n }\n } // end makeChoice\n else if (wp.trialSection==='showFeedback'){\n var tNow = getTime();\n if(tNow - wp.tFeedbackOn > EP.MSSHOWFEEDBACK){\n setup_nextTrial();\n }\n }\n else if (wp.trialSection==='tooSlow'){\n var tNow = getTime();\n if(tNow - wp.tTooSlow > EP.MSTOOSLOW){\n msgs.tooSlow.visible = false;\n setup_goToStartPoint();\n }\n } // end tooSlow\n stage.update(event);\n }", "newPowerLevel(heat) {\n let base = Math.ceil((1 + Math.random()) * 100);\n let level = Math.pow(base, 1 + heat / 1200);\n if(level > 1000000000000000000) level = 1000000000000000000; // JS craps out if we go higher than this\n return level;\n\t}", "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "function cpuAttackDelay() {\n setTimeout(function () {\n playRandomSnippet();\n specialBar(cpuSpecialBar, cpuHitCounter);\n cpuImg.setAttribute('class', 'r-swing black-border-fifty');\n determineHealthPercent(playerBattleH, playerH100, playerHBar);\n remSwing(cpuImg);\n }, 500);\n}", "function toggle_speed() {\n step = 0;\n can_poll = true;\n can_update = false;\n NUM_STEPS = NUM_STEPS == SLOW_NUM_STEPS ? FAST_NUM_STEPS : SLOW_NUM_STEPS;\n}", "function checkLevel(){\r\n let r = Math.floor(lines / 10) + 1\r\n if(r > level) {\r\n level = r\r\n }\r\n adjustDropSpeed()\r\n}", "processTick(time) {\n if (this.isPaused() || this.isGameOver()) {\n return;\n }\n if (this.lastTick === undefined) {\n this.lastTick = time;\n }\n const delta = time - this.lastTick;\n this.lastTick = time;\n this.countdown = this.countdown - delta;\n this.logger.info(\n `cd ${this.countdown}, tickTime: ${time}, delta: ${delta}`\n );\n if (this.countdown > 0) {\n return;\n }\n if (this.countdown <= 0) {\n this.logger.info('showing tick!');\n }\n this.countdown = this.getCountdown();\n if (!this.hasActivePiece()) {\n if (this.canSpawnNextPiece()) {\n this.addPiece();\n return;\n } else {\n this.endGame();\n return false;\n }\n }\n if (this.canFall()) {\n this.movePiece(moveMap['ArrowDown']);\n } else {\n this.commit();\n }\n }" ]
[ "0.6516718", "0.6267585", "0.6107849", "0.60959536", "0.6085638", "0.6081939", "0.6004342", "0.6003031", "0.59818655", "0.5981733", "0.5955449", "0.5951528", "0.59436154", "0.5934066", "0.5903567", "0.58936775", "0.5880527", "0.58787745", "0.5865957", "0.58481747", "0.58373266", "0.58286685", "0.5819102", "0.5810336", "0.58026", "0.5801884", "0.5784575", "0.5779406", "0.57679933", "0.5753981", "0.57515407", "0.5719748", "0.57070553", "0.5706641", "0.5702144", "0.56865394", "0.56611025", "0.56466556", "0.5626878", "0.56104004", "0.5607439", "0.5597883", "0.5590611", "0.55871207", "0.5583446", "0.5583095", "0.5578028", "0.5573018", "0.5572311", "0.55720687", "0.55655354", "0.5564358", "0.55638206", "0.55634946", "0.5560391", "0.55554557", "0.55458605", "0.55379456", "0.55334556", "0.5530029", "0.55290025", "0.551496", "0.5510493", "0.5507901", "0.55028635", "0.5498076", "0.54966605", "0.54919547", "0.54919547", "0.54919547", "0.5479994", "0.54769635", "0.5475997", "0.547453", "0.547453", "0.547453", "0.547453", "0.547453", "0.546815", "0.546545", "0.5464491", "0.54634523", "0.5461032", "0.54604703", "0.54522866", "0.543895", "0.54353976", "0.5433507", "0.54287744", "0.5428514", "0.5426663", "0.5422175", "0.54195213", "0.5413239", "0.5411795", "0.54104584", "0.54040754", "0.54036915", "0.5401493", "0.539635" ]
0.6856143
0
When the user clicks to struggle
function StruggleClick(SType, SDifficulty, SMessage, SDoneMessage, SX, SY, SRadius) { // If the user clicked on a struggling point if ((MouseX >= SX - SRadius) && (MouseX <= SX + SRadius) && (MouseY >= SY - SRadius) && (MouseY <= SY + SRadius)) { // If we must start a new struggling if ((SType != StruggleType) || (StruggleDifficultyShown == "")) { StruggleType = SType; StruggleDifficulty = SDifficulty; StruggleDifficultyShown = GetText(SDifficulty); StruggleMessage = SMessage; StruggleDoneMessage = SDoneMessage; StruggleX = SX; StruggleY = SY; StruggleRadius = SRadius; StruggleProgress = 0; StruggleDone = false; StruggleGetNextTick(); } // Raise the progress by 2 for each click, 100 is done if (StruggleProgress <= 0) StruggleProgress = 8; StruggleProgress = StruggleProgress + 2 + StruggleSkillBonus; if (StruggleProgress >= 100) { StruggleProgress = 100; StruggleDone = true; StruggleNextTick = CurrentTime + 6000; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function humanClicked(event)\n{\n if( origBoard[event.target.id] !== 'O' && origBoard[event.target.id] !== 'X' )\n {\n var status = gameAdvance(event.target.id,human);\n if(status==0 && !checkTie())\n {\n gameAdvance(bestSpot(),computer);\n }\n }\n}", "function noCheat(){\n console.log(\"already clicked!\");\n }", "function clickLearn() {\n\t$.trigger(\"clickLearn\");\n}", "function letterClick(){\n\t\tif (lives > 0){\n\t\t\t\tthis.classList.add(\"btn-danger\");\n\t\t\t\tthis.classList.remove(\"btn-primary\");\n\n\t\t\t\tvar letterClicked = this.getAttribute(\"data-letter\");\n\t\t\t\t\n\t\t\t\tif (solution.indexOf(letterClicked) !== -1){\n\t\t\t\t\tfor (var i = 0; i < solution.length; i++) {\n\t\t\t\t\t\tif (letterClicked === solution[i]){\n\t\t\t\t\t\t\tsolutionDisplay[i] = letterClicked;\n\t\t\t\t\t\t\tif (solutionDisplay.indexOf(\"_\") === -1) {\n\t\t\t\t\t\t\t\tif (hintCounter === 0){\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"instructions\").innerHTML = \"Awesome! You didn't even use help! Click 'Start' to try again!\";\n\t\t\t\t\t\t\t\t\t\tupdateSolutionDisplay();\n\t\t\t\t\t\t\t\t\t\tsolution.empty();\n\t\t\t\t\t\t\t\t\t} else if (hintCounter < 2){\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"instructions\").innerHTML = \"Awesome! You only needed a little help. Click 'Start' to try again!\";\n\t\t\t\t\t\t\t\t\t\tupdateSolutionDisplay();\n\t\t\t\t\t\t\t\t\t\tsolution.empty();\n\t\t\t\t\t\t\t\t\t} else if (hintCounter < 4){\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"instructions\").innerHTML = \"Not bad, but you used too much help. Click 'Start' to try again!\";\n\t\t\t\t\t\t\t\t\t\tupdateSolutionDisplay();\n\t\t\t\t\t\t\t\t\t\tsolution.empty();\n\t\t\t\t\t\t\t\t\t} else if (hintCounter < 10){\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"instructions\").innerHTML = \"Terrible! I gave you the answer! Click 'Start' to try again!\";\n\t\t\t\t\t\t\t\t\t\tupdateSolutionDisplay();\n\t\t\t\t\t\t\t\t\t\tsolution.empty();\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}\n\t\t\t\t\t}\t \n\t\t\t\t} else {\n\t\t\t\t\tlives--;\n\t\t\t\t\tif (lives === 0){\n\t\t\t\t\t\tgameOver();\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\tupdateLives();\n\t\t\t\t}\n\t\t\t\tupdateSolutionDisplay();\n\t\t} else {\n\t\t\tdocument.getElementById(\"instructions\").innerHTML = \"You have to click start to begin!\";\n\t\t}\n\t}", "function clickFunc() {\n if (!isStart) {\n initStart();\n } else if (!isPlayerWon && !isComputerWon) {\n count++;\n updateComputerInput();\n addToPlayerHistory(playerGuess.value);\n addToComputerHistory(computerGuess.value);\n checkWon();\n showMessage();\n resetBtn();\n clearInput();\n } else {\n initialGame();\n renderPlayerList();\n renderComputerList();\n initBtn();\n clearComputerInput();\n }\n}", "function takeCare (e) {\n\t//prevent from clicking more than one button at once\n\tif (press) return;\n\t//turn off default icons\n\tclearInterval(changeIcon);\n\tchangeIcon = 0;\n\tpress = true;\n\t//repeat function as long as user hold the button\n\tpressTimer = setInterval(function() {\n\t\tObject.entries( statistics ).forEach( ( [ name, value ] ) => {\n\t\t\tlet target = e.target;\n\t\t\tlet maxValue = parseFloat(document.querySelector( `#${ name }` ).max);\n\t\t\t//find stat of pushed button\n\t\t\tif (name === target.dataset.need){\n\t\t\t\t//increase value\n\t\t\t\tvalue++;\n\t\t\t\tif (value > maxValue) return;\n\t\t\t\tsetStat( name, value );\n\t\t\t\t//change icon depending on the stat\n\t\t\t\tswitch(name){\n\t\t\t\t\tcase 'eat':\n\t\t\t\t\t\tanimal.src = \"img/eat.png\";\n\t\t\t\t\t\teatNotify = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'cure':\n\t\t\t\t\t\tanimal.src = \"img/shower.png\";\n\t\t\t\t\t\tcureNotify = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'pet':\n\t\t\t\t\t\tanimal.src = \"img/laughing.png\";\n\t\t\t\t\t\tpetNotify = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdefaultMood();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}, 80);\n}", "function clickOn1(){if(goodAnswer == 1){ correctAnswerClick(1); }else{ badAnswerClick(1); }}", "techniquesClicked (){\n this.techniques.addEventListener('click',()=>{\n window.open(\"././links/advance_techniques/techniques.htm\");\n },false);\n }", "function clickResult(d, i) {\n\t\tchrome.runtime.sendMessage({method:'clickedGist', tab: activeTab, gist: d});\n\t}", "function mousedownEventListener(event) {\n if (clicked === false) {\n yNow = Math.round(stimulusYSize / PPU);\n\n // Training phase\n if (trialIndex < N / 2) {\n yTrue = yTrain[trialIndex - 1];\n // if they are wrong show feedback\n yTrainReported.push(yNow);\n feedback.attr({ y: 400 - yTrue * PPU, height: yTrue * PPU });\n feedback.show();\n feedback.animate({fill: \"#666\"}, 100, \"<\", function () {\n this.animate({fill: \"#CCC\"}, 100, \">\");\n });\n // Move on to next trial if response is correct.\n if(Math.abs(yNow - yTrue) < 4) {\n clicked = true;\n feedback.hide();\n stimulusX.hide();\n stimulusY.hide();\n Mousetrap.resume();\n }\n // Testing phase\n } else if (trialIndex <= N) {\n clicked = true;\n $(\"#training-or-testing\").html(\"Testing\");\n yTest.push(yNow);\n feedback.hide();\n stimulusX.hide();\n stimulusY.hide();\n Mousetrap.resume();\n }\n }\n}", "function StruggleLoad() {\n\tStruggleDone = false;\n\tStruggleProgress = 0;\n\tStruggleSkillBonus = PlayerGetSkillLevel(\"RopeMastery\");\n}", "function difficultySelect() {\r\n $('#easy-button').on('click', function(e) {\r\n $(`#easy-button`).remove();\r\n $(`#medium-button`).remove();\r\n $(`#hard-button`).remove();\r\n $(`#header`).remove();\r\n\r\n difficulty = \"easy\";\r\n temp = getSoundArray();\r\n \r\n renderImage();\r\n countdown();\r\n setupView();\r\n \r\n e.preventDefault();\r\n });\r\n\r\n $('#medium-button').on('click', function(e) {\r\n $(`#easy-button`).remove();\r\n $(`#medium-button`).remove();\r\n $(`#hard-button`).remove();\r\n $(`#header`).remove();\r\n\r\n difficulty = \"medium\"; \r\n temp = getSoundArray();\r\n\r\n renderImage();\r\n setupView();\r\n e.preventDefault();\r\n });\r\n\r\n $('#hard-button').on('click', function(e) {\r\n $(`#easy-button`).remove();\r\n $(`#medium-button`).remove();\r\n $(`#hard-button`).remove();\r\n $(`#header`).remove();\r\n\r\n difficulty = \"hard\";\r\n temp = getSoundArray();\r\n\r\n renderImage();\r\n setupView();\r\n \r\n\r\n e.preventDefault();\r\n });\r\n\r\n $('#easy-button').focus();\r\n readOutLoud(\"Easy\");\r\n}", "function C999_Common_Achievements_Click() {\n C999_Common_Achievements_ResetImage();\n\tClickInteraction(C999_Common_Achievements_CurrentStage);\n\tStopTimer(7.6666667 * 60 * 60 * 1000);\n}", "function C010_Revenge_SidneyJennifer_Click() {\t\n\n\t// Regular interactions\n\tClickInteraction(C010_Revenge_SidneyJennifer_CurrentStage);\n\t\n\t// The player can click on herself\n\tvar ClickInv = GetClickedInventory();\n\tif (ClickInv == \"Player\") {\n\t\tC010_Revenge_SidneyJennifer_IntroText = OverridenIntroText;\n\t\tC010_Revenge_SidneyJennifer_CurrentActor = CurrentActor; \n\t\tInventoryClick(ClickInv, CurrentChapter, CurrentScreen);\n\t}\n\t\n\t// The heroine can be restrained on stage 400\n\tif ((C010_Revenge_SidneyJennifer_CurrentStage == 38) && (ClickInv != \"\") && (ClickInv != \"Player\")) {\n\n\t\t// Both heroines react differently to the crop\n\t\tif ((ClickInv == \"Crop\") && !C010_Revenge_SidneyJennifer_CropDone) {\n\t\t\tC010_Revenge_SidneyJennifer_CropDone = true;\n\t\t\tActorChangeAttitude(-1, 1);\n\t\t}\n\n\t\t// Apply the clicked restrain\n\t\tActorApplyRestrain(ClickInv);\n\t\tOverridenIntroImage = \"\";\n\t\tC010_Revenge_SidneyJennifer_IsGagged = ActorIsGagged();\n\t\tif (C010_Revenge_SidneyJennifer_IsGagged) ActorSpecificSetPose(\"Jennifer\", \"Dog\");\n\t\tif (ClickInv == \"Crop\") OverridenIntroText = GetText(\"CropJennifer\");\n\n\t}\n\t\n}", "function listenForClick() {\n loopThroughGrid();\n clickTurnBtn();\n }", "function lastClicked() { \n // end the quiz and show the score\n console.log(\"last clik func active\");\n clearInterval(timeInterval);\n quiz.style.display = \"none\";\n\n //todo//\n }", "function interaction1() {\n window.location.href = `https://amdevito.github.io/211/interact/index.html`;\n}", "function InventoryItemMouthFuturisticHarnessPanelGagClick() {\n\tInventoryItemMouthFuturisticPanelGagClick();\n}", "function C005_GymClass_Intro_Click() {\n\tTextPhase++;\n\tif (TextPhase >= 5) {\n\t\tPlayerClothes(\"Judo\");\n\t\tCommon_SelfBondageAllowed = false;\n\t\tSetScene(CurrentChapter, \"Jennifer\");\t\t\n\t}\n}", "function johnHelpsHimself(action) {\r\n\tswitch (action) {\r\n\t\tcase 'explore':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Who knows sarcasim better than you \" + player.name + \" Lets take a peak\", 1000);\r\n\t\t\texploreship(gameobj.explore);\r\n\t\t\tgameobj.explore++;\r\n\t\tbreak;\r\n\r\n\t\tcase 'sit tight':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Good choice, Nothing passive aggression like more passive aggression!\", 1000);\r\n\t\t\tgameobj.sittight++;\r\n\t\tbreak;\r\n\t}\r\n}", "function hits() {\n \t$('.whack-bob').click(function() {\n if(checkSecret() == true) {\n ++score;\n score++;\n } else {\n score++; \n }\n \t\t$(this).hide();\n \t\tlaugh.play();\n \t\t$('.score').text('Your Score: ' + score);\n \t});\n }", "function bugClicked() {\n\tstate.larvae += state.clickRate;\n}", "function clickEgg() {\n if(eggCounter == 5) {\n serveSashimi(); \n } else {\n eggCounter += 1;\n changePic();\n }\n}", "function victory () {\n sug1.alpha = 0;\n sug2.alpha = 0;\n sug3.alpha = 0;\n sug4.alpha = 0;\n sug5.alpha = 0;\n\n game.paused = true;\n\n statoDolci = 3;\n dolciCompari();\n\n //restart on click function\n game.input.onTap.addOnce(function () {\n game.paused = false;\n game.state.restart();\n time = 0;\n ordine = 0;\n if( statoDolci == 3) {goRight();}\n else {statoDolci = 1;\n dolciCompari();\n game.paused = false;\n game.state.restart();\n }\n });\n}", "function memeclicker() {\n\tif( frame == 5 ) { frame = 0; }\n\t\telse { frame = frame + 1; }\n\tscore = score + 1;\n\tupdate_values();\n\tdocument.getElementById(\"ugandan\").firstChild.setAttribute(\"src\", \"frames/\" + frame + \".png\");\n}", "helpfulClick(event) {\n event.preventDefault();\n if (!this.state.helpfulHasBeenClicked) {\n this.setState({\n helpfulYes: this.state.helpfulYes + 1,\n helpfulHasBeenClicked: true\n })\n }\n }", "function victoryScreen() {\n winCounter++;\n winCounterField.innerHTML = winCounter;\n answerField.innerHTML = answer;\n hintField.innerHTML = hint;\n answerPic.setAttribute('src', `assets/img/${answer}.jpg`);\n}", "function click_incremental_event(event, robot) {\n var old_diff = event.difficulty;\n event.difficulty = Math.round(event.difficulty);\n click_base_event(event, robot);\n if (robot.dead) {\n event.difficulty = old_diff + 0.2;\n } \n}", "passPhase1Clicked() {\n \tthis.model.gamePhase = 2;\n \tthis.view.changeButtons(this.model.gamePhase);\n }", "function clicked(e) {\n // If the state is 1 then a score is added\n if(e.target.getAttribute('state') == 1) {\n info.score++;\n // Disable container\n e.target.setAttribute('state', 3);\n }\n // If the state is 2 reduce the lives\n else if(e.target.getAttribute('state') == 2) {\n info.lives--;\n // Disable the container\n e.target.setAttribute('state', 3);\n }\n else {\n //Not clickable\n }\n // Recalculate the level based on the aquired score\n info.level = ((info.score/50) | 0) + 1;\n // If all lives are lost the game finishes\n if(info.lives == 0) {\n updateGraphics();\n setTimeout(gameOver, 100);\n }\n // Update the graphics\n updateGraphics();\n}", "function chitClicked() {\n press(chitNumberOf(this));\n}", "function keyPressed() {\n if (can_click == true) {\n count_clicks++;\n $(story).text(count_clicks);\n\n if (count_clicks == 1) {\n myInterval(11);\n }\n }\n }", "function userTouchedContinue() {\n TileSum.game.state.start('Play');\n }", "function StruggleRun(NoStruggleMessage, StruggleStage) {\n\n\t// When the struggle timer ticks\n\tif (StruggleNextTick <= CurrentTime) {\n\t\t\n\t\t// If it's done, we call the done procedure from the calling module, if not we lower the struggle progress\n\t\tif (StruggleDone) {\n\t\t\tDynamicFunction(CurrentChapter + \"_\" + CurrentScreen + \"_StruggleDone()\");\n\t\t\tStruggleDone = false;\n\t\t\tStruggleProgress = 0;\n\t\t\tStruggleType = \"\";\n\t\t} else {\n\t\t\tStruggleProgress--;\n\t\t\tif (StruggleProgress < 0) StruggleProgress = 0;\n\t\t\tStruggleGetNextTick();\n\t\t}\n\t\t\n\t}\n\n\t// Draw the struggle scene\n\tStruggleDraw(NoStruggleMessage, StruggleStage);\n\n}", "function playGame(event) {\n let userChoice = event.target.innerText;\n let userChoiceIndex = userOptions.options.indexOf(userChoice);\n if (userChoiceIndex === -1) {\n alert('Unable to find to your choice!!!')\n }\n else {\n images[0].childNodes[1].classList = `fas ${userOptions.images[userChoiceIndex]}`;\n addAnimations();\n getResult(userChoiceIndex);\n removeClickEvents();\n }\n}", "function handleClick(event){\n counter ++ ;\n // console.log(event);\n // console.log(event.target.id);\n // 10 11\n // to make sure about the rounds ! 10\n // 10 11 \n if(maxAttempts >= counter){\n if(event.target.id === 'left-image'){\n Goat.globArr[leftIndex].votes++;\n }else if(event.target.id ==='right-image'){\n Goat.globArr[rightIndex].votes++;\n }\n renderTwoImages();\n }else{\n renderList();\n }\n}", "function handleClick(evt) {\n if (turn === 1) {\n evt.target.classList.add('puppy')\n } else if (turn === -1) {\n evt.target.classList.add('kitten')\n } else {\n return\n }\n turn *= -1;\n render();\n}", "onTutorialDone() {\n this.show();\n this.app.message('The tutorial is always available in the settings menu at the bottom right.',5000)\n }", "_onLiked() {\n Alert.alert('You Liked it')\n }", "function ggg() {\n var probDiv = document.getElementById(\"problem\");\n probDiv.classList.toggle(\"shift\")\n}", "function C001_BeforeClass_Sidney_Click() {\t\n\n\t// Regular interaction\n\tClickInteraction(C001_BeforeClass_Sidney_CurrentStage);\n\n\t// Special code for when the user wants to use the rope\n\tif ((C001_BeforeClass_Sidney_CurrentStage < 200) && (GetClickedInventory() == \"Rope\")) {\n\t\tC001_BeforeClass_Sidney_BackupStage = C001_BeforeClass_Sidney_CurrentStage;\n\t\tC001_BeforeClass_Sidney_CurrentStage = 200;\n\t\tOverridenIntroText = GetText(\"MyRopes\");\n\t}\n\t\n}", "function runClick() {\n\tdocument.querySelector('#play-again').onclick = newGame;\n}", "function ansClick(e) {\n if(qIndex >= (questions.length - 1)) {\n postScore();\n } else {\n var currentQuestion = questions[qIndex];\n var ansClick = e.target.textContent;\n if(ansClick.toLowerCase() === currentQuestion.answer.toLowerCase()) {\n currentScore+= 5;\n } else {\n time -= 10;\n currentScore -= 5;\n }\n qIndex++;\n getQuestion();\n };\n}", "function onButtonClicked(clicked_id) {\n // disable button so it can't be clicked again\n // document.getElementById(clicked_id).disabled = true;\n document.getElementById(currVect[clicks][0] + '_button').disabled = true;\n\n // Get clicked button emotion\n clicked_emotion = clicked_id.split(\"_\")[0];\n\n // compare against expected, change colour based on accuracy\n if (clicked_emotion == currVect[clicks][0]) {\n document.getElementById('selection_' + (clicks+1).toString()).textContent = clicked_emotion;\n qScore++;\n rawScore++;\n switch(clicks){ // give user points on a decreasing scale, with bonus points for all 5 right\n case 0:\n score += 2;\n case 1:\n score += 1;\n case 2:\n score += 1;\n case 3:\n score += 2;\n case 4:\n score += 1;\n if(qScore == 5){\n score += 10;\n }\n }\n document.getElementById('selection_' + (clicks+1).toString()).style = 'color: green;';\n } else {\n document.getElementById('selection_' + (clicks+1).toString()).textContent = currVect[clicks][0];\n document.getElementById('selection_' + (clicks+1).toString()).style = 'color: red;';\n }\n\n clicks++;\n setTimeout(function () { // timeout allows users to evaluate their inputs before page reloads\n // next image if ranking has been completed\n if (clicks >= emoteTypes.length) {\n clicks = 0;\n qScore = 0;\n questions++;\n if (questions >= numGames) { // move to scoring page if game complete\n showScore();\n }\n for (var i = 0; i < emoteTypes.length; i++) {\n document.getElementById(emoteTypes[i] + '_button').disabled = false;\n document.getElementById('selection_' + (i + 1).toString()).innerHTML = \"<br>\";\n document.getElementById('selection_' + (clicks+1).toString()).style = 'color: white;';\n }\n show_image();\n document.getElementById('current_pick').textContent = (clicks + 1).toString();\n }\n document.getElementById('current_pick').textContent = (clicks+1).toString();\n }, 50);\n}", "function helpJohn(action) {\r\n\r\n\r\n\tswitch (action) {\r\n\t\tcase 'explore':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Good choice, we can keep stealing stuff, sounds like that will take a while.\", 1000);\r\n\t\t\texploreship(gameobj.explore);\r\n\t\t\tgameobj.explore++;\r\n\t\tbreak;\r\n\r\n\t\tcase 'sit tight':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Good choice, Nothing puts me to sleep like the screems of my friends\", 1000);\r\n\t\t\tgameobj.sittight++;\r\n\t\tbreak;\r\n\t}\r\n}", "handleInteraction(e) {\r\n if (prevGuesses.indexOf(e) === -1){\r\n let clickedLetter = (e)\r\n let buttons = document.getElementsByClassName('key')\r\n if(this.activePhrase.checkLetter(splitPhraseArray,clickedLetter)){\r\n for(let i = 0; i < buttons.length; i++){\r\n if(buttons[i].textContent === clickedLetter){\r\n buttons[i].disabled = true;\r\n buttons[i].classList.add('chosen')\r\n }\r\n }\r\n } else {\r\n for(let i = 0; i < buttons.length; i++){\r\n if(buttons[i].textContent === clickedLetter){\r\n buttons[i].disabled = true;\r\n buttons[i].classList.add('wrong')\r\n prevGuesses.push(clickedLetter);\r\n this.removeLife();\r\n }\r\n }\r\n }\r\n this.activePhrase.showMatchedLetter(clickedLetter)\r\n if(this.checkForWin()){\r\n this.gameOver()\r\n };\r\n }\r\n }", "function onClick(x,y){\n if($scope.timer==undefined){ // Start the timer if has not been started yet\n $scope.timer = $interval(timer, 100);\n }\n if($scope.grid[x][y].state == -1){ // If the case is a mine\n $scope.play = false; // The game stops\n $interval.cancel($scope.timer); // The timer stops\n }\n else if ($scope.grid[x][y].state >= 0) { // Otherwise\n revealCase(x,y); // Potential empty neighbors are also revealed\n $scope.success = isSuccess(); // Test if the game is completed\n }\n }", "function onClick () {\n\n // erhöhe den Wert der Variable 'clicks' um 1\n clicks++;\n\n var text = '';\n\n if (clicks === 1) {\n // beim ersten Klick\n text = 'Hallo!';\n } else if (clicks < 4) {\n // beim zweiten und dritten Klick\n text = 'Hmmm';\n } else {\n // bei allen folgenden Klicks\n text = 'Autsch!';\n }\n\n // setze den Inhalt des Elements mit der ID 'reaktion' auf den zuvor bestimmten Text\n reaktion.textContent = text;\n }", "function userButtonPressAction() {\n $(\".btn\").click(function() {\n if(!isClickPatternOrderedSubsetOfGamePattern()) {\n gameOver();\n return;\n }\n if(userClickPattern.length < gamePattern.length)\n return;\n\n /*if user gets to this point, then the clickPattern must equal the\n gamePattern. So, the user will go on to the next level*/\n userClickPattern = [];\n setTimeout(nextLevel, 1000);\n\n });\n}", "function onAimedShotClick() {\r\n vaultDweller.currentAttackMode = \"single\";\r\n output = \"<p> You switch your weapon over to single-shot mode. <span class=\\\"update\\\">Click the target you want to fire at!</span> </p>\";\r\n \r\n LogInfo(output);\r\n/*\r\n Old code\r\n // Pimp that gun\r\n AKS74u.addAttachment(attachments[5]);\r\n\r\n // Give it to a dude\r\n vaultDweller.arm(AKS74u);\r\n vaultDweller.attackSingle(pig);\r\n\ttargetingOverlay(pig);\t\r\n\t*/\r\n}", "function onBoardClick() {\n if (!hasStarted) {\n startGame();\n } else {\n startPause();\n }\n }", "function bonk(e) {\n //if click did not come from mouse\n if (!e.isTrusted) {\n //exit the function\n return;\n }\n //if clicked, increment score\n score++;\n //immediatel remove the up class so mole goes down\n this.classList.remove('up');\n //update scoreboard\n scoreBoard.textContent = score;\n\n}", "function stepButtonClick() {\n if (PLAY_STATUS == PlayStatus.INITAL_STATE_PAUSED) {\n doFirstStep()\n } else {\n doStep()\n }\n\n // If we are in the middle of demonstrating the step button (see tutorial.js)\n // then we need to update the tutorial state\n if (TUTORIAL_STEP_BUTTON_ACTIVE) {\n\n // if the bot has finished, then we should transition out of the step\n // button demo\n if (\"encourage_reset\" in BOARD.visualize.step.general) {\n assert(TUTORIAL_STEP_BUTTON_ACTIVE_STEP_CLICKED,\n \"stepButtonClick: TUTORIAL_STEP_BUTTON_ACTIVE_STEP_CLICKED\")\n tutorialTransition(\"programEditor4\", \"programEditor5\")\n }\n // if this is the first time the player has clicked the Step button\n // during the step button demo\n else if (!TUTORIAL_STEP_BUTTON_ACTIVE_STEP_CLICKED) {\n // TODO: programEditor4 needs to set TUTORIAL_STEP_BUTTON_ACTIVE_STEP_CLICKED = true\n tutorialTransition(\"programEditor3\", \"programEditor4\")\n }\n }\n}", "function showThemWhatTheyWonDemo () {\n if (score >= 60) {\n $('#winnerMessage').show();\n } else {\n $('#loserMessage').show();\n }\n questionTiles.off('click'); // turn off clicking any tiles on game end\n}", "function footSteps(action) {\r\n\r\n\tswitch (action) {\r\n\t\t\r\n\t\tcase 'explore':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Good choice, it's probably best to keep lookin around, wouldn't want to bother them\", 1000);\r\n\t\t\texploreship(gameobj.explore);\r\n\t\t\tgameobj.explore++;\r\n\t\tbreak;\r\n\r\n\t\tcase 'sit tight':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Yeah you are probably right, no reason to bother them at work, its not like you're not scared, are you?\", 1000);\r\n\t\t\tgameobj.sittight++;\r\n\t\tbreak;\r\n\t}\r\n}", "handleInteraction(){\r\n for(let i = 0; i < keys.length; i++){\r\n keys[i].addEventListener(\"click\", (e)=>{\r\n target = e.target.textContent;\r\n e.target.disabled = true;\r\n if(activePhrase.checkLetter()){\r\n e.target.classList.add(\"chosen\");\r\n activePhrase.showMatchedLetter();\r\n this.checkForWin()\r\n } else {\r\n this.removeLife();\r\n e.target.classList.add(\"wrong\");\r\n this.checkForWin();\r\n };\r\n if(this.checkForWin() === true || this.missed === 5){\r\n this.gameOver(); \r\n };\r\n });\r\n }\r\n }", "function checkForIntent() {\n\t\t\t// calculate mouse position difference\n\t\t\tvar xDifference = Math.abs(session.previousX - session.currentX),\n\t\t\t\tyDifference = Math.abs(session.previousY - session.currentY),\n\t\t\t\ttotalDifference = xDifference + yDifference;\n\n\t\t\t// check if difference has passed the sensitivity threshold\n\t\t\tif (totalDifference < options.intentSensitivity) {\n\t\t\t\ttipController.showTip(element);\n\t\t\t} else {\n\t\t\t\t// try again\n\t\t\t\tsession.previousX = session.currentX;\n\t\t\t\tsession.previousY = session.currentY;\n\t\t\t\topenTooltip();\n\t\t\t}\n\t\t}", "function openLearn() {\n playAudioSelectBtn();\n const howTo = document.querySelector('.learnScreen');\n howTo.classList.toggle(\"active\");\n startScreen.classList.remove(\"active\");\n}", "function continueGame(event)\n {\n toGame();\n }", "function give_feedback_on_selected_hand(){\n $('.feedback').text( game_instance.determine_feedback_for_selected_hand() );\n }", "function Tutorial(){\n swal.setDefaults({\n confirmButtonText: 'Next &rarr;',\n showCancelButton: true,\n animation: true,\n progressSteps: ['H', '1', '2', '3', '4', '5']\n })\n\n var steps = [\n {\n html: '<h2><a href=\"//github.com/phzhou76/0xDEADBEEF\">Deja Moo</a> allows you to view cows in your surrounding areas to find ' +\n 'events, food, and sales!</h2><p align = \"left\"><br><b>Drop a cow</b> to share with other people what exciting stuff is happening near ' +\n 'you.<br><b>Delete</b> a cow that you feel is no longer needed.' +\n '<br><b>View cows</b> others have dropped and upvote them as well as leave a comment!<br><b>Filter</b> only the types of cows that ' +\n 'you want to see.<br><b>Search</b> for different addresses and see what cows there are anywhere in the world!</p>',\n imageUrl: 'img/tut1.jpg',\n imageWidth: '200px',\n imageHeight: '200px'\n },\n {\n title: 'Dropping A Cow',\n text: 'Dropping a cow lets you place a cow pin near your current location. Click on the \"Drop a Cow!\" button and enter ' +\n 'the topic, comment, and cow type to begin. To be able to drop a cow, you must be logged in! Also remember, your cow will only last 24 hours!',\n imageUrl: 'img/tut2.png',\n imageWidth: '400px',\n imageHeight: '380px',\n animation: false\n },\n {\n title: 'Deleting A Cow',\n text: 'Click on a cow you have dropped and click the recycle bin button at the bottom left of the page to delete a cow. You can ' +\n 'only delete a cow you have dropped. A popup will let you confirm.',\n imageUrl: 'img/tut3.png',\n imageWidth: '514px',\n imageHeight: '330px',\n animation: false\n },\n {\n title: 'Viewing Other Cows',\n text: 'Click on a cow on the map to see the main comment! Click view comments to view' +\n ' all of the comments. You can also upvote/downvote the main comment right from the info box! ' +\n 'If you click view comments you will be led to the all comments info box where you can see all the comments as well as upvote/downvote them.',\n imageUrl: 'img/tut4.png',\n imageWidth: '448px',\n imageHeight: '338px',\n animation: false\n },\n {\n title: 'Filter Comments',\n text: 'Click on the gear icon on the top right then click on the types to use the filter cow function! You can ' +\n 'toggle which cows you would like to see with the press of a button!',\n imageUrl: 'img/tut5.png',\n imageWidth: '500px',\n imageHeight: '310px',\n animation: false\n },\n {\n title: 'Search for Other Cows',\n text: 'Enter an address in the search bar located near the top right and press enter to go to that location! ' +\n 'This function is great for exploring cows on the other side of the world! Revert back to your original location using Recenter.',\n imageUrl: 'img/tut6.png',\n imageWidth: '570px',\n imageHeight: '300px',\n animation: false,\n confirmButtonText: 'Finish'\n },\n ]\n\n swal.queue(steps).then(function (result) {\n swal.resetDefaults()\n swal({\n title: 'Enjoy our app!',\n confirmButtonText: 'Ready to Deja Moo',\n showCancelButton: false\n })\n }, function () {\n swal.resetDefaults()\n })\n}", "function nextQuestion() {\n // currentQuestion++\n $(\"#question\").html(test[nextUp].hint);\n $(\"#guess1\").html(test[nextUp].guess1);\n $(\"#guess2\").html(test[nextUp].guess2);\n $(\"#guess3\").html(test[nextUp].guess3);\n $(\"#guess4\").html(test[nextUp].guess4);\n // console.log(nextUp)\n countDown();\n // $('#timeToGo').each(countDown); //starts counter\n anser = (test[nextUp].Answer);\n nextUp++\n // console.log(currentQuestion)\n\n //-------------------------------------------------------------------------------------------------------\n //clicks for answer 1\n}", "function faceClick_first() {\n document.face.src = faceWait.src;\n numMoves = 0;\n closeAllMenus();\n clockStop();\n clockClear();\n makeBoard();\n clearBoardImages(); \n forceFocus();\n dead = false;\n win = false;\n openRemainingUsed = false;\n document.face.src = faceSmile.src;\n return false;\n }", "function duckClicked () {\n if (gameData.eggs + gameData.click_increment <= gameData.storage) {\n gameData.eggs += gameData.click_increment;\n element[\"totalEggsProg\"].value = 100 * (gameData.eggs/gameData.storage);\n } else if (gameData.eggs + gameData.click_increment > gameData.storage) {\n gameData.eggs = gameData.storage;\n element[\"totalEggsProg\"].value = 100 * (gameData.eggs/gameData.storage);\n }\n duckUpdate();\n duckeggAnimation();\n}", "onGameWon() {\n window.location.href = 'https://www.youtube.com/watch?v=IMZo-aBp9OQ';\n }", "function mouseClicked(){\n //User clicks to advance the introduction\n if (state === `title`) {\n introState += 1;\n if (introState === 5) {\n state = `simulation`;\n }\n }\n //If user wins, click to restart\n else if (state === `win`) {\n gameStarted = false;\n score = 0;\n timer = 60;\n ant.x = floor(random(0, tileBlue.columns))* tileBlue.size + tileBlue.size/2; //random x position inside the tiles\n ant.y = floor(random(0,tileBlue.rows))* tileBlue.size + tileBlue.size/2; // random y position\n state = 'simulation';\n introState = 0;\n }\n //If user loses, click to restart\n else if (state === `lose`) {\n gameStarted = false;\n score = 0;\n timer = 60;\n ant.x = floor(random(0, tileBlue.columns))* tileBlue.size + tileBlue.size/2; //random x position inside the tiles\n ant.y = floor(random(0,tileBlue.rows))* tileBlue.size + tileBlue.size/2; // random y position\n state = 'title';\n introState = 0;\n }\n}", "function walkingToTheBack(){\n\tstory(\"The guy starts walking away and you follow him around to the back of the building where there's no cameras or light.\");\n\tchoices = [\"Run away\", \"Fight him\", \"Call the police\"];\n\tanswer = setOptions(choices);\n}", "function runGame(){\n $(\".clickImg\").on(\"click\", function(){\n var gem_score = parseInt($(this).attr(\"rand-value\"));\n\n hasWon();\n hasLost();\n\n if(total_score < targetNumber){\n total_score = total_score + gem_score;\n $(\".tallied_total\").text(total_score);\n hasWon();\n hasLost();\n }\n \n });\n \n }", "function iAmGod() {\r\n godClicks++;\r\n if (godClicks === 15 && !$(\"#start-game-btn\").hasClass(\"hidden\")) {\r\n level = stages.length - 1;\r\n $(\"#start-game-btn\").addClass(\"hidden\");\r\n getGameShift();\r\n displayNextLevel();\r\n seconds = 10;\r\n }\r\n else if (godClicks > 15) {\r\n godClicks = 0;\r\n }\r\n }", "function clickOnGameButton(event)\n{\n // Hier coderen we alles wat moet worden gedaan zodra een speler op de game button clicked\n // @TODO: Click event van de game button programmeren. Wat moet er allemaal gebeuren na een klik?\n}", "function helpWindow(){\n alert(\"Double-click on the target to add an 'arrow' to the target, and the scoreboard. Click 'Save' Button to log scores below, clear the target, and take another 5 shots\")\n}", "function auxClicked(ev) {\n clicked(ev, dificuldade, score);\n }", "onObjectClicked(pointer, gameObject) {\n\t\tif (gameObject.name === 'ok') {\n\t\t\tlet nextAction = game.gameData.getNextAction();\n\t\t\tgame.scene.start(nextAction.sceneName);\n\t\t}\n\t}", "function onClick(e) {\r\n onPause();\r\n if (getCarrier(e.yValue) == story.getFrameValue()) {\r\n onPlay();\r\n } else {\r\n story.goToFrame(getCarrier(e.yValue));\r\n onPause();\r\n }\r\n }", "function shoulderClicked(){\n console.log(\"shoulder was clicked\"); //debugging feature\n rightThird.innerHTML = shoulderContent; //sets the rightThird content to the shoulder content\n let displayImgs = document.getElementsByClassName(\"displayImg\");\n\n anime({\n targets: displayImgs,\n opacity: 1,\n duration: 2000,\n delay: anime.stagger(300),\n autoplay: true,\n })\n textFadeIn.play(); //plays animation to fade in rightThird content\n fadeDots.play(); //plays animation to fade out the dots\n anime({ //main animation to zoom in on the shoulder\n targets: mainImg,\n scale: 2.3,\n translateX: 75,\n translateY: 180,\n easing: 'easeInOutCubic'\n })\n \n document.getElementById(\"back\").addEventListener(\"click\", backClicked); //there is a back button that appears in rightThird, this makes the back button clickable\n}", "function isloss() {\n clickcount = 0;\n $(\"#currentcount\").text(\"CLICK COUNT IS: \" + clickcount);\n loss++;\n $(\"#loss\").text(\"LOSSES: \" + loss);\n coguess = compguessed();\n $(\"#randomv\").text(\"YOUR TARGET IS :\" + coguess);\n crys1 = crystall();\n crys2 = crystall();\n crys3 = crystall();\n crys4 = crystall();\n }", "function love(){\n swal({\n title: \"Good job!\",\n text: \"You clicked the button!\",\n icon: \"success\",\n button: \"Love !\",\n });\n }", "function addClickEvent() {\n $('.topic-button').on('click', function() {\n removeGifs();\n\n ingredient = $(this).attr('data-food');\n\n giphySearch(ingredient);\n });\n}", "function isLoser() {\n // if the numGuessesRemaining is 0 then -1 numLosses and switch isFinished to true\n if(numGuessesRemaining <= 0) {\n numLosses++;\n isFinished = true;\n //play the loser gif\n document.getElementById(\"giphy-embed\").src = \"https://giphy.com/embed/bBPKIt6h9yCcw\";\n document.getElementById(\"numLosses\").style.color = \"#e12d2e\";\n playAudio();\n }\n \n\n}", "function correctClick() {\n\tlet index = parseInt(this.id);\n\t\n\tplaySound(index);\n\t\t\n\tif (index != pattern[curIndex++]) {\n\t\tconsole.log(\"oh no\");\n\t\t\n\t\t//simon_exec will end the game if result is -1\n\t\tresult = -1;\n\t\tsimon_exec();\n\t}\n\telse if (curIndex >= pattern.length) {\n\t\tconsole.log(\"we did it\");\n\t\tscore++;\n\t\tuserClear();\n\t\tsimon_exec().then(() => {\n\t\t\tuser_run();\n\t\t});\n\t}\n}", "function clickHandler() {\n if (win === 0) {\n run();\n } else if (win === 5) {\n endGame();\n } else if (win > 0) {\n display();\n } else {\n }\n}", "handleInteraction(e) {\n // If the event is coming from physical keyboard and catching with 'keydown'\n if (e.type == \"keydown\") {\n const char = qwerty.querySelectorAll(\"button\"); //find all the buttons\n for (let i = 0; i < char.length; i++) {\n const button = char[i];\n const buttonText = button.innerText;\n if (e.key.toLowerCase() == buttonText) {\n // if the buttons has the text of the key pressed\n\n button.disabled = true; //disable the button\n\n if (this.activePhrase.checkLetter(buttonText)) {\n //if active phrase has the button text\n button.className = \"chosen\"; //change the class of button to chosen\n this.activePhrase.showMatchedLetter(buttonText); //display the matched letter\n if (this.checkForWin()) {\n this.gameOver(true); //check if the user is won. then display gameOver\n }\n } else {\n if (button.className != \"wrong\") {\n //if the button class is not already wrong\n button.className = \"wrong\"; //set it to wrong\n this.removeLife(); //remove life\n }\n }\n }\n }\n //If the event is coming the mouse click\n } else if (e.type == \"click\") {\n e.disabled = true;\n const button = e.target;\n\n const buttonText = button.textContent;\n\n if (this.activePhrase.checkLetter(buttonText)) {\n //if active phrase has the button text\n button.className = \"chosen\"; //change the class of button to chosen\n this.activePhrase.showMatchedLetter(buttonText); //display the matched letter\n if (this.checkForWin()) {\n this.gameOver(true); //check if the user is won. then display gameOver\n }\n } else {\n if (button.className != \"wrong\") {\n //if the button class is not already wrong\n button.className = \"wrong\"; //set it to wrong\n this.removeLife(); //remove life\n }\n }\n }\n }", "handleJDotterClick() {}", "function callHeater(){\n\tif(step_no == 2){\n\t\tstep_no++;\t\n\t\t$(\"#heater_arrow\").hide();\t// Hide arrow pointing to heater\n\t\t$(\"#heater_txt\").hide();\t// Hide text regarding heater\n\t\t$(\"#stir_txt\").show();\t\t// Show text regarding the stirrer\n\t\t$(\"#stir_arrow\").show();\t// Show arrow pointing to the stirrer button\n\t\t$(\"#change\").html(\"Click on the Stirrer Switch to turn the Magnetic Stirrer On..\");\n\t\tremovePointer(heater_button);\t// Remove pointer from heater button\n\t\taddPointer(stir_button);\t// Add pointer to the stir button\n\t}\n}", "function clickedLetter() {\n //get the letter from the button that was just clicked\n var buttonClicked = $(this);\n chosenLetter = buttonClicked.val();\n allChosenLetterIndexes(chosenLetter);\n\n\n\n $(\"#wrongGuessesOutput\").text(\"Wrong Guesses = \" + wrongGuesses);\n $(\"p\").hide();\n $(\"#wrongGuessesOutput\").show();\n\n }", "function chosenClick() {\n if (core || all || career) { // If any other tab is currently open, set them to false and show user's chosen courses\n setAll(false);\n setCore(false);\n setCareer(false);\n setChosen(true);\n }\n }", "function StruggleDraw(NoStruggleMessage, StruggleStage) {\n\t\n\t// Draw the background image\n\tDrawImage(StruggleGetImage(StruggleStage), 0, 0);\n\n\t// Draw the struggle text on top\n\tif (StruggleProgress <= 0) DrawText(NoStruggleMessage, 600, 30, \"white\");\n\tif (StruggleProgress >= 100) DrawText(StruggleDoneMessage, 600, 30, \"white\");\n\tif ((StruggleProgress > 0) && (StruggleProgress < 100)) { DrawText(StruggleMessage, 600, 30, \"white\"); DrawCircle(StruggleX, StruggleY, StruggleRadius + 4, 4, \"white\"); }\n\tif ((StruggleProgress > 50) && (StruggleProgress < 100)) DrawText(StruggleDifficultyShown, StruggleX, StruggleY + StruggleRadius + 30, \"white\");\n\n\t// Draw the progress meter\n\tDrawRect(399, 579, 402, 12, \"white\");\n\tDrawRect(400, 580, StruggleProgress * 4, 10, \"#66FF66\");\n\tDrawRect(400 + (StruggleProgress * 4), 580, (100 - StruggleProgress) * 4, 10, \"red\");\n\n}", "function playAgain() {\n showLevelOverlay();\n getId('tutorial').style.display = \"none\";\n getId('passOrFail').style.display = \"block\";\n getId('hexagonTextOverlay').innerHTML = level;\n getId('passOrFailText').innerHTML = \"Failed!\";\n getId('buttonLeftText').innerHTML = \"No\";\n getId('buttonRightText').innerHTML = \"Yes\";\n getId('playAgain').style.display = \"block\";\n getId('scoreMultiplied').style.display = \"none\";\n getId('normalScore').style.display = \"none\";\n}", "function onStartClick() {\n startCatWalk();\n}", "function goToPreviousStep() {\n\tpreviousSteps();\n\tupdateStepsText();\n\tconsole.log(\"hey\");\n}", "function startButton(){\n hunger();\n happy();\n knowledge();\n \n}", "function go_step_pressed(){\n draw_step();\n}", "function gettingDraggedAway(){\n\tstory(\"The guy out of the middle of nowhere hits you to the ground and while you are dazed he starts to drag you\");\n\tchoices = [\"Throw up\",\"Pass out\",\"Grab something from the ground\"];\n\tanswer = setOptions(choices);\n}", "function handleClick() {\r\n\tstats.total_clicks += 1;\r\n\tvar research_bonus = 1;\r\n\tvar accel_multiplier = 1;\r\n\tvar angel_multiplier = 1;\r\n\tvar temporal_multiplier = 1;\r\n\tif (assistants[0].unlocked) {\r\n\t\tangel_multiplier += 0.01 * assistants[0].level;\r\n\t}\r\n\tif (minigames[5].vars.research_tree[23].researched) {\r\n\t\tfor (var i = 0; i < buffs.length; i++) {\r\n\t\t\tif (buffs[i].active) {\r\n\t\t\t\tresearch_bonus += 0.25;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (minigames[12].vars.accel_target == 1) {\r\n\t\tminigames[12].vars.accel_bonus = Math.min(minigames[12].vars.accel_bonus + 0.001 , 0.15);\r\n\t\tminigames[12].vars.accel_time = 30;\r\n\t\taccel_multiplier = 1 + minigames[12].vars.accel_bonus;\r\n\t\t\r\n\t\tif (minigames[12].vars.accel_bonus == 0.15) {\r\n\t\t\tupgrades[164].makeAvailable();\r\n\t\t\tif (upgrades[163].available && upgrades[164].available && upgrades[165].available) {\r\n\t\t\t\tupgrades[166].makeAvailable();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tif (minigames[5].vars.research_tree[26].researched) {\r\n\t\tminigames[5].vars.research_time -= 0.1\r\n\t}\r\n\t\r\n\tif (upgrades[23].bought) {\r\n\t\tCLICK_BASE += (10 + (0.01 * stats.total_clicks)) * stats.total_clicks; \r\n\t}\r\n\t\r\n\tif (minigames[19].vars.active_effects.includes(2)) {temporal_multiplier += (GAME_SPEED - 1) * 0.1}\r\n\t\r\n\tclick_value = (CLICK_BASE + CLICK_PRODUCTION * PRODUCTION) * research_bonus * accel_multiplier * angel_multiplier * temporal_multiplier;\r\n\t\r\n\tif (buffs[11].active && !buffs[11].frozen) {click_value *= 2}\r\n\tif (buffs[12].active && !buffs[12].frozen) {click_value *= 0.5}\r\n\tif (buffs[33].active && !buffs[33].frozen) {click_value *= 1.3}\r\n\tif (buffs[35].active && !buffs[35].frozen) {click_value *= 1.75}\r\n\t\r\n\tif (challenges[7].running) {click_value = PRODUCTION}\r\n\t\r\n CREDITS += click_value;\r\n stats.credits_earned += click_value;\r\n\tstats.click_credits += click_value;\r\n\tstats.click_value = click_value\r\n\t\r\n\tclick_animations.push([-20,0, Math.round(Math.random() * (40 - (-40)) + (-40)), Math.round(Math.random() * 30) + 10, click_value,1]);\r\n\t\r\n\tif (click_animations.length >= 20) {click_animations.shift()}\r\n}", "function InventoryItemMouth2CupholderGagClick() {\n\tInventoryItemMouthCupholderGagClick();\n}", "function setup() {\n// displaying the different div needed at this part\n$('#click-to-start').unbind('click').click(roundOne);\n $('#instructions').hide();\n $('#question').hide();\n $('#narrator').hide();\n $('#story').hide();\n\n}", "function C012_AfterClass_Jennifer_Click() {\n\n\t// Regular interactions\n\tClickInteraction(C012_AfterClass_Jennifer_CurrentStage);\n\n\t// The player can click on herself in most stages\n\tvar ClickInv = GetClickedInventory();\n\tif ((ClickInv == \"Player\") && (LeaveIcon == \"Leave\")) {\n\t\tC012_AfterClass_Jennifer_IntroText = OverridenIntroText;\n\t\tInventoryClick(ClickInv, CurrentChapter, CurrentScreen);\n\t}\n\t\n\t// Jennifer can be restrained on stage 0 and 10\n\tif ((C012_AfterClass_Jennifer_CurrentStage <= 10) && (ClickInv != \"\") && (ClickInv != \"Player\") && !Common_PlayerRestrained) {\n\t\t\n\t\t// Jennifer becomes more submissive from the crop\n\t\tif (ClickInv == \"Crop\") {\n\t\t\tif (ActorIsGagged()) OverridenIntroText = GetText(\"CropWhileGagged\");\n\t\t\telse if (Common_ActorIsOwned) OverridenIntroText = GetText(\"CropFromMistress\");\n\t\t\telse OverridenIntroText = GetText(\"Crop\");\n\t\t\tif (!GameLogQuery(CurrentChapter, CurrentActor, \"CropDone\")) {\n\t\t\t\tActorChangeAttitude(0, 1);\n\t\t\t\tGameLogAdd(\"CropDone\");\n\t\t\t}\n\t\t\tCurrentTime = CurrentTime + 50000;\n\t\t\treturn;\n\t\t}\n\n\t\t// Jennifer will turn the tables on the player if -5 submission or less\n\t\tif ((ActorGetValue(ActorSubmission) <= -5) && !ActorIsRestrained() && !ActorIsGagged() && (ClickInv != \"CuffsKey\")) {\n\t\t\tPlayerRandomRestrain();\n\t\t\tif (Common_PlayerRestrained) {\n\t\t\t\tPlayerRandomGag();\n\t\t\t\tif (Common_ActorIsOwner) {\n\t\t\t\t\tEventSetGenericTimer();\n\t\t\t\t\tOverridenIntroText = GetText(\"TurnTablesFromMistress\");\n\t\t\t\t}\n\t\t\t\telse OverridenIntroText = GetText(\"TurnTables\");\n\t\t\t\tC012_AfterClass_Jennifer_CalcParams();\n\t\t\t\tCurrentTime = CurrentTime + 50000;\n\t\t\t} else OverridenIntroText = GetText(\"RefuseBondage\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Jennifer will refuse any bondage if 4 submission or less\n\t\tif ((ActorGetValue(ActorSubmission) < 5) && !ActorIsRestrained() && !ActorIsGagged() && (ClickInv != \"CuffsKey\")) {\n\t\t\tOverridenIntroText = GetText(\"RefuseBondage\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Jennifer can only wear the belt if she's naked\n\t\tif (!ActorIsChaste() && (ActorGetValue(ActorCloth) != \"Naked\") && (ClickInv == \"ChastityBelt\")) {\n\t\t\tOverridenIntroText = GetText(\"NakedForBelt\");\n\t\t\treturn;\n\t\t}\n\n\t\t// A second rope can be applied if Jennifer isn't fully clothed\n\t\tif ((ActorGetValue(ActorCloth) != \"Naked\") && (ActorGetValue(ActorCloth) != \"Underwear\") && (ClickInv == \"Rope\") && (ActorHasInventory(\"Rope\"))) {\n\t\t\tOverridenIntroText = GetText(\"StripForSecondRope\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Apply the clicked restrain\n\t\tActorApplyRestrain(ClickInv);\n\t\tC012_AfterClass_Jennifer_CalcParams();\n\n\t}\t\n\n}", "function whatCharacterIsClicked () {\n $ ('#stats0, #stats1, #stats2, #stats3').one ('click', function (e) {\n if (this.id === 'stats0') {\n console.log ('clicked geralt!');\n characters.geralt.isSelected = true;\n if (characters.geralt.isSelected) {\n $ ('#selected-character-id').html (\n \"<img id='selected-character-id' src='\" +\n characters.geralt.imageUrl +\n \"' />\"\n );\n $ ('#attack-btn').html (\n \"<button type='button' id='attack' class='btn btn-primary btn-lg'>Attack</button>\"\n );\n $('#game-actions').text(\"Slecect Defender Next!\");\n $ ('#main-actions').text ('You chose Geralt!');\n $ ('#geralt-wrap').hide ();\n $ ('.character-text').hide ();\n\n //$('geralt-img').hide();\n }\n onImgClick ();\n return characters.geralt;\n } else if (this.id === 'stats1') {\n console.log ('clicked ciri!');\n characters.ciri.isSelected = true;\n // checkIfcharacterIsChosen(characters.ciri);\n if (characters.ciri.isSelected) {\n $ ('#selected-character-id').html (\n \"<img src='\" + characters.ciri.imageUrl + \"' />\"\n );\n $ ('#attack-btn').html (\n \"<button type='button' id='attack' class='btn btn-primary btn-lg'>Attack</button>\"\n );\n $('#game-actions').text(\"Slecect Defender Next!\");\n $ ('#main-actions').text ('You chose Ciri!');\n $ ('#ciri-wrap').hide ();\n $ ('.character-text').hide ();\n }\n onImgClick ();\n return characters.ciri;\n } else if (this.id === 'stats2') {\n console.log ('clicked imleith!');\n characters.imlerith.isSelected = true;\n if (characters.imlerith.isSelected) {\n $ ('#selected-character-id').html (\n \"<img id='selected-character-id' src='\" +\n characters.imlerith.imageUrl +\n \"' />\"\n );\n $('#game-actions').text(\"Slecect Defender Next!\");\n $ ('#attack-btn').html (\n \"<button type='button' id='attack' class='btn btn-primary btn-lg'>Attack</button>\"\n );\n $ ('#main-actions').text ('You chose Imlerith!');\n $ ('#imlerith-wrap').hide ();\n $ ('.character-text').hide ();\n }\n\n onImgClick ();\n return characters.imlerith;\n } else if (this.id === 'stats3') {\n console.log ('clicked vesemir!');\n characters.vesemir.isSelected = true;\n if (characters.vesemir.isSelected) {\n $ ('#selected-character-id').html (\n \"<img id='selected-character-id' src='\" +\n characters.vesemir.imageUrl +\n \"' />\"\n );\n $ ('#attack-btn').html (\n \"<button type='button' id='attack' class='btn btn-primary btn-lg'>Attack</button>\"\n );\n $('#game-actions').text(\"Slecect Defender Next!\");\n $ ('#main-actions').text ('You chose Vesemir!');\n $ ('#vesemir-wrap').hide ();\n $ ('.character-text').hide ();\n }\n\n onImgClick ();\n return characters.vesemir;\n } else return;\n });\n }", "function turnClick(square) {\n if (typeof origBoard[square.target.id] == 'number') {\n turn(square.target.id, huPlayer);\n if (!checkTie()) turn(bestSpot(), aiPlayer); //After user takes their turn, check to see if game is tied (no available tiles to play) before executing AI function\n }\n}", "function processTopicSwitchIntervention(html) {\n //alert(\"Switching topics because \" + reason)\n interventionDialogOpen(\"Switching Topics\", html, NEXT_PROBLEM_INTERVENTION );\n\n\n}" ]
[ "0.62314314", "0.60242", "0.6021518", "0.59188396", "0.591465", "0.5887501", "0.58401346", "0.582574", "0.58041364", "0.5763264", "0.5757137", "0.5750569", "0.5747151", "0.5740466", "0.5737966", "0.5719068", "0.5713731", "0.5685854", "0.56630284", "0.56554693", "0.5639093", "0.5638933", "0.5616978", "0.56073505", "0.55963945", "0.55912393", "0.5591115", "0.5563851", "0.5534142", "0.55311906", "0.55286634", "0.5485609", "0.5479899", "0.5477958", "0.54674876", "0.54669243", "0.54645854", "0.5463125", "0.5459428", "0.5455875", "0.54541206", "0.5452512", "0.545221", "0.5452045", "0.5451207", "0.54491454", "0.5448206", "0.54460293", "0.5444136", "0.54426044", "0.5438955", "0.54289114", "0.542882", "0.542423", "0.5413097", "0.5412013", "0.54117495", "0.5402026", "0.5396573", "0.5396212", "0.5395142", "0.5391792", "0.53909755", "0.53875816", "0.53801274", "0.5379545", "0.53795195", "0.5378461", "0.5376814", "0.53762037", "0.53646934", "0.5359974", "0.5355122", "0.53537965", "0.5346951", "0.5346461", "0.53461725", "0.5342195", "0.53387654", "0.5332692", "0.5331848", "0.53309715", "0.5330845", "0.5328676", "0.5325846", "0.5325091", "0.5324642", "0.5318796", "0.5317441", "0.53153205", "0.5310342", "0.53066623", "0.53063005", "0.53062725", "0.530583", "0.5303453", "0.5300386", "0.5295445", "0.5292765", "0.52920157" ]
0.6629788
0
Return the correct background image related to the player's progress
function StruggleGetImage(StruggleStage) { // The frame of the image changes faster when progress is higher if (StruggleImageFrameTime < CurrentTime) { if (StruggleProgress <= 0) StruggleImageFrameTime = CurrentTime + 3000; if ((StruggleProgress > 0) && (StruggleProgress <= 33)) StruggleImageFrameTime = CurrentTime + 2000; if ((StruggleProgress > 33) && (StruggleProgress <= 66)) StruggleImageFrameTime = CurrentTime + 1300; if ((StruggleProgress > 66) && (StruggleProgress < 100)) StruggleImageFrameTime = CurrentTime + 800; StruggleImageFrame++; if (StruggleImageFrame > StruggleImageFrameMax) StruggleImageFrame = 0; } if (StruggleProgress >= 100) StruggleImageFrame = StruggleImageFrameMax + 1; // Returns the correct image file if (StruggleProgress <= 0) return CurrentChapter + "/" + CurrentScreen + "/Idle_" + StruggleStage.toString() + "_" + StruggleImageFrame.toString() + ".jpg"; else return CurrentChapter + "/" + CurrentScreen + "/" + StruggleType + "_" + StruggleStage.toString() + "_" + StruggleImageFrame.toString() + ".jpg"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onProgress(evt) {\n if (parseInt(evt.duration, 10) === parseInt(evt.position, 10)) {\n $(overlayControls).css('background-img', 'url(http://tempur-pedic.proto.hugeinc.com/video-test/video-controls-play.png)', 'background-size', '10%');\n }\n }", "getBackground(){\n\n\t\tif(currentLevel%5 != 0){\n\t\t\tcurrentBack = this.backLevels[0];\n\t\t}else{\n\t\t\tcurrentBack = this.backLevels[currentLevel/5];\n\t\t}\n\n\t\tvar numframe = currentLevel-Math.trunc(currentLevel/5);// Math.trunc(currentLevel/5) para que trunque el resultado \n \n \tif((currentLevel%5) != 0){ \n \t\tvar back = game.add.sprite(0, 0, currentBack, numframe);\n \t\tback.animations.currentFrame = numframe;\n \t}else{ \n \t\tgame.add.sprite(0, 0, currentBack); \n \t} \n\t}", "function addProgressBackground() {\n const canvas = document.createElement('canvas');\n const { width, height } = progressInp.getBoundingClientRect();\n\n canvas.width = width;\n canvas.height = height;\n\n const context = canvas.getContext('2d');\n context.fillStyle = ('rgba(2, 117, 216, 0.3)');\n\n sessionEvents.forEach((event) => {\n const position = (event.timeStamp / duration) * width;\n context.fillRect((position - 1), 0, 3, height);\n });\n\n progressInp.style.backgroundImage = `url('${canvas.toDataURL('image/png')}')`;\n}", "getBackgroundImage(){return this.__background.image}", "getBackgroundImage(tracks) {\n const defaultBackground = 'https://static.pexels.com/photos/6966/abstract-music-rock-bw.jpg';\n return tracks && tracks[0] && tracks[0].album.images[0].url || defaultBackground;\n }", "showProgressBar() {\n // Get the progress bar filler texture dimensions.\n const {\n width: w,\n height: h\n } = this.textures.get('progress-bar').get();\n\n // Place the filler over the progress bar of the splash screen.\n const img = this.add.sprite(100, 350, 'progress-bar').setOrigin(0).setScale(0.9);\n\n // Crop the filler along its width, proportional to the amount of files\n // loaded.\n this.load.on('progress', v => img.setCrop(0, 0, Math.ceil(v * w), h));\n }", "function recSuccessCelebrationSong() {\n document.getElementById(\"songSucDiv0\").style.opacity = \"0\";\n document.getElementById(\"songSucDiv1\").style.opacity = \"0\";\n document.getElementById(\"songSucDiv2\").style.opacity = \"0\";\n document.getElementById(\"sendToBoxButtonSong\").style.opacity = \"0\";\n $(\"#songDivMain\").css(\"background-image\", \"url('images/successImgSong.png')\");\n $(\"#songDivMain\").css(\"background-position\", \"center\");\n $(\"#songDivMain\").css(\"background-repeat\", \"no-repeat\");\n $(\"#songDivMain\").css(\"background-size\", \"initial\");\n}", "function getBackground() {\n\treturn _LEVEL_DATA[level]['background'];\n}", "function setBackgroundImg() {\n sliderItems.each(function (i, item) {\n const url = $(item).data(\"url\");\n $(item).css(\"background-image\", `url(${url})`);\n if ($(item).data(\"type\") === \"video\") {\n $(item).append(`<video width=\"100%\" height=\"100%\" controls autoplay>\n <source src=${url} >\n </video>`);\n }\n\n });\n }", "showProgressBar() {\n // Get the progress bar filler texture dimensions.\n const { width: w, height: h } = this.textures.get('progressBar').get();\n\n // Place the filler over the progress bar of the splash screen.\n const img = this.add.sprite(Constant.WIDTH / 2, Constant.HEIGHT / 4 * 3 + 16, 'progressBar').setOrigin(0.5, 0);\n\n // Add percentage text\n const loadingpercentage = this.add.bitmapText(\n Constant.WIDTH / 2,\n Constant.HEIGHT / 4 * 3 - 10,\n 'atomic',\n 'Loading:',\n Constant.FONTSIZE.small\n ).setOrigin(0.5, 0.5).setAlpha(1)\n \n // Add the title\n const title = this.add.bitmapText(Constant.WIDTH / 2, Constant.HEIGHT / 3 + 20, 'atomic', 'SnakeVania', 0)\n .setOrigin(0.5, 0.5)\n .setLetterSpacing(8)\n .setFontSize(30);\n\n // Crop the filler along its width, proportional to the amount of files loaded.\n this.load.on('progress', (progress) => {\n loadingpercentage.text = `Loading: ${Math.round(progress * 100)}%`;\n img.setCrop(0, 0, Math.ceil(progress * w), h);\n }).on('complete', () => {\n this.startNextScene(title);\n });\n }", "function update_background() {\r\n if (angle > 360) angle = 0;\r\n background.css(\"background\", \"linear-gradient(\" + angle + \"deg,\" +\r\n \"rgba(\" + local_track.palette[0][0] + \",\" + local_track.palette[0][1] + \",\" + local_track.palette[0][2] + \",\" + background_opacity + \"),\" +\r\n \"rgba(\" + local_track.palette[1][0] + \",\" + local_track.palette[1][1] + \",\" + local_track.palette[1][2] + \",\" + background_opacity + \"),\" +\r\n \"rgba(\" + local_track.palette[2][0] + \",\" + local_track.palette[2][1] + \",\" + local_track.palette[2][2] + \",\" + background_opacity + \"),\" +\r\n \"rgba(\" + local_track.palette[3][0] + \",\" + local_track.palette[3][1] + \",\" + local_track.palette[3][2] + \",\" + background_opacity + \"),\" +\r\n \"rgba(\" + local_track.palette[4][0] + \",\" + local_track.palette[4][1] + \",\" + local_track.palette[4][2] + \",\" + background_opacity + \"),\" +\r\n \"rgba(\" + local_track.palette[5][0] + \",\" + local_track.palette[5][1] + \",\" + local_track.palette[5][2] + \",\" + background_opacity + \")\");\r\n angle += (rotation_velocity);\r\n }", "get backgroundImageUrl() {\n return this._data.background_image_url;\n }", "function draw_bg() {\n title = ctx.drawImage(sprites, 13, 11, 321, 34, 0, 0, 399, 34);\n greenTop = ctx.drawImage(sprites, 0, 53, 399, 56, 0, 53, 399, 53);\n purpleTop = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 272, 399, 37);\n\tpurpleBot = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 473, 399, 37);\n}", "function setBackgroud() {\r\n var tempArr;\r\n var curTemp = round(weatherData.currently.temperature, 0);\r\n\r\n if (weatherData.flags.units == 'si')\r\n tempArr = [32, 21, 0];\r\n else\r\n tempArr = [90, 70, 32];\r\n\r\n if (curTemp >= tempArr[0])\r\n $('body').css('background-image', imgArr[0]);\r\n else if (curTemp < tempArr[0] && curTemp >= tempArr[1])\r\n $('body').css('background-image', imgArr[1]);\r\n else if (curTemp < tempArr[1] && curTemp >= tempArr[2])\r\n $('body').css('background-image', imgArr[2]);\r\n else if (curTemp < tempArr[2])\r\n $('body').css('background-image', imgArr[3]);\r\n}", "function enterLoadingScreen()\n{\n\t_canvas.style.backgroundImage = \"url(images/background.png\";\n}", "function preloadImage(status) {\n var correctAnswer = triviaQuestions[currentQuestion].correctAnswer;\n\n if (status === \"win\") {\n $(\"#game\").html(`\n <p class=\"preload-image\">The correct answer is <b>${correctAnswer}</b></p>\n <img src=\"${randomImage(winImages)}\" />\n `);\n } else {\n $(\"#game\").html(`\n <p class=\"preload-image\">The correct answer was <b>${correctAnswer}</b></p>\n <img src=\"${randomImage(lossImages)}\" />\n `);\n };\n }", "function initBgImg()\n{\n\tconsole.log(\"initBgImg()\");\n\n\tvar backgroundImage = document.getElementById(\"complete\");\n\n\tif(app.bgIndex == 1)\n\t{\n\t\tbackgroundImage.src = app.bgImg[0];\n\t}\n\telse if(app.bgIndex == 2)\n\t{\n\t\tbackgroundImage.src = app.bgImg[1];\n\t}\n\telse if(app.bgIndex == 3)\n\t{\n\t\tbackgroundImage.src = app.bgImg[2];\n\t}\n\telse if(app.bgIndex == 4)\n\t{\n\t\tbackgroundImage.src = app.bgImg[3];\n\t}\n\telse\n\t{\n\t\tbackgroundImage.src = app.bgImg[4];\n\t\tapp.bgIndex = 0;\n\t}\n\n\tapp.bgIndex++;\n}", "function renderizarImagen() {\r\n $imagen.style.backgroundImage = `url(${IMAGENES[posicionActual]})`;\r\n }", "function changeBackground() {\n\tlet timeLeft = new Date(),\n\t\thour = timeLeft.getHours(),\n\t\tmin = timeLeft.getMinutes(),\n\t\tsec = timeLeft.getSeconds();\n\tconst index = j % 24;\n\tlet currBase;\n\t\n\tif (index < 6) {\n\t\tcurrBase = nightBase;\n\t\tgreeting.textContent = \"Good Night\";\n\t}\n\telse if (index < 12) {\n\t\tcurrBase = morningBase;\n\t\tgreeting.textContent = \"Good Morning\";\n\t}\n\telse if (index < 18) {\n\t\tcurrBase = afternoonBase;\t\n\t\tgreeting.textContent = \"Good Afternoon\";\n\t}\n\telse {\n\t\tcurrBase = eveningBase;\t\n\t\tgreeting.textContent = \"Good Evening\";\n\t}\t\n\tconst imageSrc = currBase + images[index];\n\tconsole.log(imageSrc);\n\tviewBackGroundImg(imageSrc);\n\tj++;\n\tsetTimeout(changeBackground, (60 * 60 - (min * 60 + sec)) * 1000);\n}", "function updateBG() {\n\tvar d = new Date();\n\tvar n = d.getHours();\n\tif (n >= 21 || n <= 4){\n\t\tmessage = \"Goodnight\";\n\t\tbg.style.background = \"url('https://source.unsplash.com/featured/?night,space,northernlights') no-repeat center center fixed\";\n\t\tbg.style.backgroundSize = \"cover\";\n\t} else if ( n >= 5 && n <= 11 ) {\n\t\tmessage = \"Good Morning\";\n\t\tbg.style.background = \"url('https://source.unsplash.com/featured/?sunrise,morning') no-repeat center center fixed\";\n\t\tbg.style.backgroundSize = \"cover\";\n\t} else if ( n >= 12 && n <= 16 ) {\n\t\tmessage = \"Good Afternoon\";\n\t\tbg.style.background = \"url('https://source.unsplash.com/featured/?sky,city,architecture') no-repeat center center fixed\";\n\t\tbg.style.backgroundSize = \"cover\";\n\t} else if ( n >= 17 && n <= 20 ) {\n\t\tmessage = \"Good Evening\";\n\t\tbg.style.background = \"url('https://source.unsplash.com/featured/?sunset') no-repeat center center fixed\";\n\t\tbg.style.backgroundSize = \"cover\";\n\t}\n}", "bgroundStyle() {\n const { album } = this.props;\n return album.background_photo ? { backgroundImage: 'url(' + album.background_photo + ')' } : null\n }", "function image() {\n /* Set background image to desired URL, throw error if invalid URL */\n canvas.style.backgroundImage = \"url('\" + value + \"')\";\n /* Modify CSS Properties */\n\n if (options) {\n /* Set Repeat */\n canvas.style.backgroundRepeat = options.repeat ? 'repeat' : 'no-repeat';\n /* Set Position */\n\n canvas.style.backgroundPosition = options.position ? options.position : 'center';\n /* Set Size */\n\n canvas.style.backgroundSize = options.size ? options.size : 'contain';\n /* Set Color */\n\n canvas.style.backgroundColor = options.color ? options.color : 'none';\n }\n }", "function getImage(){\n return new Promise((resolve, reject) => {\n let xhr = new XMLHttpRequest()\n xhr.open('GET', 'https://api.unsplash.com/photos/random/?client_id=xmXDFa4zDCVL-ApnvXeJsUnhSivURuIZaTxuCZj-yHo')\n xhr.setRequestHeader('Accept-Version', 'v1')\n xhr.setRequestHeader('Content-Type', 'application/json')\n xhr.responseType = 'json'\n xhr.send()\n \n // after the response is received\n xhr.onload = function() {\n if (xhr.status === 200 && xhr.readyState === 4) {\n viewer.style.backgroundImage = 'none';\n resolve(xhr.response)\n } else {\n reject(Error(`Error ${xhr.status}: ${xhr.statusText}`))\n }\n };\n \n xhr.onprogress = function(event) {\n viewer.style.backgroundImage = \"url('../img/tvStatic.jpg')\" // not working? try later\n };\n \n xhr.onerror = function() {\n reject(Error(`Request failed: status: ${xhr.status} text`))\n }\n })\n}", "function progressBar() {\n try {\n //get current position \n var elapsedTime = Math.round(mediaPlayer.position);\n //update the progress bar\n if (canvas.getContext) {\n var ctx = canvas.getContext(\"2d\");\n //clear canvas before painting\n ctx.clearRect(0, 0, canvas.clientWidth, canvas.clientHeight);\n ctx.fillStyle = \"#DD4433\";\n var fWidth = (elapsedTime / mediaPlayer.naturalDuration) * (canvas.clientWidth);\n if (fWidth > 0) {\n ctx.fillRect(0, 0, fWidth, canvas.clientHeight);\n }\n }\n }\n catch (error) {\n log(error.message);\n log(error.description);\n }\n\n}", "function uploadProgress(pc) {\n \"use strict\";\n // console.log('progress ' + pc);\n $('#progress').css('background-position', (100 - pc) + '% 0').css('opacity', 1);\n}", "async function getBackgroundImg(){\r\n var response = await fetch(\"http://worldtimeapi.org/api/timezone/Asia/Kolkata\");\r\n var responseJSON = await response.json();\r\n\r\n var datetime = responseJSON.datetime;\r\n var hour = datetime.slice(11,13);\r\n \r\n if(hour>=0600 && hour<=1900){\r\n bg = \"bg1.jpg\";\r\n }\r\n else{\r\n bg = \"bg2.jpg\";\r\n }\r\n\r\n backgroundImg = loadImage(bg);\r\n // console.log(backgroundImg);\r\n}", "function bgImage() {\r\n $('[data-bgi]').each(function () {\r\n var src = $(this).attr('data-bgi');\r\n $(this).css({\r\n 'background-image': 'url(' + src + ')'\r\n });\r\n });\r\n }", "function preloadImage(status) {\n const correctAnswer = quizQuestions[currentQuestion].correctAnswer;\n\n if (status === 'win') {\n $('#game').html(`\n <p class=\"preload-image\">Yay, you are correct!</p>\n <p class=\"preload-image\">The correct answer is <b>${correctAnswer}</b></p>\n <img src=\"style/images/yes1.gif\" />\n `);\n } else if (status === 'lost'){\n $('#game').html(`\n <p class=\"preload-image\">The correct answer was <b>${correctAnswer}</b></p>\n <p class=\"preload-image\">You picked the wrong answer!</p>\n <img src=\"style/images/no1.gif\" />\n `);\n } else {\n $('#game').html(`\n <p class=\"preload-image\"> The correct answer was <b>${correctAnswer}</b></p>\n <p class=\"preload-image\"> Times up!</p>\n <img src=\"style/images/no1.gif\" />\n `);\n }\n}", "function renderizarImagen() {\n $imagen.style.backgroundImage = `url(${imagenes[posicionActual]})`\n }", "function background() {\n var img =$('.bg_img');\n img.css('background-image', function () {\n var bg = ('url(' + $(this).data('background') + ')');\n return bg;\n });\n }", "function displayLoadedBackgroundImageTheme(message) { \r\n \r\n \r\n $(\"#circleLoadingProgress\").text(100);\r\n var $popup = $(\"#popupDownloadImageTheme\");\r\n $popup.fadeOut(500, function() {\r\n $(\"#circleLoadingProgress\").text(0);\r\n });\r\n removeCurrentThemeVideo();\r\n updatePageBackgroundImage(message);\r\n displayPageHeader(message);\r\n}", "function loadBackground(assignmentNr)\n{ \n if(assignmentNr === 0 || assignmentNr === 1 || assignmentNr === 2 || assignmentNr === 3)\n {\n //Add blue background\n background = game.add.image(game.world.centerX, game.world.centerY, 'homeKeysBackground');\n }\n else if(assignmentNr === 4 || assignmentNr === 5)\n {\n //Add farm background\n background = game.add.image(game.world.centerX, game.world.centerY, 'farm');\n //Add clouds which will be constantly moving to the right\n clouds = game.add.image(-1000, 10,'clouds');\n }\n else if(assignmentNr === 6 || assignmentNr === 7)\n {\n //Load ocean floor background\n background = game.add.image(game.world.centerX, game.world.centerY, 'ocean');\n //Add orange fish which will move from end to end then turn around repeatedly\n fish1 = game.add.sprite(800, 35, 'fishes', 2);\n //Add green fish which will move from end to end then turn around repeatedly\n fish2 = game.add.sprite(25, 175, 'fishes', 1);\n }\n else if(assignmentNr === 8 || assignmentNr === 9)\n {\n //Add stage background\n background = game.add.image(game.world.centerX, game.world.centerY, 'stage');\n }\n else if(assignmentNr === 10 || assignmentNr === 11)\n {\n //Add boxing ring background\n background = game.add.image(game.world.centerX, game.world.centerY, 'box');\n }\n //Set the width and height of the background to match the witdh and height of the canvas\n background.width = width;\n background.height = height;\n background.anchor.setTo(0.5, 0.5);\n}", "function updatePageBackground() {\n\n\t\tconsole.debug( 'Update background' );\n\n\t\tvar tmp = renderResult();\n\t\tpageBackground.style.backgroundImage = 'url(' + tmp.toDataURL() + ')';\n\t}", "replaceIconVideoUnavailableOldLayout() {\n const icon = this.document.getElementById(\"player-unavailable\").getElementsByClassName(\"icon\")[0];\n\n icon.setAttribute('previous_background_img', window.getComputedStyle(icon, null).backgroundImage);\n\n icon.style.backgroundImage = 'url(' + chrome.extension.getURL(\"/assets/128.png\") + ')';\n icon.style.backgroundPosition = \"center\";\n }", "function changeBackground(){\n if($('#town-pressure').html().length > 0){\n var iconCode = $('#town-stats').attr('data-background').substr(0, 2);\n //console.log(imageLinks[iconCode]);\n $('.jumbotron').css(\"background-image\", imageLinks[iconCode]); //imageLinks is hardcoded in index.html.twig\n $('.jumbotron').css(\"background-size\", \"cover\");\n }\n\n }", "function setDynamicBackground() {\n\tsetUpGame();\n\tprogressGame();\n\tsetInterval(\"progressGame()\", refreshRate);\n}", "function _drawImage() {\n document.getElementById(\"background\").style.background = `transparent url('${ProxyState.image}') no-repeat center center /cover`\n}", "get background() {\n return this._data.background;\n }", "function gameOverLoss()\r\n{\r\n let over = document.getElementById('gameover');\r\n over.style.display = \"block\";\r\n over.style.backgroundImage = \"url(./resources/ghost.jpg)\";\r\n over.style.backgroundSize = \"100% 100%\";\r\n\r\n}", "updateForStage(progress, hardness) {\n if (!this.texturesEnabled) {\n return;\n }\n\n const index = Math.floor((progress / hardness) * (this.progressTextures.length - 1));\n const texture = this.progressTextures[index];\n\n this.setOverlayTexture(texture);\n }", "function draw() {\r\n if (x < background.w)x += 1;\r\n else x=0;\r\n if(theme==\"basic\"){\r\n bgImg=background.img;\r\n }else bgImg=backgroundSnow.img; \r\n context.drawImage(bgImg, x, 0, background.w, background.h, 0, 0, background.w ,background.h); \r\n context.save();\r\n animate(); // call function for animate player\r\n context.restore(); \r\n context.drawImage(flag.img, flag.w, flag.h); \r\n context.drawImage(tuyau.img, tuyau.w, tuyau.h); \r\n if(!progress){\r\n context.drawImage(win.img, win.w, win.h);\r\n }\r\n }", "function updateBackground()\n{\n\tif( typeof weatherBGImages == 'undefined')\n\t\treturn;\n\n\tif( curWeatherIcon in weatherBGImages ) {\n\t\tvar bgImages = weatherBGImages[curWeatherIcon];\n\t\tif( bgImages.length > 0 ) {\n\t\t\tvar index = Math.floor(Math.random() * 10) % bgImages.length;\n\n\t\t\t$('body').css('backgroundImage', function () {\n\t\t\t\treturn 'url(' + bgImages[index] + ')';\n\t\t\t});\n\n\t\t}\n\t}\n\n\tsetTimeout( updateBackground, weatherVGCycleInterval * 1000 );\n}", "function getBackground() {\n switch (homeWeather.weatherIcon) {\n case \"01d\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/clear-skyd.jpg\")';\n break;\n case \"02d\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/few-cloudsd.jpg\")';\n break;\n case \"03d\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/scattered-cloudsd.jpg\")';\n break;\n case \"04d\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/broken-cloudsd.jpg\")';\n break;\n case \"09d\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/raind.jpg\")';\n break;\n case \"10d\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/raind.jpg\")';\n break;\n case \"11d\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/thunderstormd.jpg\")';\n break;\n case \"13d\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/snowd.jpg\")';\n break;\n case \"50d\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/mistd.jpg\")';\n break;\n case \"01n\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/clear-skyn.jpg\")';\n break;\n case \"02n\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/few-cloudsn.jpg\")';\n break;\n case \"03n\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/cloudsn.jpg\")';\n break;\n case \"04n\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/cloudsn.jpg\")';\n break;\n case \"09n\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/rainn.jpg\")';\n break;\n case \"10n\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/rainn.jpg\")';\n break;\n case \"11n\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/thunderstormn.jpg\")';\n break;\n case \"13n\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/snown.jpg\")';\n break;\n case \"50n\":\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/mistn.jpg\")';\n break;\n default:\n displayBackgroundImage.style.backgroundImage = 'url(\"assets/images/default.jpg\")';\n break;\n \n }\n}", "function updatePicture($productPreview){\n // need to make sure this built URL is correct for project\n var url = pathToImages + \"/\" + folder + \"/\" + frameNum + imageNameSuffix;\n $productPreview.css(\"background\",\"url('\" + url + \"') no-repeat center center\"); \n $productPreview.css(\"background-size\",\"100%\"); \t\n }", "function changeHangImage() {\n $(\"#images-render\").css(\"background-image\", \"url(hang_images/\" + getHangImage() + \")\");\n}", "function lefthand1() {\n hand1 = 0\n document.getElementById(\"playerhand1\").innerHTML = hand1;\n document.getElementById(\"playerhand1\").style.backgroundImage = \"url('../2ndproject-minigame/assets/images/fist.png')\";\n}", "function getBackground() {\n if ( $( 'body' ).css( 'backgroundImage' ) ) {\n return $( 'body' ).css( 'backgroundImage' ).replace( /url\\(\"?(.*?)\"?\\)/i, '$1' );\n }\n }", "function righthand1() {\n hand2 = 0\n document.getElementById(\"playerhand2\").innerHTML = hand2\n document.getElementById(\"playerhand2\").style.backgroundImage = \"url('../2ndproject-minigame/assets/images/fist.png')\";\n}", "function preloader() {\n\tif (document.getElementById) {\n\t\tdocument.getElementById(\"circle_1\").style.background = \"url(pics/circle_1.jpg) no-repeat -9999px -9999px\";\t\t\n\t\tdocument.getElementById(\"circle_2\").style.background = \"url(pics/circle_2.jpg) no-repeat -9999px -9999px\";\t\n\t\tdocument.getElementById(\"circle_3\").style.background = \"url(pics/circle_3.jpg) no-repeat -9999px -9999px\";\n\t\t\n\t\tdocument.getElementById(\"pdf_1\").style.background = \"url(pics/pdf_11.png) no-repeat -9999px -9999px\";\n\t\tdocument.getElementById(\"pdf_2\").style.background = \"url(pics/pdf_22.png) no-repeat -9999px -9999px\";\n\t}\n}", "function weatherPicture(icon) {\n\n $(\"body\").css('background-image', 'url(' + background[icon] + ')');\n\n }", "function onloadCallback(current_image) {\n\t\t//set the image as the background image of the canvas wrapper\n\t\t$('#canvas-wrapper').css('background', 'url(' + current_image.path +') no-repeat center center fixed').css('background-size', 'contain');\n\t}", "function getImgBackground() {\n return gMeme.selectedImg;\n}", "function prepareBgDiv(data) {\n // set size and position\n var w = data.width / data.frames;\n var h = data.height;\n var bgCSS = {\n left: 0,\n top: 0,\n backgroundImage: 'url(\"' + data.sprites + '\")'\n };\n\n if (w / h > _utility.wndW / _utility.wndH) {\n bgCSS.height = _utility.wndH;\n bgCSS.width = bgCSS.height * w / h;\n bgCSS.left = (_utility.wndW - bgCSS.width) / 2;\n } else {\n bgCSS.width = _utility.wndW;\n bgCSS.height = bgCSS.width * h / w;\n bgCSS.top = (_utility.wndH - bgCSS.height) / 2;\n }\n\n // set css to background\n $preloaderBG.css(bgCSS);\n }", "function displayBg() \n{\n\tvar bg = new Image();\n\tbg.src = \"Images/background.jpg\";\n\tctx.drawImage(bg,minCanvasWidth,minCanvasHeight,maxCanvasWidth,maxCanvasHeight);\n}", "function recSuccessCelebration() {\n document.getElementById(\"recDiv0\").style.opacity = \"0\";\n document.getElementById(\"recDiv1\").style.opacity = \"0\";\n document.getElementById(\"sendToBoxButtonRec\").style.opacity = \"0\";\n $(\".recordDivMain\").css(\"background-image\", \"url('images/successImage.png')\");\n $(\".recordDivMain\").css(\"background-position\", \"center\");\n $(\".recordDivMain\").css(\"background-repeat\", \"no-repeat\");\n $(\".recordDivMain\").css(\"background-size\", \"initial\");\n}", "function drawProgress(init) {\n if (settings.showProgress && browserIconCtx && song.info && (init || Math.abs(song.positionSec - lastProgressPosition) > 2)) {\n lastProgressPosition = song.positionSec;\n\n if (init) browserIconWithoutProgressImageData = browserIconCtx.getImageData(0, 0, 38, 38);\n else browserIconCtx.putImageData(browserIconWithoutProgressImageData, 0, 0);\n\n if (lastProgressPosition) {\n browserIconCtx.strokeStyle = player.playing ? settings.showProgressColor : settings.showProgressColorPaused;\n browserIconCtx.globalAlpha = 0.5;\n browserIconCtx.lineWidth = 6;\n browserIconCtx.beginPath();\n browserIconCtx.arc(18, 19, 14, 1.5 * Math.PI, (2 * lastProgressPosition / song.info.durationSec - 0.5) * Math.PI);\n browserIconCtx.stroke();\n browserIconCtx.globalAlpha = 1.0;\n }\n return true;\n }\n return false;\n }", "playbackground1() {\r\n background(\"white\");\r\n\r\n //giving the background image details\r\n background(background_image_one);\r\n\r\n //displaying the variables\r\n\r\n \r\n ground.display();\r\n // drawSprites();\r\n\r\n \r\n \r\n \r\n }", "function _getGifBackground() {\n const img = document.createElement(\"img\");\n img.classList.add(\"gif-background\");\n document.body.appendChild(img);\n img.src =\n \"https://media0.giphy.com/media/xT9GEDhzERbjDD15O8/giphy.gif?cid=c055d487074b4dc39ac961aacbf05c265a2e0bb0136c4c8f&rid=giphy.gif&ct=g\";\n }", "function background(num){\n \n switch(num){\n \n case 0:\n $(\"#singleGameContent\").css({'background-image':'url(http://th05.deviantart.net/fs71/PRE/i/2011/177/1/0/tileable_wood_texture_02_by_ftourini-d3k1vk9.jpg)','background-size':'100%'}); \n \n break;\n \n case 1:\n $(\"#singleGameContent\").css('background-image', 'url(images/sports.png)');\n \n break;\n \n case 2:\n $(\"#singleGameContent\").css('background-image', 'url(images/history.png)');\n \n break;\n \n case 3:\n $(\"#singleGameContent\").css('background-image', 'url(images/philo.png)');\n\n break;\n \n case 4:\n $(\"#singleGameContent\").css(\"background-Color\",\"white\");\n \n break;\n \n case 5:\n $(\"#singleGameContent\").css('background-image', 'url(http://idesigniphone.net/wallpapers/54468.png)');\n \n break;\n }\n \n}", "function sliderBgSetting() {\n if ($(\".hero-slider .slide\").length) {\n $(\".hero-slider .slide\").each(function () {\n var $this = $(this);\n var img = $this.children(img);\n var imgSrc = img.attr(\"src\");\n\n $this.css({\n backgroundImage: \"url(\" + imgSrc + \")\",\n backgroundSize: \"cover\",\n backgroundPosition: \"center center\"\n })\n });\n }\n }", "function squareBackground() {\n $(squares[currentSquare]).css(\"background-image\", \"url('images/current.jpg')\");\n}", "function drawBackGround() {\n\t//for (let i = 0; i < 14; i++) {\n\t//\tfor (let j = 0; j < 10; j++) {\n\t//\t\tcontext.drawImage(bg, 64*i, 64*j);\n\t//\t}\n\t//}\n\tcontext.drawImage(bg, 0, 0,800,600);\n\n}", "function enterPause()\n{\t\n\t_canvas.style.backgroundImage = \"url(images/background.png)\";\n}", "function changeBackground() {\n if (pixabayJSON != null) {\n if (\"hits\" in pixabayJSON) {\n var hits = pixabayJSON[\"hits\"];\n var len = hits.length;\n var currentNum = generateNumber(1, len) - 1;\n var currentImage = hits[currentNum];\n if (\"webformatURL\" in currentImage) {\n var imageUrl = currentImage[\"webformatURL\"];\n var formatRegex = /_\\d+\\./;\n if (formatRegex.test(imageUrl)) {\n imageUrl = imageUrl.replace(formatRegex, '_960.');\n }\n $('.jumbotron-main').css(\"background-image\", \"url(\" + imageUrl + \")\");\n\n\n }\n\n }\n }\n}", "function DrawBackground(){\n\n // draw the background\n ctx.fillStyle = trial.background_colour;\n ctx.fillRect(0, 0, trial.canvas_dimensions[0], trial.canvas_dimensions[1]);\n\n // draw the progress text\n ctx.font = \"28px Arial\";\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n var info_text = \"Block \" + counter.block + \" of \" + counter.n_blocks + \", Trial \" + counter.trial + \" of \" + trial.n_trials;\n ctx.fillText(info_text, trial.canvas_dimensions[0]/2, 3* ctx.measureText('M').width/2);\n\n\n }", "function preload()\r\n{\r\n BG_IMG = loadImage(\"images/BG.png\");\r\n}", "function changeBGImage() {\n\t\t// get the custom data attribute from the clicked button\n\t\tlet currentImage = this.dataset.imageref;\n\n\t\t// `` is NOT a quote. it's a JavaScript template string\n\t\tdropZoneContainer.style.backgroundImage = `url(images/backGround${currentImage}.jpg)`;\n\n\n\t\t// this is an intermediate way to do the same something\n\t\t// dropZoneContainer.style.backgroundImage = `url(images/backGround${this.dataset.imageref}.jpg)`;\n\t\t// debugger;\n\t}", "function putPattern(indicator, urlImage){\n $(indicator).css({'background-image':'url(https://monkeds.github.io/images/dog_pattern.jpeg)','background-repeat': 'repeat', 'background-size': '80px 80px'});\n}", "function changeBackground() {\n\treturn Math.floor(Math.random() * 256);\n}", "function updateContextBackgroundImage() {\n\tcontextimage.attr(\"src\", \"images/\"+classdata[currclassindex].class+\"-context.png\");\n\tincrementProgress();\n}", "preload() {\n this.load.image(\"bg\", this.bgURL)\n this.load.image(\"ground\", this.groundURL)\n this.load.image(\"avatar\", this.avatarURL)\n this.load.image(\"squircle\", this.squircleURL)\n this.load.image(\"squircle_fill\", this.squircleFillURL)\n this.add.image(400, 300, \"loading\")\n }", "function updatePlayerUI(albumtTitle, albumCover) {\n playerAlbumCover.css(\"background\", \"url(\"+albumCover+\")\");\n playerAlbumCover.css(\"background-size\", \"cover\");\n playerAlbumTitle.html(\"\"+albumtTitle+\"\");\n}", "function updateBackground() {\n\n // Update the classes of all backgrounds to match the \n // states of their slides (past/present/future)\n toArray(dom.background.childNodes).forEach(function (backgroundh, h) {\n\n // Reverse past/future classes when in RTL mode\n var horizontalPast = config.rtl ? 'future' : 'past',\n horizontalFuture = config.rtl ? 'past' : 'future';\n\n backgroundh.className = 'slide-background ' + ( h < indexh ? horizontalPast : h > indexh ? horizontalFuture : 'present' );\n\n toArray(backgroundh.childNodes).forEach(function (backgroundv, v) {\n\n backgroundv.className = 'slide-background ' + ( v < indexv ? 'past' : v > indexv ? 'future' : 'present' );\n\n });\n\n });\n\n // Allow the first background to apply without transition\n setTimeout(function () {\n dom.background.classList.remove('no-transition');\n }, 1);\n\n }", "function UpdateTut(direction){\n var gameTutorial = document.getElementById('gameTutorial');\n var currentTut = parseInt(document.getElementById('currentTut').innerHTML);\n if(direction == \"next\" && currentTut < 3){\n var nextTut = (currentTut + 1);\n nextTut = nextTut + \"tut.png\";\n document.getElementById('currentTut').innerHTML = nextTut;\n gameTutorial.style.backgroundImage = \"url('\"+nextTut+\"')\";\n }\n else if(direction == \"previous\" && currentTut > 1){\n var previousTut = (currentTut - 1);\n previousTut = previousTut + \"tut.png\";\n document.getElementById('currentTut').innerHTML = previousTut;\n gameTutorial.style.backgroundImage = \"url('\"+previousTut+\"')\";\n }\n}", "function get_data(){\n \n setTimeout(get_data,window.play_update_interval); \n if(window.cur_player == window.my_player){\n return true;\n }\n \n $.getJSON('ajax',{\n action: 'get'\n },function(data){\n \n \n \n window.cur_player = data.cur_player;\n // $(\"#cur_player\").html(cur_player + ' Turn !');\n \n $.each(data.pieces,function(i, item){\n \n $('#'+item.id).attr('player',item.player); \n $('#'+item.id).attr('piece',item.piece); \n \n \n if(item.cover == \"true\"){\n $('#'+item.id).css(\"background-image\",'');\n $('#'+item.id).addClass('cover'); \n \n }else{\n $('#'+item.id).removeClass('cover');\n \n \n if(item.player == 'none'){\n $('#'+item.id).css(\"background-image\",'');\n \n }else{\n \n \n $('#'+item.id).css(\"background-image\",\"url('img/\" + item.player + \"_\" + item.piece + \".png')\"); \n }\n \n }\n }); \n \n \n get_result();\n \n });\n \n return true;\n}", "function st_container_bg() {\r\n\r\n\t\tp('.st-container-bg').each(function(){\r\n\r\n\t\t\tvar\r\n\t\t\t\tcontainer = p(this),\r\n\t\t\t\tscreenW = container.innerWidth(),\r\n\t\t\t\tscreenH = container.innerHeight(),\r\n\t\t\t\timageURL = container.css('background-image'),\r\n\t\t\t\timage,\r\n\t\t\t\timageRatio;\r\n\r\n\t\t\t\t// Remove url() or in case of Chrome url(\"\")\r\n\t\t\t\timageURL = imageURL.match(/^url\\(\"?(.+?)\"?\\)$/);\r\n\t\t\t\t\r\n\t\t\t\tif ( imageURL && imageURL[1] ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\timageURL = imageURL[1];\r\n\t\t\t\t\timage = new Image();\r\n\r\n\t\t\t\t\timage.src = imageURL;\r\n\r\n\t\t\t\t\t// just in case it is not already loaded\r\n\t\t\t\t\tp(image).load(function() {\r\n\r\n\t\t\t\t\t\timageRatio = image.width / image.height;\r\n\r\n\t\t\t\t\t\tif ( ( screenW / imageRatio ) < screenH ) {\r\n\t\t\t\t\t\t\tcontainer.css( 'background-size', 'auto 100%' ); }\r\n\t\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcontainer.css( 'background-size', '100% auto' ); }\r\n\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t}\r\n\t\r\n\t\t});\r\n\t\r\n\t}", "function displayLoadedBackgroundVideoTheme(message) { \r\n $(\"#squaresLoadingProgress\").text(100);\r\n var popup = $(\"#popupDownloadVideoThemeOverlay\");\r\n var currentOpacity = popup.css(\"opacity\");\r\n if(currentOpacity)\r\n themeVideoHidePopup(popup, function(popup) {\r\n popup.hide();\r\n });\r\n\r\n if(message.display)\r\n updatePageBackgroundVideo(message);\r\n}", "function preload(){\r\n backImg = loadImage('background.jpg');\r\n}", "function preload() {\n \n bgImage = loadImage(\"assets/swamp.jpg\");\n bgImage2 = loadImage(\"assets/forest.jpg\");\n}", "function get_active_image() {\n // detecto la imagen que esta al frente.\n if (getComputedStyle(ref_image_1).zIndex == 1) { image = 1; return ref_image_1.src }\n if (getComputedStyle(ref_image_2).zIndex == 1) { image = 2; return ref_image_2.src }\n if (getComputedStyle(ref_image_3).zIndex == 1) { image = 3; return ref_image_3.src }\n}", "function novel_finishLoadingBackground(effect, targetAlpha)\n{\n if (novel.pendingBackgroundImage && novel.pendingBackgroundImage.complete)\n {\n if (!effect)\n {\n novel_setAlpha(novel.pendingBackgroundImage, targetAlpha);\n novel.bgAlpha = targetAlpha;\n playNovel();\n }\n else if (effect == \"fade\")\n {\n novel_fadeBgIn(targetAlpha);\n }\n else if (effect == \"dissolve\")\n {\n novel_dissolveIn(targetAlpha, 0);\n }\n novel.pendingBackgroundImage = null;\n }\n else\n {\n setTimeout('novel_finishLoadingBackground(\"' + effect + '\", ' + targetAlpha + ')', 30);\n } \n}", "getProgressColor() {\n if (this.state.pastStepCount / this.state.stepGoal >= 1) {\n return \"skyblue\";\n } else if (this.state.pastStepCount / this.state.stepGoal >= 0.9) {\n return \"#b819fc\";\n } else if (this.state.pastStepCount / this.state.stepGoal >= 0.5) {\n return \"#d3f2ff\";\n } else if (this.state.pastStepCount / this.state.stepGoal >= 0.33) {\n return \"#e8f8ff\";\n } else {\n return \"#ffffff\";\n }\n }", "function updateProgressBarLoadingSprites() {\n var loading = 0, loaded = 0;\n // Loading.\n loading += view.getResourceManager().getLoadingCount();\n // Loaded.\n loaded += view.getResourceManager().getLoadedCount();\n // Progress %\n status.setStatusText(\"Loading Sprites (\" + loaded + \" / \" + (loaded + loading) + \")\");\n status.setProgress(Math.floor(100 * (loaded || 0) / (((loading || 0) + (loaded || 0)) || Infinity)) / 100);\n }", "function getCurrentPhoto(index, pos) {\n if (pos == \"fg\") {\n document.getElementById(foreImage).src = photosURL[index];\n }\n else if (pos == \"bg\") {\n document.getElementById(backImage).src = photosURL[index];\n }\n}", "function _drawImage() {\n document.getElementById(\"bg-image\").style.backgroundImage = `url(${store.State.imgUrl})`\n\n}", "function background(){\n var option1 = \"url('background2.jpg')\";\n var option2 = \"url('background3.jpg')\";\n var option3 = \"url('background.jpg')\";\n var option4 = \"url('background4.jpg')\";\n var selected = \"\";\n var num = Math.floor(Math.random() * 4);\n if(num == 0){\n selected = option1;\n }\n else if(num == 1){\n selected = option2;\n }\n else if(num == 2){\n selected = option3;\n }\n else if(num == 3){\n selected = option4;\n }\n for (var i = 0; i<tiles.length; i++){\n tiles[i].style.backgroundImage = selected; \n } \n }", "function addBackground(stats) {\n var bg = '';\n if (stats.type.value == \"image\") {\n bg = '#main-container{background-image:' + 'url(' + basePath + 'images/' + stats.image + ');}';\n }\n else {\n bg = '#main-container{background:' + gradientPrefix + 'linear-gradient(' + stats.gradiant_start + ', ' + stats.gradiant_end + ');}';\n }\n return bg;\n }", "setBackgroundImg() {\n if (this.scene.background) {\n push();\n imageMode(CENTER);\n image(this.backgroundImg.img, this.backgroundImg.position.x, this.backgroundImg.position.y, this.backgroundImg.size.width, this.backgroundImg.size.height);\n pop();\n }\n }", "function preload(){\nbg=loadImage(\"Img/bng.png\")\np1Img=loadImage(\"Img/p1.png\")\n}", "function getBg(value){\n if(value < 0.85) return \"rgba(255, 0, 0, 0.3)\"\n if(value < 0.91) return \"rgba(255, 255, 0, 0.3)\"\n return \"rgba(0, 255, 0, 0.3)\"\n}", "function runDanceAnimation(index) {\n\n canvases[index].style.backgroundImage = dances[index]\n console.log(canvases[index].style.backgroundImage)\n}", "function enterLoadGame()\n{\n\t_canvas.style.backgroundImage = \"url(images/background.png\";\n}", "preload() {\n GameBase.prototype.preload.call(this);\n\n // Track assets\n this.load.image('mediumTrack', 'images/tracks/mediumTrack.png');\n //this.load.image('backdrop', 'images/backdrop.png'); find a good backdrop for levels\n }", "function styleBackgroundPhoto(src) {\n return {\n backgroundImage: 'url(' + src + ')',\n }\n}", "function roomBackground()\r\n{ \r\n\t$.ajax({\r\n\t\turl: \"core/rc.listings.php?list=background&rid=\"+room,\r\n\t\tcache: false,\r\n\t\tsuccess: function(html)\r\n\t\t{\r\n\t\t\tif ($.trim(html) != \"nobg\")\r\n\t\t\t{\r\n\t\t\t\t$('#messages').css('background-image', 'url(' + html + ')');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$('#messages').css('background-image', 'none');\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n}", "function updatePicture(count) {\n\n \"use strict\";\n var path = \"images/progress\";\n path = path+count+\".png\";\n document.getElementById('progress').src = path;\n\n}", "function getBgColorUponFlashingStopped() {\r\n\treturn \"transparent\";\r\n}", "setBackgroundImage(valueNew){let t=e.ValueConverter.toString(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"BackgroundImage\")),t!==this.__background.image&&(this.__background.image=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"BackgroundImage\"}),this.__processBackgroundImage())}", "function Background() {\n _super.call(this, \"BG_Game\");\n this._repeat(0);\n this.name = \"background\";\n // If _speed.x = -1, loops once.\n // move slower, so image doesn't \"loop\" before the chimney/end shows update\n this._speed.x = -0.65;\n }", "function loadBackgroundImage() {\n var objects = document.getElementsByClassName('asyncImage');\n\n Array.from(objects).map((item) => {\n const img = new Image();\n img.src = item.dataset.src;\n\n img.onload = () => {\n item.classList.remove('asyncImage');\n if (item.nodeName === 'IMG') {\n $(\"html\").css(\"background-image\", `url(data/background_async.jpg)`);\n }\n };\n });\n\n document.getElementById('background-async').remove();\n}", "function replaceDiscordBackground(bgImage){\r\n\t\r\n\t// Identify discord background-element\r\n var backgroundElement = document.getElementById('app-mount');\r\n\r\n // If the background element doesn't exist, repeat the process after 250ms \r\n if(!backgroundElement) {\r\n \tsetTimeout(replaceDiscordBackground, 250); \r\n }\r\n else {\r\n \t\r\n \t// Set image\r\n backgroundElement.style.backgroundImage = bgImage;\r\n \r\n // Set transparency\r\n backgroundElement.style.backgroundColor = \"rgba(255, 0, 0, 0.15);\";\r\n\r\n // Set CSS background to cover\r\n backgroundElement.style.backgroundSize = \"cover\";\r\n }\r\n}" ]
[ "0.67009574", "0.63075095", "0.62776405", "0.6260093", "0.616654", "0.6065888", "0.59943736", "0.59544724", "0.58843917", "0.5865691", "0.58265716", "0.58157414", "0.58128345", "0.57561475", "0.57494366", "0.5719631", "0.57161677", "0.5712989", "0.5707925", "0.57056236", "0.57054776", "0.56929284", "0.56757563", "0.5664265", "0.56590456", "0.56449467", "0.5628803", "0.56206775", "0.56021976", "0.55950296", "0.55940974", "0.5589773", "0.5566422", "0.5552623", "0.5541411", "0.5521347", "0.55165523", "0.5514411", "0.5513132", "0.55012095", "0.5499112", "0.5495261", "0.54851526", "0.5484978", "0.5479289", "0.5474128", "0.547375", "0.54687214", "0.54673713", "0.5464252", "0.5457773", "0.5456119", "0.545532", "0.54533446", "0.54525375", "0.5440714", "0.5436005", "0.5432583", "0.54235524", "0.5421855", "0.5421607", "0.5420266", "0.54193944", "0.5414978", "0.5405622", "0.5404464", "0.53999704", "0.539193", "0.53911376", "0.5383859", "0.5382117", "0.5380327", "0.53670585", "0.5356777", "0.5354962", "0.5352565", "0.53525525", "0.53517145", "0.53516144", "0.5349505", "0.5338728", "0.5335788", "0.5335158", "0.53308743", "0.5321886", "0.5313802", "0.5312933", "0.53043693", "0.52994484", "0.5298579", "0.52942747", "0.52928793", "0.5292537", "0.52715874", "0.5271434", "0.5269855", "0.5267848", "0.5256109", "0.52560216", "0.52557576", "0.5252694" ]
0.0
-1
Draw the fight progress in the bottom of the fight scene
function StruggleDraw(NoStruggleMessage, StruggleStage) { // Draw the background image DrawImage(StruggleGetImage(StruggleStage), 0, 0); // Draw the struggle text on top if (StruggleProgress <= 0) DrawText(NoStruggleMessage, 600, 30, "white"); if (StruggleProgress >= 100) DrawText(StruggleDoneMessage, 600, 30, "white"); if ((StruggleProgress > 0) && (StruggleProgress < 100)) { DrawText(StruggleMessage, 600, 30, "white"); DrawCircle(StruggleX, StruggleY, StruggleRadius + 4, 4, "white"); } if ((StruggleProgress > 50) && (StruggleProgress < 100)) DrawText(StruggleDifficultyShown, StruggleX, StruggleY + StruggleRadius + 30, "white"); // Draw the progress meter DrawRect(399, 579, 402, 12, "white"); DrawRect(400, 580, StruggleProgress * 4, 10, "#66FF66"); DrawRect(400 + (StruggleProgress * 4), 580, (100 - StruggleProgress) * 4, 10, "red"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n\t//Redraw Background Color (Necessary?)\n\tbackground(0);\n\n\tfor (let i = 0; i < fishes.length; i++){ \n\t\t// If there is food on the screen, apply attractive force and display food\n\t\tif (food) {\n\t\t\tlet f = food.calculateAttraction(fishes[i]); \n\t\t\tfishes[i].applyForce(f); \n\t\t\tfood.display(); \n\t\t} else {\n\t\t\tfishes[i].meander();\n\t\t}\n\n\t\t// Update the properties of the fish (acceleration, velocity, location) etc\n\t\t// And display the fish\n\t\tfishes[i].update(); \n\t\tfishes[i].checkEdges();\n\t\tfishes[i].display();\n\t}\n\n\t// Text for slider\t\n\tfill(255);\n\ttextSize(16);\n\ttext('Food Size', 20, 120);\n\tfill(255);\n}", "draw() {\n let minCount = this.minuteCount();\n let minPosition = this.minutePosition();\n this.drawBG();\n this.drawFog(this.getFogOpacity(minCount, minPosition));\n this.drawActiveVisitors();\n this.drawTime(minCount);\n }", "function draw(){\n background('#BAE1FF'); //powder blue\n rect(20,100,400,400,20);\n //STATS:\n textSize(32); //size\n fill(150, 102, 153); //color of words\n text(`Happiness: ${stat.love}`, 10, 60); //string and position\n textSize(32); //size\n text(`Cleanliness: ${stat.hygiene}`, 10, 90); //string and position\n fill(150, 102, 153); //color of words\n textSize(32); //size\n text(`Hunger: ${stat.food}`, 10, 30); //string and position\n fill(150, 102, 153); //color of word\n fill(150, 102, 153); //color of word\n text(`ATLS 3300 - Object`, 300, 30); //string and position\n\n //Instructions\n textSize(30); //size\n fill(150, 102, 153); //color of words\n text(`Scan a plushy to take care of Mimitchi!`, 450, 150); //string and position\n textSize(30); //size\n text(`Cake: Feed Mimitchi`, 450, 200); //string and position\n text(`Duck Ring: Clean Mimitchi`, 450, 250); //string and position\n text(`Heart: Pet Mimitchi`, 450, 310); //string and position\n \n translate(80, 150);\n getAnimation();\n}", "draw() {\n context2d.fillStyle = 'black';\n context2d.fillRect(0, 0, this.width, this.height);\n\n this.currentScene.draw();\n\n this.gameManager.drawHUD();\n }", "function drawStatus(){\nif(shaman.hp<0) shaman.hp = 0;\nif(shaman.mp<0) shaman.mp = 0;\n\tvar cur_hp = shaman.hp/shaman.max_hp*200;\n\tvar cur_mp = shaman.mp/shaman.max_mp*200;\n\tctx.fillStyle = \"grey\";\n\tctx.strokeStyle = \"black\";\n\tctx.lineWidth = 2;\n\tctx.fillRect(0, 500, 800, 600);\n\tctx.fillStyle = \"red\";\n\tctx.fillRect(190, 505, cur_hp, 10);\n\tctx.strokeRect(190, 505, 200, 10);\n\tctx.fillStyle = \"blue\";\n\tctx.fillRect(610-cur_mp, 505, cur_mp, 10);\n\tctx.strokeRect(410, 505, 200, 10);\n\tctx.fillStyle = \"white\";\n\tctx.font = \"bold 15 px sans-serif\";\n\tctx.fillText(\"Stage: \"+(cStage+1), 1, 515);\n\tctx.fillText(\"Wave: \"+wave, 68, 515);\n\tctx.fillText(\"Total Score: \"+TotalScore, 650, 520)\t\t\n\tfor(var i = 0; i<shaman.debuffs.length; i++)\n\t\tshaman.debuffs[i].draw(i);\n}", "function drawWaterfall(){\n\t\t\n\t\t}", "function draw() {\n //----- BACKGROUND SETUP -----\n background(bg.r, bg.g, bg.b);\n\n //----- STATE SETUP -----\n if(state === 'title'){\n titleScreen();\n }\n else if (state === 'gameplay'){\n gameplay();\n }\n else if (state === 'ending'){\n //----- NUM OF LIVES CHECK -----\n if(brokenHearts <= 2){\n ending(brokenHearts, 255, 115, 171);\n } else if (brokenHearts === 3 || brokenHearts === 4){\n ending(brokenHearts, 155, 100, 120);\n } else if (brokenHearts === 5){\n ending(brokenHearts, 70, 50, 60);\n }\n }\n}", "function drawLoadingScreen() {\n if (simulation) {\n drawProgressBar(canvas.width / 2 - 100, canvas.height / 2 - 8, 200, 16, simulation.resourceManager.getProgress(), \"#888888\");\n drawRectOutline(canvas.width / 2 - 100, canvas.height / 2 - 8, 200, 16, 1, \"#888888\")\n }\n}", "function draw() {\n\n // Draw default base elements, clear previous animation frame\n clearCanvas();\n drawGround();\n drawTracks();\n\n // Check to see if the pause button is being pressed\n checkForPause();\n if (!paused) {\n drawTunnelBottom();\n //These attributes should only occur if NOT paused\n for (var i = 0; i < trains.length; i++) {\n trains[i].update();\n trains[i].show();\n }\n drawTunnelTop();\n for (var i = 0; i < hobos.length; i++) {\n hobos[i].update();\n hobos[i].show();\n }\n\n \n }\n \n\n \n\n // hobo.show also displays end screen if hobo is dead\n weatherInstance.show(hobos[0].getX()-35, hobos[0].getY()+35);\n \n weatherInstance.update();\n hobos[0].darkenHoboVision();\n\n drawGUI();\n hobos[0].showHoboGUI();\n\n if(DEBUG_STATS)\n debugStats();\n}", "function draw() {\n if (state === `title`) {\n background(0, 2, 97);\n title();\n frameCount = 0;\n } else if (state === `loading`) {\n background(0, 146, 214);\n unsureIfthisIsAnActualLoadingScreen();\n } else if (state === `bubblePoppin`) {\n background(3, 1, 105);\n mLfingerPopper();\n bubbleDisplay();\n bubbleMovement();\n playerCounter();\n conclusionConditions();\n } else if (state === `poppinChampion`) {\n background(189, 189, 189);\n winScreen();\n } else if (state === `bubblePoppinBaby`) {\n background(36, 36, 36);\n endScreen();\n }\n}", "static draw() {\n tick++;\n\n background(51);\n\n for( let b of Ball.zeBalls ) {\n b.show();\n b.step(tick);\n }\n\n // if( tick < 1000 )\n // Ball.saveScreenshot( \"balls-\" + Ball.leadingZeroes(tick, 3) );\n }", "draw() {\n if (this.isAlive) {\n fill(color(200, 0, 200));\n } else {\n fill(color(240));\n }\n noStroke();\n rect(this.column * this.size + 1, this.row * this.size + 1, this.size - 1, this.size - 1);\n }", "function draw() {\n // Kleur de achtergrond blauw, zodat je het kunt zien\n background('blue');\n \n // ga alle ballen af\n for (var i = 0; i < ballen.length; i++) {\n var bal = ballen[i];\n bal.show()\n bal.update();\n }\n}", "function draw(){\n\tbackground(255,255,255);\n\n\t//add some angry red words if you've overspent\n\tif (newTotal>dailyLimit){\n\t\tfill(255,0,0);\n\t\ttextSize(100);\n\t\ttext(\"YOU FAILED\", 50, 400);\n\t}\n\n\ttext(newTotal, 500, 100);\n\tfill(0,0,0);\n\ttextSize(50);\n\ttext(\"Total spent today: $\", 50,100);\n}", "function draw() {\n // the background image\n background(backgroundImage);\n\n if (!gameOver) {\n handleInput();\n\n moveharry();\n movesnitch();\n\n updateHealth();\n checkEating();\n\n drawsnitch();\n drawharry();\n\n drawHealthBar();\n\n }\n else {\n showGameOver();\n }\n}", "drawUI() {\n\t\tvar ctx = this.canvas.getContext('2d');\n\t\tctx.font = \"15px Courier\";\n\t\t\n\t\t// Colors to indicate the player's health situation\n\t\tif (this.player.hp >= 70) ctx.fillStyle = \"#0f0\";\n\t\telse if (this.player.hp < 70) ctx.fillStyle = \"#ff0\";\n\t\t\n\t\tif (this.player.hp < 40) ctx.fillStyle = \"#f00\";\n\t\tif (this.player.hp + this.player.armor > 100) ctx.fillStyle = \"#0ff\";\n\n\t\t// Draw the player's health\n\t\tvar max_hp = \"100\";\n\t\tvar cur_hp = this.player.hp + this.player.armor;\n\t\tvar msg = cur_hp + \"/\" + max_hp;\n\n\t\tctx.fillText(msg, this.player.position.x, this.player.position.y);\n\n\t\t// Draw the round in red above the player\n\t\tctx.fillStyle = \"#500\";\n\t\tctx.font = \"15px Arial\";\n\t\tctx.fillText(\"Round: \"+this.round, this.player.position.x, this.player.position.y-15);\n\n\t\tctx.font = \"15px Courier\";\n\t\tctx.fillStyle = \"#000\";\n\t\t\n\t\t// Draw the player's ammo reserves\n\t\tvar mag = this.player.wpn.mag;\n\t\tvar cap = this.player.wpn.cap;\n\t\tvar ammo = mag+\"/\"+cap;\n\n\t\t// Draw the player's available materials\n\t\tvar wood = this.player.materials[\"wood\"];\n\t\tvar stone = this.player.materials[\"stone\"];\n\t\tvar materials = wood+\",\"+stone;\n\n\t\t// If the player has a builder equiped, show his materials\n\t\t// otherwise, show his ammo\n\t\tif (this.player.wpn.sprite != \"builder\")\n\t\t\tctx.fillText(ammo, this.player.position.x, this.player.position.y+70);\n\t\telse {\n\t\t\tctx.fillStyle = \"#220\";\n\t\t\tctx.fillText(materials, this.player.position.x, this.player.position.y+70);\n\t\t\tctx.fillStyle = \"#000\";\n\t\t}\n\n\t\t// Draw every enemy NPC's health\n\t\tfor (var i = 1; i < this.actors.length; i ++) {\n\t\t\tif (this.actors[i].sprite in npcMap) {\n\t\t\t\tvar hp = this.actors[i].hp;\n\t\t\t\tvar z = hp + npcMap[this.actors[i].sprite];\n\t\t\t\tctx.font = \"15px Courier\";\n\t\t\t\tctx.fillStyle = \"#000\";\n\t\t\t\tctx.fillText(z, this.actors[i].position.x, this.actors[i].position.y);\n\t\t\t}\n\t\t}\n\n\t\t// Code below to draw the player's inventory\n\t\t// Drawn on a navbar defined in HTML\n\n\t\tif (this.player.weapons[0] != null)\n\t\t\tdocument.getElementById(\"inv-wpn1\").src = \"img/\"+this.player.weapons[0].sprite+'.png';\n\t\tif (this.player.weapons[1] != null) \n\t\t\tdocument.getElementById(\"inv-wpn2\").src = \"img/\"+this.player.weapons[1].sprite+'.png';\n\n\t\tfor (var i = 0; i < 5; i ++) { \n\t\t\tvar j = i+1;\n\t\t\tif (this.player.inventory[i] != null) \n\t\t\t\tdocument.getElementById(\"inv-item\" + j).src = \"img/\"+this.player.inventory[i]+'.png';\n\t\t\telse document.getElementById(\"inv-item\" + j).src = \"\";\n\t\t}\n\t}", "function draw() {\n computeBoardSize(board);\n\n context.drawImage(\n this,\n current_x_offset,\n current_y_offset,\n board.width,\n board.height\n );\n\n positionPlayer();\n clearBlinkers();\n\n for (let i of allObjects) {\n if (isInView(i.x, i.y) && !i.completed) {\n const [x, y] = normalize_image_position(i.x, i.y);\n createBlinker(x, y, i.isGold);\n }\n }\n }", "function draw() {\r\n background(46,139,87);\r\n \r\n foodObj.display();\r\n\r\n fill(255, 255, 254); \r\n textSize(15); \r\n if(lastFed>=12){\r\n\r\n text(\"Last Fed:\"+ lastFed%12+ \"PM\", 350, 30); \r\n }\r\n\r\n else if(lastFed==0){\r\n\r\n text(\"Last Fed: 12 AM\", 350, 30); \r\n }\r\n\r\n else{\r\n\r\n text(\"Last Fed:\"+ lastFed+\"AM\", 350, 30); \r\n }\r\n \r\n drawSprites();\r\n fill(255,255,254);\r\n stroke(\"black\");\r\n text(\"Food remaining : \"+foodS,170,200);\r\n textSize(13);\r\n text(\"Note: Click here to feed Spirit!\",130,10,300,20);\r\n}", "function paintTextLastScreen(){\r\n\t\t\r\n\t\tvar gameover = AppSAS.ui.resources.images['game_over'];\r\n\t\tvar finalHeightGameOver = gameover.height * AppSAS.ui.ratio;\r\n\t\tvar xDistance = AppSAS.isPortrait() ? AppSAS.ui.canvas.width / 2 : AppSAS.ui.canvas.width / 4;\r\n\t\tvar topDistanceLbl = 100 + finalHeightGameOver + (AppSAS.isPortrait() ? 175 : 140);\r\n\t\tAppSAS.ui.context.font = '50pt Minecraftia';\r\n\t\tAppSAS.ui.context.textAlign = 'center';\r\n\t\tAppSAS.ui.context.fillStyle = '#0d5d74';\r\n\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\tAppSAS.ui.context.shadowOffsetY = 0;\r\n\t\tAppSAS.ui.context.shadowBlur = 0;\r\n \tAppSAS.ui.context.fillText('DISTANCE', xDistance, topDistanceLbl);\r\n\r\n\t\tvar topDistance = topDistanceLbl + 75;\r\n\t\tAppSAS.ui.context.font = '70pt MineCrafter_3';\r\n\t\tAppSAS.ui.context.textAlign = 'center';\r\n\t\tAppSAS.ui.context.fillStyle = 'white';\r\n\t\tAppSAS.ui.context.shadowColor = '#0d5d74';\r\n\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\tAppSAS.ui.context.shadowOffsetY = 10;\r\n\t\tAppSAS.ui.context.shadowBlur = 4;\r\n \tAppSAS.ui.context.fillText(Math.floor(AppSAS.gameModel.distanceSkiff)+' M', xDistance, topDistance); \t\r\n\r\n \tvar topHighScore = AppSAS.isPortrait() ? topDistance + 225 : 150;\r\n \tvar xHighScore = AppSAS.isPortrait() ? AppSAS.ui.canvas.width / 2 : (AppSAS.ui.canvas.width * 3) / 4\r\n\t\tAppSAS.ui.context.font = '50pt Minecraftia';\r\n\t\tAppSAS.ui.context.textAlign = 'center';\r\n\t\tAppSAS.ui.context.fillStyle = '#0d5d74';\r\n\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\tAppSAS.ui.context.shadowOffsetY = 0;\r\n\t\tAppSAS.ui.context.shadowBlur = 0;\r\n \tAppSAS.ui.context.fillText('HIGH SCORES', xHighScore, topHighScore);\r\n\r\n \tvar highScores = AppSAS.gameModel.highScores;\r\n \tvar limit = Math.min(AppSAS.isPortrait() ? ConstSAS.NB_HIGHSCORES_PORTRAIT : ConstSAS.NB_HIGHSCORES_PASYAGE, highScores.length);\r\n \tfor (var i =1 ; i <= limit;i++){\r\n \t\tvar user = highScores[i-1];\r\n \t\tvar topHighScoreRow = topHighScore + (i-1) * 70 + (AppSAS.isPortrait() ? 150 : 90);\r\n \t\tvar xHighScoreRow = AppSAS.isPortrait() ? 150 : (AppSAS.ui.canvas.width / 2)+50;\r\n \t\tvar xHighScoreRowUser = xHighScoreRow + 100;\r\n\t\t\tAppSAS.ui.context.font = '30pt Minecraftia';\r\n\t\t\tAppSAS.ui.context.textAlign = 'right';\r\n\t\t\tAppSAS.ui.context.fillStyle = '#0d5d74';\r\n\t\t\tAppSAS.ui.context.shadowColor = 'white';\r\n\t\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\t\tAppSAS.ui.context.shadowOffsetY = 5;\r\n\t\t\tAppSAS.ui.context.shadowBlur = 2;\r\n\t\t\tAppSAS.ui.context.fillText(''+i, xHighScoreRow, topHighScoreRow);\r\n\t\t\tAppSAS.ui.context.textAlign = 'left';\r\n\t\t\tAppSAS.ui.context.fillStyle = 'white';\r\n\t\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\t\tAppSAS.ui.context.shadowOffsetY = 0;\r\n\t\t\tAppSAS.ui.context.shadowBlur = 0;\r\n\t\t\tAppSAS.ui.context.fillText(user.login, xHighScoreRowUser, topHighScoreRow);\r\n\t\t\tAppSAS.ui.context.textAlign = 'right';\r\n\t\t\tAppSAS.ui.context.fillText(Math.floor(user.distance)+' M', AppSAS.ui.canvas.width - 150, topHighScoreRow);\r\n \t}\r\n\t}", "drawHUD() {\n this.text.draw();\n }", "DrawPlayer() {\n this.DrawQuad(this.m_player.GetTransform().p, Fracker.LerpColor(FrackerSettings.k_playerColor, FrackerSettings.k_playerFrackColor, b2.Max(this.m_frackingFluidChargeTime /\n FrackerSettings.k_frackingFluidChargeTime, 0.0)), true);\n }", "function drawFinalBoss() {\n let chicken_x = BOSS_POSITION;\n let chicken_y = 98;\n let energybar_y = 75;\n\n bossIsRunning();\n calculateDifference();\n\n if (bossDefeatedAt > 0) {\n let timePassed = new Date().getTime() - bossDefeatedAt;\n chicken_x = chicken_x + timePassed * 0.2;\n chicken_y = chicken_y - timePassed * 0.15;\n energybar_y = -100;\n }\n\n addBackgroundobject(currentBossImage, chicken_x, bg_ground, chicken_y, 0.25, 1);\n addBackgroundobject(currentBossEnergyImage, BOSS_POSITION - 30, bg_ground, energybar_y, 0.4, 1);\n}", "function drawHUD() {\n\tcontext.fillStyle = \"#100505\";\n\tcontext.font = \"15px Verdana\";\n\tlet textWidth;\n\tswitch (screen) {\n\t\tcase 'game':\n\t\t\t\tbirghtenBackGround(0, 0, 150, 100);\n\t\t\tcontext.fillText(\"Cadeaux : \"+ gift, 10, 20);\n\t\t\tcontext.fillText(\"Monnaie : \"+ money, 10, 40);\n\t\t\tcontext.fillText(\"Temps : \" + (210 - time), 10, 60);\n\t\t\tcontext.fillText(\"Score : \" + score, 10, 80);\n\t\t\tbreak;\n\t\tcase 'start':\n\t\t\tbirghtenBackGround();\n\t\t\tcontext.fillStyle = \"#100505\";\n\t\t\t\tcontext.font = \"15px Verdana\";\n\t\t\t\tlet lineheight = 20;\n\t\t\t\tfor (let i = 0; i<startText.length; i++) {\n\t\t\t\t\ttextWidth = context.measureText(startText[i]).width;\n\t\t\t\t context.fillText(startText[i], (canvas.width-textWidth)/2,\n\t\t\t\t \t\t\t\t\t\t\t (canvas.height-lineheight*startText.length)/2 + (i*lineheight)\n\t\t\t\t );\n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase 'won':\n\t\t\tbirghtenBackGround();\n\t\t\ttextWidth = context.measureText(\"You won with \"+money+\" euros\").width;\n\t\t context.fillText(\"You won with \"+money+\" euros\", (canvas.width-textWidth)/2, (canvas.height-30)/2);\n\t\t context.fillText(\"retry ?\", canvas.width-(textWidth), (canvas.height-30));\n\t\t\tbreak;\n\t\tcase 'lose':\n\t\t\tbirghtenBackGround();\n\t\t\ttextWidth = context.measureText(\"You lose with \"+gift+\" gifts remaining\").width;\n\t\t context.fillText(\"You lose with \"+gift+\" gifts remaining\", (canvas.width-textWidth)/2, (canvas.height-30)/2);\n\t\t context.fillText(\"...retry ?\", canvas.width-(textWidth), (canvas.height-30));\n\t\t\tbreak;\n\t}\n}", "function draw() {\r\n if (x < background.w)x += 1;\r\n else x=0;\r\n if(theme==\"basic\"){\r\n bgImg=background.img;\r\n }else bgImg=backgroundSnow.img; \r\n context.drawImage(bgImg, x, 0, background.w, background.h, 0, 0, background.w ,background.h); \r\n context.save();\r\n animate(); // call function for animate player\r\n context.restore(); \r\n context.drawImage(flag.img, flag.w, flag.h); \r\n context.drawImage(tuyau.img, tuyau.w, tuyau.h); \r\n if(!progress){\r\n context.drawImage(win.img, win.w, win.h);\r\n }\r\n }", "function draw() {\n /* Drawing function where you can get all the objects moving\n *\n */\n\n background(100, 140, 130);\n screenStats();\n checkBoudaries();\n arrivalParticle();\n timeelapsed();\n particleX();\n console.log('How Many Frames per Second : ' + requestAnimFrame());\n}", "show() {\r\n if (this.life === 0) {\r\n this.shade = 50;\r\n }else{\r\n this.shade = 200;\r\n }\r\n fill(this.shade);\r\n rect(this.x, this.y, res, res);\r\n }", "drawBottomPipe() {\n\n // Draw the bottom pipe\n paint.fillStyle = this.color;\n paint.fillRect(this.x, this.y, this.width, this.height);\n\n }", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function draw() {\n if (controllers.free_flow_flag) {\n draw_step();\n }\n\n}", "function draw() {\r\n background(46,139,87);\r\ncurrentTime=hour();\r\nif(currentTime === lastFed + 1){\r\n gameState = \"playing\";\r\n updateGameState();\r\n foodObj.garden();\r\n}\r\nelse if(currentTime === lastFed + 2){\r\ngameState = \"sleeping\";\r\nupdateGameState();\r\nfoodObj.bedroom();\r\n}\r\nelse if(currentTime > lastFed + 2 && currentTime <= lastFed + 4){\r\n gameState = \"bathing\";\r\n updateGameState();\r\n foodObj.washroom();\r\n}\r\nelse{\r\ngameState=\"hungry\";\r\nupdateGameState();\r\nfoodObj.display();\r\n}\r\n\r\n foodObj.getFoodStock(),\r\n\r\n \r\ngetGameState();\r\n\r\n\r\n fedTime=database.ref('feedTime ');\r\n fedTime.on(\"value\",function(data){\r\n lastFed=data.val();\r\n })\r\n\r\n if(gameState === \"hungry\"){\r\nfeed.show();\r\naddFood.show();\r\ndog.addAnimation(\"hungry\",hungryDogIMG);\r\n}\r\n else{\r\nfeed.hide();\r\naddFood.hide();\r\ndog.remove();\r\n}\r\ndrawSprites();\r\ntextSize(32);\r\nfill(\"red\");\r\ntextSize(20);\r\ntext(\"Last fed:\"+lastFed+\":00\",300,95);\r\ntext(\"Time since last fed: \"+(currentTime-lastFed),300,125);\r\n}", "function UpdateTheProgressBar(gameStats){\n var pr = document.getElementById('progressBar').getContext('2d');\n pr.fillStyle = \"royalblue\";\n var progress = (gameStats.score/gameStats.neededScore)*100;\n progress = Math.round((progress/100) * 390);\n pr.fillRect(0,0,progress,50);\n console.log(gameStats);\n}", "function draw() {\n // menggambar dicanvas sekaligus aksi\n drawShip();\n drawEnemy();\n drawPeluru();\n \n // aksi tembak\n tembak();\n \n // update score & lives board\n update();\n}", "doDraw() {\n console.log(\"big game over\");\n draw_context.fillStyle = \"#000F\";\n draw_context.fillRect(0,0, canvas_element.width,canvas_element.height);\n draw_context.lineWidth = 20;\n draw_context.lineJoin = \"round\";\n draw_context.textAlign = \"center\";\n draw_context.font = \"80px Lemon\";\n draw_context.strokeStyle = \"#fff\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n draw_context.lineWidth = 10;\n draw_context.strokeStyle = \"#000\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n \n draw_context.fillStyle = this.grad1;\n draw_context.fillText(this.text, canvas_element.width/2, this.vertical);\n }", "function draw() {\n // Any addittional control code.\n handleSpeed()\n\n // Drawing code for game.\n background(0)\n fill(255, 255, 255)\n textSize(40)\n text(\"Tetris\", 340, 100)\n textSize(20)\n text(\"Score: \" + game.score, 345, 150)\n text(\"Lines: \" + game.lines, 345, 180)\n text(\"Next Piece\", 345, 250)\n reDrawGame() // Draws the tetris board.\n\n // Perform a step of the game.\n game.gameFrame()\n}", "function draw() {\r\n canvas_resize();\r\n set_origin();\r\n set_speed();\r\n bars[it].display();\r\n if (looping && it < nb_op) it++;\r\n}", "function drawLoadingScreen(){\n ctx.fillStyle = \"black\";\n ctx.fillRect(0,0,width,height);\n ctx.fillStyle = \"white\";\n ctx.font = \"100px Sniglet\";\n ctx.fillText(\"Loading...\", width / 2 - 200, height / 2 - 50);\n}", "function draw() {\n\tif (credits >= 0) {\n\t\tif(turnInProgress) {\n\t\t\tdoTurn();\n\t\t} else if (credits > 0) {\n\t\t\t// make sure user cant bet more than the have\n\t\t\tif (bet > credits) { bet = 1; }\n\t\t\tnextTurn();\n\t\t}\n\t\tturnInProgress = !turnInProgress;\n\t}\n\trender();\n}", "function DrawBackground(){\n\n // draw the background\n ctx.fillStyle = trial.background_colour;\n ctx.fillRect(0, 0, trial.canvas_dimensions[0], trial.canvas_dimensions[1]);\n\n // draw the progress text\n ctx.font = \"28px Arial\";\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n var info_text = \"Block \" + counter.block + \" of \" + counter.n_blocks + \", Trial \" + counter.trial + \" of \" + trial.n_trials;\n ctx.fillText(info_text, trial.canvas_dimensions[0]/2, 3* ctx.measureText('M').width/2);\n\n\n }", "draw() {\n this.drawExistingEntities();\n this.disableEntities();\n this.blockHeroMovement();\n this.killedEnemiesCounter();\n }", "draw(ctx) {\n if (Math.round(parseFloat(this.floatY) * 10) > 50) {\n this.step = -.1\n }\n else if (Math.round(parseFloat(this.floatY) * 10) < -50) {\n this.step = +.1\n }\n if (!this.drank) {\n ctx.drawImage(this.imagesheet, 0, 0, 50, 65, this.x - this.game.camera.x, this.y - this.game.camera.y + this.floatY, this.w, this.h);\n }\n if (PARAMS.DEBUG) {\n if (PARAMS.DEBUG) {\n ctx.strokeStyle = 'Red';\n ctx.strokeRect(this.BB.x - this.game.camera.x, this.BB.y - this.game.camera.y + this.floatY, this.BB.width, this.BB.height);\n }\n }\n }", "function draw() {\n background(0);\n\n // draws title\n drawTitle();\n\n // draws the replay button\n clickButton.draw();\n\n // update new random panel\n checkRunTime();\n\n //draw board\n drawBoard();\n\n //draw tally\n drawTally();\n}", "function drawHealth() {\n push()\n fill(healthColor, 255, 100);\n noStroke();\n textSize(22);\n textAlign(RIGHT);\n text(\"HEALTH-->\", width / 1.1, height - 20)\n rect(width - 50, height, width - 50, -playerHealth);\n //if the players health is gettin glow, turn the recangle red, and play a ticking clock sound\n if (playerHealth < playerMaxHealth / 3) {\n healthColor = 0;\n tickTock.play();\n } else {\n healthColor = 120;\n tickTock.stop();\n }\n pop();\n}", "function renderTop() {\n ctx.fillStyle = \"#333\";\n ctx.fillRect(0, 0, gameWidth, 50);\n\n renderLifeRemains();\n renderScore();\n renderTime();\n}", "draw() {\n\t\tpush()\n\t\timageMode(CENTER);\n\t\tif (this.isRolling)\n\t\t\tthis.handleRolling();\n\t\telse // Draw current die value\n\t\t\timage(this.faces[this.faceValue - 1], this.position.x, this.position.y);\n\t\tpop();\n\t}", "function draw() {\r\n\t\r\n\t// draws updated time/bombs left\r\n\ttextSize(50);\r\n\r\n\tstrokeWeight(7);\r\n\tstroke(0);\r\n\tfill(0);\r\n\trect(0,480,900,200);\r\n\r\n\tif(!gameOver){\r\n\t\tif(currentSecond != second()) {\r\n\t\t\tcurrentSecond = second();\r\n\t\t\ttime ++;\r\n\t\t}\r\n\t}\r\n\r\n\t// draws time elapsed\r\n\tstroke(255,255,255);\r\n\tstrokeWeight(1);\r\n\tfill(255,255,255);\r\n\ttext(\"Seconds: \" + time , 75 , 580);\r\n\t\r\n\r\n\t// checks if all bombs have been flagged\r\n\tlet bombsFlagged = 0;\r\n\tfor(let i = 0; i < bombArray.length; i ++) {\r\n\t\tif(table[bombArray[i].x][bombArray[i].y].getFlagged()) {\r\n\t\t\tbombsFlagged++;\r\n\t\t}\r\n\t}\r\n\tif(bombsFlagged == totalBombs) {\r\n\t\ttext(\"YOU WIN!\" , 300, 300);\r\n\t\tgameOver = true;\r\n\t}\r\n\r\n\t// bombs left\r\n\ttext(\"Flags left: \" + bombsLeft, 600, 580);\r\n\r\n\r\n\t// reset stroke color and weight\r\n\tstrokeWeight(1);\r\n\tstroke(0);\r\n}", "function draw() {\n background(240);\n drawTarget();\n}", "function draw() {\n\n if (now.progress.day > 0.5) {\n message.fill (0);\n background (255,255,255);\n } else {\n message.fill (255,255,255);\n background(0,0,0);\n }\n\n frameRate(60);\n rotateY(angle1);\n sphere (150, 150, 150, 150);\n angle1 += .01;\n texture(message);\n \n\n // let redTime = message.text(moment().format('MMMM Do YYYY, h:mm:ss a'), 250, 250);\n // graphics.fill(random(255));\n // texture(redTime);\n // image(graphics,0,-100);\n }", "function draw() {\r\n\tdrawTimer();\r\n\t//drawGratii();\r\n}", "draw() {\n // this calls PNGRoom.draw()\n super.draw();\n \n push();\n\n fill(248, 248, 248, 180)\n stroke(146, 161, 161);\n rect(this.drawX - 15, this.drawY - 60, width - ((this.drawX - 15) * 2),height - (this.drawY + 250), 30)\n\n // title text\n fill(\"#8D8D8D\");\n textAlign(LEFT);\n textFont(headlineFont);\n textSize(36);\n noStroke();\n\n\n text(\"$ \" + budget, this.drawX + 200 , 60);\n\n fill(\"#484848\");\n text(\"Budget: \",this.drawX , 60)\n // title text\n textSize(30);\n\n text(\"- \" + this.titleText, this.drawX , this.drawY);\n \n // Draw text in a box\n //text(this.titleText, width/6, height/6, this.textBoxWidth, this.textBoxHeight );\n \n textFont(bodyFont);\n textSize(24);\n fill(\"#8D8D8D\");\n\n text(this.bodyText, this.drawX , this.drawY + 60, width - (this.drawX*2),height - (this.drawY+100) );\n pop();\n\n\n }", "function drawUI() {\n\t\t\tflashcard.draw(ctx, correctAnswer);\n\t\t\tif(timer != null)\n\t\t\t\ttimer.draw(ctx);\n\t\t\t\n\t\t\tif(fire != null)\n\t\t\t\tfire.draw(ctx);\n\t\t\tctx.fillStyle = \"black\";\n\t\t\tctx.font = \"15px Airstrike\";\n\t\t\tctx.fillText(\"Points\", 50, canvas.height/2+20);\n\t\t\tctx.font = \"25px Airstrike\";\n\t\t\tctx.fillText(\"Speed\", canvas.width-170, canvas.height/2+20);\n\t\t\tctx.fillStyle = \"white\";\n\t\t\tctx.font = \"60px Airstrike\";\n\t\t\tctx.fillText(points, 70, canvas.height/2);\n\t\t\tctx.fillStyle = \"yellow\";\n\t\t\tif(Math.round(speed*45) >= 80)\n\t\t\t\tctx.fillStyle = \"red\";\n\t\t\telse if(Math.round(speed*45) >= 60)\n\t\t\t\tctx.fillStyle = \"orange\";\n\t\t\tctx.fillText(Math.round(speed*45), canvas.width-200, canvas.height/2-10);\n\t\t\tctx.font = \"20px Airstrike\";\n\t\t\tctx.fillText(\"MPH\", canvas.width-110, canvas.height/2-10);\n\t\t}", "function draw(w,h)\r\n{\r\n //of.Background(0,0,0);\n\tof.SetColor(0,0,0,50);\n\tof.Rect(0,0,w,h);\t\r\n \tvar p;\r\n for (var i=this.listParticles.length-1; i>=0 ; i-- )\r\n \t{\r\n \t\tp = this.listParticles[i];\r\n //println(p.color);\r\n r = (p.color >> 16) & 0xFF;\r\n g = (p.color >> 8) & 0xFF;\r\n b = p.color & 0xFF;\r\n \t\tof.SetColor(r,g,b,255*(1.0-p.age/p.ageMax)); // alpha qui dépend de l'age de la particule\r\n \t\tp.draw();\r\n\r\n if(i < this.listParticles.length-1) {\r\n of.Line(previous_p.x, previous_p.y, p.x, p.y);\r\n }\r\n previous_p = p;\r\n \t}\r\n}", "function draw() {\n if (state === `loading`) {\n loading();\n }\n else if (state === `running`) {\n running();\n }\n}", "function draw() {\n background(\"#616363\");\n \n // Show each square on the board\n if (board.length > 0) {\n for (let i = 0; i < numSquaresY; i++) {\n for (let j = 0; j < numSquaresX; j++) {\n board[i][j].show();\n }\n }\n }\n \n // Tell them if they are waiting for the game to be over\n if (!canPlay) {\n app.status = 'Please wait for the game to be over or the host to start the game.';\n }\n \n // Checks if the player has won/lost\n if (checkWin() && !endMessageShown) {\n sendGameOver();\n endMessageShown = true;\n } else if (!playerAlive && !endMessageShown) {\n app.showModal('You\\'ve died!',\n 'You can still win, so stick around to the end!',\n false, '',\n 'Exit');\n \n endMessageShown = true;\n }\n \n // Check if time is up\n if (time <= 0 && !endMessageShown) {\n sendGameOver();\n endTimer();\n }\n\n // Displays number of remaining mines and the time\n textSize(50);\n textAlign(LEFT, BASELINE);\n fill(255, 0, 0);\n text(startingMines - numPlacedFlags, 50, headerHeight - 5);\n text(time, width - 100, headerHeight - 5);\n}", "function draw() {\n var isHit = false; // Initialize to false\n background(0);\n drawTerrain();\n\n wallManager(); // Add and remove walls as they enter and leave the screen.\n \n // Update all walls position and draw.\n for (let i=0; i<walls.length; i++) {\n walls[i].move();\n walls[i].draw();\n isHit |= walls[i].isHitBy(trump); // True if hit by any wall.\n }\n trump.DEBUG = isHit; // Show debug overlay when hit.\n if (isHit) {trump.deathEvent();} // Perform Death functions and sounds.\n \n trump.applyGravity();\n trump.draw();\n}", "function render() {\n // showFPSaverage();\n showCompletedLines();\n game.getBoard.drawme();\n\n // game.getBoard.getPieces.forEach(piece => piece.drawme());\n}", "function draw() {\n\t//updating all the partical\n\tupdate();\n\t//drawing\n\tbackground(41, 128, 185);\n\tfor(var index = 0; index < particleSystem.length; index++) {\n\t\tparticleSystem[index].draw()\n\t}\n\n\t//text(\"fps\" + frameRate(), 25, 100);\n}", "function draw() {\n background(`aliceblue`);\n\n switch (state) {\n case `menu`:\n menuGame();\n break;\n case `startGame`:\n startGame();\n break;\n case `endGame`:\n endGame()\n break;\n default:\n break;\n }\n\n displayUser(125, height / 1.5, 150, 4, 250);\n // getting the money data\n dataM = JSON.parse(localStorage.getItem(`money-data`));\n $(`.walletMoneyTxt`).text(`CURRENT BALANCE = ` + dataM + `$`);\n}", "function draw() {\n // Fade existing trails\n var prev = g.globalCompositeOperation;\n g.globalCompositeOperation = \"destination-in\";\n g.fillRect(0, 0, mapView.width, mapView.height);\n g.globalCompositeOperation = prev;\n\n // Draw new particle trails\n particles.forEach(function(particle) {\n if (particle.age < settings.maxParticleAge) {\n g.moveTo(particle.x, particle.y);\n g.lineTo(particle.xt, particle.yt);\n particle.x = particle.xt;\n particle.y = particle.yt;\n }\n });\n }", "function draw(){\n // background color\n\tbackground(30);\n\n if (pause){\n fill(200);\n textSize(50);\n text(\"PAUSED\", 200, 300);\n }\n\n if (endGame){\n fill(255);\n textSize(26);\n text(scoreMessage, 215, 300);\n }\n\n if(alertCond){\n fill(200);\n textSize(30);\n text(alertMessage, 50, 250);\n setTimeout(resetAlert,1200);\n }\n\n\tsnake.update(run);\n\tsnake.show();\n for(i = 0; i < foods.length; i++){\n foods[i].show();\n snake.eat(foods[i],i);\n }\n\n for(i=0;i<skins.length;i++){\n skins[i].show();\n snake.touchSkin(skins[i]);\n }\n\n fill(255);\n textSize(14);\n text(\"Score: \" + score.getScore(), Math.floor(gameSize*0.85), Math.floor(gameSize*0.93));\n\n \n}", "function draw() {\n\n if (master == true) {\n\n if (mode == 'boomTss') {\n boomViz();\n }\n if (mode == 'gradients') {\n gradientMaster(500);\n }\n if (mode == 'drumPass') {\n drumViz();\n }\n if (mode == 'shockWave'){\n background(0);\n wavePropagate();\n }\n if (mode == 'textFlicker'){\n //fill(255);\n if (frameCount % 5 == 0){\n textLoad();\n }\n textFlick();\n }\n if (mode == 'grassy'){\n grassAttractor();\n grassMove();\n }\n }\n if (master == false) {\n\n if (mode == 'boomTss') {\n tssViz();\n }\n if (mode == 'gradients') {\n gradientMaster(100);\n }\n if (mode == 'drumPass') {\n drumViz();\n }\n if (mode == 'shockWave'){\n background(0);\n wavePropagate();\n }\n if (mode == 'grassy'){\n grassAttractor();\n grassMove();\n }\n }\n\n}", "function draw() {\n\n if (startGame == true) {\n background(BG_COLOR);\n drawForest();\n drawTrails();\n drawBlood();\n drawHikers();\n drawBear(bearX, bearY);\n moveHikers();\n moveBear();\n hikerCollide();\n allHikers();\n gameWon();\n }\n}", "function draw() {\n background(204, 231, 227)\n checkState();\n}", "function draw() {\r\n\t //debugger;\r\n\t //selectedLeague = loadJSON('assets/ligue1-2017.json');\r\n\t //stroke(153);\r\n\t //line(200,200, 1400, 1400);\r\n\t \r\n\t \r\n\t \r\n\t}", "function InventoryItemMouthFuturisticHarnessPanelGagDraw() {\n\tInventoryItemMouthFuturisticPanelGagDraw();\n}", "function draw() {\n background(0);\n backgroundMove();\n crateShow();\n if(state === `start`){\n intro();\n }\n else if(state === `diffSelect`){\n diffSelect();\n }\n else if(state === `simulation`){\n simulation();\n }\n else if(state === `winEnding`){\n winEnding();\n }\n else if(state === `loseEnding`){\n loseEnding();\n }\n}", "function draw(){\t\n\trequestAnimationFrame(draw); //allows for maximum use of the hardwares potential\n}", "function draw(){\n ctx.fillStyle = \"black\";\n ctx.clearRect(0,0, 1200, 300);\n ctx.beginPath();\n ctx.fillRect(0, 0, 1000, 400);\n //Call function for robot head drawing\n robotHead();\n // Draw mountain range in background\n mountainRange();\n targetDraw();\n if(monster == 1){\n\tmonster1();\n }\n if(monster == 2){\n\tmonster2();\n }\n if(monster == 3){\n\tmonster3();\n }\n screenText();\n ctx.strokeStyle = 'white';\n ctx.stroke();\n // call draw livebars function\n livebars();\n}", "function drawScene(){\n\tapp.context.fillStyle=\"transparent\";\n\tapp.context.fillRect(0,0, app.canvas.width, app.canvas.height);\n\n\t// app.context.fillStyle=\"rgba(0,0,0,.1)\";\n\t// app.context.fillRect(0,0,app.canvas.width,app.canvas.height); //add ball trail\n\n\tapp.ball.drawMe(app.context);\n\tapp.playerOne.drawMe(app.context);\n\tapp.playerTwo.drawMe(app.context);\n}", "function updateScreen(){\t//funcio (bucle) que s'executa per actualitzar l'estat de la pantalla del joc\n\tcuttingSegments();\t//mira si hi ha segments que es creuin\n\tdrawAll();\t\t\t//dibuixa al canvas\n\tupdateState();\t\t//reescriu el nivell i el % completat\n}", "function draw(){\n //set background\n background(145, 173, 150);\n //push score object into index 1 of concrete\n concrete[1] = new score(\"Score: \", 35, scoreCount, 14, 60);\n //push level object into index 1 of concrete\n concrete[2] = new score(\"Level\", 35, level, width - 154, 60);\n //push frog object into index 0 of concrete\n concrete[0] = new frog(img, 200, xposFrog, yposFrog);\n //display and move fireflies\n for(var i = 0; i < flObjects.length; i++){ flObjects[i].display(); flObjects[i].move();}\n\n //display objects\n for(var i = 0; i < concrete.length; i++){concrete[i].display();}\n //display all fly objects in array\n for(var i = 0; i < flies.length; i++){\n flyObjects[i].display(); flyObjects[i].buzz(); flyObjects[i].kill();\n if(flyObjects[i].intersect() === true && flyObjects[i].getId() === false){\n scoreCount += 1;\n flyObjects[i].setId(true);}\n }\n if(scoreCount === flyNumber){\n //flySound.stop();\n fill(255, 89, 34, 150);\n textSize(50);\n text(\"Game Over \", (width/2) - 150, (height/2));\n fill(0, 0, 0, 150);\n textSize(30);\n text(\" Click Next Level ⬆️\", (width/2) - 150, (height/2) + 50);\n console.log(level + \":\" + scoreCount + \" -> \" + \"success\");\n var nextlevel = level + 1;\n loadJSON('add/' + level + '/' + nextlevel, function(data){\n console.log(data);\n });\n noLoop();\n }\n for(var i = 0; i < flies.length; i++){\n if(flyObjects[i].getId() === true && flyObjects[i].intersect() === true && scoreCount < flyNumber){\n concrete[0].eat(concrete[0].x, concrete[0].y - 24, flyObjects[i].x, flyObjects[i].y);\n flyObjects[i].y = flyObjects[i].y + 60;\n flyObjects[i].setExcecute(false);\n }\n }\n strokeWeight(8);\n fill(200, 52, 0);\n stroke(200, 52, 0, 200);\n ellipse(concrete[0].x, concrete[0].y - 24, 15, 15);\nfor(var i = 0; i < flies.length; i++){\n if(falling(concrete[0], flyObjects[i], concrete[0].x, concrete[0].y) === true){\n flyObjects[i].x = flyObjects[i].x + 50;\n console.log(\"intersect\");\n }\n }\n}", "function drawGameScreen(){\n ctx.linewitdh = 1;\n ctx.clearRect(0,0,c.width,c.height);\n redrawBorad();\n writeSideNumbers(Levels[counterLevel]);\n fillButton(isFilled);\n cleanButton();\n finishButton();\n instructionButton();\n}", "draw(context) {\r\n\r\n var x = this.sprite.x_pos + this.sprite.x_offset;\r\n var y = this.sprite.y_pos + this.sprite.y_offset;\r\n\r\n context.fillStyle = '#ffffff';\r\n\r\n if (this.sprite.debug) {\r\n if (this.ghost.direction_current != null && this.ghost.direction_future != undefined) {\r\n context.fillText('Direction Current=' + this.ghost.direction_current.name, x + 20 + this.sprite.width, y + 40);\r\n context.fillText('Direction Future=' + this.ghost.direction_future.name, x + 20 + this.sprite.width, y + 60);\r\n }\r\n }\r\n //context.fillText('Target', 300, 280);\r\n super.draw(context);\r\n\r\n }", "function draw() {\n drawbackground();\n drawHoles();\n }", "function drawUpdate() {\r\n\tdrawBread();\r\n\tdrawEggs();\r\n\tdrawGold();\r\n\tdrawSkyScraper(birds);\r\n\tdrawSkyScraper(machines);\r\n}", "function draw() {\r\n background(0);\r\n\r\n // var thisLoop = new Date;\r\n // if (thisLoop - lastLoop < 500) {\r\n // jsFps++;\r\n // } else {\r\n // document.getElementById(\"jsFps\").innerHTML = 'JS: ' + jsFps * 2 + ' fps';\r\n // jsFps = 0;\r\n // lastLoop = thisLoop;\r\n // }\r\n\r\n\r\n image(tree, width/2, height/2);\r\n if (!gameStarted) {\r\n startText.show('Start');\r\n\r\n }\r\n if (startText.hovered() && !gameStarted) {\r\n //debugger;\r\n startGame();\r\n }\r\n\r\n //eglute.show();\r\n\r\n if ((random(0, 1) < 0.03 && zaisliukai.length < maxZaisliuku) || zaisliukai.length == 0) {\r\n zaisliukai.push(new Zaisliukas());\r\n }\r\n\r\n\r\n\r\n if (gameStarted) {\r\n textSize(24);\r\n fill(0, 102, 153);\r\n text('Score: ' + score, 100, 40);\r\n\r\n if (currentDuration > 0) {\r\n text(currentDuration + 's', width - 80, 40);\r\n } else {\r\n endGame();\r\n }\r\n } else if (gameEnded) {\r\n textSize(40);\r\n fill (255, 200);\r\n textAlign(CENTER);\r\n text('Your score: ' + score, width/2, 100);\r\n textSize(32);\r\n text('Highscore: ' + highScore, width/2, 200);\r\n }\r\n\r\n noStroke();\r\n fill(255, 150);\r\n //image(pointerBall, x, y, 30, 30);\r\n ellipse(x, y, 15, 15);\r\n\r\n for (var i = zaisliukai.length - 1; i >= 0 ; i--) {\r\n zaisliukai[i].update();\r\n zaisliukai[i].show();\r\n\r\n\r\n if (zaisliukai[i].checkHover(x, y)) {\r\n zaisliukai[i].expload();\r\n if (gameStarted) {\r\n score += 100;\r\n }\r\n\r\n //zaisliukai.push(new Zaisliukas());\r\n }\r\n if (zaisliukai[i].out) {\r\n if (gameStarted) {\r\n score -= 20;\r\n }\r\n\r\n }\r\n if (zaisliukai[i].remove) {\r\n zaisliukai.splice(i, 1);\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n //console.log(zaisliukai.length);\r\n\r\n\r\n // var treeWidth = 300;\r\n // var treeHeight = 400;\r\n // strokeWeight(5);\r\n // stroke(255);\r\n // noFill();\r\n // triangle(width/2 - treeWidth/2, treeHeight, width/2, height - treeHeight, width/2 + treeWidth/2, treeHeight);\r\n}", "draw() {\n this.scoreText = \"Score: \" + gameNs.game.score;\n this.timeText = \"Time: \" + gameNs.game.timePassed;\n document.body.style.background = \"#000000\";\n gameNs.game.ctx.font = '120px Spy Hunter'; //48\n gameNs.game.ctx.fillStyle = \"white\"\n gameNs.game.ctx.fillText(\"SPY HUNTER\", 300, 150);\n gameNs.game.ctx.font = '80px Spy Hunter'; //48\n gameNs.game.ctx.fillStyle = \"yellow\"\n gameNs.game.ctx.fillText(this.startText, 250, 500);\n gameNs.game.ctx.fillText(this.scoreText, 450, 600);\n gameNs.game.ctx.fillText(this.timeText, 450, 700);\n }", "function drawUI() {\n ctx.drawImage(Resources.get('images/frogger-logo.png'), 59, 30);\n let starResource = Resources.get('images/Star.png'),\n gemBlueResource = Resources.get('images/Gem-Blue.png'),\n gemGreenResource = Resources.get('images/Gem-Green.png'),\n gemOrangeResource = Resources.get('images/Gem-Orange.png');\n ctx.drawImage(starResource, 10, 670, starResource.width / 1.2, starResource.height / 1.2);\n ctx.drawImage(gemBlueResource, 219, 682, gemBlueResource.width / 1.5, gemBlueResource.height / 1.5);\n ctx.drawImage(gemGreenResource, 421, 682, gemGreenResource.width / 1.5, gemGreenResource.height / 1.5);\n ctx.drawImage(gemOrangeResource, 623, 682, gemOrangeResource.width / 1.5, gemOrangeResource.height / 1.5);\n ctx.font = \"50px Gaegu\";\n ctx.fillStyle = \"#fff\";\n ctx.strokeStyle = \"#000\";\n ctx.lineWidth = 3;\n ctx.strokeText(level.toString(), 34, 825);\n ctx.fillText(level.toString(), 34, 825);\n ctx.strokeText(GemsCollected[\"blue\"].toString(), 34 + 202, 825);\n ctx.fillText(GemsCollected[\"blue\"].toString(), 34 + 202, 825);\n ctx.strokeText(GemsCollected[\"green\"].toString(), 34 + 404, 825);\n ctx.fillText(GemsCollected[\"green\"].toString(), 34 + 404, 825);\n ctx.strokeText(GemsCollected[\"orange\"].toString(), 34 + 606, 825);\n ctx.fillText(GemsCollected[\"orange\"].toString(), 34 + 606, 825);\n }", "function draw() {\n // The background color is now a dark indigo color to\n // mimic a night sky\n background(59, 32, 102);\n\n if (!gameOver) {\n handleInput();\n\n movePlayer();\n movePrey();\n\n updateHealth();\n checkEating();\n\n drawPrey();\n\n // Add a fuction for the tiny fireflies\n drawTinyFireflies();\n\n drawPlayer();\n } else {\n showGameOver();\n // Added function to check on the reset\n checkResetGame();\n }\n}", "function draw() {\n if (stageChange_1 == 0) {\n mainScreen();\n openScreen();\n fill(0);\n }\n else if (stageChange_1 == 1) {\n mainScreen();\n rulesScreen();\n }\n if (stageChange_2 == 1) {\n mainScreen();\n choiceScreen_1();\n thirstMeter_outline_1();\n thirstMeter_1();\n thirstMeter_outline_2();\n thirstMeter_2();\n object_x = mouseX;\n object_y = mouseY;\n waterLevel();\n }\n}", "function drawFrame(perc) {\n background(backColor);\n}", "function draw() {\n background(211, 211, 211); //color of the background\n fill(0); //color of the text\n\n fill(204, 101, 192, 127);\n rect(600, 80, 100, 100, 20);\n\n fill('lightgreen');\n triangle(900, 200, 800, 200, 850, 700); \n\n fill('red');\n arc(1000, 50, 80, 80, 0, PI + QUARTER_PI, CHORD);\n\n fill('yellow');\n circle(1100, 300, 200);\n\n fill('purple');\n quad(1100, 100, 1400, 200, 1300, 450, 1400, 540, 1100, 700);\n\n fill('black');\n square(1000, 550, 300);\n\n drawHouse();\n\n flower();\n\n weird();\n\n picasso();\n\n}", "function draw() {\n background(\"lightblue\");\n /*Put your main animations and code here*/\n\t \n /*ctx.fillStyle = \"blue\";\n\tt.rect(turt.x, turt.y, 200, 200);*/\n\t\n /*log frame*/\n showFrames();\n}", "function drawFrame() {\n //Fundo e Caixas\n for (var i = 0; i < HUD.length; i++) {\n ctx.drawImage(HUD[i].image, HUD[i].x, HUD[i].y, HUD[i].w, HUD[i].h);\n }\n //Score\n ctx.fillStyle = \"#FFFFFF\"\n ctx.font = (canvas.height / 15) + \"px Roboto\"\n drawCenterText(scoreText, HUD[3].x, HUD[3].y + canvas.height / 14, HUD[3].w);\n //Tepmo\n ctx.fillStyle = \"#FFFFFF\"\n ctx.font = (canvas.height / 15) + \"px Roboto\"\n drawCenterText(Math.trunc(time), HUD[4].x, HUD[4].y + canvas.height / 14, HUD[4].w);\n //Debug\n ctx.fillStyle = \"#FFFFFF\"\n ctx.font = \"8px Roboto\"\n ctx.fillText(\"FPS: \" + fps, canvas.width / 50, canvas.height - 0.1 * modY);\n }", "function draw() {\n\tif (currentScene === \"day\") {\n\t\tdrawDay();\n\t} else if (currentScene === \"night\") {\n\t\tdrawNight();\n\t}\n}", "function draw() {\n ctx.fillRect(0, 0, WIDTH, HEIGHT);\n\n ctx.save();\n ctx.fillStyle = \"#fff\";\n\n ball.draw();\n player.draw();\n ai.draw();\n\n\n //The net down the centre of the screeen\n var w = 4;\n var x = (WIDTH - w) * 0.5;\n var y = 0;\n var step = HEIGHT / 50; //the step, the higher the number the more dots in the net\n while (y < HEIGHT) {\n ctx.fillRect(x, y + step * 0.25, w, step * 0.5);\n y += step;\n }\n\n ctx.restore();\n}", "draw(results = {}) {\n this.appendRainbow();\n this.drawScoreboard(results);\n this.drawRainbow();\n this.drawNyanCat(results);\n\n this.tick = !this.tick;\n }", "function draw() {\n topWall.draw();\n ball.draw();\n paddle.draw();\n playerIndexDigit.draw();\n playerBallIndexDigit.draw();\n\n // draw the currently act\n for (var i = 0; i < 112; i++) {\n playerBricks[activePlayer][playerLevel[activePlayer]][i].draw();\n }\n\n playerScoreDigits[0][0].draw();\n playerScoreDigits[0][1].draw();\n playerScoreDigits[0][2].draw();\n playerScoreDigits[0][3].draw();\n\n playerScoreDigits[1][0].draw();\n playerScoreDigits[1][1].draw();\n playerScoreDigits[1][2].draw();\n playerScoreDigits[1][3].draw();\n\n leftWall.draw();\n rightWall.draw();\n }", "function draw() {\n\n//sets the background colour\n background(0, 128, 0);\n//sets the colour of the text\n fill(255);\n//all these are callig on the JSON for something specific which is an\n//indevidual peice of text that they are mapped too\n text(\"The name of the superhero is \" +hawkeyeData.data.results[0].name, width/3.5, height/8, 500, 500);\n text(\"Description: \" +hawkeyeData.data.results[0].description, width/8.5, height/4, 1000, 600);\n text(\"Comics: \" +hawkeyeData.data.results[0].comics.available, width/3.3, height/5, 500, 500);\n\n}", "drawHUD()\n {\n if (RPM.datasGame.titlescreenGameover.isTitleBackgroundImage)\n {\n this.pictureBackground.draw();\n }\n super.drawHUD();\n }", "update(){\n this.graphics.clear();\n for(let bar of this.healthBars){\n if(!bar.visible){\n continue;\n }\n bar.updatePos();\n bar.outerWidth = bar.barWidth * (bar.track.health/100);\n this.draw(bar);\n }\n for(let bar of this.progressBars){\n if(bar.track.state === \"closed\"){\n bar.visible = true;\n }\n else{\n bar.visible = false;\n }\n if(bar.visible){\n bar.updatePos();\n bar.outerWidth = bar.barWidth * (bar.track.tapCount/bar.track.maxTap);\n this.draw(bar);\n }\n }\n }", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "draw() {\n noStroke();\n if (this.color) {\n fill(this.color.x, this.color.y, this.color.z);\n } else {\n fill(0);\n }\n rect(this.pos.x, this.pos.y, this.w, this.h);\n }", "draw() {\r\n if (this.aliveTime > this.initialTime - 6) {\r\n this.ctx.save();\r\n this.ctx.beginPath();\r\n let color = this.color;\r\n // let gradient = this.ctx.createLinearGradient(0, 0, this.length, this.width * 1.1);\r\n // gradient.addColorStop(0.0, `rgba(${color[0]},${color[1]},${color[2]},.9)`);\r\n // gradient.addColorStop(0.9, `rgba(${color[0]},${color[1]},${color[2]},.9)`);\r\n // gradient.addColorStop(0.95, `rgba(${color[0]},${color[1]},${color[2]},.1)`);\r\n // gradient.addColorStop(1.0, `rgba(${color[0]},${color[1]},${color[2]},0)`);\r\n // this.ctx.fillStyle = gradient;\r\n // this.ctx.shadowColor = gradient;\r\n this.ctx.fillStyle = `rgba(${color[0]},${color[1]},${color[2]},${this.alpha})`;\r\n this.ctx.strokeStyle = `rgba(${color[0]},${color[1]},${color[2]},${this.alpha})`;\r\n // this.ctx.shadowColor = `rgba(${color[0]},${color[1]},${color[2]},${this.alpha})`;\r\n // this.ctx.shadowBlur = 30;\r\n this.ctx.closePath();\r\n this.ctx.stroke();\r\n\r\n // this.ctx.shadowColor = color;\r\n // this.ctx.strokeStyle = \"black\";\r\n\r\n this.drawRect();\r\n\r\n this.ctx.restore();\r\n } else {\r\n this.ctx.save();\r\n\r\n let color = Beam.COLOR().FADE;\r\n this.ctx.beginPath();\r\n\r\n // let gradient = this.ctx.createLinearGradient(0, 0, this.length, this.width * 1.1);\r\n // gradient.addColorStop(0.0, `rgba(${color[0]},${color[1]},${color[2]},${(this.aliveTime + 3) / (this.initialTime - 6)})`);\r\n // gradient.addColorStop(0.9, `rgba(${color[0]},${color[1]},${color[2]},${(this.aliveTime + 3) / (this.initialTime - 6)})`);\r\n // gradient.addColorStop(1.0, `rgba(${color[0]},${color[1]},${color[2]},0)`);\r\n // this.ctx.fillStyle = gradient;\r\n // this.ctx.shadowColor = gradient;\r\n this.ctx.fillStyle = `rgba(${color[0]},${color[1]},${color[2]}, ${Math.pow((this.aliveTime + 3) / (this.initialTime - 6), 3) * this.alpha})`;\r\n // this.ctx.shadowColor = `rgba(${color[0]},${color[1]},${color[2]}, ${Math.pow((this.aliveTime + 3) / (this.initialTime - 6), 3) * this.alpha})`;\r\n // this.ctx.shadowBlur = 50;\r\n this.ctx.closePath();\r\n this.ctx.stroke();\r\n\r\n this.drawRect();\r\n\r\n this.ctx.restore();\r\n\r\n }\r\n }", "function draw() {\n background(\"blue\");\n \n drawBackHair();\n drawBody();\n drawHead();\n drawBangs();\n drawFace();\n drawAccs();\n\n // if (gDebugMode == true){\n // \tdrawDebugInfo();\n // }\n }", "function draw() {\r\n for (var index = 0; index < bar.length; index++) {\r\n\r\n ctx.fillStyle = barColor;\r\n ctx.clearRect(bar[index].x, bar[index].y, barWidth, bar[index].height);\r\n bar[index].y = getHeight(bar[index].height);\r\n bar[index].x = (index + index) * barPadding + (barWidth * index);\r\n\r\n if (mousePos.x >= bar[index].x - barWidth * 10 &&\r\n mousePos.x < bar[index].x + barWidth * 10 &&\r\n Math.abs(mousePos.y - maxBarHeight / 2) < 100) {\r\n bar[index].direction = -1;\r\n\r\n }\r\n\r\n if (bar[index].height < bar[index].buffHeight && bar[index].direction > 0) {\r\n bar[index].height += speed.grow;\r\n } else if (bar[index].direction > 0) {\r\n bar[index].direction = -1;\r\n }\r\n\r\n // If increasing grow it \r\n if (bar[index].height > bar[index].buffHeight / 1.25 && bar[index].direction < 0) {\r\n bar[index].height -= speed.shrink;\r\n } else if (bar[index].direction < 0) {\r\n bar[index].buffHeight = randomizeHeight(bar[index].x);\r\n bar[index].direction = 1;\r\n }\r\n\r\n ctx.fillRect(bar[index].x, bar[index].y, barWidth, bar[index].height);\r\n }\r\n\r\n var grd = ctx.createLinearGradient(146.000, 0.000, 154.000, 4000.000);\r\n /* var grd = ctx.createLinearGradient(146.000, 0.000, 154.000, 600.000);*/\r\n\r\n // Add colors\r\n grd.addColorStop(0.000, 'rgba(255, 255, 255, 0.000)');\r\n grd.addColorStop(1.000, 'rgba(0, 0, 0, 1.000)');\r\n\r\n // Fill with gradient\r\n ctx.fillStyle = grd;\r\n ctx.fillRect(0, 400, width, 400);\r\n\r\n }", "draw() {\n\t\tinfo.context.beginPath();\n\t\tinfo.context.arc(this.position.x, this.position.y, 30, 0, 2 * Math.PI);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function draw() {\n \n// 4. Use clock function to get the present time.\n let now = clock();\n let hr = now.hour;\n let mn = now.min;\n let sc = now.progress.min;\n\n// 5. Use map function to re-map time from one range (0-24/60) to another (canvas size).\n let end_sec = map(sc, 0, 1, 0, 800);\n let end_min = map(mn, 0, 60, 0, 800);\n let end_hour = map(hr, 0, 24, 0, 800);\n \n// 6. Draw 3 stagnant rectangles (hour, minute, second) for reference of the canvas. \n fill(70);\n noStroke();\n rect(0, 100, maxWidth, barHeight);\n rect(0, 200, maxWidth, barHeight);\n rect(0, 300, maxWidth, barHeight);\n\n// 7. Draw 3 rectangles that would change thier lenth as per the time (hour, minute, second). \n fill('#00628F');\n rect(0, 90, end_hour, barHeight + 20);\n \n fill('#618EB3');\n rect(0, 195, end_min, barHeight + 10);\n \n fill('#ACC2D9');\n rect(0, 298, end_sec, barHeight + 4);\n}", "draw()\n {\n document.body.style.background = \"#66F9FF\";\n\n\n //ctx.fillText(this.title, 100,100);\n }", "showResult(ctx) {\n\t\tctx.drawImage(ASSET_MANAGER.getAsset(\"./sprites/end game GUI.png\"), 150, 150);\n\t\tctx.font = \"30px Arial\";\n\t\tctx.fillText((\"Score: \" + this.score), 200, 225);\n\t\tctx.fillText((\"Highest combo: \" + this.highestCombo), 200, 275);\n\t\tctx.stroke();\n }", "appear()\n {\n\n this.canvas.fillStyle = Fruit.COLORS[Fruit.getRndInteger(0,Fruit.COLORS.length-1)];\n this.canvas.fillRect(this.x,this.y,this.w,this.h);\n\n }", "function draw(){\n\n //Schachbrettmuster\n context.fillStyle = \"#694a00\";\n context.fillRect(0, 0, canvasSize, canvasSize);\n context.fillStyle = \"#9e8400\";\n for(i = 0;i<4;i++){\n for(j = 0;j<4;j++){\n context.fillRect(tileSize*j*2, tileSize*2*i, tileSize, tileSize);\n }\n for(j = 0;j<4;j++){\n context.fillRect(tileSize*(2*i+1), tileSize*(1+j*2), tileSize, tileSize);\n }\n }\n\n //Figuren zeichnen\n fillStyle = \"#000000\";\n numOfPieces = Pieces.length;\n for(i = 0;i<numOfPieces;i++){\n context.fillRect(Pieces[i].x, Pieces[i].y, tileSize-10, tileSize-10);\n }\n\n }" ]
[ "0.66108024", "0.66059893", "0.65087074", "0.6458034", "0.64127505", "0.64049536", "0.63743716", "0.63591605", "0.6353695", "0.63489753", "0.6293734", "0.6262873", "0.6226263", "0.6224778", "0.62203366", "0.6215338", "0.62022007", "0.6191622", "0.6188831", "0.6186327", "0.6183392", "0.61640865", "0.61399394", "0.6128291", "0.61208403", "0.6111763", "0.61112434", "0.61010325", "0.60971284", "0.6070114", "0.60689706", "0.60687107", "0.6068602", "0.6067821", "0.60635746", "0.6051294", "0.60435486", "0.6040966", "0.60390514", "0.6036164", "0.6029718", "0.60213196", "0.60143733", "0.6012816", "0.60093176", "0.6008406", "0.6007981", "0.6007358", "0.6006126", "0.6004564", "0.6002281", "0.5986928", "0.5982489", "0.5970752", "0.5964069", "0.59533554", "0.59522915", "0.5948447", "0.594604", "0.59440285", "0.5925453", "0.592167", "0.59213537", "0.5921297", "0.5917784", "0.59151614", "0.5914903", "0.5914062", "0.591299", "0.59083015", "0.5902975", "0.5899702", "0.5898369", "0.58983266", "0.5894503", "0.5890346", "0.588989", "0.5886563", "0.5886348", "0.5878474", "0.58765", "0.5871786", "0.5866271", "0.5865755", "0.5854345", "0.5854176", "0.5853931", "0.5853144", "0.5852385", "0.58497167", "0.58393407", "0.58390015", "0.5833417", "0.58312565", "0.58304113", "0.58294106", "0.5825449", "0.58250153", "0.58229476", "0.5818822", "0.5817056" ]
0.0
-1
When the struggle timer runs
function StruggleRun(NoStruggleMessage, StruggleStage) { // When the struggle timer ticks if (StruggleNextTick <= CurrentTime) { // If it's done, we call the done procedure from the calling module, if not we lower the struggle progress if (StruggleDone) { DynamicFunction(CurrentChapter + "_" + CurrentScreen + "_StruggleDone()"); StruggleDone = false; StruggleProgress = 0; StruggleType = ""; } else { StruggleProgress--; if (StruggleProgress < 0) StruggleProgress = 0; StruggleGetNextTick(); } } // Draw the struggle scene StruggleDraw(NoStruggleMessage, StruggleStage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timer() {\n footballCrowd();\n timerId = setInterval(() => {\n time--;\n $timer.html(time);\n\n if(time === 0) {\n restart();\n lastPage();\n }\n }, 1000);\n highlightTiles();\n }", "onTik(){\n \n console.log('timer tikking')\n}", "function breakTimer() {}", "function onTimer(){\r\n\tif (turn == OPPONENT) return;\r\n\tupdate_handler({time:timer});\r\n\ttimer--;\r\n\tif (timer < 0){\r\n\t\tmissStep();\r\n }\r\n}", "function timePassed() {\r\n if (health === 0 || happiness === 0 || hunger === 0) {\r\n clearInterval(timer);\r\n dodo(); \r\n timer =null; \r\n groan();\r\n }\r\n \r\n message();\r\n screen();\r\n i++;\r\n decrease();\r\n changeStar();\r\n changeDonut();\r\n changeHeart();\r\n console.log(i)\r\n console.log(`health: ${health}, happiness: ${happiness}, hunger: ${hunger}`) \r\n }", "function timer()\r\n {\r\n console.log(\"running...\");\r\n }", "function time_watcher_turn(){\n if(game_content.watcher.turn_watcher){\n // If he is looking, take it down so he is not looking.\n if(game_content.watcher.watcher_looking){\n game_content.watcher.watcher_staring = false;\n game_content.watcher.watcher_frame++;\n if(game_content.watcher.watcher_frame == 6){\n game_content.watcher.turn_watcher = false;\n game_content.watcher.watcher_looking = false;\n }\n } else {\n game_content.watcher.watcher_frame--;\n if (game_content.watcher.watcher_frame == 1){\n game_content.watcher.turn_watcher = false;\n game_content.watcher.watcher_looking = true;\n game_content.watcher.watcher_staring = true;\n }\n }\n }\n setTimeout(time_watcher_turn, interval * 5);\n}", "function countDown()\n{\n //Reduce the time\n if (timer > 0)\n {\n timer--;\n document.getElementById('timer').innerHTML = timer;\n }\n //End the turn when time runs out\n else if (timer == 0)\n {\n window.dispatchEvent(thisPlayerEndTurn);\n }\n}", "async function roundtimer(){\r\n //gets the fighht row from the database to check if the round is supposed to update yet\r\n let frow = await sql.get(`SELECT * FROM fights WHERE user = \"${petrow.owner}\" AND pet = \"${petrow.name}\"`).catch(allerrors)\r\n //only advances the round every 20 seconds\r\n if(getcurdate()>=frow.roundtime){\r\n // --- advances the round\r\n //updates the time to the next round to in 20 seconds\r\n await updateroundtime(20)\r\n //updates the recap\r\n await updaterecaps(`turnrecap`, `You didn't react in time!`)\r\n //starts the enemie's round\r\n await enemyround()\r\n }\r\n }", "function startGame() {\r\n countUp = 0;\r\n setTimeout(endGame, 120000);\r\n startTimer();\r\n cancelTimer = false;\r\n triggerCrime();\r\n}", "ontimeout() {}", "function timeUp() {\n // clear the timing interval on the timer function.\n clearInterval(timer);\n // count the non answer as a wrong answer\n loss++;\n /* run preloadImage function with \"lost\" as argument (still trying to fully understand why calling it\n with the argument lost makes it work, i found this solution online)*/\n preloadImage(\"lost\");\n // set a timeout interval of 3 seconds before the nextquestion is generated\n setTimeout(nextQuestion, 3 * 1000);\n }", "function timer(ctr) {\n ctr = typeof ctr !== 'undefined';\n statusGood();\n worldSaved();\n setInterval(function() {\n lightSequence(3);\n if (ctr > 0) {\n timer(ctr - 1);\n }\n }, 13000);\n}", "function updateTimer() {\r\n var now = new Date();\r\n var distance = timeEnd.getTime() - now.getTime();\r\n var minutes = Math.floor(distance / (1000 * 60));\r\n var seconds = Math.floor((distance % (1000 * 60)) / 1000);\r\n\r\n if (minutes < 10)\r\n minutes = \"0\" + minutes;\r\n if (seconds < 10)\r\n seconds = \"0\" + seconds;\r\n\r\n if (currentStep < 3) {\r\n let countdownMessage = minutes + \":\" + seconds;\r\n if (presentationType == \"words\") {\r\n countdownMessage = countdownMessage + \" \" + currentChordName;\r\n }\r\n document.querySelector('#countdown').innerText = countdownMessage;\r\n\r\n if (minutes > 0 || seconds > 0) {\r\n window.setTimeout(function () {\r\n updateTimer();\r\n }, 1000);\r\n } else if (minutes == 0 && seconds == 0) {\r\n\t\t\tconsole.warn('runsequence from updatetimer');\r\n runSequence('gameover');\r\n }\r\n }\r\n}", "function timer(){\n countStartGame -= 1;\n console.log(countStartGame);\n if (countStartGame === 0){\n console.log (\"time's up\");\n //need to clear interval - add stop\n }\n}", "function timeTrack() {\r\n timer++;\r\n }", "function startGameTimer(){\n var timer = setInterval(() => {\n console.log(GMvariables.timerSecs);\n $(\"#timer\").text(GMvariables.timerSecs);\n if(GMvariables.timerSecs == 0){\n $(\"#timer\").text(\"Go\");\n clearInterval(timer);\n setTimeout(() => {\n $(\"#timer\").css(\"display\", \"none\");\n reset();\n changePositionOfElement();\n headerUpdater();\n }, 1000);\n }\n GMvariables.timerSecs -= 1;\n }, 1000);\n \n}", "function runTimer() {\n timerID = setTimeout(function()\n {\n timer--;\n timerTrack.innerHTML = timer;\n if (timer<=0) {\n // alert('game over');\n var accuracy =\n score + mistake === 0\n ? \"0.00\"\n : (score / (score + mistake) * 100).toFixed(2);\n alert(\n score + \" letters, \" + mistake + \"miss!\" + accuracy + \"% accuracy\"\n );\n clearTimeout(timerID);\n init();\n return;\n }\n runTimer();\n }, 1000);\n }", "function timeOut() {\n if (counter === 0) {\n yourWrong(true);\n }; \n }", "function startTime() {\n setTimer();\n}", "function trykk() {\n on[i] = false;\n finishTime = new Date().getTime();\n clearTimeout(timeID);\n utregningTid();\n updateView();\n}", "function changeCulprit() {\n let timerId = null; \n timerId = setInterval(holeRandom, 700) \n}", "function util_fun(){\r\n gametime = document.getElementById(\"timer\");\r\n\t\tgametime.innerHTML=\"0\";\r\n\t\tgame_secs=0;\r\n\t\tgame_mins=0;\r\n totalsecscount = 0;\r\n setInterval(setInfoTandR, 1000);\r\n}", "function timerStart(){\n\t\n\t\t\n\t}", "function timer(){\t\t\t\t\t\t\t//actual timer for the race\n\t\trace();\n\t}", "function startTimeControl(){\n $(\".myTimer\").text(time);\n $(\".timerBox\").html(\"<div class=\\\"timer\\\" style=\\\"--duration: \" + time + \" \\\">\\n\" +\n \" <div></div>\\n\" +\n \" </div>\").show();\n let seconds = time-1;\n myTimer = setInterval(function (){\n $(\".myTimer\").text(seconds--);\n }, 1000);\n myTimeout = setTimeout(function () {\n clearInterval(myTimer);\n $(\".myTimer\").text(0);\n if(tryCount < 3){\n failedAttempt();\n }\n }, time*1000);\n}", "function timer () {\n \n timerId = setInterval(triviaCount, 1000);\n function triviaCount () {\n if (timerCounter === 0) {\n clearInterval(timerId);\n timeRunsOut();\n }\n else {\n $(\".timer-number\").html(timerCounter);\n timerCounter--;\n }\n\n }\n // console.log(timer);\n \n }", "function gameLost(){\n setTimeout(alert('You Lose'), 2000);\n restart()\n}", "setTimer() {\n time=30;\n const timer = setInterval( ()=> {\n time--\n $('h3').text(time);\n if (time===0) {\n clearInterval(timer);\n checkForWin();\n }\n }, 1000);\n }", "function onTimesUp() {\n clearInterval(timerInterval);\n}", "function StartHappyCounter () {\n\t\ttimerID2 = setInterval (\"happyDrop ()\", 150000);\n}", "function checkTime() {\n self.time--;\n $('.time .value').html(self.time);\n if (self.time<=0) {\n console.log(self.intervalID);\n self.progress+=10;\n self.lives--;\n $('canvas').css('background-color','rgba(233, 72, 88, 0.1)');\n setTimeout(function() { self.nextTurn(); }, 300);\n }\n }", "function testTimer() {\n toast({text: \"Testing Timer\", duration: 3, type: \"success\"});\n\n var time = 46;\n setInterval(() => {\n\n time -= 1;\n NetworkTables.putValue(\"/robot/time\", time);\n\n if (time < -5) time = 126;\n\n }, 1000);\n}", "function countdown() {\n runtime();\n}", "function timesUp() {\n timer--;\n\n $(\"#timer\").text(timer);\n if (timer === 0) {\n // clearInterval(countDown);\n // i++;\n timerTwo = 8;\n unanswered++;\n $(\"#gap-time\").show();\n // i++;\n gifTimer();\n booYou();\n }\n}", "function handleTimeIntervar() {\n if (!state.isGameOver) {\n state.elapsedSeconds = state.elapsedSeconds + 1;\n document.querySelector('.timer').textContent = 'Elapsed Time:' + state.elapsedSeconds + 's.';\n\n saveState();\n }\n }", "function start_opp_timer() {\n\t\ttime--;\n\t\trun_timer(time);\n\n\t\tif(score >= TARGET_POINTS){\n\t\t\t// console.log('WOOOOOHHOOOO!!! your at '+TARGET_POINTS);\n\t\t\tif(t){\n\t\t\t\tclearTimeout(t);\t\n\t\t\t}\n\t\t\troundFinished = true;\n\t\t\top_success();\t\n\t\t}\n\t\telse if(time < 1) {\n\t\t\t// console.log('UHH OHH!!! your at '+TARGET_POINTS);\n\t\t\troundFinished = true;\n\t\t\top_fail();\n\t\t}\n\t\telse {\n\t\t\tt = setTimeout(start_opp_timer, 1000);\n\t\t}\n\t}", "function checkIfHandedOff(){\n if (tagpro.players[currentlyScoring].dead){\n timer = clearInterval(timer);\n timer = setInterval(searchForScorer,10);\n }\n}", "function startOpponentCheckTimer() {\n nIntervId = setInterval(checkForOpponent, 5000);\n }", "function handle_timeout() {\n\tif(!heating) {\n\t\tif(happenen) {\n\t\t\tconsole.log(\"on :\"+Date());\n\t\t}else {\n\t\t\tconsole.log(\"off:\"+Date());\n\t\t}\n\t}\n\tif(brew_last != 0.0) {\n\t\tconsole.log(\"last brew was \"+ (Date.now() - brew_last)/60000 + \" Minutes Ago\");\n\t}\n\tstartTimeout(handle_timeout, warming_interval);\n}", "function timeUp() {\n clearInterval(timer);\n\n lost++;\n\n preloadImage('lost');\n setTimeout(nextQuestion, 3 * 1000);\n}", "function ourConstantTimer(){\n let interval = setInterval(() => {\n let i = 1;\n if(finishChecker()){\n clearInterval(interval)\n }\n //console.log('machine', turrets['machineGun'].quantity)\n isNewBoss()\n attackAuto()\n updateAllVisibility()\n drawPage()\n if(i % 300 == 0){\n bossAttack(gameSettings.currentBoss)\n }\n },\n 300)\n}", "function stopwatch() {\n\tgameTime++;\n\titemTimer.innerText = gameTime /100;\n\t//statement to stop the game when time is too long\n\tif (gameTime == 9999) { // set max. time value (100 = 1 [s])\n\t\ttoStopWatch();\n\t\tmodalToLong();\n\t} else {\n\t\t\n\t}\n}", "function startTimer(){\n gameTimer= setInterval(countUpTimer, 1000);\n}", "function checkTimers() {\n //Change ghost time to 8 seconds from round 5\n if (round > 4) {\n ghostAction = 8000;\n ghostcountReset = 8;\n }\n\n //Change ghost time to 6 seconds from round 10\n if (round > 9) {\n ghostAction = 6000;\n ghostcountReset = 6;\n }\n\n //Change ghost time to 4 seconds from round 15\n if (round > 14) {\n ghostAction = 4000;\n ghostcountReset = 4;\n }\n}", "function I(){return _.setTimeout(function(){yt=void 0}),yt=me.now()}", "function startTimer() {\n timerInterval = setInterval(() => {\n timePassed = timePassed += 1;\n timeLeft = TIME_LIMIT - timePassed;\n document.getElementById(\"base-timer-label\").innerHTML = formatTime(\n timeLeft\n );\n\n if (timeLeft <= 0) {\n onTimesUp();\n }\n }, 1000);\n}", "function C007_LunchBreak_Natalie_Kiss() {\r\n CurrentTime = CurrentTime + 60000;\r\n if ((C007_LunchBreak_Natalie_IsRoped) && (!C007_LunchBreak_Natalie_IsGagged)) {\r\n OveridenIntroText = GetText(\"KissTied\");\r\n if (!C007_LunchBreak_Natalie_KissDone) {\r\n C007_LunchBreak_Natalie_KissDone = true;\r\n ActorChangeAttitude(1, 0);\r\n }\r\n }\r\n if (C007_LunchBreak_Natalie_IsGagged) {\r\n OveridenIntroText = GetText(\"KissGagged\");\r\n if (!C007_LunchBreak_Natalie_KissDone) {\r\n C007_LunchBreak_Natalie_KissDone = true;\r\n ActorChangeAttitude(0, 1);\r\n }\r\n }\r\n C007_LunchBreak_Natalie_TimeLimit()\r\n}", "function myTimer()\n {\n var d = new Date();\n var n = d.getSeconds();\n if (n % 2 === 0) {\n showMapLayer(keyLayer);\n } else {\n hideMapLayer(keyLayer);\n }\n }", "function startTimer() {\n runTime = setInterval(() => {\n displayTime();\n time++;\n }, 1000);\n\n}", "timer2()\n {\n timer2 = setInterval(() => {\n console.log(\"time B \" + seconds2);\n seconds2--;\n if (seconds2 < 0) {\n redBugLoop.destroy();\n clearInterval(timer2);\n this.moveToNextScene();\n\n }\n }, 10000);\n }", "function timer() {\n setInterval(() => {countUp();}, 1000);\n}", "function hangTime() {\nlet currentExercise = '';\n\nif (counterReps > 0) {\n displayRep = displayRep + 1;\n let currentExerciseIndex = displayRep - 1;\n currentExercise = workoutSequence[currentExerciseIndex];\n}\n\nmessageSpan.innerHTML = 'HANG ' + displayRep;\n\nif (userSetup.NoOFSets === 0 && userSetup.NoOfReps === 24) {\n exerciseSpan.innerHTML = currentExercise;\n} else {\n exerciseSpan.innerHTML = '';\n}\n\ndocument.body.style.backgroundColor = \"coral\";\ndocument.body.style.backgroundImage = \"\";\n\nif (counterReps > 0) {\n --counterReps;\n initializeClock(convertTime(userSetup.hangTime), restTime);\n} else if (counterSets > 1) {\n workoutSequence.splice(0, 1); // Remove the first element from the workoutSequence array\n --counterSets;\n messageSpan.innerHTML = 'SET REST';\n exerciseSpan.innerHTML = ''; // Clear the exercise text during set rest\n displayRep = 0;\n counterReps = userSetup.NoOfReps;\n initializeClock(convertTime(userSetup.SetRest), hangTime);\n document.body.style.backgroundColor = \"MediumSlateBlue\";\n} else {\n minutesSpan.innerHTML = '';\n secondsSpan.innerHTML = '';\n werkoutSpan.innerHTML = 'reps: ' + counterReps + ' <br> ' + 'sets: ' + (counterSets - 1);\n messageSpan.innerHTML = ' DONE!';\n $(\".inputShowHide\").toggle();\n $(\".mybuttons\").toggle();\n $(\".werkout\").toggle();\n populateTimer();\n document.body.style.backgroundImage = \"url('https://media.giphy.com/media/pHb82xtBPfqEg/giphy.gif')\";\n}\n}", "function myTimerParticipent()\n{\n sec = ((Math.floor( Date.now() / 1000 )) - startTIme);\n secShow = ((Math.floor( Date.now() / 1000 )) - startTImeShow);\n document.getElementById( \"seconds\" ).innerHTML = pad( secShow % 60 );\n document.getElementById( \"minutes\" ).innerHTML = pad( parseInt( secShow / 60 , 10 ) ); //messageBox.innerHTML=window.orientation+' '+d.toLocaleTimeString()+' '+pictureWasTake;\n if ( (sec % divideTime) == 0 )\n {\n startTIme = Math.floor( Date.now() / 1000 );\n if ( tagsToSend.length > 0 )\n {\n uploadTags();\n }\n\n }\n\n}", "function startTimer() {\n setTimeout(function () {\n //when game is stopped timer from previous game shouldn't infere\n if (!pausedGame) timerDone = true;\n }, 10000);\n}", "function mainLoop() {\n\n\t\tvar timeChecker = setInterval(function() {\n\n\t\t\tstate.videoPlayer.update();\n\t\t\t// Forced update of time. Required for Safari.\n\t\t\ttime = state.videoPlayer.currentTime;\n\n\t\t\t// console.log('time:', time);\n\t\t\t_.each(popUpProblemTimer, function(obj) {\n\t\t\t\tif (time >= obj.start && time < obj.end) {\n\t\t\t\t\t// console.log(obj);\n\t\t\t\t\tvideoActions.actionFunction(time, obj);\n\t\t\t\t} else {\n\t\t\t\t\tvideoActions.actionFunction(time, null);\n\t\t\t\t}\n\t\t\t})\n\t\t}, 500);\n\n\t}", "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 tiktok() {\n int = setInterval(run, 1000); // configure interval\n}", "function startGame(){\n countStartGame = 30;\n correctAnswers = 0;\n wrongAnswers = 0;\n unanswered = 0;\n\n if (!timerRunning){ \n intervalId = setInterval(timer, 1000);\n timerRunning = true;\n }\n timer();\n console.log(\"game startiiing\");\n \n}", "function timer() {\n t = setTimeout(time, 1000);\n }", "function timerWrapper () {}", "function setGameTime() {\r\n if (test) { console.log(\"--- setGameTime ---\"); }\r\n if (test) { console.log(\"gameDuration \" + gameDuration); }\r\n clearInterval(gameInterval);\r\n gameSeconds = gameDuration;\r\n}", "function werewolfTimer() {\n\tif (GM_getValue('werewolf'+getUsername())) {\n\t\tvar userTime=GM_getValue('werewolfTime'+getUsername(),'');\n\t\ttimes=userTime.split(':');\n\t\t// if the date isn't properly formatted, forget it.\n\t\tif (times.length=2) {\n\t\t\ttimes[0]=parseInt(times[0]);\n\t\t\ttimes[1]=parseInt(times[1]);\n\t\t\t// a little bit of multi-compatibility: if they use a HH:MMpm time format, then add 12 hours.\n\t\t\tif (/pm/i.test(userTime) && times[0]!=12) times[0]+=12;\n\t\t\tvar curDate=new Date();\n\t\t\tvar dressDate=new Date();\n\t\t\tdressDate.setHours(times[0]);\n\t\t\tdressDate.setMinutes(times[1]);\n\t\t\tdressDate.setSeconds(0);\n\t\t\tif (dressDate.getTime()-curDate.getTime() < 0) dressDate.setDate(dressDate.getDate()+1);\n\t\t\tsetTimeout(function() {startDressing(GM_getValue('wereOutfit'+getUsername(),0), true);}, dressDate.getTime()-curDate.getTime());\n\t\t\tif (debug) GM_log ('milliseconds to outfit change: '+(dressDate.getTime()-curDate.getTime())+' dressDate:'+dressDate.getTime()+' curDate:'+curDate.getTime());\n\t\t}\n\t}\n}", "function timer() {\n function countSeconds() {\n if (moves !== 0 && matched < 16) {\n seconds++\n document.querySelector('.timer').innerHTML = seconds;\n }\n } setInterval(countSeconds, 1000);\n}", "function SarahActivityRun() {\n\tif (AmandaIntroTime > 0) AmandaIntroTime = AmandaIntroTime - 60000;\n\tif (SophieIntroTime > 0) SophieIntroTime = SophieIntroTime - 60000;\n\tSarahLoadNewCharacter();\n}", "function timeFunc(){\n if(time=== 0){\n clearInterval(timer)\n gameOver()\n }\n timeSpan.innerText = time;\n time --;\n }", "function C007_LunchBreak_Natalie_Spank() {\r\n CurrentTime = CurrentTime + 60000;\r\n if (!C007_LunchBreak_Natalie_SpankDone) {\r\n C007_LunchBreak_Natalie_SpankDone = true;\r\n ActorChangeAttitude(-1, 1);\r\n }\r\n C007_LunchBreak_Natalie_TimeLimit()\r\n}", "function timerOn()\n {\n console.log (\"Timer is on\");\n timerOn = p5.createP(duration);\n }", "function runTimer() {\n let currentTime = leadingZero(timer[0]) + \":\" + leadingZero(timer[1]) + \":\" + leadingZero(timer[2]);\n theTimer.innerHTML = currentTime;\n timer[3]++;\n\n timer[0] = Math.floor((timer[3]/100)/60);\n timer[1] = Math.floor((timer[3]/100) - (timer[0] * 60));\n timer[2] = Math.floor(timer[3] - (timer[1] * 100) - (timer[0] * 6000));\n\n}", "async function timerZ() {\n timerP.innerHTML = `00:20`;\n await sleep(1000);\n for (let i = 19; i >= 0; i -= 1) {\n if (check === true) { return; }\n (i < 10) ? timerP.innerHTML = `00:0${i}` : timerP.innerHTML = `00:${i}`;\n await sleep(1000);\n }\n const imgPoke = document.querySelector('.pokemons');\n imgPoke.classList.remove('pokemon-filter');\n efect();\n erros += 1;\n localErros.innerText = erros;\n timerP.innerHTML = ``;\n}", "function transitionTime() {\n if (questionCounter < 8) {\n questionCounter++;\n generateGame();\n counter = 15;\n timer();\n }\n else {\n endGame();\n }\n }", "function startSnitchGame(){\n setTimeout (function(){\n startTimer()}, 500);\n snitch.addEventListener('click', moveSnitchRandom);\n}", "function tick() {\n if (timerRep.value.state === 'running') {\n // Calculates the milliseconds the timer has been running for and updates the replicant.\n var time = timer.currentTime().gameTime();\n var ms = Math.floor((time.totalSeconds()) * 1000);\n setTime(ms);\n timerRep.value.timestamp = Date.now();\n }\n}", "function timer() {\n difference = Math.round(milliseconds - (Date.now() - now) / 1000);\n if (difference < 0) {\n return;\n }\n // eslint-disable-next-line no-use-before-define\n const { minutes, seconds } = displayTimer(difference);\n\n // eslint-disable-next-line\n displayElement.textContent = `${minutes}:${seconds}`;\n document.title = `${minutes}:${seconds}`;\n }", "function pauseGameOfLifeDev()\n{\n console.log(\"pausing game of life\");\n // TELL JavaScript TO STOP RUNNING THE LOOP\n clearInterval(timerDev);\n clearInterval(shipTimerDev);\n clearTimeout(slowTimerDev);\n\n // AND THIS IS HOW WE'LL KEEP TRACK OF WHETHER\n // THE SIMULATION IS RUNNING OR NOT\n timerDev = null;\n shipTimerDev = null;\n slowTimerDev = null;\n}", "function timeOn(){\n\tgameTime = setInterval(function(){\n\t\tt++;\n\t\t$(\"#time\").html(t);\n\t},1000);\n}", "function hourGlass() {\n\t//decrement \"countdown\"\n\tcountdown--;\n\t//display \"countdown\"\n\t$(\"#countdown\").css(\"font-size\", (150-(5*countdown)));\n\t$(\"#countdown\").text(countdown);\n\t//if countdown is 0 clear the interval, increase incorrect count and display result\n\tif (countdown === 0) {\n\t\t$(\"#qresult\").html(\"TIME'S UP! \");\n\t\t$(\"#images\").attr(\"src\",qnaArray[questionIdx][6]);\n\t\tclearInterval(timer);\n\t\t$(\"#question\").empty();\n\t\t$(\"#choices\").empty();\n\t\t$(\"#submit\").empty();\n\t\tincorrect++;\n\t\tdisplayAnswer();\n\t}\n}", "function startTimer(){\n timeRemain = setInterval(timeCount, 1000); \n}", "function C007_LunchBreak_Natalie_Tickle() {\r\n CurrentTime = CurrentTime + 60000;\r\n if (ActorHasInventory(\"Rope\")) {\r\n OveridenIntroText = GetText(\"TickleTied\");\r\n if (!C007_LunchBreak_Natalie_TickleDone) {\r\n C007_LunchBreak_Natalie_TickleDone = true;\r\n ActorChangeAttitude(-1, 1);\r\n }\r\n }\r\n C007_LunchBreak_Natalie_TimeLimit()\r\n}", "function countDown() {\n seconds -= 1;\n\n if (seconds < 0 && minutes > 0) {\n seconds += 60;\n minutes -= 1;\n }\n else if (seconds === -1 && minutes === 0) {\n // Timer is done. Call relevant functions\n stopTimer();\n PEvents.timerDone(currentTimerType);\n loadTimer();\n }\n \n render();\n }", "timeDilation(){\r\n if(game.global.timeDilation > 0){\r\n console.log(\"Beginning time dilation!\");\r\n game.global.timeDilation += 0.1;\r\n console.log(game.global.timeDilation);\r\n } else {\r\n console.log(\"Max time dilation reached!\");\r\n }\r\n }", "function countdownTimer() {\r\n setInterval(() => {\r\n roundComplete.play();\r\n swal(\"TIME IS UP\");\r\n }, 60000);\r\n}", "function timer()\n\t{\n\t count=count-1;\n\t if (count <= 0)\n\t {\n\t \t$(\"#timer\").html(toMinutes(count));\n\t \tclearInterval(counter);\n\t $(\"#info\").html(\"<div width='100%' style='font-size:2em;text-align:center;font-weight:bold' >Time's up! Waiting for results...</div>\");\n\t $(\"#you-box\").attr(\"disabled\", true);\n\t $(\"#submit\").html(\"<h4>Thanks for your submission!</h4>\");\n\t $(\"#submit\").attr(\"submit\", \"true\");\n\t $(\"#submit\").attr(\"disabled\", true);\n\n\n\t return;\n\t }\n\n\t $(\"#timer\").html(toMinutes(count));\n\t updateOpponentBox();\n\t}", "function timer(duration) {\n setInterval(commitmentCheck, duration)\n}", "function timerStart(){\n heatGenerate();\n dsec++;\n totalTime++;\n if(dsec == 10) {\n dsec = 0;\n sec++;\n if(sec == 60) {\n sec = 0;\n min++;\n }\n }\n \n if(totalTime % GAME_SPAWN_TIME == 0) {\n spawnRandomGame();\n }\n \n if(difficulty < MAX_DIFFICULTY && totalTime % DIFF_INCREASE == 0) {\n difficulty++;\n }\n \n timer.innerHTML = pad(min) + \" : \" + pad(sec) + \" : \" + dsec;\n\n\n if(min == TIME_GOAL){\n ironManAction();\n }\n}", "onTimerCompleted ()\n {\n // emit sound alert\n this.audio.pause();\n this.audio.currentTime = 0;\n this.audio.play();\n\n // display notification\n new Notification(`The ${CICLE[this.state.step]} is over`);\n\n // cancel the current interval\n clearInterval(this.interval);\n this.interval = null;\n this.lastUpdated = null;\n\n // all steps are over: go to first step and return\n if (this.state.step + 1 === CICLE.length)\n {\n this.setState({\n step: 0,\n hours: DURATIONS.get(CICLE[0]).hours,\n minutes: DURATIONS.get(CICLE[0]).minutes,\n seconds: DURATIONS.get(CICLE[0]).seconds\n });\n return;\n }\n\n // not all steps are over: go to the next one\n this.setState({\n step: this.state.step + 1,\n hours: DURATIONS.get(CICLE[this.state.step + 1]).hours,\n minutes: DURATIONS.get(CICLE[this.state.step + 1]).minutes,\n seconds: DURATIONS.get(CICLE[this.state.step + 1]).seconds\n });\n }", "function timerOn() {\n\t\tif (timer === false) {\n\t\t\t\tcount = setInterval(countTime, 1000);\n\t\t\t\ttimer = true;\n\t\t}\n}", "function updateTimer(){\r\n timer--\r\n $('.timer').text(`Time: ${timer}`)\r\n if(timer <= 0){\r\n endGame()\r\n }\r\n}", "function runTimer() {\r\n let currentTime =\r\n leadingZero(timer[0]) +\r\n \":\" +\r\n leadingZero(timer[1]) +\r\n \":\" +\r\n leadingZero(timer[2]);\r\n\r\n theTimer.innerHTML = currentTime;\r\n timer[3]++;\r\n\r\n timer[0] = Math.floor(timer[3] / 100 / 60);\r\n timer[1] = Math.floor(timer[3] / 100 - timer[0] * 60);\r\n timer[2] = Math.floor(timer[3] - timer[1] * 100 - timer[0] * 6000);\r\n}", "function playerOneBuzzer() {\n\n// Make sure a timer is still going, and if so, stop it and change the buzzer flag so we know what caused it\n if(buzzer==false) {\n console.log ('time stopped due to buzzer');\n buzzer=true;\n\n\n buzzerActivation(); // Call activation function for insctructions\n }\n } // End playerOneBuzzer()", "function timerFinished(){\n\n //Update\n MODE = 'break'\n $('#pomodoro').animateCss('flip');\n $(\"#mode\").html(\"Break!\");\n\n //Reset Normal Timer\n BASICTIMER = ONEMINUTE * SESSIONCOUNTER;\n REFERENCE = BREAKTIMER;\n $(\"#pomodoro #progress\").css('background', '#092B40').css('width', '100%');\n\n\n //Start interval for break\n pomodoroClick();\n\n}", "function timer() {\n var seconds = 30;\n var timer = document.getElementById(\"timer\");\n timer.innerHTML = \"<i class='fas fa-hourglass-start ml-2'></i> Temps restant : \" + seconds + \" s\";\n setInterval(function(){\n if(seconds >= 1) {\n seconds --;\n timer.innerHTML = \"<i class='fas fa-hourglass-start ml-2'></i> Temps restant : \" + seconds + \" s\";\n }\n else {\n restartGame(false);\n }\n }, 1000);\n}", "function updateTimer(){\n if(gameOverCount<8){\n timerInterval=setInterval(updateTime,1000);\n }\n}", "function gameTimer() {\n\tcountDown = setInterval(clockIsTicking, 1000);\n\tfunction clockIsTicking() {\n\t\tif (questionTimer === 0) {\n\t\t\tclearInterval(countDown);\n\t\t\twrongAnswerTimeOut();\n\t\t}\n\t\tif (questionTimer > 0) {\n\t\t\tquestionTimer--;\n\t\t}\n\t\t$(\".timer\").html(questionTimer);\n\t}\n}", "function incrementTime(){\n time -= 1;\n $(\".timer\").html(\"time: <strong>\" + timeConverter(time) + \"</strong>\");\n //if the time limits has been reached then the player loses\n if(time === 0){\n if(charArr.length === 0){gameGoing = false;}\n clearInterval(intervalID);\n timerRunning = false;\n $(\".info\").html(\"info: <strong>You ran out of time! Answer: \"+ currentChar.name + \"</strong>\");\n resetVariables(false);\n }\n }", "function startedTrackingSuccessful() {\n tryingToTrack = true;\n timeCounter = 30 * 60;\n\n $(\"#startTrackingMe\").css({\n \"display\": \"none\"\n });\n $(\"#stopTrackingMe\").css({\n \"display\": \"inline-block\"\n });\n $(\"#extendTrackingMe\").css({\n \"display\": \"inline-block\"\n });\n $(\"#extendTrackingMe\").on('click', () => {\n alert(\"Timer set to 30 mins\")\n })\n }", "startCountDown() {\n return setInterval(() => {\n this.timeRemaining--;\n this.time.innerText = this.timeRemaining\n if (this.timeRemaining === 0)\n this.gameOver();\n }, 1000);\n }", "eventTimer() {throw new Error('Must declare the function')}", "function timeOn(){\n\n\n if(timer){\n limit = setInterval(() => {\n time = time - 1;\n console.log(\"Timer:\" + time);\n\n if(time == 0){\n clearInterval(limit);\n clearInterval(interval);\n endGame();\n timer = false;\n }\n\n }, 1000);\n } else {\n time = 5;\n clearInterval(limit);\n }\n}", "function shotclockTimer() {\n\tif(TIMER_SHOTCLOCK_STOPPED == false) {\n\t\tTIMER_SHOTCLOCK--;\n\t\tif(TIMER_SHOTCLOCK == 0) {\n\t\t\tTIMER_SHOTCLOCK_STOPPED = true;\n\t\t}\n\n\t\tsetShotclockTimer(TIMER_SHOTCLOCK);\n\t}\n}" ]
[ "0.7058319", "0.70026064", "0.6942228", "0.6907968", "0.6835131", "0.67971987", "0.6784356", "0.6698008", "0.66730934", "0.66625625", "0.6644883", "0.6642243", "0.6606459", "0.65906316", "0.6585043", "0.65644354", "0.6556645", "0.65497905", "0.6538009", "0.6535849", "0.65296024", "0.6513069", "0.6494798", "0.648975", "0.6481583", "0.64811623", "0.64655715", "0.64623404", "0.64412105", "0.6441019", "0.6427653", "0.6416359", "0.6412796", "0.64106876", "0.640381", "0.6390292", "0.63819224", "0.6378515", "0.63679016", "0.63638777", "0.6356397", "0.63528615", "0.63436484", "0.6329312", "0.63246983", "0.6322857", "0.6320259", "0.6316697", "0.63112813", "0.63049614", "0.6300825", "0.6300229", "0.6299675", "0.62962055", "0.6294728", "0.6294104", "0.6292482", "0.6284811", "0.6283314", "0.6280928", "0.62788635", "0.62708783", "0.6260023", "0.62585723", "0.62558883", "0.6249641", "0.6246523", "0.6243328", "0.6240907", "0.6237761", "0.6236054", "0.62354124", "0.6234673", "0.6226392", "0.6222311", "0.62202996", "0.62194276", "0.621897", "0.6217864", "0.62175685", "0.6215871", "0.62135124", "0.6212913", "0.6210013", "0.62064445", "0.6201231", "0.62010163", "0.61996984", "0.61915857", "0.6191275", "0.6191061", "0.6184779", "0.6182979", "0.6182837", "0.6182309", "0.6177343", "0.6176434", "0.61759526", "0.61739445", "0.61727273" ]
0.6462497
27
checks if user has his own column already and sets properties accordingly
function refreshUserColumns() { //get current columns var userCols = _.map(_.filter($localStorage.columns, { type: 'userFeed'}), 'user'); _.each($scope.users, function(user) { if (userCols.indexOf(user.username) !== -1) { user.hasColumn = true; } else { user.hasColumn = false; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasColumn(tableName, columnName) {\n let sql =\n 'select * from information_schema.columns where table_name = ? and column_name = ?';\n const bindings = [tableName, columnName];\n\n if (this.schema) {\n sql += ' and table_schema = ?';\n bindings.push(this.schema);\n } else {\n sql += ' and table_schema = current_schema()';\n }\n\n this.pushQuery({\n sql,\n bindings,\n output(resp) {\n return resp.rows.length > 0;\n },\n });\n }", "function ColumnMeta() {}", "singleColumn() {\n\t\t\treturn this.uiSetting?.dataObject?.singleColumn ?? false;\n\t\t}", "constructor() {\n super();\n const user = auth.getCurrentUser();\n if (user && user.isAdmin) this.columns.push(this.deleteColumn);\n }", "hasExtraColumn() {\n return false;\n }", "onAfterCreateCol() {\n this.columnMetaCache.clear();\n }", "function wddxRecordset_isColumn(name)\n{\n\t// Columns must be objects\n\t// WddxRecordset extensions might use properties prefixed with \n\t// _private_ and these will not be treated as columns\n\treturn (typeof(this[name]) == \"object\" && \n\t\t name.indexOf(\"_private_\") == -1);\n}", "hasColumn(tableName, column) {\n this.pushQuery({\n sql: `show columns from ${this.formatter.wrap(tableName)}`,\n\n output(resp) {\n return (0, _lodash.some)(resp, row => {\n return this.client.wrapIdentifier(row.Field) === this.client.wrapIdentifier(column);\n });\n }\n\n });\n }", "function whileColumnsNotSet() {\n // Only act when the data has been filled in\n if ($scope.data.length > 0) {\n // Auto-generate columns if the user hasn't created them yet.\n if ($scope.columns.length === 0) {\n $scope.columns = Object.keys($scope.data[0])\n .map(function(columnName) {\n return {key: columnName};\n });\n }\n clearWatch();\n }\n }", "preservesDesiredColumn() {\n return false;\n }", "updateCustomColumn() {\n olArray.remove(this.scope['columns'], this.customColumn);\n\n var name = (this.labelConfig && this.labelConfig['customName'] || '').trim();\n if (name) {\n // update the custom column if the column name has been set\n this.customColumn['name'] = name;\n this.customColumn['field'] = name;\n this['showCustomWarning'] = false;\n\n // if a custom label is configured, make it available for selection in the column picker\n if (this['addCustomLabel'] && this.scope && this.scope['columns']) {\n var findFn = column.findByField.bind(undefined, 'field', name);\n if (!olArray.find(this.scope['columns'], findFn)) {\n this.scope['columns'].push(this.customColumn);\n this.scope['columns'].sort(column.nameCompare);\n }\n }\n }\n\n this.validate();\n ui.apply(this.scope);\n }", "newColumn() {\n this.setState({\n newColumn: true\n });\n }", "function setOneColumnView() {\n\t\t\t\tconsole.log(\"Set one column view called\");\n\t\t\t\t$scope.isTwoColumns = false;\n\t\t\t}", "addColumn(val) {\n this.props.addColumn(val);\n this.setState({\n newColumn: false\n });\n }", "createColumn() {\n const first = this.data[0];\n this.fields = Reflect.ownKeys(first);\n this.caricaFlussi();\n \n this.fields.map((col) => {\n \tswitch (col) {\n \tcase \"id\":\n\t \tthis.myJson = {\n\t \t\t data: col,\n\t \t\t title: col,\n\t \t\t type: \"readonly\"\t \t\t \n\t \t};\n\t \tbreak;\n \tcase \"flusso\":\n\t \tthis.myJson = {\n \t\t data: col,\n \t\t title: col,\n \t\t type: \"select\", \n \t\t options: this.arrOpt\t \t\t \n \t};\n\t \tbreak;\n \tcase \"data\":\n\t \tthis.myJson = {\n \t\t data: col,\n \t\t title: col,\n \t\t datepicker: true\t \t\t \n \t};\n\t \tbreak;\n \tdefault:\n\t \tthis.myJson = {\n\t \t\t data: col,\n\t \t\t title: col \t\t\t\n\t \t};\n \t}\n \tthis.ArrCol.push(this.myJson);\n } );\n\t}", "setInitialValueOfColumn() {\n this.columns.map((item) => {\n if (item.hasOwnProperty('initialValue')) {\n this.hot.setDataAtRowProp(0, item.data, item.initialValue)\n }\n return true;\n })\n }", "generate() {\n this.columns.forEach((column) => {\n const col = createERDColumn(this.parent)\n Object.keys(column).forEach((attribute) => {\n app.engine.setProperty(col, attribute, column[attribute])\n })\n })\n }", "set columns(columns) {\n this._columns = columns;\n }", "linkColumns() {\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 dbIndependentColumnOpts(this, element.type, name, element);\n else if(element === \"increment\")\n this.primary = {name, type: element, auto: true};\n } \n }\n }", "get HasColumnSettings() {\n return !tp.IsEmpty(this.fColumnSettings) && (this.fColumnSettings.length > 0);\n }", "get columns() {\n return this._columns;\n }", "@api \n get columns()\n {\n return this._columns;\n \n }", "get columnDef() {\n return this.args && this.args.column;\n }", "get columnDef() {\n return this.args && this.args.column;\n }", "get columnDef() {\n return this.args && this.args.column;\n }", "get columnDef() {\n return this.args && this.args.column;\n }", "get columnDef() {\n return this.args && this.args.column;\n }", "get columnDef() {\n return this.args && this.args.column;\n }", "get columnDef() {\n return this.args && this.args.column;\n }", "get columnDef() {\n return this.args && this.args.column;\n }", "get columnDef() {\n return this.args && this.args.column;\n }", "function _checkHootColVal(compactMode) {\n $scope.columns.val = LayoutColumnsConfig.getHootColsConfig(compactMode) || constants.UI.defaultHootColumn;\n }", "generateColumns() {\r\n this.columns = _(this.getColumns())\r\n .map(this.getColumnOptions)\r\n .filter(\r\n o => {\r\n return _.isFunction(o.hidden) ? !o.hidden(o) : !o.hidden;\r\n }\r\n )\r\n .sortBy([\r\n o => {\r\n return _.isFunction(o.order) ? o.order(o) : o.order;\r\n }\r\n ])\r\n .value();\r\n\r\n this.fireSlimGridEvent(\"onColumnsGenerated\", {});\r\n }", "function setupColumnInfo(el) {\n var srcSettings = el.settings.sourceObject.settings;\n if (!el.settings.columns) {\n el.settings.columns = [];\n // In aggregation mode, defaults are the field list + aggs list.\n if (srcSettings.mode.match(/Aggregation$/)) {\n el.settings.columns.push(buildColDef(srcSettings.uniqueField));\n $.each(srcSettings.fields, function eachField() {\n if (this !== srcSettings.uniqueField) {\n el.settings.columns.push(buildColDef(this));\n }\n });\n $.each(srcSettings.aggregation, function eachAgg(key) {\n el.settings.columns.push(buildColDef(key, this));\n });\n } else {\n // Docs mode.\n el.settings.columns.push({\n field: 'taxon.accepted_name',\n caption: indiciaData.gridMappingFields['taxon.accepted_name'].caption\n });\n el.settings.columns.push({\n field: '#event_date#',\n caption: 'Date'\n });\n el.settings.columns.push({\n field: 'location.output_sref',\n caption: indiciaData.gridMappingFields['location.output_sref'].caption\n });\n }\n }\n el.settings.availableColumnInfo = {};\n // Keep the list of names in order.\n el.settings.availableColumnNames = [];\n // Specified columns must appear first.\n $.each(el.settings.columns, function eachCol() {\n el.settings.availableColumnInfo[this.field] = this;\n el.settings.availableColumnNames.push(this.field);\n });\n // Add other mappings if in docs mode, unless overridden by availableColumns\n // setting.\n if (srcSettings.mode === 'docs') {\n $.each(indiciaData.gridMappingFields, function eachMapping(key, obj) {\n var exist = el.settings.availableColumnInfo[key] || {};\n // Include unless not in configured list of available cols.\n if (!el.settings.availableColumns || $.inArray(key, el.settings.availableColumns) > -1) {\n el.settings.availableColumnInfo[key] = $.extend({}, obj, exist, { field: key });\n el.settings.availableColumnNames.push(key);\n }\n });\n }\n }", "_cacheColumnDefs() {\n this._columnDefsByName.clear();\n const columnDefs = mergeArrayAndSet(this._getOwnDefs(this._contentColumnDefs), this._customColumnDefs);\n columnDefs.forEach(columnDef => {\n if (this._columnDefsByName.has(columnDef.name) &&\n (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getTableDuplicateColumnNameError(columnDef.name);\n }\n this._columnDefsByName.set(columnDef.name, columnDef);\n });\n }", "addActiveColumn(str){\r\n\t\tthis.activeColumns.push(str);\r\n\t}", "function emptyColumnCheck() {\n\t\t\tvar data = grid.getData().getItems() || [];\n //Avoiding Resize functionality when there is no data.\n if (data.length === 0) {\n return;\n }\n var headerColumns = $('.slick-header-column', $(container));\n var flag = [];\n var updateGrid = false;\n for (i = 0; i < headerColumns.length; i++) {\n \tif(grid.getColumns()[i].hasOwnProperty('editor')){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n flag[i] = true;\n\t\t\t\tfor(j = 0; j < data.length; j++){\n\t\t\t\t\tif($.trim(data[j][grid.getColumns()[i].field])){\n\t\t\t\t\t\tflag[i] = false;\n if (grid.getColumns()[i].originalWidth)\n grid.getColumns()[i].width = grid.getColumns()[i].originalWidth;\n break;\n\t\t\t\t\t}\n\t\t\t\t}\n if (flag[i] && grid.getColumns()[i]) {\n grid.getColumns()[i].originalWidth = grid.getColumns()[i].width;\n // grid.getColumns()[i].width = 40;\n updateGrid = true;\n }\n }\n if (updateGrid) {\n grid.setColumns(grid.getColumns(), true);\n }\n }", "applyPermission() {\n if (this.permission[2] == 0) {\n this.showEditColumn(false);\n }\n if (this.permission[3] == 0) {\n this.showDeleteColumn(false);\n }\n }", "function ViewColumn() {\n return function (object, propertyName) {\n __1.getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"regular\",\n options: {}\n });\n };\n}", "onAddNewColumn() {\n console.log(\"Add New Column\")\n this.setState({\n addNewColumnModal: true\n })\n }", "getPlayerActiveColumn() {\n return this._playerActiveColumn;\n }", "get isColumn() {\n return this.startColumn === this.endColumn && this.startRow === 0 && this.endRow === null\n }", "function addCol(){\n\n}", "calculateColumns(){\n var columns = this.options.columns;\n this.columnsByPin = ColumnsByPin(columns);\n this.columnWidths = ColumnGroupWidths(this.columnsByPin, columns);\n }", "setColumns() {\r\n if (!this.slickGrid) return;\r\n\r\n this.slickGrid.setColumns(this.columns);\r\n this.fireSlimGridEvent(\"onColumnsSet\", { columns: this.columns });\r\n }", "function userTable() { }", "function setColumnDefaults(columns) {\n if (!columns)\n return;\n for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {\n var column = columns_1[_i];\n if (!column.$$id) {\n column.$$id = id_1.id();\n }\n // prop can be numeric; zero is valid not a missing prop\n // translate name => prop\n if (isNullOrUndefined(column.prop) && column.name) {\n column.prop = camel_case_1.camelCase(column.name);\n }\n if (!column.$$valueGetter) {\n column.$$valueGetter = column_prop_getters_1.getterForProp(column.prop);\n }\n // format props if no name passed\n if (!isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {\n column.name = camel_case_1.deCamelCase(String(column.prop));\n }\n if (isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {\n column.name = ''; // Fixes IE and Edge displaying `null`\n }\n if (!column.hasOwnProperty('resizeable')) {\n column.resizeable = true;\n }\n if (!column.hasOwnProperty('sortable')) {\n column.sortable = true;\n }\n if (!column.hasOwnProperty('draggable')) {\n column.draggable = true;\n }\n if (!column.hasOwnProperty('canAutoResize')) {\n column.canAutoResize = true;\n }\n if (!column.hasOwnProperty('width')) {\n column.width = 150;\n }\n }\n}", "get columns() {\n return this._columns;\n }", "initializeColumns() {\r\n const columnElements = $('.column-name').toArray();\r\n for (let i = 0; i < columnElements.length; i++) {\r\n this.columns.push(new Column(columnElements[i], i));\r\n }\r\n }", "fillupColumn() {\n let columns = this.get('columns');\n let tableWidth = this.get('_width');\n let sum = this.get('allColumnWidths');\n let tableResizeMode = this.get('tableResizeMode');\n\n if (sum !== tableWidth) {\n let delta = tableWidth - sum - 1;\n // Distribute the delta in pixel among columns according to the table fill up mode.\n if (tableResizeMode === TABLE_RESIZE_MODE_FIRST_COLUMN) {\n let [column] = columns;\n this.setColumnWidth(column, get(column, 'width') + delta);\n } else if (tableResizeMode === TABLE_RESIZE_MODE_EQUAL_COLUMN) {\n // Split delta by their proportion.\n let columnDelta = delta / columns.length;\n for (let i = 0; i < columns.length; i++) {\n let column = columns[i];\n this.setColumnWidth(column, get(column, 'width') + columnDelta);\n }\n } else if (tableResizeMode === TABLE_RESIZE_MODE_LAST_COLUMN) {\n // Add all delta to last column\n let lastColumn = columns[columns.length - 1];\n set(lastColumn, 'width', get(lastColumn, 'width') + delta);\n }\n }\n\n if (this.get('hasSubcolumns')) {\n columns.forEach((groupColumn) => {\n let subcolumns = get(groupColumn, 'subcolumns');\n if (subcolumns) {\n // Each subcolumn has equal width.\n let subcolumnWidth = get(groupColumn, 'width') / get(subcolumns, 'length');\n subcolumns.forEach((subcolumn) => {\n set(subcolumn, 'width', subcolumnWidth);\n });\n }\n });\n }\n }", "function addColumn(){\r\n $('tr').append('<td></td>');\r\n column++;\r\n }", "@wire(getObjectInfo, { objectApiName: ALLOCATION_OBJECT })\n setColumns({ data, error }) {\n if (data) {\n this.isEditable = data.updateable;\n }\n else if (error) {\n console.log(error);\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Error while fetching data',\n message: error.body.message,\n variant: 'error'\n })\n );\n }\n }", "function getBaseColObj(dataField, dataType, baseObject) {\n\n var objColumn = {};\n // objColumn.caption = \"\";\n objColumn.dataField = dataField;\n objColumn.dataType = dataType;\n objColumn.width = \"auto\";\n objColumn.allowEditing = false;\n objColumn.showInColumnChooser = true;\n objColumn.allowResizing = true;\n objColumn.allowHiding = true;\n baseObject.push(objColumn);\n\n\n }", "function addAttendanceColumn(eventId, columnId) {\n // Fetch and populate the event header\n url = \"/events/\" + eventId + \".json\"\n var attendanceOptions = []\n $.getJSON( url, function( data ) {\n // console.log(data)\n $('.attendance-matrix thead th[data-column-id=' + columnId + ']').html( \n (data.name || \"\") + \"<br>\" + data.date\n ).data(\"attendance-options\", data.attendance_options)\n \n // Fetch and populate the attendee rows\n url = \"/events/\" + eventId + \"/event_attendances.json\"\n $.getJSON( url, function( data ) {\n $.each( data, function( key, value ) {\n elem = $(\".attendance-matrix tbody tr[data-participant-id='\" + value.person_id + \"'] td[data-column-id='\" + columnId + \"']\")\n attendanceCheckbox(elem, eventId, value)\n })\n });\n\n // Populate the empty rows\n $(\".attendance-matrix tbody tr[data-participant-id] td[data-column-id='\" + columnId + \"']:empty\").each( function(index, elem) {\n attendanceCheckbox($( this ), eventId, null)\n });\n })\n}", "function populateColumnGrid()\n{\n // clear additional column list\n // it lists columns that don't get populated in the grid, and needs to be cleared\n \n updateAdditionalColumnList('clear'); \n \n // if there are no tables, then clear grid\n \n if (!connectionHasBeenChosen())\n {\n _ColumnNames.setAllRows(new Array(), new Array());\n return;\n }\n\n //var colsAndTypes = MMDB.getColumnAndTypeOfTable(_ConnectionName.getValue(), _TableName.getValue());\n var columnInfo = dwscripts.getColumnValueList(_ConnectionName.getValue(), _TableName.getValue());\n var rowTextArr = new Array();\n var rowValArr = new Array();\n \n ColumnTypes = new Array(); // clear the column types map\n\n //for (var i = 0; i < colsAndTypes.length; i+=2)\n for (var i = 0; i < columnInfo.length; i++)\n {\n var columnName = columnInfo[i].getColumnName();\n\tvar columnType = columnInfo[i].getColumnType();\n\n ColumnTypes[columnName] = columnType;\n \n if (EDIT_OP_TYPE == \"Update\") \n {\n rowInfo = getRowTextAndValue(columnName,\n\t columnType,\n\t\t\t\t\t\t\t\t _RecordsetName.getValue(),\n\t\t\t\t\t\t\t\t _UniqueKeyColumn.getValue());\n\n\t if (columnInfo[i].getIsPrimaryKey() && !uniqueKeyColumnName)\n\t {\n\t uniqueKeyColumnName = columnName;\n\t }\n } \n else \n { \n\t rowInfo = getRowTextAndValue(columnName, columnType);\n }\n \n\trowTextArr.push(rowInfo[0]);\n rowValArr.push(rowInfo[1]);\n }\n \n _ColumnNames.setAllRows(rowTextArr, rowValArr);\n \n // clear global field names array (used to check for dupe field names)\n\n STR_ELEMENT_NAMES = STR_DIVIDER; \n}", "function setColumnDefaults(columns) {\r\n if (!columns)\r\n return;\r\n for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {\r\n var column = columns_1[_i];\r\n if (!column.$$id) {\r\n column.$$id = id_1.id();\r\n }\r\n // prop can be numeric; zero is valid not a missing prop\r\n // translate name => prop\r\n if (isNullOrUndefined(column.prop) && column.name) {\r\n column.prop = camel_case_1.camelCase(column.name);\r\n }\r\n if (!column.$$valueGetter) {\r\n column.$$valueGetter = column_prop_getters_1.getterForProp(column.prop);\r\n }\r\n // format props if no name passed\r\n if (!isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {\r\n column.name = camel_case_1.deCamelCase(String(column.prop));\r\n }\r\n if (isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {\r\n column.name = ''; // Fixes IE and Edge displaying `null`\r\n }\r\n if (!column.hasOwnProperty('resizeable')) {\r\n column.resizeable = true;\r\n }\r\n if (!column.hasOwnProperty('sortable')) {\r\n column.sortable = true;\r\n }\r\n if (!column.hasOwnProperty('draggable')) {\r\n column.draggable = true;\r\n }\r\n if (!column.hasOwnProperty('canAutoResize')) {\r\n column.canAutoResize = true;\r\n }\r\n if (!column.hasOwnProperty('width')) {\r\n column.width = 150;\r\n }\r\n }\r\n}", "personalizeColumns() {\n const self = this;\n let markup = `<div class=\"listview-search alternate-bg\"><label class=\"audible\" for=\"gridfilter\">Search</label><input class=\"searchfield\" placeholder=\"${Locale.translate('SearchColumnName')}\" name=\"searchfield\" id=\"gridfilter\"></div>`;\n markup += '<div class=\"listview alternate-bg\" id=\"search-listview\"><ul></ul></div>';\n\n $('body').modal({\n title: Locale.translate('PersonalizeColumns'),\n content: markup,\n cssClass: 'full-width datagrid-columns-dialog',\n buttons: [{\n text: Locale.translate('Close'),\n click(e, modal) {\n modal.close();\n $('body').off('beforeopen.datagrid');\n }\n }]\n }).off('beforeopen.datagrid')\n .on('beforeopen.datagrid', (e, modal) => {\n if (!modal) {\n return;\n }\n\n self.isColumnsChanged = false;\n modal.element.find('.searchfield').searchfield({ clearable: true, tabbable: false });\n modal.element.find('.listview')\n .listview({\n source: self.settings.columns,\n template: `\n <ul>\n {{#dataset}}\n {{#name}}\n <li>\n <a href=\"#\" target=\"_self\" tabindex=\"-1\">\n <label class=\"inline\">\n <input tabindex=\"-1\" type=\"checkbox\" class=\"checkbox\" {{^hideable}}disabled{{/hideable}} {{^hidden}}checked{{/hidden}} data-column-id=\"{{id}}\"/>\n <span class=\"label-text\">{{name}}</span>\n </label>\n </a>\n </li>\n {{/name}}\n {{/dataset}}\n </ul>`,\n searchable: true,\n selectOnFocus: false,\n listFilterSettings: {\n filterMode: 'contains',\n searchableTextCallback: item => item.name || item.id\n }\n })\n .off('selected.datagrid')\n .on('selected.datagrid', function (selectedEvent, args) {\n const chk = args.elem.find('.checkbox');\n const id = chk.attr('data-column-id');\n const isChecked = chk.prop('checked');\n\n args.elem.removeClass('is-selected hide-selected-color');\n\n if (chk.is(':disabled')) {\n return;\n }\n self.isColumnsChanged = true;\n\n // Set listview dataset node state, to be in sync after filtering\n const lv = { node: {}, api: $(this).data('listview') };\n if (lv.api) {\n const idx = self.columnIdxById(id);\n if (idx !== -1 && lv.api.settings.dataset[idx]) {\n lv.node = lv.api.settings.dataset[idx];\n }\n }\n if (!isChecked) {\n self.showColumn(id);\n chk.prop('checked', true);\n lv.node.hidden = false;\n } else {\n self.hideColumn(id);\n chk.prop('checked', false);\n lv.node.hidden = true;\n }\n if (self.settings.groupable) {\n self.rerender();\n }\n });\n\n modal.element.on('close.datagrid', () => {\n self.isColumnsChanged = false;\n });\n modal.element.on('keydown.datagrid', (event) => {\n // Escape Button Code. Make sure to close the modal correctly.\n if (event.keyCode === 27) {\n modal.close();\n $('body').off('beforeopen.datagrid');\n }\n });\n });\n }", "rebuildColumnMetaCache() {\n const numberOfColumns = this.hot.countCols();\n\n if (numberOfColumns === 0) {\n this.columnMetaCache.clear();\n\n } else {\n rangeEach(numberOfColumns - 1, visualColumnIndex => this.setMergedPluginSettings(visualColumnIndex));\n }\n }", "function onAddColumn(columnName) {\n setAddingColumn(false)\n const newBoard = {...board}\n\n const columnId = new Date().toString()\n\n const newColumns = {...newBoard.columns}\n\n // Create new column\n newColumns[columnId] = {id: columnId, title: columnName, taskIds: []}\n\n newBoard.columns = newColumns\n newBoard.columnOrder = [...newBoard.columnOrder, columnId]\n\n setBoard(newBoard)\n }", "function BrowserColumn() {}", "function BrowserColumn() {}", "isActiveColumn(strColumnName){\r\n\t\tvar i;\r\n\t\tfor(i=0;i<this.activeColumns.length;i++)\r\n\t\t{\r\n\t\t\tif(this.activeColumns[i]==strColumnName){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function setupColumns(columns) {\n columns.forEach(function (column) {\n var col = new Column(column.id, column.name);\n board.addColumn(col);\n setupCards(col, column.cards);\n });\n}", "getAddColumnQuery(model_name, column_property) {\n return null;\n }", "createMap() {\n const schema = this.getSchema();\n\n if (typeof schema === 'undefined') {\n throw new Error('trying to create `columns` definition but you didn\\'t provide `schema` nor `data`');\n }\n\n const columns = this.tableMeta.columns;\n let i;\n\n this.colToPropCache = [];\n this.propToColCache = new Map();\n\n if (columns) {\n let columnsLen = 0;\n let filteredIndex = 0;\n let columnsAsFunc = false;\n\n if (typeof columns === 'function') {\n const schemaLen = deepObjectSize(schema);\n\n columnsLen = schemaLen > 0 ? schemaLen : this.countFirstRowKeys();\n columnsAsFunc = true;\n\n } else {\n const maxCols = this.tableMeta.maxCols;\n\n columnsLen = Math.min(maxCols, columns.length);\n }\n\n for (i = 0; i < columnsLen; i++) {\n const column = columnsAsFunc ? columns(i) : columns[i];\n\n if (isObject(column)) {\n if (typeof column.data !== 'undefined') {\n const index = columnsAsFunc ? filteredIndex : i;\n\n this.colToPropCache[index] = column.data;\n this.propToColCache.set(column.data, index);\n }\n\n filteredIndex += 1;\n }\n }\n\n } else {\n this.recursiveDuckColumns(schema);\n }\n }", "function Column(_) {\n return null;\n}", "function Column(_) {\n return null;\n}", "function Column(_) {\n return null;\n}", "function Column(_) {\n return null;\n}", "function Column(_) {\n return null;\n}", "function Column(_) {\n return null;\n}", "function Column(_) {\n return null;\n}", "addColumn(column) {\n this.items.push(column);\n }", "function initColumn(area){\n\n\t//string replacement\n\tvar show_area = area.replace('show_','');\n\n\tif(jQuery(\"#\"+area).is(':checked')){\n\t\t//insert the new rule\n\t\tdocument.styleSheets[0].insertRule('div#com_cobalt th.'+show_area+'{ display:table-cell; }',0);\n\t\t//insert reference to the new rule to our global references object\n\t\theader_refs[show_area] = document.styleSheets[0].cssRules[0];\n\t\t\n\t\t//insert the new rule\n\t\tdocument.styleSheets[0].insertRule('div#com_cobalt td.'+show_area+'{ display:table-cell; }',0);\n\t\t//insert reference to the new rule to our global references object\n\t\trow_refs[show_area] = document.styleSheets[0].cssRules[0];\n\t}else{\n\t\t//insert the new rule\n\t\tdocument.styleSheets[0].insertRule('div#com_cobalt th.'+show_area+'{ display:none; }',0);\n\t\t//insert reference to the new rule to our global references object\n\t\theader_refs[show_area] = document.styleSheets[0].cssRules[0];\n\t\t\n\t\t//insert the new rule\n\t\tdocument.styleSheets[0].insertRule('div#com_cobalt td.'+show_area+'{ display:none; }',0);\n\t\t//insert reference to the new rule to our global references object\n\t\trow_refs[show_area] = document.styleSheets[0].cssRules[0];\n\t}\n\n\n}", "_syncColumnDefName() {\n if (this.columnDef) {\n this.columnDef.name = this.name;\n }\n }", "get columns() {\n return this.$columns;\n }", "function setTwoColumnView() {\n\t\t\t\tconsole.log(\"Set two column view called\");\n\t\t\t\t$scope.isTwoColumns = true;\n\t\t\t}", "function set_columns_hidden() {\n //console.log( \"===== set_columns_hidden === \");\n //console.log( \" permit_dict\", permit_dict);\n\n if (permit_dict.requsr_role_system) {\n columns_hidden = [];\n } else if (permit_dict.requsr_role_admin) {\n // PR2023-05-30 admin must approve secret exams, dont hide auth3 auth4\n //columns_hidden = [\"group_auth3\", \"group_auth4\"];\n } else if (permit_dict.requsr_role_insp) {\n columns_hidden = [\"group_auth3\", \"group_auth4\"];\n } else if (permit_dict.requsr_role_corr) {\n columns_hidden = [\"sb_code\", \"school_abbrev\", \"group_auth3\", \"group_anlz\"];\n } else if (permit_dict.requsr_role_school) {\n columns_hidden = [\"sb_code\", \"school_abbrev\", \"group_anlz\", \"allowed_schoolbases\"];\n };\n }", "function isColumnEditable(args) {\n\n\t\t\t\t\t// skip pinned (footer) nodes\n\t\t\t\t\tif(args.node.rowPinned) return false;\n\n\t\t\t\t\t// if read-only and no r-o columns\n\t\t\t\t\tif($scope.model.readOnly && !$scope.model.readOnlyColumnIds) return false;\n\n\t\t\t\t\tvar rowGroupCols = getRowGroupColumns();\n\t\t\t\t\tfor (var i = 0; i < rowGroupCols.length; i++) {\n\t\t\t\t\t\tif (args.colDef.field == rowGroupCols[i].colDef.field) {\n\t\t\t\t\t\t\treturn false;\t// don't allow editing columns used for grouping\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar isColumnEditable = true;\n\t\t\t\t\tif (!isTableGrouped()) {\n\t\t\t\t\t\tvar column = getColumn(args.colDef.field);\n\t\t\t\t\t\tif (column && column.isEditableDataprovider) {\n\t\t\t\t\t\t\tvar index = args.node.rowIndex - foundset.foundset.viewPort.startIndex;\n\t\t\t\t\t\t\tisColumnEditable = column.isEditableDataprovider[index];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar foundsetManager = getFoundsetManagerByFoundsetUUID(args.data._svyFoundsetUUID);\n\t\t\t\t\t\tvar index = foundsetManager.getRowIndex(args.data) - foundsetManager.foundset.viewPort.startIndex;\n\t\t\t\t\t\tif (index >= 0 && foundsetManager.foundset.viewPort.rows[index][args.colDef.field + \"_isEditableDataprovider\"] != undefined) {\n\t\t\t\t\t\t\tisColumnEditable = foundsetManager.foundset.viewPort.rows[index][args.colDef.field + \"_isEditableDataprovider\"];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// if editable check the r-o state from the runtime map\n\t\t\t\t\tif(isColumnEditable && $scope.model.readOnlyColumnIds && args.colDef.colId && $scope.model.readOnlyColumnIds['_' + args.colDef.colId] != undefined) {\n\t\t\t\t\t\treturn !$scope.model.readOnlyColumnIds['_' + args.colDef.colId];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn isColumnEditable && !$scope.model.readOnly;\n\t\t\t\t}", "function set_table_column() {\n var columns = []; var i=0;\n $('#showColumnList .list-group-item').each(function() {\n columns[i] = $(this).attr('class').split('list-group-item ')[1];\n i++;\n });\n if(i==0){\n alert(\"Kolom yang ditampilkan tidak boleh kosong\");\n } else {\n localStorage.setItem(storage_name, JSON.stringify(columns));\n reload_table();\n set_column_short_order();\n }\n set_column_height();\n}", "function Column(name)\n{\n\tthis.name = name;\n}", "_define_user() {\n if ( GenericStore.defaultUserId ) {\n this.definedProps[ 'uid' ] = GenericStore.defaultUserId;\n }\n }", "uiUpdateTableColumn(column, what) {\n let dsColumns = lodash.cloneDeep(this.state.dsColumns);\n\n switch (what) {\n case \"add\":\n column.key = column.column_id;\n\n dsColumns.push(lodash.cloneDeep(column));\n\n this.setState({\n pageSizeColumns: dsColumns.length,\n dsColumns: dsColumns\n })\n break\n case \"update\":\n for(let i = 0; i < dsColumns.length; i++) {\n if (dsColumns[i].column_id === column.column_id) {\n dsColumns[i].column_name = column.column_name;\n dsColumns[i].data_type = column.data_type;\n dsColumns[i].data_length = column.data_length;\n dsColumns[i].primary_flag = column.primary_flag;\n dsColumns[i].nullable_flag = column.nullable_flag;\n dsColumns[i].data_default = column.data_default;\n dsColumns[i].split_flag = column.split_flag;\n dsColumns[i].repeat_flag = column.repeat_flag;\n dsColumns[i].column_desc = column.column_desc;\n break\n }\n }\n this.setState({\n dsColumns: dsColumns\n })\n break\n case \"delete\":\n break\n default:\n break\n }\n }", "function setupColumns(columns) {\n columns.forEach(function(column) {\n var col = new Column(column.id, column.name);\n board.addColumn(col);\n setupCards(col, column.cards);\n });\n}", "function RecordsetColumnMenu_applyServerBehavior(sbObj, paramObj) {\r\n var retVal = \"\";\r\n var colName = this.listControl.getValue();\r\n if (!colName || colName.indexOf(\"MM_ERROR\") != -1) {\r\n retVal = MM.MSG_NeedColumn;\r\n }\r\n paramObj[this.paramName] = colName;\r\n return retVal;\r\n}", "withChild(){\n this.columns.push({\n \"className\": 'details-control',\n \"orderable\": false,\n \"data\": null,\n \"defaultContent\": ''\n });\n }", "render() {\n const { dataSource, count,disableButton } = this.state;\n const components = {\n body: {\n cell: EditableCell\n }\n };\n const columns = this.columns.map(col => {\n if (!col.editable) {\n return col;\n }\n return {\n ...col,\n onCell: record => ({\n record,\n inputType: col.dataIndex === \"name\" ? \"text\" : \"email\",\n dataIndex: col.dataIndex,\n title: col.title,\n editing: this.isEditing(record)\n })\n };\n });\n return (\n <div style={Styles.container}>\n <style dangerouslySetInnerHTML={{ __html: stylesheet }} />\n <Row type=\"flex\">\n <Col>\n <Text style={{ fontWeight: \"bold\" }}>{dataSource.length} Users</Text>\n </Col>\n <Col />\n <Col />\n\n <Col offset={21}>\n <Button\n onClick={this.handleAdd}\n type=\"primary\"\n style={!disableButton?Styles.button_add:null}\n disabled={disableButton}\n >\n Add User\n </Button>\n </Col>\n </Row>\n <Row>\n <EditableContext.Provider value={this.props.form}>\n <Table\n dataSource={dataSource}\n columns={columns}\n components={components}\n />\n </EditableContext.Provider>\n </Row>\n </div>\n );\n }", "$setColumnNames(columns) {\n\n if (this.$isSeries) {\n if (columns) {\n if (this.$data.length != 0 && columns.length != 1 && typeof columns != 'string') {\n ErrorThrower.throwColumnNamesLengthError(this, columns);\n }\n this.$columns = columns;\n } else {\n this.$columns = [\"0\"];\n }\n } else {\n if (columns) {\n\n if (this.$data.length != 0 && columns.length != this.shape[1]) {\n\n ErrorThrower.throwColumnNamesLengthError(this, columns);\n }\n if (Array.from(new Set(columns)).length !== this.shape[1]) {\n ErrorThrower.throwColumnDuplicateError();\n }\n\n this.$columns = columns;\n } else {\n this.$columns = (utils.range(0, this.shape[1] - 1)).map((val) => `${val}`); //generate columns\n }\n }\n }", "cols(){return player.u.unlockedBuyables}", "SetTaskColumnProperties() {\n try {\n var closeTask = new ColumnProperties(\"\", \"Close\", \"3\", true, false, ReactDataGridConstants.ColumnTypes.CustomHTMLControl, \"\", false, null, this.CheckBoxCheckFunction, null, true);\n oEmployeeTasksColProps.push(closeTask);\n\n var colID = new ColumnProperties(\"ID\", \"ID\", \"3\", false, true, \"Number\", \"\", false, \"\");\n oEmployeeTasksColProps.push(colID);\n\n var colAssignedToID = new ColumnProperties(\"AssignedToId\", \"Assigned To\", \"3\", false, true, \"PeopleWithID\", \"\", false, \"\");\n oEmployeeTasksColProps.push(colAssignedToID);\n\n var colActivity = new ColumnProperties(\"DueDate\", \"Due Date\", \"8\", true, true, \"text\", \"MM/DD/YYYY\", false, \"\", this._isDueDateExceed);\n oEmployeeTasksColProps.push(colActivity);\n\n var colTitle = new ColumnProperties(\"Title\", \"Task Name\", \"16\", true, true, \"text\", \"\", false, \"\");\n oEmployeeTasksColProps.push(colTitle);\n\n var colEmployee = new ColumnProperties(\"OData__EmployeeID\", \"Employee\", \"9\", true, true, \"Lookup\", \"\", true, \"_EmployeeName\");\n oEmployeeTasksColProps.push(colEmployee);\n\n var colTaskType = new ColumnProperties(\"TypeOfTask\", \"TaskType\", \"9\", false, true, \"text\", \"\", false, \"\");\n oEmployeeTasksColProps.push(colTaskType);\n\n var colStandardTaskID = new ColumnProperties(\"OData__IDStandardTask\", \"StandardTaskID\", \"9\", false, true, \"Lookup\", \"\", true, \"ID\");\n oEmployeeTasksColProps.push(colStandardTaskID);\n\n\n\n var colEmployeeStatus = new ColumnProperties(\"OData__EmployeeID\", \"Employee Status\", \"9\", false, true, \"Lookup\", \"\", true, \"_StatusE\");\n oEmployeeTasksColProps.push(colEmployeeStatus);\n\n var colEmployeeID = new ColumnProperties(\"OData__EmployeeID\", \"Employee ID\", \"\", false, true, \"Lookup\", \"\", true, \"ID\");\n oEmployeeTasksColProps.push(colEmployeeID);\n\n //var colDepartmentID = new ColumnProperties(\"IDDepartment\", \"Department\", \"\", true, true, \"Number\", \"\", false, \"\");\n //oEmployeeTasksColProps.push(colDepartmentID);\n\n var colDepartmentID = new ColumnProperties(\"Departments\", \"Department\", \"11\", true, true, \"Lookup\", \"\", true, \"_DepartmentName\");\n oEmployeeTasksColProps.push(colDepartmentID);\n\n var colCategoryID = new ColumnProperties(\"OData__IDCategory\", \"Category\", \"9\", true, true, \"Lookup\", \"\", true, \"CategoryName1\");\n oEmployeeTasksColProps.push(colCategoryID);\n\n var colLevel = new ColumnProperties(\"TaskLevel\", \"Level\", \"8\", true, true, \"Lookup\", \"\", true, \"Title\");\n oEmployeeTasksColProps.push(colLevel);\n\n var colAssignedTo = new ColumnProperties(\"AssignedTo\", \"Assigned To\", \"10\", true, false, \"People\", \"\", false, \"\");\n oEmployeeTasksColProps.push(colAssignedTo);\n\n var colStatus = new ColumnProperties(\"Status\", \"Status\", \"6\", true, true, \"text\", \"\", false, \"\", this.ShowOpenAsNotStarted);\n oEmployeeTasksColProps.push(colStatus);\n\n //var colRemark = new ColumnProperties(\"Remark\", \"Remark\", \"\", true, true, \"text\", \"\", false, \"\");\n //oEmployeeTasksColProps.push(colRemark);\n }\n catch (e) { BKJSShared.GlobalErrorHandler(e, \"DashboardMain.SetTaskColumnProperties\"); }\n\n }", "function getColumnCount() {\n pquery = pobjects.get(0);\n colCount = pquery.getColumnCount();\n return colCount + 1; // we added a new column\n\n}", "get customStructure() {\n return this.columnDef && this.columnDef.internalColumnEditor && this.columnDef.internalColumnEditor.customStructure;\n }", "get customStructure() {\n return this.columnDef && this.columnDef.internalColumnEditor && this.columnDef.internalColumnEditor.customStructure;\n }", "function _init_user_name(){\n try{\n var db = Titanium.Database.open(self.get_db_name());\n db.execute('CREATE TABLE IF NOT EXISTS my_login_info('+\n 'id INTEGER,'+\n 'name TEXT,'+\n 'value TEXT)');\n var rows = db.execute('SELECT * FROM my_login_info where id=1');\n if((rows.getRowCount() > 0) && (rows.isValidRow())){\n _user_name = rows.fieldByName('value');\n }\n rows.close();\n db.close();\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _init_user_name');\n return;\n } \n }", "recalculateColumnWidths(){if(!this._columnTree){return;// No columns\n}const cols=this._getColumns().filter(col=>!col.hidden&&col.autoWidth);this._recalculateColumnWidths(cols)}", "function setColumnFilter() {\n\n // Get the column filter object for this popup instance\n var filter = properties.activeColumn.enhancedTable.filter;\n\n // Make sure we start fresh\n filter.set = [];\n\n // Only proceed if there is a value in the first value input element\n if (properties.screen[properties.filterPopupValueName1] != undefined && properties.screen[properties.filterPopupValueName1] != null) {\n\n // Add this first key/value set into our filter set\n filter.set.push({\n operator: properties.screen[properties.filterPopupOperatorName1],\n value: properties.screen[properties.filterPopupValueName1]\n });\n\n // If there is also data in the second value input element\n if (properties.screen[properties.filterPopupValueName2] != undefined && properties.screen[properties.filterPopupValueName2] != null) {\n\n // Add this second key/value into the set\n filter.set.push({\n operator: properties.screen[properties.filterPopupOperatorName2],\n value: properties.screen[properties.filterPopupValueName2]\n });\n\n }\n\n }\n\n\n \t// Initialize the filter position for this column\n if (filter.position == null)\n \tfilter.position = filter.set.length > 0 ? 1000 : null;\n\n // Setup the concat field, regardless of values or not\n filter.concatType = properties.screen[properties.filterPopupConcatName];\n\n // Since we added/removed a filter item, re-sort the fields based on their filter position\n properties.filterColumns = _.sortBy(properties.filterColumns, function (item) {\n return item.enhancedTable.filter.position == null ? 10000 : item.enhancedTable.filter.position;\n });\n\n // Recalculate the filter position property, for use in the header display\n _.each(properties.filterColumns, function (item, index) {\n if (item.enhancedTable.filter.position != null) {\n item.enhancedTable.filter.position = index;\n }\n });\n\n\t\t\t// Get the data if we are not in batch mode\n\t if (!properties.batchMode) reQuery();\n\n \t// So now lets go update the column headers\n updateTableHeaders();\n\n }", "getColumns() {\n return [];\n }", "setOriginalColumns() {\n this.originalColumns = utils.deepCopy(this.settings.columns);\n }", "get userPopulated() {\n return this.user && this.user.id;\n }", "function RecordsetColumnMenu_analyzeServerBehavior(sbObj, allRecs) {\r\n if (!sbObj.incomplete && !this.colNameIsValid(sbObj.parameters[this.rsParamName], sbObj.parameters[this.paramName])) {\r\n sbObj.incomplete = true;\r\n }\r\n}" ]
[ "0.6035241", "0.6034718", "0.59831727", "0.59749687", "0.59431833", "0.58390737", "0.5812239", "0.57996655", "0.5766", "0.57393545", "0.56383014", "0.5565568", "0.55211943", "0.5511923", "0.5486036", "0.54610777", "0.5449025", "0.5428122", "0.54271585", "0.5407509", "0.5406668", "0.53825116", "0.5369037", "0.5369037", "0.5369037", "0.5369037", "0.5369037", "0.5369037", "0.5369037", "0.5369037", "0.5369037", "0.5363833", "0.53464913", "0.5338521", "0.53362864", "0.5323751", "0.53236663", "0.53151983", "0.52872455", "0.5279457", "0.5255303", "0.5251478", "0.52357066", "0.5234417", "0.52329165", "0.52296567", "0.5206268", "0.51865315", "0.5179774", "0.51771486", "0.5174327", "0.516786", "0.516265", "0.51597756", "0.51537925", "0.51426184", "0.51415014", "0.5140261", "0.5131497", "0.5123838", "0.5123838", "0.51226056", "0.5108934", "0.51088953", "0.5106713", "0.51045215", "0.51045215", "0.51045215", "0.51045215", "0.51045215", "0.51045215", "0.51045215", "0.5103151", "0.5094852", "0.5090004", "0.50890136", "0.50852036", "0.5082289", "0.5079871", "0.5079744", "0.507903", "0.50721925", "0.5069067", "0.5064153", "0.50631726", "0.5060222", "0.50401324", "0.50393623", "0.50380427", "0.5036094", "0.5035041", "0.50344205", "0.50344205", "0.50257283", "0.5017336", "0.50170016", "0.5015452", "0.50142086", "0.5013399", "0.50103766" ]
0.67901367
0
Understand Scope. Write Higher Order Functions. Pass Functions As Callbacks. Scope Variable Visbility. The location where a variable is defined dictates where we have access to that variable. Function Scope
function lol() { let person = 'Tom'; const age = 45; var color = 'teal'; console.log(age); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myFunction(callback) {\n console.log(\"This is myFunction\"); // This is myFunction\n callback(); // This is myCallback\n function myInnerFunction() {\n console.log(\"This is myInnerFunction\");\n }\n myInnerFunction(); // This is myInnerFunction\n}", "function outerFunction (outerArg) { // begin of scope outerFunction\r\n // Variable declared in outerFunction function scope \r\n var outerFuncVar = 'x'; \r\n // Closure self-invoking function \r\n function innerFunction (innerArg) { // begin of scope innerFunction\r\n // variable declared in innerFunction function scope\r\n var innerFuncVar = \"y\"; \r\n console.log( \r\n \"outerArg = \" + outerArg + \"\\n\" +\r\n \"outerFuncVar = \" + outerFuncVar + \"\\n\" +\r\n \"innerArg = \" + innerArg + \"\\n\" +\r\n \"innerFuncVar = \" + innerFuncVar + \"\\n\" +\r\n \"globalVar = \" + globalVar);\r\n \r\n }\r\n innerFunction(5);\r\n}", "function foo() {\n\tvar bar = 'bat'\n\n\tfunction asdf() {\n\t\tconsole.log(bar)\n\t}\n\tasdf() // bat\n}", "function foo() {\n var x = 1;\n function bar() {\n console.log(x);\n }\n baz(bar);\n}", "function foo() {\n var a = 2;\n\n function baz() {\n console.log( a ); // 2\n }\n\n bar( baz );\n}", "function foo() {\n\tvar bar = \"bar\";\n\n\tfunction baz() {\n\t\tconsole.log(bar);\n\t}\n\n\tbam(baz)\n}", "function foo() {\n\tvar a = 1;\n\n\tfunction bar() {\n\t\tvar b = 2;\n\n\t\tfunction baz() {\n\t\t\tvar c = 3;\n\n\t\t\tconsole.log( a, b, c );\t// 1 2 3\n\t\t}\n\n\t\tbaz();\n\t\tconsole.log( a, b );\t\t// 1 2\n\t}\n\n\tbar();\n\tconsole.log( a );\t\t\t\t// 1\n}", "function bar() {\n // Local function scope of bar\n }", "function closureExample(parameterOne) { \n let localScope = parameterOne; //variable assigned within function scope.\n return () => localScope; //anonymous function declared in return statement.\n}", "function closureFoo() {\n var bar = \"bar\";\n function baz() {\n console.log(`closure, remembers the lexical scope: ${bar}`);\n }\n\n // baz is passed as reference to outside function, and still remembers the its scope\n // and accesses bar variable outside the invokiing scope\n outsideFunction(baz);\n}", "function a() \n{\n b(function fun(x){\n console.log(x)\n }); /** passing a parameter as function */\n}", "function testHoist() {\n becomesGlobal = \"not declared, it becomes part of the global scope\";\n console.log('Prior to declaring ', insideFunc);\n var insideFunc = \"Rules still apply here\";\n console.log(insideFunc);\n}", "function foo(){\n var bar = 10;\n console.log(\"3: \" + bar); //3: What will bar be on this line?\n\n var innerFoo = function(){\n bar = 15;\n }\n\n console.log(\"4: \" + bar); //4: What will bar be on this line? -->\n}", "function scoper() {\n // let cat = 'Toby';\n console.log('cat inside scoper ', cat);\n function innerScope() {\n console.log('cat inside innerScope ', cat);\n }\n innerScope();\n}", "function store(){\n\n // function scope \n var w = 11;\n var x = \"banana\";\n var y = 50;\n var z = false;\n console.log('FUNCTION SCOPE : '+ w,x,y,z); \n}", "function foo(a) {\n\t//scope of foo. Includes identifiers a, bar, and b.\n\tvar b = a * 2;\n\n\t// scope of bar. Just has identifier c.\n\tfunction bar(c) {\n\t\tconsole.log( a, b, c);\n\t}\n\n\tbar(b * 3);\n\n}", "function foo() {\n\tvar name = 'mike'\n\tfunction bar() {\n\t\tconsole.log(name)\n\t}\n}", "function testHoist() {\n becomesGlobal = \"not declared, it becomes part of the global scope\";\n console.log('prior to declaring ', insideFunc);\n var insideFunc = \"Rules still apply here\";\n console.log(insideFunc);\n}", "function MV_SetCallBack($function) {\n MV_CallBackFunc = $function;\n}", "function outerFunction(){\n var outerFunctionVariable='outer-function-value';\n console.log(outerFunctionVariable);\n function innerFunction(){\n var innerFunctionVariable='inner-function-value';\n console.log(innerFunctionVariable);\n console.log(outerFunctionVariable);\n }\n innerFunction();\n // Variables declared inside inner functions are also not visible from\n // enclosing functions\n //console.log(innerFunctionVariable);\n}", "function foo(a) {\n var b = a + 2\n function bar(c) {\n console.log(a, b, c)\n }\n bar(b * 2)\n}", "function foo(a){\n var b = 2;\n\n //some code\n\n function bar() {\n //...\n }\n\n //more code\n\n var c =3;\n}", "function x () {\n var a = 17\n\n function y () {\n console.log(a)\n }\n y()\n}", "function a() {\n\tvar myVar = 2;\n\tfunction b() {\n\t\tconsole.log(myVar);\n\t}\n\tb();\n}", "function foo1() {\n\tvar a = 1;\n\n\tfunction bar() {\n\t\tvar b = 2;\n\n\t\tfunction baz() {\n\t\t\tvar c = 3;\n\n\t\t\tconsole.log( a, b, c );\t// 1 2 3\n\t\t}\n\n\t\tbaz();\n\t\tconsole.log( a, b );\t\t// 1 2\n\t}\n\n\tbar();\n\tconsole.log( a,b );\t\t\t\t// 1\n}", "function foo(){\n var bar = 10;\n console.log(\"3: \" + bar); //3: What will bar be on this line? --> 3: 10\n\n var innerFoo = function(){\n bar = 15;\n }\n\n console.log(\"4: \" + bar); //4: What will bar be on this line? --> 4: 10 (not 15 bacause bar = 15 in innerFoo becomes global but\n //it does not affect the bar = 10 in function foo)\n}", "function mycallback() {}", "function foo(){\n function bar(){\n console.log(\"hello\");\n }\n}", "function xyz(){\n console.log(abc); // it is available here!\n function qwe(){\n console.log(abc); // it is available here too!\n }\n\n}", "function fa() {\r\n\t\t\t\t// fa scope = VO:{a: undefined, x: undefined, fb: <reference to function>}-->Global\r\n\t\t\t\t// fb scope = Closure:{a: undefined}-->Global\r\n\t\t\t\tvar a = 100;\r\n\t\t\t\tvar x = 'wwq';\r\n\r\n\t\t\t\tfunction fb() {\r\n\t\t\t\t\t// fb scope = VO:{b: undefined, y: undefined, fc: <reference to function>}-->Closure:{a: 100}-->Global\r\n\t\t\t\t\t// fc scope = Closure:{b: undefined}-->Closure:{a: 100}-->Global\r\n\t\t\t\t\tvar b = 1;\r\n\t\t\t\t\tvar y = 'wwl';\r\n\r\n\t\t\t\t\tfunction fc() {\r\n\t\t\t\t\t\t// fc scope = VO:{z: undefined}-->Closure:{b: 1}-->Closure:{a: 100}-->Global\r\n\t\t\t\t\t\tvar z = 'wmm';\r\n\t\t\t\t\t\treturn a + b;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn fc;\r\n\t\t\t\t}\r\n\t\t\t\treturn fb();\r\n\t\t\t}", "function foo() {\n var b = a * 3;\n function bar(c) {\n var b = 2;\n console.log(a, b, c);\n }\n\n bar(b * 4);\n}", "function hello(){\n var a = 10 \n hi()\n\n function hi(){\n var b = 20\n console.log(a)\n console.log(b)\n //console.log(c)\n\n bye()\n\n function bye(){\n var c = 90\n console.log(a)\n console.log(b)\n console.log(c)\n }\n }\n}", "function functionScope(){\n var functionVariable='function-value';\n console.log(functionVariable);\n}", "function a() {\n\n function b() {\n console.log(myVar);\n }\n\n let myVar = 2;\n b();\n}", "function main(param1,param2,callBack){ \n console.log(param1, param2) \n callBack() \n }", "function top2() {\n var a;\n function inner() {\n console.log(a);\n }\n inner();\n}", "function x() {\n var variable = 10;\n function y() {\n console.log(variable);\n }\n variable = 100;\n return y;\n}", "function someFunction() {\n // Local Scope #1\n function someOtherFunction() {\n // Local Scope #2\n }\n}", "function foo() {\n var a = 2;\n function bar() { // bar() has lexical scope access to inner scope of foo()\n console.log( a );\n }\n return bar; // passed as a value.. return function object itself that bar references\n}", "function someFunction() {\r\n // Local Scope #1\r\n function someOtherFunction() {\r\n // Local Scope #2\r\n }\r\n}", "function secondFunction() {\n\t\tvar z = 3;\n\t\tconsole.log(\"Second x = \", x); // 1 \n\t\tconsole.log(\"Second y = \", y); // 2 \n\t\tconsole.log(\"Second z = \", z); // 3 \n\t\t\n\t\tfunction thirdFunction(z) {\n\t\t\tz = 5;\t// not global\n\t\tconsole.log(\"Third x = \", x); // 1\n\t\tconsole.log(\"Third y = \", y); // 2 \n\t\tconsole.log(\"Third z = \", z); // 5 \n\t\t\t\n\t\t}\n\t\tthirdFunction(z);\n\t}", "function f3() {\n var x = 4; // local variable, scope = the function\n console.log(x); // displays '4'. The local variable x\n // \"masks\" the global variable x\n}", "function myReallyCoolFunction(someOtherFunction){\n //it does some stuff...\n //the passed in function might do some post processing\n \n\n console.log(\"the function passed in =\", someOtherFunction)\n}", "function calling(fun){\n fun();\n}", "function scope(){\n var x = 33; //local scope inside of a function - variables only exist within that function\n console.log(x); //you can also read the global scope (x) inside of this funtion if x isn't defined inside of the function\n}", "function Func_s() {\n}", "function myFunction() { //declaring and initializing a function\n return 1+2; //as mentioned before, this function is now available anywhere \n}", "function checkscope(){\n //function scope Everthing in the function block is locally accessable to the function only!!!\n var scope = \"local scope\" // local variable\n\n // create a local variable!!\n var scope = \"local scope\" // a local variable\n function f(){ return scope;} // another local variable\n\n return f(); //Return the value in the scope here\n }", "function Lambda(cohortP) {\n const cohort = cohortP\n console.log(`Hello, ${cohort}`);\n \n\n function rock(rockP) {\n const rocknRoll = rockP\n const gotThis = \"You got this!\"\n console.log(`${rocknRoll}, GO ${cohort}`);\n\n function got() {\n console.log(`${gotThis}, ${cohort}`)\n \n }\n got();\n }\n rock(\"You guys ROCK!\");\n}", "function foo() {\n\tvar a = 7;\n\tfunction bar() {\n\t\t// var a is hoisted here (don't write this until after)\n\t\tconsole.log(a)\n\t\tvar a = 3\n\t}\n\n\tbar();\n}", "function bar(){\n var foo = \"baz\";\n \n function baz(){\n foo = \"bam\";\n bam = \"yay\";\n console.log(foo);\n }\n baz();\n console.log(foo);\n}", "function testScope() {\n//var e is hoisted only to the top of the function, not the global scope. Since this is functional scoped.\n console.log(e); //undefined\n var e = \"I'm a var in a function!\";\n console.log(e); //\"I'm a var in a function\"\n}", "function higherOrder( callbackFn ){\n //call the callback function inside body\n callbackFn() //this is a function call.\n}", "function useLessFuntion() {\n // function scope\n var myVariable = \"Some Text\";\n}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function exampleFunc(a, b) { // a & b are parameters, local function variables\n return a + b; // code the function runs\n }", "function top3() {\n var a, b;\n function inner() {\n console.log(a);\n }\n return inner;\n}", "function callback(){}", "function setupSomeGlobals() {\n // Local variable that ends up within closure\n var num = 666;\n // Store some references to functions as global variables\n gAlertNumber = function() { alert(num); }\n gIncreaseNumber = function() { num++; }\n gSetNumber = function(x) { num = x; }\n}", "function GiveSalaryToEmployeeIn2Calls(employeeName){\n return function(salaryAmount){\n // IMPORTANT - notice that the employeeName from the outer function is used here .. \n // the outer function is almost like an object where it stores the data passed to it \n // at some point of time.. \n Console.log(\"paying \" + salaryAmount + \" to \" + employeeName)\n }\n }", "function numFunction(numValue1,numValue2,numCallback){\n\nlet result = numCallback(numValue1,numValue2); //2-The input values are brought here inside numFunction \nreturn result + 50; //4- Result is brought here and returned to console.log below\n}", "function top4(){\n var a;\n function inner1(){\n var b;\n function inner2(){\n console.log(a,b);\n }\n inner2();\n }\n inner1();\n}", "function foo(){\n var name =\"Grace\";\n function age(){\n var age =21;\n function gender(){\n var gender =\"female\";\n console.log(name,age,gender);\n }\n console.log(name,age);\n }\n console.log(name)\n}", "function outsideFunction () {\n return function insideFunction () {\n // it's functions all the way down...\n }\n}", "function example8() {\n\n //useful for callbacks\n var arr = [5, 2, 4];\n var sorted = arr.sort(function (a, b) {\n return a - b;\n });\n\n console.log(sorted); // 2,4,5\n\n //Hasn't its own THIS: get it from outer function\n\n var group = {\n title: \"Our command\",\n users: [{\n name: \"Alex\"\n }, {\n name: \"Bob\"\n }, {\n name: \"John\"\n }],\n\n showList: function showList() {\n var _this = this;\n\n this.users.forEach(function (user) {\n console.log(_this.title + \": \" + user.name); //this === group\n });\n }\n };\n group.showList();\n\n // Hasn't its own ARGUMENTS object. Get it from outer function\n\n function foo() {\n var _arguments = arguments;\n\n return (function () {\n return _arguments[0];\n })();\n }\n console.log(foo(123)); // 123\n}", "function foo () {\n\tvar x = 1;\n\tfunction bar () {\n\t\tvar y = x + 1;\t//bar可以访问foo的变量x\n\t}\n\tvar z = y + 1;\t//foo不可以访问bar的变量y\n}", "function inner(param){\n //the inner function can see all of the variables \n //that are declared in the enclosing function\n equal(bar, \"bar\", \"the inner function can see bar\");\n equal(foo, \"bar\", \"the inner function also see the re-assigned foo\");\n\n //the inner function can read parameters\n ok(param,\"inner has a parameter\");\n\n //the inner function can also have late references to\n //things that are declared in the scope of the caller\n ok(wayTooLate, \"late variable declaration\");\n }", "function myFunction () {\n console.log( myVariable ); // Can we see myVariable in the function!? Yes! We can see GLOBALLY scoped variables inside of a function!\n\n var myFunctionScopeVariable = 64; // Declared in a local (function) scope.\n}", "function callback(fun) {\n var nombre = \"Raquel\";\n console.log('Hola ' + nombre)\n fun(nombre);\n}", "function variablesInFunction() {\n // var inFunction = \"I am\";\n // var varFun = 0;\n varFun = 4;\n // console.log(inFunction);\n // console.log(varFun);\n let letFun = 5;\n // const constFun = 6;\n // console.log(letFun);\n\n // console.log(localInLocalFun); //nie ma dostępu z zakresu globalnego do lokalnego i wywali błąd\n\n function showVariable() {\n let localInLocalFun = \"local in local\";\n\n const constFun = \"Function in Function.\";\n varFun = \"I am overwriting value of variable from higher scope.\";\n console.log(varFun);\n console.log(letFun);\n console.log(constFun);\n }\n // showVariable();\n}", "function foo() { // this foo function gets its own execution context object\n var age = 28; // this variables is stored inside this function\n console.log(age); // this log is 28\n}", "function foo() {\n var a = 2;\n\n function bar() {\n console.log(a);\n }\n\n return bar;\n}", "function outerFunction(b){\n let x=10;\n function innerFunction(){\n console.log(x); //10\n console.log(b); //5\n }\n return innerFunction;\n}", "function outer(){\n var outervari = \"i am an outer variable\";\n console.log(outervari);\n function inner(){\n var innervari = \"i am an inner variable\";\n console.log(innervari);\n console.log(outervari);\n }\n inner();\n console.log(outervari);\n // console.log(innervari); will produce error\n}", "function funcA() {\n console.log(a);\n console.log(foo());\n var a = 1;\n function foo() {\n return 2;\n }\n}", "function sayHello() {\n const say = function () { console.log(hello); }\n // Local variable that ends up within the closure\n const hello = 'Hello, world!';\n return say;\n}", "function myFunction2() {\n\t// local scope variable\n\tvar y = 50;\n\n\t// document.write(\"y = \" + y + \" accessed inside of a function.\");\n}", "function add()\n{\n var xx = \"sdsjd\"; //variable declared inside function can only be used for that function(function scoped)\n}", "function foo() {\n console.log(\"I'm the callback\");\n}", "function exampleFunction() {\n var x = \"declared inside function\"; // x can only be used in exampleFunction\n console.log(\"Inside function\");\n console.log(x);\n}", "function foo() {\n var x = 10;\n return function bar() {\n console.log(x);\n };\n}", "function foo(a) {\n var b = a * 2;\n //var c =7;\n function bar(c) {\n console.log(a, b, c);\n }\n bar(b * 3);\n}", "function fuction() {\n\n}", "function a() {\n console.log(myVar);\n\n function b() {\n let myVar = 2;\n }\n\n b();\n}", "function foo(){\n var bar = 10;\n console.log(\"3: \" + bar); //3: What will bar be on this line?\n //--->Answer: 3: 10, it's a string plus the value.\n\n var innerFoo = function(){\n bar = 15;\n }\n\n console.log(\"4: \" + bar); //4: What will bar be on this line?\n}//-->Answer: 4: 10, Q: Is this because the console.log is outside of innerFoo(),", "function foo() {\n var bar;\n\n function zip() {\n var quux;\n }\n}", "function c() {\n\tfunction d() {\n\t\tconsole.log(myVar);\n\t}\n\n\tvar myVar = 2;\n\td();\n}", "function x(){\r\n var a = 7;\r\n function y(){\r\n console.log(a);\r\n }\r\n return y;\r\n}", "function parent(){\n const parent = 'parent';\n console.log(`I am the ${parent} and my closure is. I can't say who my child or grandchild is. I do not have a closure in chrome dev tools, but I am restricted the global window object on the DOM.`);\n child();\n function child(){\n let child = 'child';\n console.log(`I am the ${child}. My parent is ${parent}. I can't say who my child is. Since I am accessing the parent variable, my closure is the parent function`);\n grandChild();\n function grandChild(){\n const grandchild = 'grandchild';\n console.log(`I am the ${grandchild}. My parent is ${child}, and my grandparent is ${parent}. I have no children. I have two closures. My first closure is child since I use the child variable and because it's located inside the child function. My second closure is parent since I access the parent variable inside of the parent function.`);\n }\n }\n}", "function greet (vlanguage){\nreturn function(name){\n console.log(vlanguage+' ' + name);\n}\n}", "function foo(cb) {\n cb();\n}", "function greet() {\r\n name = 'Hammad';\r\n return function () {\r\n console.log('Hi ' + name);\r\n }\r\n}", "function greet() {\r\n name = 'Hammad';\r\n return function () {\r\n console.log('Hi ' + name);\r\n }\r\n}", "function example4() {\n\n function makeArmy() {\n var shooters = [];\n\n var _loop = function _loop(i) {\n //*\n shooters.push(function () {\n alert(i); // выводит свой номер\n });\n };\n\n for (var i = 0; i < 10; i++) {\n _loop(i);\n }\n return shooters;\n }\n\n var army = makeArmy();\n army[0](); // 0\n army[5](); // 5\n}", "function myName(name, callback) {\n var age = 20;\n callback(age);\n console.log(\"My Name is : \", name);\n}", "function caller(){\n return function(name){\n return \"Caller calling you \" + name;\n }\n }", "function foo(cb){\n console.log(cb); // prints [Function: sayHello]\n cb(); // prints 'Hello World'\n var result = cb()\n console.log(result); //prints 42\n}" ]
[ "0.6458311", "0.6325073", "0.62958777", "0.6288805", "0.62867975", "0.6269847", "0.62111706", "0.62006533", "0.6198064", "0.6187406", "0.61860406", "0.6152954", "0.6139012", "0.6134924", "0.6130482", "0.6127705", "0.61213946", "0.6115675", "0.6108972", "0.60993445", "0.60983825", "0.606563", "0.60357136", "0.6018628", "0.5991791", "0.59814787", "0.5959649", "0.5951617", "0.59460425", "0.59446657", "0.59234303", "0.59201044", "0.5908984", "0.5896006", "0.58956563", "0.58907", "0.58861387", "0.5884836", "0.5883285", "0.58686167", "0.5855595", "0.58454126", "0.58325714", "0.5821174", "0.5818127", "0.58176863", "0.5812891", "0.5810734", "0.58092964", "0.580166", "0.57985806", "0.5784843", "0.5781797", "0.57727957", "0.5767089", "0.5767089", "0.5767089", "0.5767089", "0.5767089", "0.57653546", "0.5765343", "0.5761339", "0.5743667", "0.5739785", "0.5725411", "0.5719908", "0.57153475", "0.5715272", "0.5714711", "0.5711265", "0.57093656", "0.57066846", "0.57062536", "0.57020587", "0.57018477", "0.5700102", "0.56968397", "0.5696529", "0.56936026", "0.56878215", "0.5685147", "0.5682829", "0.5676279", "0.5675651", "0.56701386", "0.56686854", "0.5666334", "0.5653989", "0.5650828", "0.56478024", "0.563954", "0.5638883", "0.5638152", "0.5635322", "0.5632451", "0.56297576", "0.56297576", "0.5629689", "0.5627176", "0.56251645", "0.5625081" ]
0.0
-1
you can add any code you want within this function scope
function polybius(input, encode = true) { // create dictionary for decoding input = input.toLowerCase(); const alphabet = "abcdefghijklmnopqrstuvwxyz".split(""); const toFive = ["1", "2", "3", "4", "5"]; let code = []; toFive.forEach((col) => { toFive.forEach((row) => { if (row + col === "42") { code.push("42", "42"); } else { code.push(row + col); } }); }); const polyKey = {}; alphabet.forEach((letter, index) => (polyKey[letter] = code[index])); // Dictionary for decoding created if (encode) { // Encode input based on dictionary let result = ""; for (const letter of input) { if (letter != " ") { result += polyKey[letter]; } else { result += letter; } } return result; } else { // Decode input if (input.replace(/ /g, "").length % 2 != 0) { /* Return false if the length of input minus the spaces is odd because we decode #s in pairs */ return false; } let result = ""; // Split into words input = input.split(" "); // Split input into pairs of strings let codePairs = input.map((string) => string.match(/.{1,2}/g)); let wrdCount = 1; codePairs.forEach((word) => { word.forEach((num) => { if (num === "42") { result += "(i/j)"; } else { // Decrypt letter & add to result result += Object.keys(polyKey).find((key) => polyKey[key] === num); } }); if (codePairs.length > wrdCount) { // If its not the last word add a space between the words result += " "; wrdCount++; } }); return result; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function customFunction() {\n //Statements\n }", "function fn() {\n\t\t }", "function additionalSettings(){\n\n\n}", "function _____SHARED_functions_____(){}", "function exampleFunctionToRun(){\n\n }", "function funcionPorDefinicion(){\n //Body\n }", "function wa(){}", "private public function m246() {}", "function fuctionPanier(){\n\n}", "function lalalala() {\n\n}", "function ea(){}", "addedToWorld() { }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "function myOwnFunctionName() {\n // a block of code\n}", "function fuction() {\n\n}", "function add() {\n // TODO: your code here\n}", "function codeReporter(fun) {\n less_fun = fun.replace(/\\(\\)/, '');\n // Convert line to HTML.\n line = \"<li>\" + code_lines.length + \"<code>\" + fun + \"</code>\" +\n \"<span class='code_modal_link'><a href='#' onclick='display_function_modal(\" + less_fun +\n \")'>view</a></span></li>\";\n // Add line to (global) code_lines.\n code_lines.unshift(line);\n // Recreate contents of code-box.\n $(\"#code-box-content\").html(code_lines.slice(0,5));\n}", "function doCoolStuff(){\n // do cool stuff\n }", "function Expt() {\r\n}", "private internal function m248() {}", "function Annotate() {\r\n}", "function h(){if(!h.called){h.called=!0;var e=document.querySelectorAll(\"pre code\");x.forEach.call(e,p)}}", "click_extra() {\r\n }", "function myOwnFunctionName( parameters ) {\n // a block of code\n}", "protected internal function m252() {}", "function onloevha() {\n}", "function Scdr() {\r\n}", "function generateCode(){\n\n}", "function miFuncion (){}", "function comportement (){\n\t }", "function fm(){}", "function name() {\u000b \n //code to be executed\u000b\n }", "function runCode() {\n\t\tset_code(data);\n\t}", "function add() {}", "function customHandling() { }", "onCodePathStart(codePath, node) {\n funcInfo = {\n upper: funcInfo,\n codePath,\n hasReturn: false,\n node\n };\n }", "function cargarpista1 (){\n \n}", "editTattoo () {\n\n }", "function Introducao_elementsExtraJS() {\n // screen (Introducao) extra code\n\n }", "function PaginaInicial_elementsExtraJS() {\n // screen (PaginaInicial) extra code\n\n }", "onModifySpA() {}", "function __func(){}", "function add()\n{\n var xx = \"sdsjd\"; //variable declared inside function can only be used for that function(function scoped)\n}", "function ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "function add(code) {\n $css.append(code);\n }", "function miFuncion(){\n\n}", "function TrackByFunction() { }", "function TrackByFunction() { }", "function setScopeFunctions() {\n\t\t\tscope.updateLabel = function(index, value) {\n\t\t\t\tCubeService.updateMeta('labels', index, value, cubeId);\n\t\t\t};\n\t\t\n\t\t\t// true if items the same\n\t\t\tscope.show = function(type, otherType) {\n\t\t\t\treturn type != otherType;\n\t\t\t};\n\t\t\t\n\t\t\tscope.cubeSeeMore = cubeSeeMore;\n\t\t\t\n\t\t\tscope.cubeRemove = cubeRemove;\n\t\t}", "function setCodeExamples(){\n\n\t\n\n\tvar html=\"\";\n\t$('*[data-language]').each(function(){\n\t\tvar code=$(this).html();\n\t\tcode=code.replace(/</g,\"&lt;\");\n\t \tcode=code.replace(/>/g,\"&gt;\");\n\t \tcode=$.trim(code);\n\n\t \tif(code!==\"\"){\n\t\t \thtml+=\"<h3>\"+$(this).attr('data-language-label')+\"</h3>\";\n\t\t \thtml+='<pre class=\"'+$(this).attr('data-language')+' line-numbers\"><code class=\"'+$(this).attr('data-language')+' line-numbers\">'+code+'</code></pre>';\n\t\t}\n\t});\n\n $('#code_prisim').html(html);\n if(html==\"\"){\n $('#headPreview').hide();\n\t}\n\t\n\tsetTimeout(function(){\n\t\t$('.code-toolbar').attr('tabindex','0').addClass('prismButtonListenerAdded');\n\t\t$(document).on('click','.code-toolbar .toolbar-item a',function(){\n\t\t\t$(this).parents('.code-toolbar:first').focus();\n\t\t})\n\t\t$('.code-toolbar .toolbar-item a').attr('tabindex','0').attr(\"href\",\"javascript:void(0)\").attr('role','button');\n\t\t$('.code-toolbar').focusin(function(){\t\n\t\t\t$(this).find('.toolbar').css('opacity','1')\n\t\t})\n\t\t$('.code-toolbar').focusout(function(){\n\t\t\t$(this).find('.toolbar').removeAttr('style')\n\t\t})\n\t},200)\n\t\n\n}", "function TermsServices_elementsExtraJS() {\n // screen (TermsServices) extra code\n\n }", "function doOtherStuff() {}", "function InitValues_Framework_L0(){\n // You must make some text.\n \n}", "function InitValues_Framework_L0(){\n // You must make some text.\n \n}", "function init(){\n\t\tconsole.log('a');\n\t\tconsoleSomething('hello' + ' *1');\n\t\tconsole.log(returnSomething(27) + ' *2');\n\t\tconsole.log(returnObjectValue(myCloudObject.name));\n\t\t// Here we invoke a function from within a function\n\t\t// which needs to be above the return statement\n\t\tconsole.log(updateObject('age', 32) + ' *3');\n\t\tconsole.log('finished***')\n\t}", "function doStuff(){\n\n}", "function ExtraMethods() {}", "function main() {\n addImage();\n hideRules();\n}", "function setCodeDefault ()\n{\n\tcode =\"keyword.condition.statement\";\n//\tshowBaseCodeOn();\n}", "enterFuncdef(ctx) {\n\t}", "function add_event() {\n search_submit();\n //activeLoadMore();\n activeHistory();\n}", "make_code_item(code_expr, start_v) {\n this.code_item = code_expr\n this.code_item.prop_name_ser = \"cv\"\n this.code_item.override_create_elem = (line, show_v, change_func, prop_name)=>{ \n const ed = new Editor(line, show_v, change_func, {lang:\"glsl\", dlg_title:prop_name, dlg_rect_wrap:this.dlg_rect_wrap, with_popout:true});\n return ed\n }\n this.code_item.parse_opt = PARSE_CODE\n this.populate_code_ctx_menu(this.code_item.ctx_menu)\n // initial code string, done even if code is not selected since this is the only place we can do this initialization\n this.code_item.peval(\"return \" + start_v) \n this.do_set_eactives()\n\n this.code_line = null\n this.single_line = null // set in the subclass add_elems\n this.show_code_callback = null \n }", "function TELUGU_elementsExtraJS() {\n // screen (TELUGU) extra code\n }", "function settingFunc() {\n\n}", "function Cond() {\r\n}", "function exampleFunction1() {\n /* SOME CODE */\n }", "function BaixarOrdemTV_elementsExtraJS() {\n // screen (BaixarOrdemTV) extra code\n\n }", "function Carnivorus(){\n\n}", "function prepend() {\n \n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "custom(fn) {\r\n\t\treturn this.push('fn', [...arguments]);\r\n\t}", "function statement() {\n\n}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function myUpdateFunction(event) {\n Blockly.Python.addReservedWords(['code', 'headers']);\n workingCode = Blockly.Python.workspaceToCode(workspace);\n var code = document.createTextNode(workingCode);\n exportXML();\n // For iOS\n if (is_ios){\n webkit.messageHandlers.save_xml.postMessage({xml: xml_str});\n }\n // For Electron\n if (is_electron){\n ipcRenderer.send('save_xml',{xml: xml_str});\n }\n\n // For Web\n if (is_web){\n eventHandlers['save_xml']({xml: xml_str});\n }\n\n if (!python_editing){\n workingCode_cm = workingCode;\n loadBlockToCode();\n } \n}", "function redactInfo (obj) {\n \n}// CODE HERE", "function func(){\r\n\r\n}", "_reflow() {\n this._init();\n }", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function kp() {\n $log.debug(\"TODO\");\n }", "FunctionDeclaration() {\n pushContext();\n }", "function IntroducaoContra_elementsExtraJS() {\n // screen (IntroducaoContra) extra code\n\n }", "function main(){\n//CODE//\n}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function hello(){\n//Everything in here is a block\n}", "function reusableFunction() {\r\n console.log(\"Hi World\");\r\n}", "function updateFunction() {\n \tupdatePreview();\n \tupdateHTMLCode();\n }", "function useItem(){\n\t\n}", "function reusableFunction() {\r\n // alert('Hello Swati');\r\n console.log(\"Hello\")\r\n}", "function jessica() {\n $log.debug(\"TODO\");\n }", "function CustomSQLDo() {\n}", "async 'after sunbath' () {\n console.log( 'see? I appear here because of the first custom above' )\n }", "function Scan_elementsExtraJS() {\n // screen (Scan) extra code\n\n }" ]
[ "0.62623835", "0.6198179", "0.6105098", "0.6009181", "0.5894238", "0.588272", "0.5820974", "0.58202416", "0.580512", "0.58043975", "0.5785289", "0.572518", "0.5722489", "0.5722489", "0.5722489", "0.5717057", "0.5707794", "0.5676393", "0.5665082", "0.56603694", "0.56482315", "0.5647359", "0.5642205", "0.56414044", "0.56330544", "0.5632934", "0.5623187", "0.5619226", "0.5617914", "0.5610316", "0.5608041", "0.5580726", "0.55729437", "0.5568093", "0.5554301", "0.55527854", "0.55526507", "0.5551077", "0.5550017", "0.5539667", "0.55315244", "0.5525742", "0.5524153", "0.55125386", "0.5498838", "0.54937136", "0.5492506", "0.54906213", "0.5489898", "0.54824084", "0.54824084", "0.54760903", "0.5468633", "0.54677117", "0.5467253", "0.54592425", "0.54592425", "0.5456173", "0.54557997", "0.544299", "0.5427412", "0.5427376", "0.542558", "0.5421878", "0.54158676", "0.5409743", "0.54000133", "0.53900605", "0.53841144", "0.53836894", "0.53799665", "0.5370942", "0.53683007", "0.53683007", "0.5366541", "0.5366401", "0.5362169", "0.53552747", "0.5354413", "0.53542924", "0.535248", "0.53488946", "0.53488946", "0.53488946", "0.53488946", "0.5346285", "0.5341978", "0.53414637", "0.53400093", "0.53311735", "0.53311735", "0.53311735", "0.5328264", "0.5328221", "0.53250337", "0.53176016", "0.5314563", "0.5312782", "0.53094065", "0.53089315", "0.5307202" ]
0.0
-1
if the artist is more than 1 word, add '+' signs inbetween words
function getConcert() { for (var i = 3; i < command.length; i++) { if (i > 3 && i < command.length) { artist = artist + "+" + command[i]; } else { artist += command[i]; } } //if artist exists, run axios function to pull the artist and console log the info //if song does not exsist, console log a message that the artist doesn't exist if (artist !== '') { axios({ method: 'get', //Change API key below url: `https://rest.bandsintown.com/artists/${artist}/events?app_id=codingbootcamp`, responseType: 'json' }).then(function (response) { let showArr = response.data; for (let i = 0; i < showArr.length; i++) { let orgShowDate = showArr[i].datetime; let showDate = moment(orgShowDate).format('L'); console.log(` Lineup: ${showArr[i].lineup} Venue Name: ${showArr[i].venue.name} Venue Location: ${showArr[i].venue.city}, ${showArr[i].venue.country} Show Date: ${showDate} `); fs.appendFile('log.txt', ` Lineup: ${showArr[i].lineup} Venue Name: ${showArr[i].venue.name} Venue Location: ${showArr[i].venue.city}, ${showArr[i].venue.country} Show Date: ${showDate} `, (err) => { if (err) throw err; }); } }).catch(err => { console.log(err); }); } else { console.log("The artist name is not defined. Please try a different artist"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_to_words(words, triplet_words, scale_word) {\n return triplet_words ? triplet_words + ((scale_word && ' ' + scale_word) || '') + ' ' + words : words;\n }", "function combine(prev, word) {\n\n // Loop to find the append string\n // which can be broken into\n for (i = 0; i < prev.length - 1; i++) {\n prev[i] += \" \" + word;\n }\n\n return prev;\n}", "function addSpeaker(transcript){\n\n for(let speaker of speakers){\n if(transcript.includes(`c'est ${speaker} qui parle`))\n return ` ${speaker}`; \n}\n}", "function formatSearchTerm(term) {\n return term.split(\" \").join(\"+\");\n}", "function addToWords(words, tripletWords, scaleWord) {\n return tripletWords ?\n tripletWords + (scaleWord && ' ' + scaleWord || '') + ' ' + words :\n words;\n }", "function firstCarAdd(word, l) {\n    var newWord = \"\";\n    for (i = 0; i < l; i++) {\n        newWord += word[i];\n    } \n newWord += \"...\";\n    return newWord;\n}", "function addExcitement (theWordArray) {\n var stringPrint = ''\n var exclam = 1\n for (var i = 0; i < sentence.length; i = i + 1){\n stringPrint += sentence[i]\n if ((i + 1) % 3 === 0) {\n stringPrint += '!'.repeat(exclam);\n exclam++ \n }\n console.log(stringPrint);\n };\n}", "function addExcitement(theWordArray, puncutation) {\n // Each time the for loop executes, you're going to add one more word to this string\n let buildMeUp = \"\";\n\n for (let i = 0; i < theWordArray.length; i++) {\n if ([i] % 3 === 0 && [i] != 0) {\n buildMeUp += \" \" + theWordArray[i] + puncutation;\n } else {\n buildMeUp += \" \" + theWordArray[i];\n }\n // Print buildMeUp to the console\n console.log(buildMeUp);\n }\n}", "function addExcitement (theWordArray) {\n // Each time the for loop executes, you're going to add one more word to this string\n let buildMeUp = \"\"\n\n for (let i = 0; i < theWordArray.length; i++) {\n if ((i+1)%3===0) {\n buildMeUp += `${theWordArray[i]}!`\n } else {\n // Concatenate the new word onto buildMeUp\n buildMeUp += `${theWordArray[i] }` }\n console.log(buildMeUp)\n // Print buildMeUp to the console \n }\n}", "function updateText(addData) {\r\n var text = addData.toLowerCase().split(\" \");\r\n \r\n $('#conCat').text(stringText.join(' '));\r\n $('#stringsTotal').text(stringText.length);\r\n}", "function addS(word) {\n\treturn word + \"s\"\n}", "function addExcitement (theWordArray,character) {\n\n // Each time the for loop executes, you're going to add one more word to this string\n let buildMeUp = \"\"\n var counter = 1;\n for (let i = 0; i < theWordArray.length; i++) {\n // Concatenate the new word onto buildMeUp\n buildMeUp += theWordArray[i];\n \n if (i % 3 === 2){\n buildMeUp += character.repeat(counter) + ' ';\n counter += 1;\n }else{\n buildMeUp += \" \";\n }\n // Print buildMeUp to the console\n }\n console.log(buildMeUp);\n}", "function addS(word) {\n return word + 's';\n}", "function addTonemelodyString(line) {\n line.tonemelodyString = line\n .getWords()\n .map((word) => word.tone + word.melody)\n .join('')\n .replace(/ /g, '');\n return line;\n}", "function addExcitement (theWordArray) {\n\tvar bangPlace = 3\n\tvar output = \"\"; \n for (var i = 0; i < theWordArray.length; i++) {\n \tvar word = (x) => {return x + 1};\n \t(word(i) % bangPlace === 0) ? output += theWordArray[i] + \"!\".repeat(word(i)/bangPlace) + \" \" : output += theWordArray[i] + \" \"; \t\n \tconsole.log(output);\n } \n}", "function addExcitement (theWordArray, numberOfDelimiters, delimiter) {\n\n // Each time the for loop executes, you're going to add one more word to this string\n let buildMeUp = \"\"\n\n for (let i = 0; i < theWordArray.length; i++) {\n \n \n const delimiters = delimiter.repeat(numberOfDelimiters)\n\n if ((i + 1) % 3 === 0) {\n buildMeUp += `${theWordArray[i]}${delimiters} `\n } else {\n buildMeUp += `${theWordArray[i]} `\n }\n\n console.log(buildMeUp)\n }\n}", "function addToWordCount(string) {\r\n // Split words, names, or terms in titles\r\n var words = string.toLowerCase().replace(/[^\\w#$\\'\\’\\-]+/g,'.').split('.');\r\n g_words = g_words.concat(words);\r\n}", "function duplicateEncode(word){\n let string = \"\";\n let lower = word.toLowerCase();\n for (let i=0; i<lower.length; i++) {\n if ( lower.indexOf(lower[i]) == lower.lastIndexOf(lower[i]) ) {\n string += \"(\";\n } else {\n string += \")\"\n }\n }\n return string\n}", "function addArticle(word) {\n\tvar wordStr = word;\n\tvar a = \"a \";\n\tvar an = \"an \";\n\tfunction findNextWord(){\n\t\tif(wordStr[0] == \"a\"){\n\t\t\treturn an+wordStr;\n\t\t} else {\n\t\t\treturn a+wordStr;\n\t\t}\n\t}\nreturn findNextWord;\n}", "function toAsterisk(word){\n return Array(word.length+1).join(\"*\");\n}", "function encodeWordPlus(string) {\n string = string.toLowerCase().split('');\n var i;\n for (var i = 7; i < string.length; i += 7) {\n string.splice(i, 0, Math.floor((Math.random() * 1000) + 0));\n }\n var result = string.join('');\n return result;\n\n}", "function duplicateEncode(word){\n var result = '';\n for(var i in word){ isUnique(word[i].toLowerCase(),word.toLowerCase()) ? result +=')' : result += '('; }\n return result;\n}", "function duplicateEncode(word){\n var newArra = [];\n var wordArr = word.toLowerCase().split(\"\");\n var x;\n for (var i = 0; i < wordArr.length; i++) {\n x = searchElement(wordArr, wordArr[i])\n if(x.length > 1){\n newArra.push(')');\n }\n else {\n newArra.push('(');\n }\n }\n return newArra.join(\"\");\n}", "function add(){\n chickens = ''\n for(i = 0; i < 2; i++){\n chickens += 'chicken ';\n }\n return chickens.trim();\n}", "function formatWords(words){\n if (words === null) return '';\n let arr = words.filter((word) => { return word.length > 1 });\n \n if (arr.length === 1) return arr[0];\n \n return arr.reduce((acc, curr) => {\n if (arr.indexOf(curr) === arr.length - 1) {\n acc += 'and ' + curr;\n } else if (arr.indexOf(curr) === arr.length - 2) {\n acc += curr + ' ';\n } else {\n acc += curr + ', ';\n }\n return acc;\n }, \"\");\n}", "function addS(word) {\n\n}", "function madLib(wordToAdd){\n // This <word> is the coolest thing ever\n var thisString = \"This \";\n var coolestString = \" is the coolest thing ever\";\n // concat'd in the middle of my two vars with word to add\n var outputString = thisString + wordToAdd + coolestString;\n // Output the sentence\n return outputString;\n}", "function gordon(a){\n return a.split(\" \").map(function(word) {\n return word.toUpperCase().replace(/A/g, \"@\").replace(/E|I|U|O/g, \"*\") + \"!!!!\"\n }).join(\" \")\n}", "function additionalTags(tags = '', tags2 = '', artistName = '', artistName2 = ''){\n // get the youtubeDescription field\n var tagField = document.getElementById(\"tags\");\n var tagField2 = document.getElementById(\"tags2\");\n\n var checkBox = document.getElementById(\"myCheck\");\n if (checkBox.checked == true){\n tags += `\n ${artistName} type beat with hook free,\n ${artistName} type beat 2021 with hook,\n ${artistName} type beat 2021 with hook free,\n ${artistName} type beat 2020 with hook,\n ${artistName} type beat 2020 with hook free,\n ${artistName} type beat 2019 with hook,\n ${artistName} type beat 2019 with hook free,\n ${artistName} type instrumental,\n ${artistName} type instrumental free,\n ${artistName} type instrumental with hook,\n ${artistName} type instrumental with hook free,\n ${artistName} type instrumental free for profit,\n ${artistName} type instrumental 2021,\n ${artistName} type instrumental 2021 with hook,\n ${artistName} type instrumental 2021 with hook free,\n ${artistName} type instrumental 2020,\n ${artistName} type instrumental 2020 with hook,\n ${artistName} type instrumental 2020 with hook free,\n ${artistName} type instrumental 2019,\n ${artistName} type instrumental 2019 with hook,\n ${artistName} type instrumental 2019 with hook free,\n `\n // add EXTRA tags to the existing tags 2\n tags2 += `\n ${artistName2} type beat with hook free,\n ${artistName2} type beat 2021 with hook,\n ${artistName2} type beat 2021 with hook free,\n ${artistName2} type beat 2020 with hook,\n ${artistName2} type beat 2020 with hook free,\n ${artistName2} type beat 2019 with hook,\n ${artistName2} type beat 2019 with hook free,\n ${artistName2} type instrumental,\n ${artistName2} type instrumental free,\n ${artistName2} type instrumental with hook,\n ${artistName2} type instrumental with hook free,\n ${artistName2} type instrumental free for profit,\n ${artistName2} type instrumental 2021,\n ${artistName2} type instrumental 2021 with hook,\n ${artistName2} type instrumental 2021 with hook free,\n ${artistName2} type instrumental 2020,\n ${artistName2} type instrumental 2020 with hook,\n ${artistName2} type instrumental 2020 with hook free,\n ${artistName2} type instrumental 2019,\n ${artistName2} type instrumental 2019 with hook,\n ${artistName2} type instrumental 2019 with hook free,\n free beat, type beat, airavata, airavata type beat, free, airavata music\n `\n var description = `${tags}${tags2}`\n var descriptionNode = document.createTextNode(description);\n tagField2.appendChild(descriptionNode)\n }\n // var additionalTagNode1 = document.createTextNode(tags);\n // var additionalTagNode2 = document.createTextNode(tags2);\n // tagField += additionalTagNode1;\n // tagField2 += additionalTagNode2;\n // var description = \"[Insert Title]\\n 🛒 Purchase Beat (Instant Delivery): [BEATSTARS LINK]\\n🌐 Social Media: @addyhebou, @saintstephmusic\\n📩 Email: [email protected]\\n\\n[QUIRKY MESSAGE]\\n\\nThank you for listening to my music - let me know what you think below and I'll get back to you! You're the best - subscribe to get more airavata !!\\n\\nUSAGE RIGHTS FOR FREE USE\\n\\n* You can use this beat for non-commercial and/or promotional use if you wish\\n* You must credit the producer as shown in the title of this video\\n* (Prod. by airavata) if you choose to use this beat for non-commercial and/or promotional use\\n\\n____________________________\\n\\nWhat's okay for promotional use? I'm glad you asked, buddy.\\n\\n✅ Soundcloud (no ads enabled)\\n✅ YouTube (no ads enabled)\\n\\nWhat's NOT okay for promotional use? Once again, I'm glad you asked.\\n\\n🚫 Uploading to streaming service (Apple Music, Spotify, DistroKid, etc.) is NOT permitted\\n🚫 No paid performances\\n\\nIf you were to purchase this beat untagged for lease or exclusive license, please HIT ME UP. Contact me at my info listed above.\\n\\n______________\\nOtherwise, let's get this bread\\n\\n\\n\\n\\n=======\\n$\";\n ;\n\n\n}", "function additionalTags(tags = '', tags2 = '', artistName = '', artistName2 = ''){\n // get the youtubeDescription field\n var tagField = document.getElementById(\"tags\");\n var tagField2 = document.getElementById(\"tags2\");\n\n var checkBox = document.getElementById(\"myCheck\");\n if (checkBox.checked == true){\n tags += `\n ${artistName} type beat with hook free,\n ${artistName} type beat 2021 with hook,\n ${artistName} type beat 2021 with hook free,\n ${artistName} type beat 2020 with hook,\n ${artistName} type beat 2020 with hook free,\n ${artistName} type beat 2019 with hook,\n ${artistName} type beat 2019 with hook free,\n ${artistName} type instrumental,\n ${artistName} type instrumental free,\n ${artistName} type instrumental with hook,\n ${artistName} type instrumental with hook free,\n ${artistName} type instrumental free for profit,\n ${artistName} type instrumental 2021,\n ${artistName} type instrumental 2021 with hook,\n ${artistName} type instrumental 2021 with hook free,\n ${artistName} type instrumental 2020,\n ${artistName} type instrumental 2020 with hook,\n ${artistName} type instrumental 2020 with hook free,\n ${artistName} type instrumental 2019,\n ${artistName} type instrumental 2019 with hook,\n ${artistName} type instrumental 2019 with hook free,\n `\n // add EXTRA tags to the existing tags 2\n tags2 += `\n ${artistName2} type beat with hook free,\n ${artistName2} type beat 2021 with hook,\n ${artistName2} type beat 2021 with hook free,\n ${artistName2} type beat 2020 with hook,\n ${artistName2} type beat 2020 with hook free,\n ${artistName2} type beat 2019 with hook,\n ${artistName2} type beat 2019 with hook free,\n ${artistName2} type instrumental,\n ${artistName2} type instrumental free,\n ${artistName2} type instrumental with hook,\n ${artistName2} type instrumental with hook free,\n ${artistName2} type instrumental free for profit,\n ${artistName2} type instrumental 2021,\n ${artistName2} type instrumental 2021 with hook,\n ${artistName2} type instrumental 2021 with hook free,\n ${artistName2} type instrumental 2020,\n ${artistName2} type instrumental 2020 with hook,\n ${artistName2} type instrumental 2020 with hook free,\n ${artistName2} type instrumental 2019,\n ${artistName2} type instrumental 2019 with hook,\n ${artistName2} type instrumental 2019 with hook free,\n free beat, type beat, saint steph, saint steph type beat, free, saint steph music\n `\n var description = `${tags}${tags2}`\n var descriptionNode = document.createTextNode(description);\n tagField2.appendChild(descriptionNode)\n }\n // var additionalTagNode1 = document.createTextNode(tags);\n // var additionalTagNode2 = document.createTextNode(tags2);\n // tagField += additionalTagNode1;\n // tagField2 += additionalTagNode2;\n // var description = \"[Insert Title]\\n 🛒 Purchase Beat (Instant Delivery): [BEATSTARS LINK]\\n🌐 Social Media: @addyhebou, @saintstephmusic\\n📩 Email: [email protected]\\n\\n[QUIRKY MESSAGE]\\n\\nThank you for listening to my music - let me know what you think below and I'll get back to you! You're the best - subscribe to get more Saint Steph !!\\n\\nUSAGE RIGHTS FOR FREE USE\\n\\n* You can use this beat for non-commercial and/or promotional use if you wish\\n* You must credit the producer as shown in the title of this video\\n* (Prod. by Saint Steph) if you choose to use this beat for non-commercial and/or promotional use\\n\\n____________________________\\n\\nWhat's okay for promotional use? I'm glad you asked, buddy.\\n\\n✅ Soundcloud (no ads enabled)\\n✅ YouTube (no ads enabled)\\n\\nWhat's NOT okay for promotional use? Once again, I'm glad you asked.\\n\\n🚫 Uploading to streaming service (Apple Music, Spotify, DistroKid, etc.) is NOT permitted\\n🚫 No paid performances\\n\\nIf you were to purchase this beat untagged for lease or exclusive license, please HIT ME UP. Contact me at my info listed above.\\n\\n______________\\nOtherwise, let's get this bread\\n\\n\\n\\n\\n=======\\n$\";\n ;\n\n\n}", "function additionalTags(tags = '', tags2 = '', artistName = '', artistName2 = ''){\n // get the youtubeDescription field\n var tagField = document.getElementById(\"tags\");\n var tagField2 = document.getElementById(\"tags2\");\n\n var checkBox = document.getElementById(\"myCheck\");\n if (checkBox.checked == true){\n tags += `\n ${artistName} type beat with hook free,\n ${artistName} type beat 2021 with hook,\n ${artistName} type beat 2021 with hook free,\n ${artistName} type beat 2020 with hook,\n ${artistName} type beat 2020 with hook free,\n ${artistName} type beat 2019 with hook,\n ${artistName} type beat 2019 with hook free,\n ${artistName} type instrumental,\n ${artistName} type instrumental free,\n ${artistName} type instrumental with hook,\n ${artistName} type instrumental with hook free,\n ${artistName} type instrumental free for profit,\n ${artistName} type instrumental 2021,\n ${artistName} type instrumental 2021 with hook,\n ${artistName} type instrumental 2021 with hook free,\n ${artistName} type instrumental 2020,\n ${artistName} type instrumental 2020 with hook,\n ${artistName} type instrumental 2020 with hook free,\n ${artistName} type instrumental 2019,\n ${artistName} type instrumental 2019 with hook,\n ${artistName} type instrumental 2019 with hook free,\n `\n // add EXTRA tags to the existing tags 2\n tags2 += `\n ${artistName2} type beat with hook free,\n ${artistName2} type beat 2021 with hook,\n ${artistName2} type beat 2021 with hook free,\n ${artistName2} type beat 2020 with hook,\n ${artistName2} type beat 2020 with hook free,\n ${artistName2} type beat 2019 with hook,\n ${artistName2} type beat 2019 with hook free,\n ${artistName2} type instrumental,\n ${artistName2} type instrumental free,\n ${artistName2} type instrumental with hook,\n ${artistName2} type instrumental with hook free,\n ${artistName2} type instrumental free for profit,\n ${artistName2} type instrumental 2021,\n ${artistName2} type instrumental 2021 with hook,\n ${artistName2} type instrumental 2021 with hook free,\n ${artistName2} type instrumental 2020,\n ${artistName2} type instrumental 2020 with hook,\n ${artistName2} type instrumental 2020 with hook free,\n ${artistName2} type instrumental 2019,\n ${artistName2} type instrumental 2019 with hook,\n ${artistName2} type instrumental 2019 with hook free,\n free beat, type beat, saint steph, saint steph type beat, free, saint steph music\n `\n var description = `${tags}${tags2}`\n var descriptionNode = document.createTextNode(description);\n tagField2.appendChild(descriptionNode)\n }\n // var additionalTagNode1 = document.createTextNode(tags);\n // var additionalTagNode2 = document.createTextNode(tags2);\n // tagField += additionalTagNode1;\n // tagField2 += additionalTagNode2;\n // var description = \"[Insert Title]\\n 🛒 Purchase Beat (Instant Delivery): [BEATSTARS LINK]\\n🌐 Social Media: @addyhebou, @saintstephmusic\\n📩 Email: [email protected]\\n\\n[QUIRKY MESSAGE]\\n\\nThank you for listening to my music - let me know what you think below and I'll get back to you! You're the best - subscribe to get more Saint Steph !!\\n\\nUSAGE RIGHTS FOR FREE USE\\n\\n* You can use this beat for non-commercial and/or promotional use if you wish\\n* You must credit the producer as shown in the title of this video\\n* (Prod. by Saint Steph) if you choose to use this beat for non-commercial and/or promotional use\\n\\n____________________________\\n\\nWhat's okay for promotional use? I'm glad you asked, buddy.\\n\\n✅ Soundcloud (no ads enabled)\\n✅ YouTube (no ads enabled)\\n\\nWhat's NOT okay for promotional use? Once again, I'm glad you asked.\\n\\n🚫 Uploading to streaming service (Apple Music, Spotify, DistroKid, etc.) is NOT permitted\\n🚫 No paid performances\\n\\nIf you were to purchase this beat untagged for lease or exclusive license, please HIT ME UP. Contact me at my info listed above.\\n\\n______________\\nOtherwise, let's get this bread\\n\\n\\n\\n\\n=======\\n$\";\n ;\n\n\n}", "function additionalTags(tags = '', tags2 = '', artistName = '', artistName2 = ''){\n // get the youtubeDescription field\n var tagField = document.getElementById(\"tags\");\n var tagField2 = document.getElementById(\"tags2\");\n\n var checkBox = document.getElementById(\"myCheck\");\n if (checkBox.checked == true){\n tags += `\n ${artistName} type beat with hook free,\n ${artistName} type beat 2021 with hook,\n ${artistName} type beat 2021 with hook free,\n ${artistName} type beat 2020 with hook,\n ${artistName} type beat 2020 with hook free,\n ${artistName} type beat 2019 with hook,\n ${artistName} type beat 2019 with hook free,\n ${artistName} type instrumental,\n ${artistName} type instrumental free,\n ${artistName} type instrumental with hook,\n ${artistName} type instrumental with hook free,\n ${artistName} type instrumental free for profit,\n ${artistName} type instrumental 2021,\n ${artistName} type instrumental 2021 with hook,\n ${artistName} type instrumental 2021 with hook free,\n ${artistName} type instrumental 2020,\n ${artistName} type instrumental 2020 with hook,\n ${artistName} type instrumental 2020 with hook free,\n ${artistName} type instrumental 2019,\n ${artistName} type instrumental 2019 with hook,\n ${artistName} type instrumental 2019 with hook free,\n `\n // add EXTRA tags to the existing tags 2\n tags2 += `\n ${artistName2} type beat with hook free,\n ${artistName2} type beat 2021 with hook,\n ${artistName2} type beat 2021 with hook free,\n ${artistName2} type beat 2020 with hook,\n ${artistName2} type beat 2020 with hook free,\n ${artistName2} type beat 2019 with hook,\n ${artistName2} type beat 2019 with hook free,\n ${artistName2} type instrumental,\n ${artistName2} type instrumental free,\n ${artistName2} type instrumental with hook,\n ${artistName2} type instrumental with hook free,\n ${artistName2} type instrumental free for profit,\n ${artistName2} type instrumental 2021,\n ${artistName2} type instrumental 2021 with hook,\n ${artistName2} type instrumental 2021 with hook free,\n ${artistName2} type instrumental 2020,\n ${artistName2} type instrumental 2020 with hook,\n ${artistName2} type instrumental 2020 with hook free,\n ${artistName2} type instrumental 2019,\n ${artistName2} type instrumental 2019 with hook,\n ${artistName2} type instrumental 2019 with hook free,\n free beat, type beat, saint steph, saint steph type beat, free, saint steph music\n `\n var description = `${tags}${tags2}`\n var descriptionNode = document.createTextNode(description);\n tagField2.appendChild(descriptionNode)\n }\n // var additionalTagNode1 = document.createTextNode(tags);\n // var additionalTagNode2 = document.createTextNode(tags2);\n // tagField += additionalTagNode1;\n // tagField2 += additionalTagNode2;\n // var description = \"[Insert Title]\\n 🛒 Purchase Beat (Instant Delivery): [BEATSTARS LINK]\\n🌐 Social Media: @addyhebou, @saintstephmusic\\n📩 Email: [email protected]\\n\\n[QUIRKY MESSAGE]\\n\\nThank you for listening to my music - let me know what you think below and I'll get back to you! You're the best - subscribe to get more Saint Steph !!\\n\\nUSAGE RIGHTS FOR FREE USE\\n\\n* You can use this beat for non-commercial and/or promotional use if you wish\\n* You must credit the producer as shown in the title of this video\\n* (Prod. by Saint Steph) if you choose to use this beat for non-commercial and/or promotional use\\n\\n____________________________\\n\\nWhat's okay for promotional use? I'm glad you asked, buddy.\\n\\n✅ Soundcloud (no ads enabled)\\n✅ YouTube (no ads enabled)\\n\\nWhat's NOT okay for promotional use? Once again, I'm glad you asked.\\n\\n🚫 Uploading to streaming service (Apple Music, Spotify, DistroKid, etc.) is NOT permitted\\n🚫 No paid performances\\n\\nIf you were to purchase this beat untagged for lease or exclusive license, please HIT ME UP. Contact me at my info listed above.\\n\\n______________\\nOtherwise, let's get this bread\\n\\n\\n\\n\\n=======\\n$\";\n ;\n\n\n}", "function pluralize()\r\n{\r\n var quantity = Number(document.project4.num1.value);\r\n var noun = document.project4.word1.value;\r\n\r\n if (noun == 'mouse') {\r\n if (quantity > 1) {\r\n return quantity + \" mice \";\r\n }\r\n else {\r\n return quantity + \"mouse\";\r\n }\r\n }\r\n else if (noun == 'deer')\r\n {\r\n return quantity + \"deer\";\r\n }\r\n else if (noun == 'cactus')\r\n {\r\n if (quantity > 1)\r\n return quantity + \"cacti\"\r\n }\r\n\r\n if (quantity > 1)\r\n {\r\n //tacK on an 's' tot the noun aka CONCATENATE\r\n return quantity + \" \" + noun + \"s\";\r\n }\r\n else\r\n {\r\n return quantity + \" \" + noun;\r\n }\r\n}", "function addArticle (string) {\n let vowels = ['a', 'e', 'i', 'o', 'u']\n let article = ''\n if (vowels.includes(string.charAt(0))) {\n article = 'an '\n } else {\n article = 'a '\n }\n return article + ' ' + string\n}", "function duplicateEncode(word){\n let w = word.toLowerCase();\n let wordObj = count(w);\n let letters = w.split('');\n return letters.reduce((a, c) => { return wordObj[c] > 1 ? a += ')' : a += '('; }, '');\n}", "function pigIt(str){\n let wordArr = str.split(' ')\n wordArr.forEach((word,i)=>{\n if(!\".?!\".includes(word)){\n wordArr[i] = word.slice(1) + word[0] + 'ay'\n }\n })\n return wordArr.join(' ')\n }", "function combineWords(word1, word2) {\n return (word1 + \" \" + word2);\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}", "function combineTwoConsecutive (post, i, word_1, word_2) {\n\t\tif (post[i] === word_1 && post[i+1].includes(word_2)) {\n\t\t\tpost[i] += \" \" + post[i+1];\n\t\t\tpost.splice(i+1, 1); // remove following index\n\t\t}\n\t\treturn post;\n\t}", "function formatWords(words){\n if(!words || words.join('') == ''){\n return \"\";\n };\n \n let newWords = words.filter(x => x != '');\n let last = newWords.splice(newWords.length - 1, 1)[0];\n \n if(newWords.length == 0){\n return last;\n };\n \n if(newWords.length == 1){\n return newWords[0] + ' and ' + last;\n };\n \n return newWords.join(', ') + ' and ' + last;\n}", "function toonify(accent, sentence){\n if (accent == 'daffy') {\n var newstr = sentence.replace(/s/g, 'th');\nconsole.log(newstr);\n}\nelse if (accent == 'elmer') {\n var newstr = sentence.replace(/r/g, 'w');\nconsole.log(newstr);\n}}", "addWords(words) {}", "function concatenation(reWord,addingWord){\n var reWord2 = reWord+addingWord\n return reWord2;\n}", "function addWord() {\n if (currentWordLen > 0) {\n const word = str\n .slice(currentStartIdx, currentStartIdx + currentWordLen)\n .toLowerCase();\n currentWordLen = 0;\n if (counts[word] === undefined) {\n counts[word] = 1;\n } else {\n counts[word] += 1;\n }\n }\n }", "function censorWord(word){\n var text = document.getElementById(\"message\");\n\n var newWord = \"\";\n for (var i = 0; i < word.length; i++){\n newWord += \"*\";\n }\n\n //var res = text.value.replace(word, newWord);\n\n var res = text.value.substring(0, index - word.length) + newWord + \" \";\n\n\n text.value = res;\n}", "function addExcitement (dogs, cats, fish) {\n\n // Each time the for loop executes, you're going to add one more word to this string\n let buildMeUp = \"\"\n\n for (let i = 0; i < dogs.length; i++) {\n if ((i + 1) % 3 === 0) { \n buildMeUp += ` ${dogs[i]}${cats.repeat(fish)}`;\n console.log(buildMeUp);\n }\n else {\n buildMeUp += ` ${dogs[i]}`;\n console.log(buildMeUp);\n }\n\n}}", "function changeToPigLatin(text) {\n\n var wordArray = text.split(\" \");\n var newtext = \"\";\n\n wordArray.forEach(element => {\n\n if (element[0] === 'a' || element[0] === 'e' || element[0] === 'i' || element[0] === 'u' || element[0] === 'o') {\n console.log(newtext.concat(element.slice(1, 6) + element[0] + \"way\"));\n }\n else if (getCount(element) === 1) {\n console.log(newtext.concat(element.slice(1, 7) + element[0] + \"ay\"));\n }\n else if (getCount(element) === 2) {\n console.log(newtext.concat(element.slice(2, 8) + element[0] + element[1] + \"ay\"));\n }\n\n });\n\n return text;\n}", "function cleanup_discogs_artist_credit(obj) {\n // Fix some odd Discogs release (e.g. http://api.discogs.com/releases/1566223) that have a ',' join phrase after the last artist\n // Discogs set a join phrase even there's only one artist or when extraartists is set (ie. remix)\n var last = obj.artist_credit.length-1;\n if (last == 0 || obj.artist_credit[last].joinphrase == \", \") {\n obj.artist_credit[last].joinphrase = \"\";\n }\n}", "function qwerty_addSpaceText() {\n\tqwerty_appendText(\" \");\n}", "function pigIt(str){\n return str.replace(/(\\w)(\\w*)(\\s|$)/g, \"\\$2\\$1ay\\$3\")\n }", "function qwerty_addSpaceText() {\r\n\tqwerty_appendText(\" \");\r\n}", "function qwerty_addSpaceText() {\r\n\tqwerty_appendText(\" \");\r\n}", "function qwerty_addSpaceText() {\r\n\tqwerty_appendText(\" \");\r\n}", "function buildSentence( category, phrase ) {\n if (category.length > 0) {\n sentence += phrase;\n if (category.length == 1) {\n sentence += category[0] + \". \";\n } else if (category.length == 2) {\n sentence += category[0] + \" & \" + category[1] + \". \";\n } else {\n for (var i = 0; i < category.length; i++) {\n if (i < category.length - 1) {\n sentence += category[i] + \", \";\n } else {\n sentence += \" and \" + category[i] + \". \";\n }\n }\n }\n } \n }", "function duplicateEncode(word){\n var encodedString = \"\";\n word = word.toLowerCase();\n var dict = [];\n for (var i = 0; i < word.length; i++){\n dict.push({key:word[i], value:0});\n for (var j = 0; j < word.length; j++){\n if (word[i] == word[j]){\n dict[i].value++;\n }\n \n }\n }\n for (var k = 0; k < dict.length; k++){\n if (dict[k].value > 1){\n encodedString += \")\";\n }\n else {\n encodedString += \"(\";\n }\n }\n return encodedString;\n}", "print(){\r\n var y =\"\";\r\n for (x of this.words) {\r\n if(x == \",\"){\r\n x = \"\";\r\n }\r\n else{\r\n y += \"$\" + x;\r\n }\r\n }\r\n \r\n y = y + \"$\";\r\n console.log(y);\r\n }", "function addChar(char) {\n for (var index = 0; index < chosenWord.length; index++) {\n if (chosenWord[index] === char) {\n blankWord = (blankWord.replaceAt(index, char));\n SpaceInWord();\n console.log(spacedWord);\n countUp++;\n $(\"#theWord\").text(spacedWord);\n //document.getElementById(\"animeImage\").src = \"\";\n }\n }\n }", "function pigIt(str){\n return str.replace(/(\\w)(\\w*)(\\s|$)/g, \"\\$2\\$1ay\\$3\")\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}", "function addPhraseToDisplay(arr) {\n for (i = 0; i < arr.length; i += 1) {\n var li = document.createElement('li');\n li.appendChild(document.createTextNode(arr[i]));\n ul.appendChild(li);\n if (li.textContent != \" \") {\n li.className = 'letter';\n } else {\n li.className = 'space';\n }\n }\n}", "function format(track) {\r\n\t\t\t\tvar pattern = /^(a|an|the)\\b\\s*/;\r\n\t\t\t\tvar values = order.slice(0);\r\n\r\n\t\t\t\tfor (var i = 0; i < values.length; i++)\r\n\t\t\t\t\tvalues[i] = track[values[i]].toLowerCase().replace(pattern, \"\");\r\n\t\t\t\treturn values.join(\"|\");\r\n\t\t\t}", "function duplicateEncode(word){\n // ...\n var letters = word.toLowerCase().split('');\n return letters.map(function(c, i) {\n return letters.some(function(x, j) {\n return x === c && i !== j\n }) ? ')' : '(' ;\n }).join('');\n}", "function madLibs(str, array) {\n var finalSentence = '';\n //segments [ 'Marching is fun: ', ', ', ', ', ', ', '!' ]\n var segments = str.split('*');\n var nextWordIdx = 0;\n\n for (var i = 0; i < segments.length - 1; i++) {\n //adds element then word at array and then add them to the finalString\n var segment = segments[i];\n segment += array[nextWordIdx];\n finalSentence += segment;\n // increase the counter \n nextWordIdx = nextWordIdx + 1 < array.length ? nextWordIdx + 1 : 0;\n }\n\n finalSentence += segments[segments.length - 1];\n \n return finalSentence;\n }", "function sanitizeArtistOrTitle(value) {\n var regexp = /(ft\\..*$|\\(.*$|\\[.*$|feat\\..*$)/\n return value.replace(regexp, '');\n}", "function addSpaces(randomWord) {\n for (var i = 0; i < randomWord.length; i++) {\n if (randomWord[i] != \" \") {\n $(\"<span class='letters'>\").text(\"_ \").appendTo(\"#chalk\");\n } else {\n $(\"<span class='letters'>\").html('&nbsp&nbsp&nbsp;').appendTo(\"#chalk\");\n winCounter++;\n }\n }\n}", "function improvedCombine(word1, word2, glue){\n console.log(word1 + word2 + word3)\n }", "function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {\n // Your code below this line\n var result = \"\";\n result+= \"My \"+myAdjective+\" \"+myNoun+\" \"+myVerb+\" away \"+myAdverb+\".\";\n // Your code above this line\n return result;\n}", "function wordsComplex() {\n\n}", "noun( num, singular, plutal, append ) {\n append = String( append || '' );\n return String( num +' '+ ( parseFloat( num ) === 1 ? singular : plutal ) +' '+ append ).trim();\n }", "function add(char, str) {\n return str.split(' ').join(char)\n }", "function duplicateEncode(word) {\n const wordLowerCased = word.toLowerCase();\n let res = '';\n for (const letter of wordLowerCased) {\n if (wordLowerCased.indexOf(letter) === wordLowerCased.lastIndexOf(letter)) {\n res += '(';\n } else {\n res += ')';\n }\n }\n return res;\n}", "function pigIt(str){\n let newArr = [];\n let arr = str.split(\" \");\n for (let i=0; i<arr.length; i++) {\n if (arr[i]!='?' && arr[i]!='!') {\n let word = arr[i];\n let letter = word.charAt(0);\n let newWord = word.slice(1) + letter + \"ay\";\n newArr.push(newWord);\n } else {\n newArr.push(arr[i]);\n }\n }\n return newArr.join(\" \");\n}", "function addPhraseToDisplay(arr) {\n for (let i = 0; i < arr.length; i += 1) {\n let li = document.createElement('li');\n li.textContent = arr[i];\n if (li.textContent != \" \") {\n li.className = 'letter';\n } else {\n li.className = 'space';\n }\n ul.appendChild(li);\n }\n}", "function printLatinWord(word){\r\n\t// combine the word without its first letter, then the first letter, then 'ay'.\r\n\treturn word.slice(1) + word.slice(0, 1) + \"ay \";\r\n}", "addPhraseToDisplay() {\n let thisPhrase = this.phrase.split('');\n let thisUl = $('#phrase ul');\n for (var i = 0; i < thisPhrase.length; i++) {\n if (thisPhrase[i] === ' ') {\n thisUl.append('<li class = \"hide space\"> </li>');\n } else {\n thisUl.append(`<li class = \"hide letter ${thisPhrase[i]}\">${thisPhrase[i]}</li>`);\n }\n }\n }", "function pigIt(str){\n\treturn str.split('').map(el=> el.slice(1)+el.slice(0,1)+'ay').join('');\n\t//return str.split(' ').map(el=>el.substr(1) + el.charAt(0) + 'ay').join(' ');\n}", "function addPhraseToDisplay(arr) {\n let letters = \"\";\n\n for (var i = 0; i < arr.length; i += 1 ) {\n if (arr[i] !== \" \") {\n letters += '<li class=\"letter\">' + arr[i] + '</li>';\n } else {\n letters += '<li class=\"space\">' + arr[i] + '</li>';\n }\n }\n phraseUl.innerHTML = letters;\n}", "function insertGlossaryItems (obj) {\r\n var nums = \"012346789\";\r\n for (var i=0; i<obj.length; i++) {\r\n var c = obj[i].Term.substr(0,1);\r\n $(\"#glossary_\" + c).append (\"<p><b>\" + obj[i].Term + \"</b>: \" + obj[i].Definition + \"</p>\");\r\n }\r\n}", "function buildSentence(movie){ //for input of \"movie\", needs to do following:\n var result = \"You have \";\n if(movie.hasWatched){\n result += \"watched \";\n } else {\n result += \"not seen \";\n }\n result += \"\\\"\" + movie.title + \"\\\" - \";\n result += movie.rating + \" stars\";\n return result; //different from the console.log above\n //return will be made each time function is called (number of items in array)\n}", "function displayWord(myword, desc){\r\n let display = \"\";\r\n for(let i = 0; i < myword.length; i++){\r\n if(i != myword.length - 1){\r\n display += myword.charAt(i) + \" \";\r\n } else {\r\n display += myword.charAt(i);\r\n }\r\n }\r\n document.getElementById(\"display\").innerHTML = display;\r\n document.getElementById(\"desc\").innerHTML = desc;\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 fancifyNoun(noun) {\n\treturn noun.split(' ').map((token, index, tokens) => {\n\t\tconst isLastToken = index === tokens.length - 1;\n\t\tif (token.toUpperCase() === 'OF' || token.toUpperCase() === 'AND') {\n\t\t\treturn [<span key=\"heuoatohuheo\" className=\"sm-caps\">{token}</span>, !isLastToken ? ' ' : ''];\n\t\t}\n\n\t\treturn token + (!isLastToken ? ' ' : '');\n\t});\n}", "function addPhraseToDisplay(arr) {\n for (let i = 0; i < arr.length; i++) {\n const li = document.createElement('li');\n li.textContent = arr[i];\n ul.appendChild(li);\n if (arr[i] !== ' ') {\n li.className = 'letter';\n } else {\n li.className = 'space';\n }\n }\n}", "function addToTicker(word, propagate, appendString, prependDelimiter) {\n propagate = typeof propagate !== 'undefined' ? propagate : true;\n appendString = typeof appendString !== 'undefined' ? appendString : true;\n prependDelimiter = typeof prependDelimiter !== 'undefined' ? prependDelimiter : true;\n wordTicker.addWord(word, propagate, appendString, prependDelimiter);\n}", "function s(text, words) {\n\n let copy = text;\n for( let word of words) {\n let length = word.length;\n\n for (let i = 0; i < copy.length; i++) {\n\n let piece = text.substr(i, length);\n\n if (word === piece)\n text = text.replace(piece, '-'.repeat(length));\n\n }\n }\n\n console.log(text);\n}", "function censor(text, word) {\n let arr = text.split(\" \");\n // console.log(arr); <-- logs out the split elements of the text [\"this\", \"is\", \"an\", \"algorithm\"]\n for (let i = 0; i < arr.length; i++) {\n if (word == arr[i]) {\n // console.log(arr[i]); <-- logs out the word if it exists in the elements of the array (\"algorithm\")\n let asterisks = Array(arr[i].length + 1).join(\"*\");\n // console.log(asterisks); <-- a new variable that makes asterisks for the length of the word (*********)\n let index = arr.indexOf(arr[i]);\n // console.log(index); <-- log out the index of the array where the word exists (3)\n if (index !== -1) {\n arr[index] = asterisks; //<-- replace the index of the array where the word exists with the asterisk version\n }\n console.log(arr.join(\" \")); //<-- pull the elements out of the array (now with the asterisks)\n }\n }\n}", "function addSpace(contactDetails, str){\r\n if(contactDetails.text()!=\"\") {\r\n return \" \"+str;\r\n }\r\n}", "function madLib(word1, word2, word3, word4){\n return 'The ' + word1 + word2 + word3 + word4 + \"!\";\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 addPhraseToDisplay(arr) {\n for (let i = 0; i < arr.length; i++) {\n const listItem = document.createElement('LI');\n listItem.textContent = arr[i];\n if (arr[i] != \" \") {\n listItem.classList = \"letter\";\n } else {\n listItem.classList = \"space\";\n }\n phrase.appendChild(listItem)\n }\n }", "function addPhraseToDisplay (arr) {\n for (i = 0; i < arr.length; i++){\n let li = document.createElement('li');\n phrase.appendChild(li);\n li.textContent = arr[i];\n if (li.textContent === ' ') {\n li.className = 'space'\n li.style.display = 'block'\n } else {\n li.className = 'letter'\n }\n }\n}", "function renderSongLiTrackArtists (track) {\n var html = ''\n if (track.artists) {\n for (var i = 0; i < track.artists.length; i++) {\n html += track.artists[i].name\n html += (i === track.artists.length - 1) ? '' : ' / '\n // Stop after 3\n if (i > 2) {\n html += '...'\n break\n }\n }\n }\n return html\n}", "function renderSongLiTrackArtists (track) {\n var html = ''\n if (track.artists) {\n for (var i = 0; i < track.artists.length; i++) {\n html += track.artists[i].name\n html += (i === track.artists.length - 1) ? '' : ' / '\n // Stop after 3\n if (i > 2) {\n html += '...'\n break\n }\n }\n }\n return html\n}", "function separateText() {\r\n var $curNode = $(this);\r\n $curNode.html($curNode.text().replace(/\\b(\\w+)\\b/g, \"<span text=\\\"word\\\">$1</span>\"));\r\n}", "function add3CharactersInFrontAndBack(str)\n {\n if (str.length>=3)\n {\n str_len = 3;\n \n back = str.substring(str.length-3);\n alert(back + str + back);\n }\n else\n return false;\n }", "function dupEncoder(word) {\n // convert word to lowercase and split it\n // loop over word and compare chars in array\n // if the char is in arr more than once return \"(\"\n // if the char is in arr only once return \")\"\n // join the array and return the string\n return word\n .toLowerCase()\n .split(\"\")\n .map((val, i, arr) => {\n return arr.indexOf(val) === arr.lastIndexOf(val) ? \"(\" : \")\";\n })\n .join(\"\");\n}", "function stockList2(listOfArt, listOfCat) {\n var qs = {};\n if (!listOfArt.length) return '';\n \n listOfArt.forEach(function(art) {\n var cat = art[0];\n qs[cat] = (qs[cat] | 0) + +art.split(' ')[1];\n });\n \n return listOfCat.map(function(c) {\n return '(' + c + ' : ' + (qs[c] | 0) + ')'; \n }).join(' - '); \n }", "function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {\n var result = \"\";\n\n\n result = \"My \"+myAdjective+\" \"+myNoun+\" \"+myVerb+\" \"+myAdverb+\".\";\n\n}", "updateMysteryWord(input) {\n for (let i = 0; i < 5; i++) {\n if (input - 1 !== i) {\n let lineThroughWord = document.getElementById(\"word\" + (i + 1));\n lineThroughWord.style.textDecoration = \"line-through\";\n }\n }\n }", "function addPhraseToDisplay(arr){\n for (let i=0; i < arr.length; i++) {\n const letter = document.createElement('li');\n letter.textContent = arr[i];\n ul.appendChild(letter);\n if (letter.textContent === \" \") {\n letter.className = \"space\";\n } else {\n letter.className = \"letter\";\n }\n };\n }", "function rejoin(words) {\n var quotes = [];\n for (var i in words) {\n if (words[i].match('\"')) {\n quotes.push(parseInt(i))\n }\n }\n if (quotes.length == 2) {\n var quote = words.slice(quotes[0], quotes[1] + 1).join(' ');\n quote = quote.replace(/\"/g, '')\n words.push(quote)\n }\n return words;\n }" ]
[ "0.6323251", "0.626245", "0.6086326", "0.6073268", "0.6021625", "0.5988574", "0.5925556", "0.5906927", "0.58547896", "0.5849243", "0.58031327", "0.57860357", "0.57566273", "0.57542235", "0.5750625", "0.5748227", "0.5693753", "0.5684746", "0.56772006", "0.5671405", "0.56292886", "0.5580989", "0.5576145", "0.5573555", "0.55687034", "0.55514663", "0.55500346", "0.5545247", "0.5542752", "0.5542752", "0.5542752", "0.5542752", "0.5535341", "0.55326575", "0.5531899", "0.55292785", "0.55186874", "0.5512399", "0.5501275", "0.5499268", "0.54973745", "0.5482206", "0.54660004", "0.54608136", "0.54602534", "0.5446568", "0.5440903", "0.54385674", "0.5427326", "0.54215217", "0.54107326", "0.54107326", "0.54107326", "0.54046685", "0.54011613", "0.54008806", "0.5394221", "0.5383763", "0.53809685", "0.53763956", "0.53725576", "0.5358427", "0.5353613", "0.5347441", "0.53422177", "0.5334827", "0.5331768", "0.5330576", "0.53187484", "0.5316163", "0.5302218", "0.52979726", "0.5293752", "0.5284095", "0.5280337", "0.5278325", "0.52608025", "0.5257306", "0.52502936", "0.52415997", "0.5232549", "0.5230557", "0.5230545", "0.5223967", "0.5221592", "0.5220455", "0.521655", "0.52160406", "0.52105993", "0.51982135", "0.51941365", "0.5193854", "0.5193854", "0.5189888", "0.51886386", "0.5188206", "0.518126", "0.51750594", "0.5169196", "0.5166706", "0.516401" ]
0.0
-1
if movie exists, run axios function to pull the artist and console log the info if song does not exsist, pull information for the movie 'Mr. Nobody' uses IMDB API
function getMovie() { for (var i = 3; i < command.length; i++) { if (i > 3 && i < command.length) { movie = movie + "+" + command[i]; } else { movie += command[i]; } } if (movie !== '') { axios({ method: 'get', //Change API key below url: `http://www.omdbapi.com/?apikey=c3f10979&t=${movie}`, responseType: 'json' }).then(function (response) { //console.log(response.data); let dateObj = new Date(response.data.Released); let releaseDate = dateObj.toISOString(); let releaseYear = moment(releaseDate).format('YYYY'); console.log(` Title: ${response.data.Title} Year Released: ${releaseYear} IMDB Rating: ${response.data.Ratings[0].Value} RottenTomatoes Rating: ${response.data.Ratings[1].Value} Country: ${response.data.Country} Language: ${response.data.Language} Plot: ${response.data.Plot} Actors: ${response.data.Actors} `); fs.appendFile('log.txt', ` Title: ${response.data.Title} Year Released: ${releaseYear} IMDB Rating: ${response.data.Ratings[0].Value} RottenTomatoes Rating: ${response.data.Ratings[1].Value} Country: ${response.data.Country} Language: ${response.data.Language} Plot: ${response.data.Plot} Actors: ${response.data.Actors} `, (err) => { if (err) throw err; }); }).catch(err => { console.log(err); }); } else { let movie = 'Mr. Nobody'; axios({ method: 'get', url: `http://www.omdbapi.com/?apikey=c3f10979&t=${movie}`, responseType: 'json' }).then(function (response) { //console.log(response.data); let dateObj = new Date(response.data.Released); let releaseDate = dateObj.toISOString(); let releaseYear = moment(releaseDate).format('YYYY'); console.log(` Title: ${response.data.Title} Released: ${releaseYear} IMDB Rating: ${response.data.Ratings[0].Value} RottenTomatoes Rating: ${response.data.Ratings[1].Value} Country: ${response.data.Country} Language: ${response.data.Language} Plot: ${response.data.Plot} Actors: ${response.data.Actors} `); fs.appendFile('log.txt', ` Title: ${response.data.Title} Year Released: ${releaseYear} IMDB Rating: ${response.data.Ratings[0].Value} RottenTomatoes Rating: ${response.data.Ratings[1].Value} Country: ${response.data.Country} Language: ${response.data.Language} Plot: ${response.data.Plot} Actors: ${response.data.Actors} `, (err) => { if (err) throw err; }); }).catch(err => { console.log(err); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doMovieThis(movie) {\n // If no movie provided, default to Mr. Nobody\n var queryUrl = \"http://www.omdbapi.com/?apikey=trilogy&t=\" + (movie == \"\" ? \"Mr. Nobody\" : movie);\n axios.get(queryUrl)\n .then(function (response) {\n var data = response.data;\n if (data.Response == \"False\") {\n // Movie not found\n writeLog(\"We're sorry, the movie '\" + movie + \"' doesn't seem to exist.\");\n } else {\n // Print movie information\n writeLog(\"------------------------------------\");\n writeLog(\"Title: \" + data.Title);\n writeLog(\"Release Year: \" + data.Year);\n writeLog(\"IMDB Rating: \" + data.Ratings[0].Value);\n writeLog(\"Rotten Tomatoes Rating: \" + data.Ratings[1].Value);\n writeLog(\"Produced in: \" + data.Country);\n writeLog(\"Language: \" + data.Language);\n writeLog(\"Plot: \" + data.Plot);\n writeLog(\"Actors and Actresses: \" + data.Actors);\n }\n })\n .catch(function (error) {\n writeLog(error);\n });\n}", "function getMovie(movie) {\n //If there is no movie listed for this command default to'Mr. Nobody'\n if (movie === \"\" || movie === undefined || movie === null) {\n var defaultMovie = 'Mr. Nobody';\n\n axios.get(\"http://www.omdbapi.com/?t=\" + defaultMovie + \"&plot=full&apikey=3d42b8e8\").then(function (response) {\n console.log('---------------------------------------------\\nMOVIE TITLE: \"' + response.data.Title +\n '\"\\nRelease Year: ' + response.data.Year +\n '\\nIMDB Rating: ' + response.data.imdbRating +\n '\\nRotten Tomatoes Rating: ' + response.data.Ratings[1].Value +\n '\\nCountry: \"' + response.data.country +\n '\"\\nLanguage: \"' + response.data.Language +\n '\"\\nActors: \"' + response.data.Actors +\n '\"\\n\\nPlot: \"' + response.data.Plot +\n '\"\\n---------------------------------------------\\nIf you haven\\'t watched Mr. Nobody, you should! It\\'s on Netflix!\\n\"http://www.imdb.com/title/tt0485947/\"');\n })\n }\n // Run normally if a movie title is entered\n else {\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&plot=full&apikey=3d42b8e8\").then(function (response) {\n console.log('---------------------------------------------\\nMOVIE TITLE: \"' + response.data.Title +\n '\"\\nRelease Year: ' + response.data.Year +\n '\\nIMDB Rating: ' + response.data.imdbRating +\n '\\nRotten Tomatoes Rating: ' + response.data.Ratings[1].Value +\n '\\nCountry: \"' + response.data.country +\n '\"\\nLanguage: \"' + response.data.Language +\n '\"\\nActors: \"' + response.data.Actors +\n '\"\\n\\nPlot: \"' + response.data.Plot + '\"\\n');\n });\n }\n}", "function movieThis(movieName) {\n\n // const movieName = process.argv.slice(3).join(\" \");\n movieName = movieName || \"Mr. Nobody\";\n var queryUrl = `http://www.omdbapi.com/?t=${movieName}&apikey=trilogy`;\n // if (movieName === \"\") {\n // return movieName(\"mr+nobody\");\n // console.log(\"Movie Title: Mr. Nobody\");\n // console.log(\"Movie Year: 2009\");\n // console.log(\"IMDB Rating: 7.8/10\");\n // console.log(\"Rotten Tomatoes Rating: 67%\");\n // console.log(\"Country: Belgium, Germany, Canada, France, USA, UK\");\n // console.log(\"Plot Summary: A boy stands on a station platform as a train is about to leave. Should he go with his mother or stay with his father? Infinite possibilities arise from this decision. As long as he doesn't choose, anything is possible.\");\n // console.log(\"Actors: Jared Leto, Sarah Polley, Diane Kruger, Linh Dan Pham\");\n // } else {\n axios.get(queryUrl).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Movie Year: \" + response.data.Year);\n console.log(\"IMDB 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 Summary: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n if (movieName === \"Mr. Nobody\") {\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\n })\n .catch(function (err) {\n console.log(err);\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}", "async function movieThis(searchFor) {\n\n // console.log(\"Inside movieThis()\");\n\n //Store movie name taken from file\n let movie = searchFor;\n\n //If 'movie' is null then prompt user for movie name\n if (movie === \"\") {\n\n // Prompt to get artist name from user input\n const movieResponse = await getMovieName();\n\n //Get movie name from user response\n movie = movieResponse.movie;\n }\n\n let queryUrl = `http://www.omdbapi.com/?t=${movie}&y=&plot=short&apikey=trilogy`;\n // console.log(\"queryUrl: \" + queryUrl);\n\n // Then run a request with axios to the OMDB API with the movie specified\n axios\n .get(queryUrl)\n .then(function (response) {\n\n console.log(\"\\n-------------------------------------------------------\\n\");\n\n //Check if omdb server response is null\n if (response.data === \"\") {\n console.log(\"Movie not found !!\");\n return;\n }\n\n console.log(`Title of the movie: ${response.data.Title}`);\n console.log(`Year the movie came out: ${response.data.Year}`);\n console.log(`IMDB Rating of the movie: ${response.data.imdbRating}`);\n console.log(`Rotten Tomatoes Rating of the movie: ${response.data.Ratings[1].Value}`);\n console.log(`Country where the movie was produced: ${response.data.Country}`);\n console.log(`Language of the movie: ${response.data.Language}`);\n console.log(`Plot of the movie: ${response.data.Plot}`);\n console.log(`Actors in the movie: ${response.data.Actors}`);\n\n //Call restartApp() to restart the app if user wishes to\n restartApp();\n })\n .catch(function (err) {\n console.log(err);\n });\n\n} //End of movieThis()", "function movieThis() {\n //default input if there is no input from user\n if (!input) {\n input = \"Mr. Nobody\";\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\n //axios get callback to the omdb api\n axios.get(\"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=trilogy\")\n .then (function(response) {\n console.log(\"========SEARCHING...========\");\n console.log(\"Title: \" + response.data.Title);\n console.log(\"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: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Cast: \" + response.data.Actors);\n console.log(\"============================\");\n })\n}", "function movieThis(request) {\n console.log(request);\n if (!request) {\n console.log(\"Please enter a movie for this search. In the meantime here is the information for Cars...\");\n queryURL = \"http://www.omdbapi.com/?t=cars&y=&plot=short&apikey=b55c4ee7\";\n axios.get(queryURL).then(function (response) {\n var movieInfoMN = (`\n Title: ${response.data.Title}\n Year: ${response.data.Year}\n Rated: ${response.data.Rated}\n IMDB Score: ${response.data.Ratings[0].Value}\n Rotten Tomatoes Score: ${response.data.Ratings[1].Value}\n Country: ${response.data.Country}\n Languages: ${response.data.Language}\n Plot: ${response.data.Plot}\n Actors: ${response.data.Actors}\n `);\n console.log(movieInfoMN);\n process.exit();\n });\n } else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + request + \"&y=&plot=short&apikey=b55c4ee7\";\n console.log(queryURL);\n axios.get(queryURL).then(function (response) {\n if (response.data.Error) {\n console.log(`${response.data.Error}`);\n process.exit();\n } else {\n var movieInfo = (`\n Title: ${response.data.Title}\n Year: ${response.data.Year}\n Rated: ${response.data.Rated}\n IMDB Score: ${response.data.Ratings[0].Value}\n Rotten Tomatoes Score: ${response.data.Ratings[1].Value}\n Country: ${response.data.Country}\n Languages: ${response.data.Language}\n Plot: ${response.data.Plot}\n Actors: ${response.data.Actors}\n `);\n console.log(movieInfo);\n process.exit();\n }\n });\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(){\n axios.get('http://www.omdbapi.com/?t=' + arg2 + '&y=&plot=full&tomatoes=true&apikey='+ keys.omdb.apiKey)\n .then(function (response) {\n var movieData = response.data\n if(movieData.Response === 'True'){\n console.log('\\n##########################')\n console.log('\\nmovie-this =>', arg2)\n console.log('\\n------------------------')\n console.log('Title:', movieData.Title)\n console.log('Release Date:', movieData.Year)\n console.log('IMDB Rating:', movieData.imdbRating)\n console.log('Rotten Tomatoes Rating:', movieData.tomatoRating)\n console.log('Language:', movieData.Language)\n console.log('Plot:', movieData.Plot)\n console.log('Actors:', movieData.Actors)\n console.log('\\n##########################')\n console.log('\\n')\n }else {\n console.log('\\n##########################')\n console.log('\\nmovie-this =>', arg2)\n console.log('\\n------------------------')\n console.log('\\n')\n console.log('OOPS, something went wrong! Please try again with another movie title.')\n console.log('\\n') \n }\n \n })\n .catch(function (error) {\n return console.log('Error occurred: please try again O_o');\n });\n\n }", "function movieThis(user) {\n if (user.length === 0) {\n user = \"Mr.Nobody\";\n }\n axios\n .get(\"http://www.omdbapi.com/?apikey=trilogy&t=\" + user)\n .then(function(response) {\n // console.log(response);\n // console.log(response.data);\n var rottenTomatoes = response.data.Ratings[1];\n // console.log(rottenTomatoes);\n if (rottenTomatoes === undefined) {\n rottenTomatoes = \"Unavailable\";\n } else {\n rottenTomatoes = response.data.Ratings[1].Value;\n }\n console.log(\"\");\n console.log(\n \"===== MOVIE ==========[ Searched: \" + response.data.Title + \" ]=====\"\n );\n console.log('===================================================================================================================================');\n // * Title of the movie.\n console.log(\"Title Of Movie: [ \" + response.data.Title + ' ]');\n // * Year the movie came out.\n console.log(\"Year Movie Published: [ \" + response.data.Year + ' ]');\n // * IMDB Rating of the movie.\n console.log(\"IMDB Rating: [ \" + response.data.imdbRating + ' ]');\n // * Rotten Tomatoes Rating of the movie.\n console.log(\"Rotten Tomatoes Rating: [ \" + rottenTomatoes + ' ]');\n // * Country where the movie was produced.\n console.log(\"Country Produced: [ \" + response.data.Country + ' ]');\n // * Language of the movie.\n console.log(\"Language: [ \" + response.data.Language + ' ]');\n // * Plot of the movie.\n console.log(\"Plot: [ \" + response.data.Plot + ' ]');\n // * Actors in the movie.\n console.log(\"Actors: [ \" + response.data.Actors + ' ]');\n console.log('===================================================================================================================================');\n })\n .catch(function(error) {\n console.log(\"MOVIE ERROR: \" + error);\n });\n}", "function movieInfo(userSearch) {\n //If user does not enter any info\n if (userSearch === undefined) {\n userSearch = \"Mr. Nobody\"\n console.log('--------------------')\n console.log('')\n console.log(`If you haven't watched \"Mr. Nobody,\" then you should: http://www.imdb.com/title/tt0485947/. It's on Netflix`)\n } {\n //Call API once user enter search\n axios.get(`http://www.omdbapi.com/?t=${userSearch}&y=&plot=short&apikey=trilogy`)\n .then(function (response) {\n console.log(`Title: ${response.data.Title}`)\n console.log(`Released: ${response.data.Year}`)\n console.log(`The IMDB rating is: ${response.data.imdbRating}`)\n console.log(`The Rotten Tomotoes score is: ${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}", "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 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 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 ShowMovieInformation(info){\n //If the user doesn't type a movie in, the program will output data for the movie 'Mr. Nobody.'\n if(info == \"\" || info == null || info.length == 0){\n info = \"Mr.Nobody\"\n }\n axios\n .get(\"http://www.omdbapi.com/?t=\" + info + \"&apikey=\" + keys.omdbAPIKey)\n .then(function(response) {\n var movieData = response.data;\n // If the axios was successful...\n // Then log the body from the site!\n console.log(chalk.cyan(\" __ __ _____ _____ _____ ___ _ _ _____ ___ ____ __ __ _ _____ ___ ___ _ _ \"));\n console.log(chalk.cyan(\" | \\\\/ |/ _ \\\\ \\\\ / /_ _| ____| |_ _| \\\\ | | ___/ _ \\\\| _ \\\\| \\\\/ | / \\\\|_ _|_ _/ _ \\\\| \\\\ | |\"));\n console.log(chalk.cyan(\" | |\\\\/| | | | \\\\ \\\\ / / | || _| | || \\\\| | |_ | | | | |_) | |\\\\/| | / _ \\\\ | | | | | | | \\\\| |\"));\n console.log(chalk.cyan(\" | | | | |_| |\\\\ V / | || |___ | || |\\\\ | _|| |_| | _ <| | | |/ ___ \\\\| | | | |_| | |\\\\ |\"));\n console.log(chalk.cyan(\" |_| |_|\\\\___/ \\\\_/ |___|_____| |___|_| \\\\_|_| \\\\___/|_| \\\\_\\\\_| |_/_/ \\\\_\\\\_| |___\\\\___/|_| \\\\_|\"));\n console.log(\" \");\n console.log(\"================================================================================\\n\");\n console.log(chalk.green(\"\\t> LIRI: \") + \"You searched for '\" + chalk.bgBlue.white(info) + \"'. Here are the information.\\n\");\n console.log(\"================================================================================\\n\\n\");\n console.log(chalk.cyan(\" Title\\t\\t\\t: \") + movieData.Title);\n console.log(chalk.cyan(\" Year\\t\\t\\t\\t: \") + movieData.Year);\n for(var i = 0; i < movieData.Ratings.length; i++){\n if(movieData.Ratings[i].Source == \"Internet Movie Database\"){\n console.log(chalk.cyan(\" \" + movieData.Ratings[i].Source + \" \\t: \") + movieData.Ratings[i].Value)\n }\n\n if(movieData.Ratings[i].Source == \"Rotten Tomatoes\"){\n console.log(chalk.cyan(\" \" + movieData.Ratings[i].Source + \"\\t\\t: \") + movieData.Ratings[i].Value)\n }\n }\n console.log(chalk.cyan(\" Country\\t\\t\\t: \") + movieData.Country);\n console.log(chalk.cyan(\" Language\\t\\t\\t: \") + movieData.Language);\n console.log(chalk.cyan(\" Cast\\t\\t\\t\\t: \") + movieData.Actors);\n console.log(chalk.cyan(\" Plot\\t\\t\\t\\t: \") + movieData.Plot);\n console.log(\"\\n\\n================================================================================\");\n })\n .catch(function(error) {\n if (error.response) {\n // The request was made and the server responded with a status code\n // that falls out of the range of 2xx\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else if (error.request) {\n // The request was made but no response was received\n // `error.request` is an object that comes back with details pertaining to the error that occurred.\n console.log(error.request);\n } else {\n // Something happened in setting up the request that triggered an Error\n console.log(\"Error\", error.message);\n }\n console.log(error.config);\n }\n );\n}", "function getFilm(pFilmName){\n const searchTitle = titleSearch(pFilmName); \n\n const url =\"http://www.omdbapi.com/?t=\"+searchTitle+\"&apikey=c6bcf5ce\";\n //const url = \"https://aws.random.cat/meow\"\n \n axios.get(url)\n .then(function(response){\n filmInfo['poster'] = response.data.Poster;\n filmInfo['title'] =response.data.Title;\n filmInfo['decrp'] = response.data.Plot;\n })\n \n .catch(function(error){\n \n console.log(error);\n })\n .then(function(){\n showFilm();\n });\n}", "function movieThis(show) {\n // when called, show will be replaced with var = title.\n axios.get('http://www.omdbapi.com/?t=' + show + '&plot=short&apikey=trilogy')\n .then(function (response) {\n // console.log('////////////////AXIOS NO ERROR////////////')\n // console.log(response)\n // * Title of the movie.\n console.log(`Movie: ${response.data.Title}`)\n // * IMDB Rating of the movie.\n console.log(`IMDB Rating is: ${response.data.imdbRating}`)\n // * Year the movie came out.\n console.log(`Year Released : ${response.data.Released}`)\n // * Rotten Tomatoes Rating of the movie.\n console.log(`Rotten Tomatoes Rating : ${response.data.Ratings[1].Value}`)\n // * Country where the movie was produced.\n console.log(`Country : ${response.data.Country}`)\n // * Language of the movie.\n console.log(`Language : ${response.data.Language}`)\n // * Plot of the movie.\n console.log(`Plot : ${response.data.Plot}`)\n // * Actors in the movie.\n console.log(`Actors in movie : ${response.data.Actors}`)\n })\n // log error\n .catch(function (error) {\n console.log('//////////ERROR!!!/////////////')\n console.log(error);\n });\n}", "function movieThis(){\n console.log(\"Getting the information you requested\");\n if (!userQuery){userQuery = \"mr nobody\";\n };\n // var axios = require(\"axios\");\n axios.get(\"http://www.omdbapi.com/?t=\" + userQuery + \"&apikey=1d86f0e6\").then(function(response){\n // console.log(response);\n \n // let userMovie = JSON.parse(body);\n\n // Title of the movie.\n console.log(\"Movie: \" + response.data.Title);\n // Year the movie came out.\n console.log(\"Released: \" + response.data.Released);\n // IMDB Rating of the movie.\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n // Rotten Tomatoes Rating of the movie.\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n // Country where the movie was produced.\n console.log(\"Country: \" + response.data.Country);\n // Language of the movie.\n console.log(\"Language: \" + response.data.Language);\n // Plot of the movie.\n console.log(\"Plot: \" + response.data.Plot);\n // Actors in the movie.\n console.log(\"Actors: \" + response.data.Actors);\n \n }, \n \n function(error) {\n if (error.response) {\n // The request was made and the server responded with a status code\n // that falls out of the range of 2xx\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else if (error.request) {\n // The request was made but no response was received\n // `error.request` is an object that comes back with details pertaining to the error that occurred.\n console.log(error.request);\n } else {\n // Something happened in setting up the request that triggered an Error\n console.log(\"Error\", error.message);\n }\n console.log(error.config);\n }\n );\n}", "function lookupSpecificMovie () {\n //Calls upon the OMDB api to get data related to the 2009 movie MR. Nobody\n axios.get('http://www.omdbapi.com/?apikey=trilogy&t=Mr.+Nobody')\n .then(function (response) {\n //Node command\n logOutput('Command: node liri.js movie-this ' + response.data.Title);\n //Title of the movie.\n logOutput('Title: ' + response.data.Title);\n //Year the movie came out.\n logOutput('Year: ' + response.data.Year);\n //IMDB Rating of the movie.\n logOutput('IMDB Rating: ' + response.data.Ratings[0].Value);\n //Rotten Tomatoes Rating of the movie.\n logOutput('Rotton Tomatoes Rating ' + response.data.Ratings[1].Value);\n //Country where the movie was produced.\n logOutput('Country ' + response.data.Country);\n //Language of the movie.\n logOutput('Language ' + response.data.Language);\n //Plot of the movie.\n logOutput('Plot ' + response.data.Plot);\n //Actors in the movie.\n logOutput('Actors ' + response.data.Actors);\n logOutput(\"------------\");\n})\n.catch(function (error) {\n //Logs any errors to the log.txt files\n logOutput(error);\n});\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 showMovie(userSearch) {\n\n if (userSearch === \"\") {\n userSearch = \"Mr. Nobody\"\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 var queryUrl = 'http://www.omdbapi.com/?t=' + userSearch + '&y=&plot=short&apikey=trilogy';\n axios.get(queryUrl).then(\n function (response) {\n\n if (response.status === 200) {\n var movies = response.data\n\n console.log(\"**********MOVIE INFO*********\");\n fs.appendFileSync(\"log.txt\", \"**********MOVIE INFO*********\\n\");\n console.log(\"Title: \" + movies.Title);\n fs.appendFileSync(\"log.txt\", \"Title: \" + movies.Title + \"\\n\");\n console.log(\"Release Year: \" + movies.Year);\n fs.appendFileSync(\"log.txt\", \"Release Year: \" + movies.Year + \"\\n\");\n console.log(\"IMDB Rating: \" + movies.imdbRating);\n fs.appendFileSync(\"log.txt\", \"IMDB Rating: \" + movies.imdbRating + \"\\n\");\n // console.log(\"Rotten Tomatoes Rating: \" + getRottenTomatoesRatingValue(movies));\n // fs.appendFileSync(\"log.txt\", \"Rotten Tomatoes Rating: \" + getRottenTomatoesRatingValue(movies) + \"\\n\");\n console.log(\"Country of Production: \" + movies.Country);\n fs.appendFileSync(\"log.txt\", \"Country of Production: \" + movies.Country + \"\\n\");\n console.log(\"Language: \" + movies.Language);\n fs.appendFileSync(\"log.txt\", \"Language: \" + movies.Language + \"\\n\");\n console.log(\"Plot: \" + movies.Plot);\n fs.appendFileSync(\"log.txt\", \"Plot: \" + movies.Plot + \"\\n\");\n console.log(\"Actors: \" + movies.Actors);\n fs.appendFileSync(\"log.txt\", \"Actors: \" + movies.Actors + \"\\n\");\n console.log(\"*****************************\");\n fs.appendFileSync(\"log.txt\", \"*****************************\\n\");\n } else {\n console.log(\"There is an error\")\n\n }\n //Axios call to get information on concerts from Bands in Town\n });\n\n}", "function movieSearch(movieInput) { \n \n if (movieInput === \"\") {\n movieInput = \"Mr. Nobody\";\n }\n console.log(\"movie input: \" + movieInput);\n\n axios.get(\"http://www.omdbapi.com/?t=\" + movieInput + \"&y=&plot=short&apikey=trilogy\").then(\n function (response) {\n // console.log(response.data);\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(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Rotten Tomatoes: \" + response.data.Ratings[0].Value);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n );\n}", "function getMovieInfo() {\n // if no movie entered, default to \"Mr. Nobody\"\n if (userQuery === undefined) {\n userQuery = \"Mr. Nobody\";\n }\n\n axios.get(`http://www.omdbapi.com/?t=${userQuery}&y=&plot=short&apikey=trilogy`)\n .then(function (response) {\n displayMovieInfo(response)\n })\n}", "function movieThis(movie) {\r\n var axios = require('axios');\r\n var apikey = keys.omdb.apikey;\r\n var queryURLString = \"\";\r\n\r\n // Default to Mr. Nobody if we don't get a movie request\r\n if (!movie) {\r\n movie = \"Mr. Nobody\";\r\n }\r\n\r\n // Build the url string with the api key and movie title\r\n queryURLString = \"http://www.omdbapi.com/?apikey=\" + apikey + \"&\" + \"t=\" + movie;\r\n\r\n // The axios.get function takes in a URL and returns a promise\r\n axios\r\n .get(queryURLString)\r\n .then(function (response) {\r\n // Success - log the JSON resposne from the site\r\n parseOMDBResponse(response.data);\r\n })\r\n .catch(function (error) {\r\n // Error - log an error based on its type\r\n if (error.response) {\r\n // The request was made and the server responded with a status codethat falls out of the range of 2xx\r\n console.log(error.response.data);\r\n console.log(error.response.status);\r\n console.log(error.response.headers);\r\n } else if (error.request) {\r\n // The request was made but no response was received\r\n // `error.request` is an object that comes back with details pertaining to the error that occurred.\r\n console.log(error.request);\r\n } else {\r\n // Something happened in setting up the request that triggered an Error\r\n console.log(\"Error\", error.message);\r\n }\r\n console.log(error.config);\r\n });\r\n\r\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 movies(movieName) {\n \n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n // console.log(movieName);\n // console.log(queryUrl);process.argv.length === 3\n if (process.argv[2] === \"do-what-it-says\"){\n axios.get(queryUrl).then(\n function (response) {\n console.log(\"-----------------------\");\n console.log(`\\nTitle: ${response.data.Title}`);\n console.log(`Year: ${response.data.Year}`);\n console.log(`Rating: ${response.data.imdbRating}`);\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 console.log(\"-----------------------\");\n });\n\n }\n else if (!query) {\n axios.get(\"http://www.omdbapi.com/?t=mr+nobody&y=&plot=short&apikey=trilogy\").then(\n function (response) {\n console.log(\"-----------------------\");\n console.log(`\\nTitle: ${response.data.Title}`);\n console.log(`Year: ${response.data.Year}`);\n console.log(`Rating: ${response.data.imdbRating}`);\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 console.log(\"-----------------------\");\n\n })\n } else {\n axios.get(queryUrl).then(\n function (response) {\n console.log(\"-----------------------\");\n console.log(`\\nTitle: ${response.data.Title}`);\n console.log(`Year: ${response.data.Year}`);\n console.log(`Rating: ${response.data.imdbRating}`);\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 console.log(\"-----------------------\");\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 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 movieThis(movie){\n //console.log(\"Movie This\");\n\n if (movie === undefined){\n movie = \"Mr. Nobody\";\n }\n //else movie = inputs[3];\n\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&apikey=\" + omdb).then(\n results => {\n //console.log(results.data);\n console.log(\"Title: \" + results.data[\"Title\"]);\n console.log(\"Year: \" + results.data[\"Year\"]);\n //console.log(\"IMDB Rating: \" + results.data[\"Ratings\"][0][\"Value\"]);\n console.log(\"IMDB Rating: \" + results.data[\"imdbRating\"]);\n console.log(\"Rotten Tomatoes Rating: \" + results.data[\"Ratings\"][1][\"Value\"]);\n console.log(\"Country: \" + results.data[\"Country\"]);\n console.log(\"Language: \" + results.data[\"Language\"]);\n console.log(\"Plot: \" + results.data[\"Plot\"]);\n console.log(\"Actors: \" + results.data[\"Actors\"]);\n },\n err => {\n console.log(err);\n }\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 movieThis(movieName) {\n console.log(\"movie is working\");\n if (movieName === undefined) {\n movieName = \"Mr Nobody\";\n }\n\n var movieUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=trilogy\";\n\n axios.get(movieUrl).then(\n function (response) {\n var movieData = response.data;\n\n console.log(\"Title: \" + movieData.Title);\n console.log(\"Year: \" + movieData.Year);\n console.log(\"Rated: \" + movieData.Rated);\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.Ratings[1].Value);\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 movieThis(movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n let queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&tomatoes=true&apikey=trilogy\";\n axios.get(queryUrl)\n .then(\n function (response) {\n console.log('\\x1b[33m%s\\x1b[0m', 'Movie Data');\n console.log('\\x1b[33m%s\\x1b[0m', \"----------------------------\");\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Released year: \" + response.data.Year);\n console.log(\"Imdb Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Movie produced in: \" + 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('\\x1b[33m%s\\x1b[0m', \"----------------------------\");\n\n let logHead = \"\\n\\nNEW SEARCH ( Movie: \" + movie + \" )\\n**************************************************\\n\"\n let log = [\"Title: \" + response.data.Title,\n \"Released year: \" + response.data.Year,\n \"Imdb Rating: \" + response.data.Ratings[0].Value,\n \"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value,\n \"Movie produced in: \" + response.data.Country,\n \"Language: \" + response.data.Language,\n \"plot: \" + response.data.Plot,\n \"Actors: \" + response.data.Actors].join(\"\\n\\n\");\n\n fs.appendFile(\"log.txt\", logHead + log, function (err) {\n if (err) {\n return console.log(err);\n }\n console.log('\\x1b[33m%s\\x1b[0m', \"You can also check logs at log.txt\");\n });\n }\n );\n}", "function defaultMovie() {\n const queryUrl = 'http://www.omdbapi.com/?t=mr.nobody&y=&plot=short&apikey=trilogy';\n axios.get(queryUrl).then((response) => {\n console.log('If you haven\\'t watched Mr. Nobody');\n console.log('Then you should: http://www.imdb.com/title/tt0485947/');\n console.log('It\\'s on Netflix! Here\\'s the info!');\n console.log(`Year the movie came out: ${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 The Movie was produced: ${response.data.Country}`);\n console.log(`Language of the movie: ${response.data.Language}`);\n console.log(`Plot of the movie: ${response.data.Plot}`);\n console.log(`Actors: ${response.data.Actors}`);\n }).catch((error) => {\n if (error.response) {\n console.log('---------------Data---------------');\n console.log(error.response.data);\n }\n });\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 movieAPI (movieName) {\n // Create an if-statement in case the user does not enter a movie title and set default movie to Mr. Nobody\n if (movieName == \"\") {\n // Place URL into variable for debugging\n var queryURL = \"http://www.omdbapi.com/?t=Mr.+Nobody&y=&plot=short&apikey=trilogy\";\n // Axios Get request\n axios.get(queryURL).then(function (response) { \n //console.log(queryURL)\n //console.log(response.data)\n\n // Store data into variable to shorten code\n var data = response.data;\n \n //console.log the default movie information along with Error alert\n console.log(\"Error: A movie title was not entered\");\n console.log(\"==============================================================================\");\n console.log(\"Suggestion:\");\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 console.log(\"Title: \" + data.Title);\n console.log(\"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(\"Actors: \" + data.Actors); \n console.log(\"Plot: \" + data.Plot); \n \n }).catch(function (error) {\n console.log(\"==============================================================================\");\n console.log(\"Error: We could not find your movie. Please try again.\");\n console.log(\"Tip: Check the spelling of your movie title.\");\n console.log(\"==============================================================================\");\n console.log(error);\n });\n } \n // Else Statement for when user correctly enters movie title, re-run moveiAPI code minus default movie and error alert. \n else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n axios.get(queryURL).then(function (response) {\n //console.log(queryURL)\n //console.log(response.data)\n\n var data = response.data; \n\n console.log(\"Title: \" + data.Title);\n console.log(\"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(\"Actors: \" + data.Actors); \n console.log(\"Plot: \" + data.Plot);\n\n }).catch(function (error) {\n console.log(\"==============================================================================\");\n console.log(\"Error: We could not find your movie. Please try again.\");\n console.log(\"Tip: Check the spelling of your movie title.\");\n console.log(\"==============================================================================\");\n console.log(error);\n });\n };\n}", "function movieThis() {\n let queryURL = \"http://www.omdbapi.com/?t=\" + userInput + \"&y=&plot=short&apikey=trilogy\";\n axios.get(queryURL).then(\n function (movieResponse) {\n if (!userInput) {\n userInput = 'mr nobody';\n movieThis();\n }\n else {\n console.log('Title: ' + movieResponse.data.Title);\n console.log('Release Year: ' + movieResponse.data.Year);\n console.log('OMdB Rating: ' + movieResponse.data.Ratings[0].Value);\n console.log('Rotten Tomatoes Rating: ' + movieResponse.data.Ratings[1].Value);\n console.log('Country: ' + movieResponse.data.Country);\n console.log('Language: ' + movieResponse.data.Language);\n console.log('Plot: ' + movieResponse.data.Plot);\n console.log('Actors: ' + movieResponse.data.Actors);\n };\n });\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 movieThis(search){\n axios.get(\"https://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\")\n .then(function(response) {\n console.log(\n `--------------------------------------------------------------------\nMovie Title: ${response.data.Title}\nYear of Release: ${response.data.Year}\nIMDB Rating: ${response.data.imdbRating}\nRotten Tomatoes Rating: ${response.data.Ratings[1].Value}\nLanguage: ${response.data.Language}\nCast: ${response.data.Actors}\nPlot: ${response.data.Plot}`\n );\n \n })\n .catch(function (error) {\n console.log(error);\n });\n \n}", "function noMovie (){\n axios.get(\"http://www.omdbapi.com/?t=\" + argString + \"&apikey=trilogy\")\n .then(function(response){\n var data = response.data;\n var title = data.Title;\n var year = data.Year;\n var imdbRating = data.imdbRating;\n var country = data.Country;\n var language = data.Language;\n var plot = data.Plot;\n var actors = data.Actors;\n\n console.log(\"\\nTitle: \" + title + \"\\n Year: \" + year + \"\\n Imdb Rating: \" + imdbRating\n + \"\\n Country Produced: \" + country + \"\\n Language: \" + language + \"\\n Plot: \" + plot + \"\\n Actors: \" + actors + \"\\n\");\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}", "function movieThis() {\r\n var movieTitle = value;\r\n axios.get(`http://www.omdbapi.com/?t=${movieTitle}&y=&plot=short&apikey=trilogy`).then(\r\n function(response) {\r\n\r\n if (response.data.Response === 'False') {\r\n console.log('Movie is not found. Here is something for your to watch')\r\n axios.get(`http://www.omdbapi.com/?t=Mr.Nobody&y=&plot=short&apikey=trilogy`).then( function(secondResponse) {\r\n // log this by appending to log.txt\r\n logThis(`\\n******************************************\\n${action} ${value}\r\n\\t Title: ${secondResponse.data.Title}\r\n\\t Year: ${secondResponse.data.Year}\r\n\\t IMBD Rating: ${secondResponse.data.imdbRating}\r\n\\t Rotten Tomatoes Rating: ${findRotTomato(secondResponse.data.Ratings)}\r\n\\t Country: ${secondResponse.data.Country}\r\n\\t Language: ${secondResponse.data.Language}\r\n\\t Plot: ${secondResponse.data.Plot}\r\n\\t Actors: ${secondResponse.data.Actors}\r\n -------------------\r\n `);\r\n // console this to terminal\r\n console.log(`\r\n Title: ${secondResponse.data.Title}\r\n Year: ${secondResponse.data.Year}\r\n IMBD Rating: ${secondResponse.data.imdbRating}\r\n Rotten Tomatoes Rating: ${findRotTomato(secondResponse.data.Ratings)}\r\n Country: ${secondResponse.data.Country}\r\n Language: ${secondResponse.data.Language}\r\n Plot: ${secondResponse.data.Plot}\r\n Actors: ${secondResponse.data.Actors}\r\n `)\r\n });\r\n } else {\r\n // log this by appending to log.txt\r\n logThis(`\\n******************************************\\n${action} ${value}\r\n\\t Title: ${response.data.Title}\r\n\\t Year: ${response.data.Year}\r\n\\t IMBD Rating: ${response.data.imdbRating}\r\n\\t Rotten Tomatoes Rating: ${findRotTomato(response.data.Ratings)}\r\n\\t Country: ${response.data.Country}\r\n\\t Language: ${response.data.Language}\r\n\\t Plot: ${response.data.Plot}\r\n\\t Actors: ${response.data.Actors}\r\n -------------------\r\n `);\r\n // console log this to terminal\r\n console.log(`\r\n Title: ${response.data.Title}\r\n Year: ${response.data.Year}\r\n IMBD Rating: ${response.data.imdbRating}\r\n Rotten Tomatoes Rating: ${findRotTomato(response.data.Ratings)}\r\n Country: ${response.data.Country}\r\n Language: ${response.data.Language}\r\n Plot: ${response.data.Plot}\r\n Actors: ${response.data.Actors}\r\n `); \r\n };\r\n }).catch(function(error) {\r\n if (error.response) {\r\n // The request was made and the server responded with a status code\r\n // that falls out of the range of 2xx\r\n console.log(\"---------------Data---------------\");\r\n console.log(error.response.data);\r\n console.log(\"---------------Status---------------\");\r\n console.log(error.response.status);\r\n console.log(\"---------------Status---------------\");\r\n console.log(error.response.headers);\r\n } else if (error.request) {\r\n // The request was made but no response was received\r\n // `error.request` is an object that comes back with details pertaining to the error that occurred.\r\n console.log(error.request);\r\n } else {\r\n // Something happened in setting up the request that triggered an Error\r\n console.log(\"Error\", error.message);\r\n }\r\n console.log(error.config);\r\n });\r\n}", "function movieThis(input) {\n if(input.length < 1) {\n console.log(\"Nothing was searched...\");\n console.log(\"Here! Let me try searching something!\");\n movieThis(\"Mulan\");\n }\n else{\n console.log(\"Searching \" + input + \" on IMDB...\");\n axios.get(\"https://www.omdbapi.com/?t=\" + input + \"&apikey=trilogy\")\n .then(function(response) {\n data = response.data\n var result = {\n Title : data.Title,\n Year : data.Year,\n \"IMDB Rating\" : data.imdbRating,\n Country : data.Country,\n Language : data.Language,\n Plot : data.Plot,\n Actors : data.Actors\n };\n console.log(JSON.stringify(result, null, 2));\n // Asks the user if they want to continue searching\n searchAgain();\n })\n }\n}", "function ombdMovie(parameter) {\n // If the user doesn't type a movie in, the program will output data for the movie 'Mr. Nobody.'\n if (parameter === undefined || null) {\n parameter = \"Mr. Nobody\";\n console.log(\"If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\");\n fs.appendFileSync(\"log.txt\", \"If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\" + \"\\n\");\n console.log(\"It's on Netflix!\");\n fs.appendFileSync(\"log.txt\", \"It's on Netflix!\\n\");\n };\n\n axios.get(\"https://www.omdbapi.com/?t=\" + parameter + \"&y=&plot=short&apikey=trilogy\")\n .then(function (movie) {\n var movieInfo =\n \"--------------------------------------------------------------------\" +\n \"\\nMovie Title: \" + movie.data.Title +\n \"\\nYear of Release: \" + movie.data.Year +\n \"\\nIMDB Rating: \" + movie.data.imdbRating +\n \"\\nRotten Tomatoes Rating: \" + movie.data.Ratings[1].Value +\n \"\\nCountry Produced: \" + movie.data.Country +\n \"\\nLanguage: \" + movie.data.Language +\n \"\\nPlot: \" + movie.data.Plot +\n \"\\nActors/Actresses: \" + movie.data.Actors;\n console.log(movieInfo);\n })\n .catch(function (error) {\n console.log(error);\n });\n\n // var queryUrl = \"http://www.omdbapi.com/?t=\" + parameter + \"&y=&plot=short&apikey=trilogy\";\n\n // request(queryUrl, function (error, response, body) {\n // var movie = JSON.parse(body);\n // if (!error && response.statusCode === 200) {\n // // Title of the movie.\n // console.log(\"Title: \" + movie.Title);\n // fs.appendFileSync(\"log.txt\", \"Title: \" + movie.Title + \"\\n\");\n\n // // Year the movie came out.\n // console.log(\"Release Year: \" + movie.Year);\n // fs.appendFileSync(\"log.txt\", \"Release Year: \" + movie.Year + \"\\n\");\n\n // // IMDB Rating of the movie.\n // console.log(\"IMDB Rating: \" + movie.imdbRating);\n // fs.appendFileSync(\"log.txt\", \"IMDB Rating: \" + movie.imdbRating + \"\\n\");\n\n // // Rotten Tomatoes Rating of the movie.\n // console.log(\"Rotten Tomatoes Rating: \" + movie.Rating[1].Value);\n // fs.appendFileSync(\"log.txt\", \"Rotten Tomatoes Rating: \" + movie.Rating[1].Value + \"\\n\");\n\n // // Country where the movie was produced.\n // console.log(\"Country of Production: \" + movie.Country);\n // fs.appendFileSync(\"log.txt\", \"Country of Production: \" + movie.Country + \"\\n\");\n\n // // Language of the movie.\n // console.log(\"Language: \" + movie.Language);\n // fs.appendFileSync(\"log.txt\", \"Language: \" + movie.Language + \"\\n\");\n\n // // Plot of the movie.\n // console.log(\"Plot: \" + movie.Plot);\n // fs.appendFileSync(\"log.txt\", \"Plot: \" + movie.Plot + \"\\n\");\n\n // // Actors in the movie.\n // console.log(\"Actors: \" + movie.Actors);\n // fs.appendFileSync(\"log.txt\", \"Actors: \" + movie.Actors + \"\\n\");\n\n // console.log(\"----------------------------------------\");\n // fs.appendFileSync(\"log.txt\", \"-----------------------------------\");\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 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 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 callMovie() {\n //Loads Axios & sets default search to Mr. Nobody if the user does not enter a movie name\n var axios = require(\"axios\");\n var movieNodeArgs = process.argv;\n var movieTitle = \"Mr. Nobody\";\n //For Loop that combines multiple words in a search term and assigns it to the \"movieTitle\" variable\n for (var i = 3; i < movieNodeArgs.length; i++) {\n movieTitle = \"\";\n if (i > 3 && i < movieNodeArgs.length) {\n movieTitle = movieTitle + \"+\" + movieNodeArgs[i];\n }\n else {\n movieTitle += movieNodeArgs[i];\n }\n };\n //API call that searchs OMDB for the \"movieTitle\" variable created above\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=trilogy\";\n //Displays the response in the terminal. Inlcudes Title, Ratings, Year of Production, Language, Plot, and Cast list.\n axios.get(queryUrl).then(\n function (response) {\n console.log(\"\\nMovie Title: \" + response.data.Title, \"\\nRelease Year: \" + response.data.Year, \"\\nIMDB Rating: \" + response.data.imdbRating, \"\\nRotten Tomatoes Rating: \" + JSON.stringify(response.data.Ratings[1].Value), \"\\nProduced in: \" + response.data.Country, \"\\nLanguage: \" + response.data.Language, \"\\nPlot: \" + response.data.Plot, \"\\nCast: \" + response.data.Actors);\n }\n );\n}", "function doMovie(name) {\n\n if (name == null) {\n name = 'Mr. Nobody';\n };\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + name + \"&y=&plot=short&apikey=trilogy\";\n\n axios.get(queryUrl).then(\n function (response) {\n\n console.log(\"\\nMovie Name: \" + response.data.Title +\n \"\\nYear: \" + response.data.Year +\n \"\\nIMDB Rating: \" + response.data.imdbRating +\n \"\\nRotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\nCountry it was produced: \" + response.data.Country +\n \"\\nMovie Language: \" + response.data.Language +\n \"\\nMovie Plot: \" + response.data.Plot +\n \"\\nActors: \" + response.data.Actors);\n\n\n appendFile(\"\\nMovie Name: \" + response.data.Title +\n \"\\nYear: \" + response.data.Year +\n \"\\nIMDB Rating: \" + response.data.imdbRating +\n \"\\nRotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\nCountry it was produced: \" + response.data.Country +\n \"\\nMovie Language: \" + response.data.Language +\n \"\\nMovie Plot: \" + response.data.Plot +\n \"\\nActors: \" + response.data.Actors);\n });\n}", "function MovieThis(Movie) {\n\n if (!Movie) {\n\t\tMovie = \"Mr. Nobody\";\n\t} // if (!Movie)\n \n if (DebugON) console.log (\"** in MovieThis() \" + Movie);\n\n // Use axios call to query omdb\n axios.get(\"http://www.omdbapi.com/?t=\"+Movie+\"&y=&plot=short&apikey=trilogy\").then(\n function (response) {\n // Create Movie Results string \n var MovieResults = \n \"--------------------------------------------------------------------\" +\n \"\\n M O V I E - T H I S\" +\n \"\\n--------------------------------------------------------------------\" +\n \"\\n-Title \" + response.data.Title +\n \"\\n-Year: \" + response.data.Year +\n \"\\n-IMDB Rating: \" + response.data.Ratings[0].Value +\n \"\\n-Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\n-Country: \" + response.data.Country +\n \"\\n-Language: \" + response.data.Language +\n \"\\n-Plot: \" + response.data.Plot +\n \"\\n-Actors: \" + response.data.Actors +\n \"\\n--------------------------------------------------------------------\";\n console.log(MovieResults);\n }) // function(response)\n .catch(function (error) {\n console.log(\"axios.get Error: \" + error);\n\t}); // axios.get\n\n} // MovieThis()", "function movie() {\n var url;\n\n if (input !== undefined) {\n var url = \"http://www.omdbapi.com/?apikey=\" + omdbKey + \"&t=\" + input;\n }\n else {\n var url = \"http://www.omdbapi.com/?apikey=\" + omdbKey + \"&t=mr+nobody\";\n }\n\n axios\n .get(url)\n .then(function(response) {\n\n var result = \"\\n\" + \"******* \" + response.data.Title + \" *******\" + \"\\n\" + \"\\n\" +\n \"Title: \" + response.data.Title + \"\\n\" +\n \"Year: \" + response.data.Year + \"\\n\" +\n \"IMDB Rating: \" + response.data.imdbRating + \"\\n\" + \n \"Rotten Tomatoes: \" + response.data.Ratings[1].Value + \"\\n\" + \n \"Country: \" + response.data.Country + \"\\n\" + \n \"Language: \" + response.data.Language + \"\\n\" + \n \"Plot: \" + response.data.Plot + \"\\n\" +\n \"Actors: \" + response.data.Actors + \"\\n\";\n\n // display movie info\n console.log(result);\n\n // log info to log.txt\n fs.appendFile(\"log.txt\", result, function(err) {\n if(err) {\n console.log(err);\n }\n });\n })\n .catch(function(error) {\n\n // make sure there are no errors\n if(error.response) {\n console.log(error.response);\n }\n\n else if (error.request) {\n console.log(error.request);\n }\n\n else {\n console.log(\"Error: \", error.message);\n }\n\n console.log(error.config);\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}", "function movieInfo(input) {\n \n if(!input){\n // If no input data has been entered... default to Mr. Nobody\n axios.get(\"http://www.omdbapi.com/?t=Mr.+Nobody&apikey=trilogy\").then(function(response){\n // log(response.data); \n\n // Stores data from the omdb API \n var movieSearch = \n title_3(\"\\n -\") + titleCommand(\"| MOVIE-THIS |\") + title_3(\"-----------------------------------------------------------------------------------------------------------\\n\") +\n title_3(\"\\n If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\" + titleCommand.underline(\"\\n\" + \"\\n _____It's on Netflix!_____\\n\")) +\n title_3(\"\\n * Movie Title: \") + bodyText(response.data.Title) +\n title_3(\"\\n * Plot: \") + bodyText(response.data.Plot) + \n title_3(\"\\n\" + \"\\n * Actors: \") + bodyText(response.data.Actors) + \n title_3(\"\\n * IMDB Rating: \") + bodyText(response.data.imdbRating) +\n title_3(\"\\n * Rotten Tomatoes Rating: \") + bodyText(response.data.Ratings[1].Value) +\n title_3(\"\\n * Release Date: \") + bodyText(response.data.Released) + \n title_3(\"\\n * Language(s): \") + bodyText(response.data.Language) + \n title_3(\"\\n * Production Location(s): \") + bodyText(response.data.Country) + \"\\n\" +\n title_3(\"\\n--------------------------------------------------------------------------------------------------------------------------\\n\");\n\n // Logs and separates the movie data colorfully with Chalk\n log(wrapAnsi(movieSearch, 124));\n\n // Stores data from the omdb API \n var movieSearch_log = \n \"\\n -| MOVIE-THIS |-------------------------------------------------------------------------------------------------------------\\n\" +\n \"\\n If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\" + \"\\n\" + \"\\n It's on Netflix!\\n\" +\n \"\\n * Movie Title: \" + response.data.Title +\n \"\\n * Plot: \" + response.data.Plot + \n \"\\n\" + \"\\n * Actors: \" + response.data.Actors + \n \"\\n * IMDB Rating: \" + response.data.imdbRating +\n \"\\n * Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\n * Release Date: \" + response.data.Released + \n \"\\n * Language(s): \" + response.data.Language + \n \"\\n * Production Location(s): \" + response.data.Country + \"\\n\" +\n \"\\n-----------------------------------------------------------------------------------------------------------------------------\\n\";\n \n // Appends the movie's information to the log.txt file \n fs.appendFileSync(\"log.txt\", movieSearch_log, (err) => {\n if (err) throw err;\n });\n })\n \n } else {\n // If input data is entered... run the following code \n axios.get(\"http://www.omdbapi.com/?t=\" + input + \"&apikey=trilogy\").then(function(response){\n // log(response.data); \n\n // Stores data from the omdb API - this variable will appear in the terminal\n var movieSearch = \n title_3(\"\\n -\") + titleCommand(\"| MOVIE-THIS |\") + title_3(\"-----------------------------------------------------------------------------------------------------------\\n\") +\n title_3(\"\\n * Movie Title: \") + bodyText(response.data.Title) +\n title_3(\"\\n * Plot: \") + bodyText(response.data.Plot) + \n title_3(\"\\n\" + \"\\n * Actors: \") + bodyText(response.data.Actors) + \n title_3(\"\\n * IMDB Rating: \") + bodyText(response.data.imdbRating) +\n title_3(\"\\n * Rotten Tomatoes Rating: \") + bodyText(response.data.Ratings[1].Value) +\n title_3(\"\\n * Release Date: \") + bodyText(response.data.Released) + \n title_3(\"\\n * Language(s): \") + bodyText(response.data.Language) + \n title_3(\"\\n * Production Location(s): \") + bodyText(response.data.Country) + \"\\n\" + \n title_3(\"\\n---------------------------------------------------------------------------------------------------------------------------\\n\");\n \n // Stores data from the omdb API - this variable will appear in the lox.txt file\n var movieSearch_log = \n \"\\n -| MOVIE-THIS |-------------------------------------------------------------------------------------------------------------\\n\" +\n \"\\n * Movie Title: \" + response.data.Title +\n \"\\n * Plot: \" + response.data.Plot + \n \"\\n\" + \"\\n * Actors: \" + response.data.Actors + \n \"\\n * IMDB Rating: \" + response.data.imdbRating +\n \"\\n * Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\n * Release Date: \" + response.data.Released + \n \"\\n * Language(s): \" + response.data.Language + \n \"\\n * Production Location(s): \" + response.data.Country + \"\\n\" + \n \"\\n-----------------------------------------------------------------------------------------------------------------------------\\n\";\n \n // Logs and separates the movie data colorfully with Chalk\n log(wrapAnsi(movieSearch, 124));\n\n // Appends the movie's information to the log.txt file \n fs.appendFileSync(\"log.txt\", movieSearch_log, (err) => {\n // throws an error, you could also catch it here\n if (err) throw err;\n \n });\n\n })\n\n .catch(function(err) {\n log(err);\n });\n \n } \n }", "function searchMovies() {\n\n\n //TITLE DISCERNMENT\n\n // Store all of the arguments in an array\n var movieArgs = process.argv;\n // Create an empty variable for holding the movie name\n var movieName = \"\";\n\n // Loop through all words from movie args\n // For-Loop Magic for handlings inclusion of \"+\"s\n for (var i = 3; i < movieArgs.length; i++) {\n if (i > 3 && i < movieArgs.length) {\n movieName = movieName + \"+\" + movieArgs[i];\n }\n else {\n movieName += movieArgs[i];\n }\n }\n\n // Run Request with Axios to OMDB API\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n // Debugging Help\n console.log(\"Extracted from: \" + queryUrl);\n\n axios.get(queryUrl).then(\n function(response) {\n console.log(\"Movie Title: \" + response.data.Title); \n console.log(\"Production: \" + response.data.Production);\n console.log(\"Release Year: \" + response.data.Year);\n console.log(\"Rating: \" + response.data.imdbRating);\n console.log(\"Writer: \" + response.data.Writer);\n console.log(\"Director: \" + response.data.Director);\n console.log(\"Actors: \" + response.data.Actors);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Awards: \" + response.data.Awards);\n console.log(\"Website: \" + response.data.Website);\n }\n );\n\n\n // CREATE movie.txt if non-existant and ADD movie title. \"\\r\\n\" Places the Content on a New Line\n fs.appendFile(\"movies.txt\", movieName + \"\\r\\n\", function(err) {\n // log errors\n if (err) {\n console.log(err);\n }\n else {\n console.log(\"Title added to movies.txt! :D \\r\\n---------\");\n }\n });\n\n}", "function fetchMovie(e){\n e.preventDefault();\n \n const searchText = document.querySelector('#search-text').value;\n searchText.replace(' ','+');\n const fetchUrl =`http://www.omdbapi.com/?i=tt3896198&apikey=3f6a0e17&s=${searchText}&type=movie&page=1`;\n\n axios.get(fetchUrl)\n .then(response => {\n var ms = response.data;\n if(ms.Response){\n showMovie(ms.Search);\n }else{\n alert(\"error\")\n }\n })\n .catch(error => {\n console.log(error);\n });\n}", "function movieThis() {\n if (input === undefined) {\n input = \"Mr.Nobody\"\n console.log(\"******************\");\n fs.appendFile(\"log.txt\", \"************\\n\");\n console.log(\"If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\");\n fs.appendFile(\"log.txt\", \"If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\\n\");\n console.log(\"It's on Netflix\");\n fs.appendFile(\"log.txt\", \"Its on Netflix\\n\")\n }\n\n axios.get(\"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=trilogy\").then(\n function (response) {\n // console.log(response.data.Ratings[1].Value);\n \n console.log(\"\\n\" + \"----Movie -----\" + \"\\n\");\n fs.appendFile(\"log.txt\", +\"\\n\" + \"----OMDB Movie -----\" + \"\\n\"+ \"\\n\");\n console.log(\"Title: \" + response.data.Title);\n fs.appendFile(\"log.txt\", \"Title: \" + response.data.Title + \"\\n\");\n console.log(\"Year: \" + response.data.Year);\n fs.appendFile(\"log.txt\", \" Year: \" + response.data.Year + \"\\n\");\n console.log(\"IMDB Rating : \" + response.data.Ratings[0].Value);\n fs.appendFile(\"log.txt\", \" IMDB Rating: \" + response.data.Ratings[0].Value + \"\\n\");\n console.log(\"Rotten Tomato Rating : \" + response.data.Ratings[1].Value);\n fs.appendFile(\"log.txt\", \" Rotten Tomato Rating: \" + response.data.Ratings[1].Value + \"\\n\");\n console.log(\"Country: \" + response.data.Country);\n fs.appendFile(\"log.txt\", \" Country: \" + response.data.Country + \"\\n\");\n console.log(\"Language: \" + response.data.Language);\n fs.appendFile(\"log.txt\", \" Language: \" + response.data.Language + \"\\n\");\n console.log(\"Plot: \" + response.data.Plot);\n fs.appendFile(\"log.txt\", \" Plot: \" + response.data.Plot + \"\\n\");\n console.log(\"Actors: \" + response.data.Actors);\n fs.appendFile(\"log.txt\", \" Actors: \" + response.data.Actors + \"\\n\");\n }\n\n )\n .catch(function (error) {\n if (error.response) {\n // The request was made and the server responded with a status code\n // that falls out of the range of 2xx\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else if (error.request) {\n // The request was made but no response was received\n // `error.request` is an object that comes back with details pertaining to the error that occurred.\n console.log(error.request);\n } else {\n // Something happened in setting up the request that triggered an Error\n console.log(\"Error\", error.message);\n }\n console.log(error.config);\n });\n\n}", "function movieThis() {\n // If no movie is entered, it will default to 'Mr Nobody'\n if (!liriSearchTerm) {\n var movieTitle = \"Mr Nobody\";\n }\n else {\n var movieTitle = liriSearchTerm;\n }\n // create the query for the omdb request\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=trilogy\";\n // console.log(queryUrl);\n // Using axios to send the request and retieve the response \n axios.get(queryUrl).then(async function (response) {\n // console.log (response.data);\n var jsonData = response.data;\n // console.log(jsonData);\n // This code checks if the movie has a rotten tomatoe rating and either saves the rating, or responds no rating is available\n var rottenRatings;\n var rottenIndex = await _.find(jsonData.Ratings, function (rating) {\n return rating.Source === \"Rotten Tomatoes\"\n })\n // console.log (\"index\", rottenIndex);\n if (rottenIndex) {\n // console.log(\"Rotten Tomatoes Rating: \" + rottenIndex.Value);\n rottenRatings = rottenIndex.Value;\n }\n else {\n rottenRatings = \"This movie does not have a Rottern Tomatoes Rating\";\n }\n\n // Creating an array to hold the data that we are interested in \n var movieData = [\n \"Title: \" + jsonData.Title,\n \"Release Date: \" + jsonData.Released,\n \"IMDB Rating: \" + jsonData.imdbRating,\n \"Rotten Tomatoes Rating: \" + rottenRatings,\n \"Country produced in: \" + jsonData.Country,\n \"Language produced in: \" + jsonData.Language,\n \"Movie plot: \" + jsonData.Plot,\n \"Actors: \" + jsonData.Actors\n ].join(\"\\n\");\n\n // Write the data to the terminal\n console.log(movieData);\n // Write the data to the log.txt file \n updateLogFile(movieData);\n })\n}", "function movieSearch(userInput) {\n if(!userInput) {\n userInput = `Mr.+Nobody`;\n console.log(`Can't think of a movie to search for, huh? Here's one you might like!\n `);\n }\n\n let movieUrl = `http://www.omdbapi.com/?t=${userInput}&y=&plot=short&apikey=trilogy`;\n\n axios.get(movieUrl).then(\n function(response) {\n console.log(`Title: ${response.data.Title}`);\n console.log(`Year: ${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: ${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 let exportMovie = (`movie-this / Title: ${response.data.Title} / Year: ${response.data.Year} / Plot: ${response.data.Plot},\n `)\n // Exports command and response to log.txt\n fs.appendFile('log.txt', exportMovie, function(err) {\n if(err) {\n console.log(err);\n }\n else {\n console.log(`\n Movie information added to search log!`);\n }\n })\n }\n ).catch(function (error) {\n console.log(error);\n });\n} // ends movieSearch function", "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}", "async function getMovieByTitle(title) {\n const apiKey = process.env.TMDB_API_KEY;\n const movie = await axios.get(\"https://api.themoviedb.org/3/search/movie?api_key=\" + apiKey + \"&query=\" + title)\n .then((movieResponse) => {\n return movieResponse;\n })\n .catch((error) => {\n console.log(error);\n });\n\n return movie;\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 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}", "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 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 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 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 fetchMovie() {\n axi.get(\"/api/v1\").then(r => setMovie(r.data.movie));\n }", "async fetchFilmById() {\n try {\n const response = await axios.get(\n `${BASE_URL}movie/${this.movieId}?${API_KEY}&language=en-US`,\n );\n return response.data;\n } catch (error) {\n return error;\n }\n }", "function getMovie(userInput) {\r\n//If no movie name is specified on the command line, then show the movie info for the movie, Mr. Nobody.\r\nif (!userInput) {\r\n //If no movie is specified... Mr. Nobody.\r\n userInput = \"Mr Nobody\";\r\n console.log(\"If you haven't watched Mr. Nobody, then you should: http://www.imdb.com/title/tt0485947/\");\r\n console.log(\"It's on Netflix!\")\r\n}\r\n request(\"http://www.omdbapi.com/?t=\" + userInput + \"&y=&plot=short&apikey=trilogy\", function (error, response, body) {\r\n if (!error && response.statusCode === 200) {\r\n var body = JSON.parse(body);\r\n //console.log(body);\r\n var movieResults =\r\n \"________________________________________________\" + \"\\r\\n\" +\r\n //Output the artist\r\n \"Movie Title: \" + body.Title + \"\\r\\n\" +\r\n //Output the song's name.\r\n \"Release Date: \" + body.Year + \"\\r\\n\" +\r\n //Output a preview link of the song from Spotify.\r\n \"IMDB Rating: \" + body.imbdRating + \"\\r\\n\" +\r\n //Output the album that the song is from.\r\n \"Rotten Tomatoes Rating: \" + body.Ratings[1].Value + \"\\r\\n\" +\r\n \"Country: \" + body.Country + \"\\r\\n\" +\r\n \"Language: \" + body.Language + \"\\r\\n\" +\r\n \"Plot: \" + body.Plot + \"\\r\\n\" +\r\n \"Actors: \" + body.Actors + \"\\r\\n\" +\r\n \"________________________________________________\";\r\n //Display song info in the terminal.\r\n console.log(movieResults);\r\n\r\n logData(movieResults);\r\n\r\n\r\n } else {\r\n return console.log(error)\r\n\r\n }\r\n\r\n\r\n });\r\n}", "function searchMovie(search){\n\tvar request = require('request');\n\trequest('http://www.omdbapi.com/?apikey=40e9cece&t='+search, function (error, response, body) {\n\t\tvar movie = JSON.parse(body); \n\t \t\n\t\tif(error){\n\t \t\tconsole.log('error:', error); \n\t \t\tlog('error:', error);\n\t \t}\n\t \tif(movie.Title == null){\n\t \t\tconsole.log(\"If you haven't watched 'Mr. Nobody', then you should: http://www.imdb.com/title/tt0485947/\" );\n\t \t\tconsole.log(\"It's on Netflix!\")\n\t \t\tlog(\"If you haven't watched 'Mr. Nobody', then you should: http://www.imdb.com/title/tt0485947/\" );\n\t \t\tlog(\"It's on Netflix!\");\n\t \t}else{\n\t\t\tconsole.log(\"Title of the Movie: \" + movie.Title )\n\t\t\tconsole.log(\"Year the movie came out: \" + movie.Year)\n\t\t\tconsole.log(\"IMDB Rating of the movie: \" + movie.imdbRating)\n\t\t\tconsole.log(\"Country where the movie was produced: \" + movie.Country)\n\t\t\tconsole.log(\"Language of the Movie: \" + movie.Language)\n\t\t\tconsole.log(\"Plot of the movie: \" + movie.Plot)\n\t\t\tconsole.log(\"Actors in the movie: \" + movie.Actors)\n\t\t\tconsole.log(\"Rotten Tomatoes URL\" + movie.Website)\n\n\t\t\tlog(\"Title of the Movie: \" + movie.Title )\n\t\t\tlog(\"Year the movie came out: \" + movie.Year)\n\t\t\tlog(\"IMDB Rating of the movie: \" + movie.imdbRating)\n\t\t\tlog(\"Country where the movie was produced: \" + movie.Country)\n\t\t\tlog(\"Language of the Movie: \" + movie.Language)\n\t\t\tlog(\"Plot of the movie: \" + movie.Plot)\n\t\t\tlog(\"Actors in the movie: \" + movie.Actors)\n\t\t\tlog(\"Rotten Tomatoes URL\" + movie.Website)\n\t\t}\n\t});\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 showMovieInfo(userInputs) {\n //if no userinput given for movie info, defaults to movie Mr. Nobody \n if (userInputs === \"\") {\n userInputs = \"Mr. Nobody\"\n };\n console.log(userInputs);\n var queryUrl = \"http://www.omdbapi.com/?t=\" + userInputs + \"&y=&plot=short&apikey=trilogy\";\n //axios call to OMDB for movie info\n axios.get(queryUrl).then(\n function (response, err) {\n if (err) {\n console.log(\"error\");\n return;\n }\n\n // console.log(response);\n // Prints out movie info\n console.log(\"Title: \" + response.data.Title);\n console.log(\"The movie's rating is: \" + response.data.imdbRating);\n console.log(\"Year released: \" + response.data.Year);\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(\"Actors: \" + response.data.Actors);\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 movieThis(term) {\n\n console.log(\"Running movie-this...\");\n\n if (process.argv[3]) { \n var movieName = process.argv.slice(3).join(\" \");\n }\n else if (term) {\n var movieName = term;\n }\n else {\n var movieName = \"Mr. Nobody\";\n }\n\n var movieUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n // Runs a request with axios to the OMDB API with the movie specified\n axios.get(movieUrl).then(\n function(response) {\n console.log(\"\\n\" + \"Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Released);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\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(\"Actors: \" + response.data.Actors + \"\\n\");\n }\n );\n}", "function movieThis(movie){\n var omdbQuery = 'http://www.omdbapi.com/?apikey='+ omdb + '&t=';\n axios.get(omdbQuery + movie)\n .then(function (response) {\n var movieSearch = response.data;\n console.log(\n \"\\n-----------------------\\n\" +\n \"Title: \" + movieSearch.Title + \"\\n\" +\n \"Director: \" + movieSearch.Director + \"\\n\" +\n \"Actors: \" + movieSearch.Actors + \"\\n\" +\n \"Rating: \" + movieSearch.Rated + \"\\n\" +\n \"IMDB Rating: \" + movieSearch.Ratings[0].Value + \"\\n\" +\n \"Rotten Tomatoes Rating: \" + movieSearch.Ratings[1].Value + \"\\n\" +\n \"Language: \" + movieSearch.Language + \"\\n\" +\n \"Release Date: \" + movieSearch.Released + \"\\n\" +\n \"Synopsis: \" + movieSearch.Plot + \n \"\\n-----------------------\\n\" \n );\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"Is this the movie you were looking for?\",\n name: \"movie_check\"\n }\n ]).then(function(answer){\n if(!answer.movie_check){\n console.log(\"\\n----------------\\n\\n\")\n omdbCommand();\n } else {\n anythingElse()\n }\n })\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 movie_this(){\n \n\n // console.log(\"movie_this works\")\n Axios.get(`http://www.omdbapi.com/?t=${input}&y=&plot=short&apikey=trilogy`)\n .then(function(response){\n // console.log(response.data);\n\n //console.log required 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.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 console.log(\"__________________________\")\n })\n //set blank input to mr. nobody\n // if(input = \"\"){\n // input === \"mr nobody\"\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 getMovieDetails(){\n \n var idF = sessionStorage.getItem('movieId');\n console.log(idF);\n\n axios.request({\n method: 'GET',\n url: 'https://imdb8.p.rapidapi.com/title/get-overview-details',\n params: {tconst:idF, currentCountry: 'US'},\n headers: {\n 'x-rapidapi-key': '3d1de671d0mshcd7c4f21da3d565p194067jsn03cba614409e',\n 'x-rapidapi-host': 'imdb8.p.rapidapi.com'}\n })\n\n .then(function (response) {\n console.log(response.data);\n\n var movie = response.data;\n var output = '';\n\n output += `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"${movie.title.image.url}\" class=\"thumbnail\">\n </div>\n <div class=\"col-md-8\">\n <h2>${movie.title.title}</h2>\n <ul class=\"list-group\">\n <li class=\"list-group-item\"><strong>Genres:</strong> ${movie.genres}</li>\n <li class=\"list-group-item\"><strong>Realeased:</strong> ${movie.title.year}</li>\n <li class=\"list-group-item\"><strong>IMDB Rating:</strong> ${movie.ratings.rating}</li>\n <h2></h2>\n <li class=\"list-group-item\"><strong>Plot:</strong> ${movie.plotOutline.text}</li>\n <a href=\"dailyMovie.html\" class=\"btn btn-primary\">Go back</a>\n </ul>\n </div>\n </div>\n`;\n\n$('#movies').html(output);\n\n})\n.catch(function (error) {\n console.error(error);\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 movieThis(){\n if (process.argv.length > 3){\n movieName = \"\";\n for (var i = 3; i < process.argv.length; i++){\n movieName += process.argv[i] + \"+\";\n }\n }\n\n request(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=40e9cece\", function(error, response, body) {\n // Check for error from API call\n if (!error && response.statusCode === 200) {\n // Check to see if the movie input was found\n if(JSON.parse(body).Response === \"False\"){\n console.log(JSON.parse(body).Error);\n }\n // Check to see if any of the individual data elements return 'undefined'\n else if (typeof JSON.parse(body).Title === \"undefined\" || typeof JSON.parse(body).Year === \"undefined\" || typeof JSON.parse(body).Ratings[0] === \"undefined\" || typeof JSON.parse(body).Ratings[1] === \"undefined\" || typeof JSON.parse(body).Country === \"undefined\" || typeof JSON.parse(body).Language === \"undefined\" || typeof JSON.parse(body).Plot === \"undefined\" || typeof JSON.parse(body).Actors === \"undefined\") {\n console.log(\"Sorry, missing information on that title\");\n }\n else {\n console.log(\"Movie Title: \" + JSON.parse(body).Title + \"\\nYear: \" + JSON.parse(body).Year + \"\\nIMDB Rating: \" + JSON.parse(body).Ratings[0].Value + \"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value + \"\\nMade in: \" + JSON.parse(body).Country + \"\\nLanguage: \" + JSON.parse(body).Language + \"\\nPlot: \" + JSON.parse(body).Plot + \"\\nActors: \" + JSON.parse(body).Actors);\n }\n }\n fs.appendFile(\"./log.txt\", \"\\n\" + new Date().toISOString().replace('T', ' ').substr(0, 19) + \" ==> Looked up the movie '\" + movieName + \"' on OMDB\\n--------------------------------------------------------------------\", function(err){\n if(err){\n throw err;\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 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 getOMDB(movie) {\n if(!movie){\n movie=\"Mr Nobody\"\n }\n\n var OmdbUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios.get(OmdbUrl).then(function (response) {\n //console.log(response.data); \n console.log(\"==================================================\")\n console.log(\"Movie Title: \" + response.data.Title + \"\\r\\n\")\n console.log(\"Year Released: \" + response.data.Year + \"\\r\\n\")\n console.log(\"IMDB Rating: \" + response.data.imdbRating + \"\\r\\n\")\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value + \"\\r\\n\")\n console.log(\"Country Where Produced: \" + response.data.Country + \"\\r\\n\")\n console.log(\"Language: \" + response.data.Language + \"\\r\\n\")\n console.log(\"Plot: \" + response.data.Plot + \"\\r\\n\")\n console.log(\"Actors: \" + response.data.Actors + \"\\r\\n\")\n //Appends the search results to a text file name \"log\"\n var logMovie = (\"***** OMDB Entry *****\" + \n \"\\nMovie - \" + response.data.Title +\n \"\\nReleased: \" + response.data.Year+ \n \"\\nRating: \" + response.data.imdbRating +\n \"\\nRotten Tomatoes Rating: \" + response.data.Ratings[1].Value +\n \"\\nCountry Where Produced: \" + response.data.Country +\n \"\\nLanguage: \" + response.data.Language+ \n \"\\nPlot: \" + response.data.Plot +\n \"\\nActors: \" + response.data.Actors +\"\\n\" +\"\\r\\n\")\n\n fs.appendFile(\"log.txt\", logMovie, function (err){\n if(err) throw err\n});\n\n })\n}", "async function getMovies(searchText){\n //console.log(searchText);\n await fetch(`https://www.omdbapi.com?s=`+searchText+'&apikey=9a7c1c71')\n .then(Response => Response.json())\n .then(data => {\n console.log(data);//logging as one data\n\n /*If the movie is not found ,display an error message*/ \n if (data.Error == \"Movie not found!\"){\n $(\"#search_result\").append(`\n <div class=\"not_found\">\n <p>Search results for <span class=\"not-found-alert\">${searchText}</span> not found</p>\n <p>Please enter another title</p>\n </div>`) \n }\n \n /*Retrieve the results*/\n var movies = data.Search;\n console.log(movies);\n let styleName = \"\"; \n\n /*Loop throught the mvoies information retrieved to extract specific data*/\n for(var i = 0; i < movies.length; i++) {\n var obj = movies[i];//Individual datas extracted from the nested portion\n\n if (obj.Poster == \"N/A\"){\n obj.Poster = \"images/not-found-image.jpg\";\n styleName = \"na\";\n }\n //logging object titles\n console.log(obj.Title);\n var id = obj.imdbID;\n var votes = obj.imdbVotes;\n //Append the results into the search results div to display to the user \n $(\"#search_result\").append(`\n <div class='movie-card'>\n <img class=\"${styleName}\" src =\"${obj.Poster}\"></img>\\\n <h5>${obj.Title}</h5>\n <button id=\"${id}\" class=\"movie-card-btn\" onclick=\"getInfo(this.id)\">Learn More</button>\n </div>`) \n }\n })\n}", "function movieFun(movieSel) {\n axios.get('http://www.omdbapi.com/?t=' + movieSel + '&apikey=' + omdbKey).then(\n function (response) {\n let omdbResponse = response.data;\n let realMoviecheck = response.data.Response;\n // console.log(realMoviecheck);\n // console.log(response.data);\n let movieData;\n if (realMoviecheck === 'True'){\n movieData = [\n 'title: ' + omdbResponse.Title,\n 'year: ' + omdbResponse.Year,\n 'imdb rating: ' + omdbResponse.imdbRating,\n 'rotten tomatoes: ' +omdbResponse.Ratings[1].Value,\n 'country: ' + omdbResponse.Country,\n 'language: ' + omdbResponse.Language,\n 'plot: ' + omdbResponse.Plot,\n 'actors: ' + omdbResponse.Actors,\n ];\n } else {\n console.log(\"We couldn't find that movie, but here's some information on Mr. Nobody.\");\n movieData = [\n 'title: ' +'Mr. Nobody',\n 'year: ' + '2009',\n 'imdb rating: ' + '7.8',\n 'rotten tomatoes: ' + '67%',\n 'country: ' + 'Belgium, Germany, Canada, France, USA, UK',\n 'language: ' + 'English, Mohawk',\n 'plot: ' + \"A boy stands on a station platform as a train is about to leave. Should he go with his mother or stay with his father? Infinite possibilities arise from this decision. As long as he doesn't choose, anything is possible.\",\n 'actors: ' + 'Jared Leto, Sarah Polley, Diane Kruger, Linh Dan Pham',\n ];\n }\n console.log(movieData);\n fs.appendFileSync('log.txt', movieData + '\\n', function (err) {\n if (err) throw err;\n console.log('Error adding to log.txt file' + err);\n });\n }).catch(function (error) {\n console.log(\"Error\", error.message);\n })\n}", "function movieSearch(searchTerms) {\n \n // In case no movie is searched, search for Mr. Nobody\n if (searchTerms === \"\") {\n queryURL = \"http://www.omdbapi.com/?t=\" + \"Mr.Nobody\" + \"&y=&plot=short&apikey=trilogy\"\n } else {\n queryURL = \"http://www.omdbapi.com/?t=\" + searchTerms + \"&y=&plot=short&apikey=trilogy\"\n };\n\n // OMDB API request via axios\n axios.get(queryURL).then(function(response) {\n console.log(\"\\n------------------OMDB Info------------------\");\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Rated: \" + response.data.Rated);\n console.log(\"Runtime: \" + response.data.Runtime);\n console.log(\"Released on: \" + response.data.Released)\n console.log(\"Director: \" + response.data.Director);\n console.log(\"Starring: \" + response.data.Actors);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language(s): \" + response.data.Language);\n console.log(\"IMDB score: \" + response.data.imdbRating);\n console.log(\"Rotten Tomatoes: \" + response.data.Ratings[1].Value);\n console.log(\" * * * * * * * * * * * * * * * *\")\n console.log(response.data.Plot);\n console.log(\" * * * * * * * * * * * * * * * *\");\n console.log(\"------------------------------------------------\");\n\n // Log query to txt file\n let text = \"\\r\\nmovie-search,\" + '\"' + searchTerms + '\";';\n fs.appendFile(\"savedsearches.txt\", text, function (err) {\n if (err) {\n console.log(\"Search not saved to .txt file\");\n console.log(err);\n };\n });\n\n searchAgain();\n }).catch(function(error) {\n if (error.response) {\n // The request was made and the server responded with a status code that falls out of the range of 2xx\n console.log(\"---------------Data---------------\");\n console.log(error.response.data);\n console.log(\"---------------Status---------------\");\n console.log(error.response.status);\n console.log(\"---------------Status---------------\");\n console.log(error.response.headers);\n } else if (error.request) {\n // If the request was made but no response was received\n console.log(error.request);\n } else {\n // Something happened in setting up the request that triggered an Error\n console.log(\"Error\", error.message);\n }\n console.log(error.config);\n searchAgain();\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 movieSearch() {\n //asks user for movie title\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"Ok, well tell me the movie then...\",\n name: \"movie\"\n },\n ])\n .then(function (inquirerResponse) {\n //checks if user entered a movie, if not it defaults to Mr Nobody\n if (inquirerResponse.movie) {\n movie = inquirerResponse.movie;\n }\n else {\n movie = \"Mr. Nobody\";\n console.log(\"If you haven't seen Mr. Nobody, you should. Its on Netflix\")\n }\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=\" + omdbKey)\n .then(\n function (response) {\n\n var movieData = [`\n Title: ${response.data.Title} \n IMDB rating: ${response.data.Ratings[0].Value} \n Rotten Tomatoes rating: ${response.data.Ratings[1].Value} \n Country Produced: ${response.data.Country} \n Language: ${response.data.Language} \n Plot: ${response.data.Plot} \n Actors: ${response.data.Actors} \n `].join(\"/n/r\")\n\n console.log(movieData);\n\n\n logSearches(movieData);\n \n askQuestion();\n }\n );\n }).catch(function (error) {\n console.error(\"there was an error: \" + 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}", "async fetchMovies(ctx, search) {\n let result = [];\n await axios\n .get(\n \"http://www.omdbapi.com/?apiKey=\" + key.key + \"&s=\" + search + \"&page=1\"\n )\n .then(response => {\n result = response.data.Search;\n });\n ctx.commit(\"setSearchResult\", result);\n if(result == undefined) {\n ctx.commit('setSearchResponse', false);\n }\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 action(movieName) {\n if (movieName === \"\") {\n movieName = \"Mr Nobody\"\n }\n var queryUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(queryUrl)\n .then(function(response) {\n console.log(\n `\n Title: ${response.data.Title}\n Release Year: ${response.data.Year}\n IMDB Ratings: ${response.data.imdbRating}\n Rotten Tomatoes Ratings: ${response.data.Ratings[1].Value}\n Country produced: ${response.data.Country}\n Lanuage: ${response.data.Language}\n Plot: ${response.data.Plot}\n Actors: ${response.data.Actors}\n `\n );\n \n })\n .catch(function(error) {\n console.log(error);\n });\n}", "function movieThis(action){\n var movie = value;\n if (!movie) {\n console.log(\"If you haven't watched 'Parasite' then you should!\".yellow)\n movie = \"Parasite\"\n }\n var url = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n axios.get(url).then(\n function (response) {\n // console.log(response.data)\n console.log(\"======================================================\\n\".rainbow)\n console.log(\"Movie Title: \".red + response.data.Title);\n console.log(\"Year: \".red + response.data.Year);\n console.log(\"IMDB Rating: \".red + response.data.imdbRating);\n console.log(\"Rotten Tomatoes: \".red + response.data.Ratings[1].Value);\n console.log(\"Country: \".red + response.data.Country);\n console.log(\"Language: \".red + response.data.Language);\n console.log(\"Plot: \".red + response.data.Plot);\n console.log(\"Actors: \".red + response.data.Actors);\n console.log(\"======================================================\\n\".rainbow)\n \n //adds text to log.txt\n fs.appendFileSync('log.txt', \"\\r\\n\" + \"MOVIE LOG----------------------\" + \"\\r\\n\", 'utf8');\n fs.appendFileSync('log.txt', \"\\r\\n\" + \"Year: \" + response.data.Year + \"\\r\\n\", 'utf8');\n fs.appendFileSync('log.txt', \"\\r\\n\" + \"IMDB Rating: \" + response.data.imdbRating + \"\\r\\n\", 'utf8');\n fs.appendFileSync('log.txt', \"\\r\\n\" + \"Rotten Tomatoes: \" + response.data.Ratings[1].Value + \"\\r\\n\", 'utf8');\n fs.appendFileSync('log.txt', \"\\r\\n\" + \"Country: \" + response.data.Country + \"\\r\\n\", 'utf8'); \n fs.appendFileSync('log.txt', \"\\r\\n\" + \"Language: \" + response.data.Language + \"\\r\\n\", 'utf8'); \n fs.appendFileSync('log.txt', \"\\r\\n\" + \"Plot: \" + response.data.Plot + \"\\r\\n\", 'utf8'); \n fs.appendFileSync('log.txt', \"\\r\\n\" + \"Year: \" + response.data.Year + \"\\r\\n\", 'utf8'); \n fs.appendFileSync('log.txt', \"\\r\\n\" + \"Actors: \" + response.data.Actors + \"\\r\\n\", 'utf8');\n fs.appendFileSync('log.txt', \"\\r\\n\" + \"-----------------------------------------\"+ \"\\r\\n\", 'utf8');\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(){\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 findSong(){\r\n\"https://rest.bandsintown.com/artists/\" + artist + \"/events?app_id=codingbootcamp\"\r\n\r\n\r\n\r\n// query \r\n\r\n\r\n// axios call\r\n \r\n// get the info and\r\n\r\n// console log \r\n\r\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 OMDBquery(movie) {\n console.log(\"searching for movie: \" + movie);\n const queryURL =\n \"https://www.omdbapi.com/?t=\" + movie + \"=&plot=short&apikey=trilogy\";\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function (response) {\n handleMovieResponse(response);\n })\n .catch(function (error) {\n // error case\n let message = `${movie} was not found in OMDB`;\n updateErrorDiv(message);\n });\n}", "function searchOMDb() {\n // vars to build url string for axios:\n var movieTitle = \"\";\n var OMDBkey = keys.omdb.key; //key stored in gitignored .env file, ref'd thru keys.js\n\n /* if nothing is entered after the 'movie-this' command, Jaco Van Dormael's criminally-underrated \n surrealist sci-fi masterpiece 'Mr. Nobody' will be assigned to the movieTitle var by default */\n if (input[1] === undefined) {\n movieTitle = \"Mr. Nobody\";\n } else {\n movieTitle = input.slice(1).join(\" \"); //otherwise the title will be built by joining the rest of the inputs into a string with each item separated by a space\n }\n\n //axios request:\n axios.get(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=\" + OMDBkey).then(\n function(response) { \n \n if (response.data.Title === undefined) { //checks if first item in the return array(in this case, 'Title', is undefined; defaults out with a message if so)\n console.log(movieBumpers);\n console.log(\"Sorry, I don't know that movie! Have you tried the Lost Films subreddit @ https://www.reddit.com/r/Lost_Films/ ?\");\n console.log(movieBumpers);\n return;\n }\n\n //successful query returns block of console logs with strings formatted for readability(in the terminal, anyway)\n console.log(movieBumpers);\n console.log(beginBold + \"Title: \" + endBold + response.data.Title);\n console.log(beginBold + \"Release year: \" + endBold + response.data.Year);\n console.log(beginBold + \"IMDb user rating(out of 10): \" + endBold + response.data.imdbRating);\n console.log(beginBold + \"RottenTomatoes score(out of 100%): \" + endBold + response.data.Ratings[1].Value); //<- well this one took a lot of trial and error to figure out how to reference....\n console.log(beginBold + \"Country of production: \" + endBold + response.data.Country);\n console.log(beginBold + \"Language: \" + endBold + response.data.Language);\n console.log(beginBold + \"Plot synopsis: \" + endBold + response.data.Plot);\n console.log(beginBold + \"Starring: \" + endBold + response.data.Actors);\n console.log(movieBumpers);\n\n logFile(\"\\nOMDb search returned: \" + response.data.Title + \", \" + response.data.Year); //pass some of the data as an argument to logFile function which will add it to log.txt\n }\n );\n}" ]
[ "0.76526517", "0.7547257", "0.75171465", "0.75153077", "0.75013703", "0.7499233", "0.7487267", "0.748239", "0.7439715", "0.7402306", "0.73898107", "0.7370455", "0.73536515", "0.7351585", "0.73444146", "0.7344135", "0.7297138", "0.7267268", "0.7261334", "0.7257096", "0.72492594", "0.7235993", "0.72335637", "0.7227003", "0.7222519", "0.7205323", "0.7204941", "0.7164496", "0.7157313", "0.71547365", "0.714059", "0.7129439", "0.7104757", "0.70415103", "0.703938", "0.7037796", "0.7018973", "0.70107985", "0.7008144", "0.69920355", "0.69908386", "0.69866335", "0.6978315", "0.6954689", "0.695024", "0.694877", "0.6937076", "0.6923409", "0.6916247", "0.6912314", "0.69021004", "0.68838847", "0.68640476", "0.6856609", "0.68559164", "0.68546987", "0.6852682", "0.6820619", "0.6814704", "0.6813945", "0.68130404", "0.6795741", "0.67911106", "0.6777841", "0.6776314", "0.6770937", "0.6761566", "0.6757698", "0.6756558", "0.67552656", "0.6731824", "0.6726476", "0.6724508", "0.66960317", "0.66907364", "0.66872954", "0.6683596", "0.6667247", "0.6664077", "0.6652656", "0.6641899", "0.6636257", "0.66345096", "0.6633553", "0.6633057", "0.6631038", "0.6629689", "0.66285306", "0.6614435", "0.66062814", "0.65999335", "0.6597062", "0.6590607", "0.6590323", "0.657637", "0.657223", "0.6555217", "0.65551287", "0.655187", "0.6535493" ]
0.7241575
21
STLYE GRIDS BASED ON USER INPUT Commit Search Button Feature
function commitSearchFunction() { //Calculate Weights for 100km & 30km Grids var source_100km = grid100km.getSource(); var features_100km = source_100km.getFeatures(); var source_30km = grid30km.getSource(); var features_30km = source_30km.getFeatures(); var source_1km_fyn = grid1km_vectorimage_fyn.getSource(); var features_1km_fyn = source_1km_fyn.getFeatures(); var source_1km_hovestad = grid1km_vectorimage_hovestad.getSource(); var features_1km_hovestad = source_1km_hovestad.getFeatures(); var source_1km_midtjylland = grid1km_vectorimage_midtjylland.getSource(); var features_1km_midtjylland = source_1km_midtjylland.getFeatures(); var source_1km_midtjyllandw = grid1km_vectorimage_midtjyllandw.getSource(); var features_1km_midtjyllandw = source_1km_midtjyllandw.getFeatures(); var source_1km_sjælland = grid1km_vectorimage_sjælland.getSource(); var features_1km_sjælland = source_1km_sjælland.getFeatures(); var uni_matchmax = 0; var uni_matchmin = 0; var uni_matchdiff = 0; var cell_int_u = 0; var uni_match_perc = 0; var sch_matchmax = 0; var sch_matchmin = 0; var sch_matchdiff = 0; var cell_int_sch = 0; var sch_match_perc = 0; var coast_matchmax = 0; var coast_matchmin = 0; var coast_matchdiff = 0; var cell_int_coast = 0; var coast_match_perc; var hos_matchmax = 0; var hos_matchmin = 0; var hos_matchdiff = 0; var cell_int_hos = 0; var hos_match_perc = 0; var parks_matchmax = 0; var parks_matchmin = 0; var parks_matchdiff = 0; var cell_int_parks = 0; var parks_match_perc = 0; var roads_matchmax = 0; var roads_matchmin = 0; var roads_matchdiff = 0; var cell_int_roads = 0; var roads_match_perc = 0; var markets_matchmax = 0; var markets_matchmin = 0; var markets_matchdiff = 0; var cell_int_markets = 0; var markets_match_perc = 0; var house_match_perc = 0; var ptst_matchmax = 0; var ptst_matchmin = 0; var ptst_matchdiff = 0; var cell_int_ptst = 0; var ptst_match_perc = 0; var ptsta_matchmax = 0; var ptsta_matchmin = 0; var ptsta_matchdiff = 0; var cell_int_ptsta = 0; var ptsta_match_perc = 0; var resto_matchmax = 0; var resto_matchmin = 0; var resto_matchdiff = 0; var cell_int_resto = 0; var resto_match_perc = 0; var the_matchmax = 0; var the_matchmin = 0; var the_matchdiff = 0; var cell_int_the = 0; var the_match_perc = 0; var cin_matchmax = 0; var cin_matchmin = 0; var cin_matchdiff = 0; var cell_int_cin = 0; var cin_match_perc = 0; var kin_matchmax = 0; var kin_matchmin = 0; var kin_matchdiff = 0; var cell_int_kin = 0; var kin_match_perc = 0; var ind_matchmax = 0; var ind_matchmin = 0; var ind_matchdiff = 0; var cell_int_ind = 0; var ind_match_perc = 0; var wat_matchmax = 0; var wat_matchmin = 0; var wat_matchdiff = 0; var cell_int_wat = 0; var wat_match_perc = 0; var accessibility; var suitability; var livability; features_100km.forEach(function(feature ){ var grid100_id = feature.get("id"); // MATCH PERCENTAGE FOR UNIVERSITIES // When user input doesn't match cell range if ((feature.get("_univers_1")/1000) > parseInt(sliderUni.value)) { uni_matchmax = 0; uni_matchmin = 0; console.log(grid100_id + ": Cell min larger than Uni slider"); } else if (parseInt(sliderUni.value) == (feature.get("_univers_1")/1000)) { uni_matchmax = 0; uni_matchmin = 0; console.log (grid100_id + ": Cell min equal to Uni slider"); } // Getting the maximum matching distance value else if ((feature.get("_univers_2")/1000) == parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); console.log(grid100_id + ": Cell max equal to Uni slider: " + uni_matchmax); } else if ((feature.get("_univers_2")/1000) > parseInt(sliderUni.value)) { uni_matchmax = parseInt(sliderUni.value); console.log(grid100_id + ": Cell max greater than Uni slider: " + uni_matchmax); } else if ((feature.get("_univers_2")/1000) < parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); console.log(grid100_id + ": Cell max smaller than Uni slider: " + uni_matchmax); } // Getting the minimum matching distance value else if ((feature.get("_univers_1")/1000) == 0) { uni_matchmin = 0; console.log(grid100_id + ": Cell min equal to 0: " + uni_matchmin); } else if ((feature.get("_univers_1") /1000 > 0)) { uni_matchmin = (feature.get("_univers_1")/1000); console.log(grid100_id + ": Minimum user slider (0) smaller than cell min: " + uni_matchmin); } // MATCH PERCENTAGE FOR SCHOOLS // When user input doesn 't match cell range if ((feature.get("_schoolsmi")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = 0; sch_matchmin = 0; console.log(grid100_id + ": School min larger than slider"); } else if (parseInt(sliderSchools.value) == (feature.get("_schoolsmi")/1000)) { sch_matchmax = 0; sch_matchmin = 0; console.log(grid100_id + ": School min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_schoolsma")/1000) == parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); console.log(grid100_id + ": School max value equal to slider max"); } else if ((feature.get("_schoolsma")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = parseInt(sliderSchools.value); console.log(grid100_id + ": School max value greater than slider max"); } else if ((feature.get("_schoolsma")/1000) < parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); console.log(grid100_id + ": School max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_schoolsmi")/1000) == 0) { sch_matchmin = 0; console.log(grid100_id + ": School min value equal to 1"); } else if ((feature.get("_schoolsmi")/1000 > 0)) { sch_matchmin = (feature.get("_schoolsmi")/1000); console.log(grid100_id + ": School slider value smaller than min value"); } // MATCH PERCENTAGE FOR COASTLINE // When user input doesn 't match cell range if ((feature.get("_coastli_1")/1000) > parseInt(sliderCoasts.value)) { coast_matchmax = 0; coast_matchmin = 0; console.log(grid100_id + ": Coast min larger than slider max"); } else if (parseInt(sliderCoasts.value) == (feature.get("_coastli_1")/1000)) { coast_matchmax = 0; coast_matchmin = 0; console.log(grid100_id + ": Coast min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_coastli_2")/1000) == parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); console.log(grid100_id + ": Coast max value equal to slider max"); } else if ((feature.get("_coastli_2")/1000) > parseInt(sliderSchools.value)) { coast_matchmax = parseInt(sliderCoasts.value); console.log(grid100_id + ": Coast max value greater than slider max"); } else if ((feature.get("_coastli_2")/1000) < parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); console.log(grid100_id + ": Coast max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_coastli_1")/1000) == 0) { coast_matchmin = 0; console.log(grid100_id + ": Coast min value equal to 0"); } else if ((feature.get("_coastli_1")/1000 > 0)) { coast_matchmin = (feature.get("_coastli_1")/1000); console.log(grid100_id + ": Coast user slider smaller than cell value"); } // MATCH PERCENTAGE FOR HOSPITALS // When user input doesn 't match cell range if ((feature.get("_hospita_1")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = 0; hos_matchmin = 0; console.log(grid100_id + ": Hospital min value larger than slider max"); } else if (parseInt(sliderHospitals.value) == (feature.get("_hospita_1")/1000)) { hos_matchmax = 0; hos_matchmin = 0; console.log(grid100_id + ": Hospital min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_hospita_2")/1000) == parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); console.log(grid100_id + ": Hospital max value equal to slider max"); } else if ((feature.get("_hospita_2")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = parseInt(sliderHospitals.value); console.log(grid100_id + ": Hospital max value greater than slider max"); } else if ((feature.get("_hospita_2")/1000) < parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); console.log(grid100_id + ": Hospital max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_hospita_1")/1000) == 0) { hos_matchmin = 0; console.log(grid100_id + ": Hospital min value equal to 0"); } else if ((feature.get("_hospita_1")/1000 > 0)) { hos_matchmin = (feature.get("_hospita_1")/1000); console.log(grid100_id + ": Hospital slider value smaller than Cell min"); } // MATCH PERCENTAGE FOR LEISURE PARKS // When user input doesn 't match cell range if ((feature.get("_leisure_1")/1000) > parseInt(sliderParks.value)) { parks_matchmax = 0; parks_matchmin = 0; console.log(grid100_id + ": Parks min value larger than slider max"); } else if (parseInt(sliderParks.value) == (feature.get("_leisure_1") /1000)) { parks_matchmax = 0; parks_matchmin = 0; console.log(grid100_id + ": Parks min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_leisure_2")/1000) == parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); console.log(grid100_id + ": Parks max value equal to slider max"); } else if ((feature.get("_leisure_2")/1000) > parseInt(sliderParks.value)) { parks_matchmax = parseInt(sliderParks.value); console.log(grid100_id + ": Parks max value greater than slider max"); } else if ((feature.get("_leisure_2")/1000) < parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); console.log(grid100_id + ": Parks max value smaller than Parks slider max"); } // Getting the minimum matching distance value else if ((feature.get("_leisure_1")/1000) == 0) { parks_matchmin = 0; console.log(grid100_id + ":Parks min value equal to 0"); } else if ((feature.get("_leisure_1")/1000 > 0)) { parks_matchmin = (feature.get("_leisure_1")/1000); console.log(grid100_id + ": Parks slider value smaller than cell min "); } // MATCH PERCENTAGE FOR ROADS // When user input doesn 't match cell range if ((feature.get("_roadsmin")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = 0; roads_matchmin = 0; console.log(grid100_id + ": Roads min value larger than slider max"); } else if (parseInt(sliderRoads.value) == (feature.get("_roadsmin")/1000)) { roads_matchmax = 0; roads_matchmin = 0; console.log(grid100_id + ": Roads min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_roadsmax")/1000) == parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); console.log(grid100_id + ": Roads max value equal to slider max"); } else if ((feature.get("_roadsmax")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = parseInt(sliderRoads.value); console.log(grid100_id + ": Roads max value greater than slider max"); } else if ((feature.get("_roadsmax")/1000) < parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); console.log(grid100_id + ": Roads max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_roadsmin")/1000) == 0) { roads_matchmin = 0; console.log(grid100_id + ": Roads min value equal to 0"); } else if ((feature.get("_roadsmin")/1000 > 0)) { roads_matchmin = (feature.get("_roadsmin")/1000); console.log(grid100_id + ": Roads slider value smaller than cell min"); } // MATCH PERCENTAGE FOR SUPERMARKETS // When user input doesn 't match cell range if ((feature.get("_superma_1")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = 0; markets_matchmin = 0; console.log(grid100_id + ": Markets min value larger than slider max"); } else if (parseInt(sliderMarkets.value) == (feature.get("_superma_1")/1000)) { markets_matchmax = 0; markets_matchmin = 0; console.log(grid100_id + ": Markets min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_superma_2")/1000) == parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); console.log(grid100_id + ": Markets max value equal to slider max"); } else if ((feature.get("_superma_2")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = parseInt(sliderMarkets.value); console.log(grid100_id + ": Markets max value greater than slider max"); } else if ((feature.get("_superma_2")/1000) < parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); console.log(grid100_id + ": Market max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_superma_1")/1000) == 0) { markets_matchmin = 0; console.log(grid100_id + ": Markets min value equal to 1"); } else if ((feature.get("_superma_1")/1000 > 0)) { markets_matchmin = (feature.get("_superma_1")/1000); console.log(grid100_id + ": Markets slider value smaller than cell min"); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STOPS // When user input doesn't match cell range if ((feature.get("_pt_stop_1")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = 0; ptst_matchmin = 0; console.log(grid100_id + ": Cell min larger than PT stops slider"); } else if (parseInt(sliderPstops.value) == (feature.get("_pt_stop_1")/1000)) { ptst_matchmax = 0; ptst_matchmin = 0; console.log (grid100_id + ": Cell min equal to PT stops slider"); } // Getting the maximum matching distance value else if ((feature.get("_pt_stop_2")/1000) == parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); console.log(grid100_id + ": Cell max equal to PT stops slider"); } else if (( feature.get("_pt_stop_2")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = parseInt(sliderPstops.value); console.log(grid100_id + ": Cell max greater than PT stops slider"); } else if ((feature.get("_pt_stop_2")/1000) < parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); console.log(grid100_id + ": Cell max smaller than PT stops slider"); } // Getting the minimum matching distance value else if ((feature.get("_pt_stop_1")/1000) == 0) { ptst_matchmin = 0; console.log(grid100_id + ": Cell min equal to 0."); } else if ((feature.get("_pt_stop_1") /1000 > 0)) { ptst_matchmin = (feature.get("_pt_stop_1")/1000); console.log(grid100_id + ": Minimum user slider (0) smaller than cell min."); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STATIONS // When user input doesn't match cell range if ((feature.get("_pt_stat_1")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = 0; ptsta_matchmin = 0; console.log(grid100_id + ": Cell min larger than PT stations slider"); } else if (parseInt(sliderPstations.value) == (feature.get("_pt_stat_1")/1000)) { ptsta_matchmax = 0; ptsta_matchmin = 0; console.log (grid100_id + ": Cell min equal to PT stations slider"); } // Getting the maximum matching distance value else if ((feature.get("_pt_stat_2")/1000) == parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); console.log(grid100_id + ": Cell max equal to PT stations slider"); } else if (( feature.get("_pt_stat_2")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = parseInt(sliderPstations.value); console.log(grid100_id + ": Cell max greater than PT stations slider"); } else if ((feature.get("_pt_stations_2")/1000) < parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); console.log(grid100_id + ": Cell max smaller than PT stations slider"); } // Getting the minimum matching distance value else if ((feature.get("_pt_stat_1")/1000) == 0) { ptsta_matchmin = 0; console.log(grid100_id + ": Cell min equal to 0."); } else if ((feature.get("_pt_stat_1") /1000 > 0)) { ptsta_matchmin = (feature.get("_pt_stat_1")/1000); console.log(grid100_id + ": Minimum user slider (0) smaller than cell min."); } // MATCH PERCENTAGE FOR RESTAURANTS // When user input doesn 't match cell range if ((feature.get("_restaur_1")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = 0; resto_matchmin = 0; console.log(grid100_id + ": Resto min larger than slider max"); } else if (parseInt(sliderRestuarants.value) == (feature.get("_restaur_1")/1000)) { resto_matchmax = 0; resto_matchmin = 0; console.log(grid100_id + ": Resto min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_restaur_2")/1000) == parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); console.log(grid100_id + ": Resto max value equal to slider max"); } else if ((feature.get("_restaur_2")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = parseInt(sliderRestuarants.value); console.log(grid100_id + ": Resto max value greater than slider max"); } else if ((feature.get("_restaur_2")/1000) < parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); console.log(grid100_id + ": Resto max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_restaur_1")/1000) == 0) { resto_matchmin = 0; console.log(grid100_id + ": Resto min value equal to 0"); } else if ((feature.get("_restaur_1")/1000 > 0)) { resto_matchmin = (feature.get("_restaur_1")/1000); console.log(grid100_id + ": Resto user slider smaller than cell value"); } // MATCH PERCENTAGE FOR THEATRES // When user input doesn 't match cell range if ((feature.get("_theatre_1")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = 0; the_matchmin = 0; console.log(grid100_id + ": Theatres min larger than slider max"); } else if (parseInt(sliderTheatres.value) == (feature.get("_theatre_1")/1000)) { the_matchmax = 0; the_matchmin = 0; console.log(grid100_id + ": Theatres min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_theatre_2")/1000) == parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); console.log(grid100_id + ": Theatres max value equal to slider max"); } else if ((feature.get("_theatre_2")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = parseInt(sliderTheatres.value); console.log(grid100_id + ": Theatres max value greater than slider max"); } else if ((feature.get("_theatre_2")/1000) < parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); console.log(grid100_id + ": Theatres max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_theatre_1")/1000) == 0) { the_matchmin = 0; console.log(grid100_id + ": Theatres min value equal to 0"); } else if ((feature.get("_theatre_1")/1000 > 0)) { the_matchmin = (feature.get("_theatre_1")/1000); console.log(grid100_id + ": Theatres user slider smaller than cell value"); } // MATCH PERCENTAGE FOR CINEMAS // When user input doesn 't match cell range if ((feature.get("_cinemasmi")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = 0; cin_matchmin = 0; console.log(grid100_id + ": Cinemas min value larger than slider max"); } else if (parseInt(sliderCinemas.value) == (feature.get("_cinemasmi")/1000)) { cin_matchmax = 0; cin_matchmin = 0; console.log(grid100_id + ": Cinemas min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_cinemasma")/1000) == parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); console.log(grid100_id + ": Cinemas max value equal to slider max"); } else if ((feature.get("_cinemasma")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = parseInt(sliderCinemas.value); console.log(grid100_id + ": Cinemas max value greater than slider max"); } else if ((feature.get("_cinemasma")/1000) < parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); console.log(grid100_id + ": Cinemas max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_cinemasmi")/1000) == 0) { cin_matchmin = 0; console.log(grid100_id + ": Cinemas min value equal to 0"); } else if ((feature.get("_cinemasmi")/1000 > 0)) { cin_matchmin = (feature.get("_cinemasmi")/1000); console.log(grid100_id + ": Cinemas slider value smaller than cell min"); } // MATCH PERCENTAGE FOR KINDERGARTENS // When user input doesn 't match cell range if ((feature.get("_kindermin")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = 0; kin_matchmin = 0; console.log(grid100_id + ": Kinder min value larger than slider max"); } else if (parseInt(sliderKinder.value) == (feature.get("_kindermin")/1000)) { kin_matchmax = 0; kin_matchmin = 0; console.log(grid100_id + ": Kinder min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_kindermax")/1000) == parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); console.log(grid100_id + ": Kinder max value equal to slider max"); } else if ((feature.get("_kindermax")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = parseInt(sliderKinder.value); console.log(grid100_id + ": Kinder max value greater than slider max"); } else if ((feature.get("_kindermax")/1000) < parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); console.log(grid100_id + ": Kinder max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_kindermin")/1000) == 0) { kin_matchmin = 0; console.log(grid100_id + ": Kinder min value equal to 0"); } else if ((feature.get("_kindermin")/1000 > 0)) { kin_matchmin = (feature.get("_kindermin")/1000); console.log(grid100_id + ": Kinder slider value smaller than cell min"); } // MATCH PERCENTAGE FOR INDUSTRIES // When user input doesn 't match cell range if ((feature.get("_industr_1")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = 0; ind_matchmin = 0; console.log(grid100_id + ": Indu min larger than slider max"); } else if (parseInt(sliderIndustry.value) == (feature.get("_industr_1")/1000)) { ind_matchmax = 0; ind_matchmin = 0; console.log(grid100_id + ": Indu min value equal to slider max"); } // Getting the maximum matching distance value else if ((feature.get("_industr_2")/1000) == parseInt(sliderIndustry.value)) { ind_matchmax = (feature.get("_industr_2")/1000); console.log(grid100_id + ": Indu max value equal to slider max"); } else if ((feature.get("_industr_2")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = parseInt(sliderIndustry.value); console.log(grid100_id + ": Indu max value greater than slider max"); } else if ((feature.get("_industr_2")/1000) < parseInt(sliderIndustry.value)) { ind_matchmax = (feature.get("_industr_2")/1000); console.log(grid100_id + ": Indu max value smaller than slider max"); } // Getting the minimum matching distance value else if ((feature.get("_industr_1")/1000) == 0) { ind_matchmin = 0; console.log(grid100_id + ": Indu min value equal to 0"); } else if ((feature.get("_industr_1")/1000 > 0)) { ind_matchmin = (feature.get("_industr_1")/1000); console.log(grid100_id + ": Indu user slider smaller than cell value"); } // MATCH PERCENTAGE FOR WATER BODIES // When user input doesn 't match cell range if ((feature.get("_waterbo_1")) > parseInt(sliderWater.value)) { wat_matchmax = 0; wat_matchmin = 0; } else if (parseInt(sliderWater.value) == (feature.get("_waterbo_1"))) { wat_matchmax = 0; wat_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_waterbo_2")) == parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } else if ((feature.get("_waterbo_2")) > parseInt(sliderWater.value)) { wat_matchmax = parseInt(sliderWater.value); } else if ((feature.get("_waterbo_2")) < parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } // Getting the minimum matching distance value else if ((feature.get("_waterbo_1")) == 0) { wat_matchmin = 0; } else if ((feature.get("_waterbo_1")) > 0){ wat_matchmin = (feature.get("_waterbo_1")); } // MATCH PERCENTAGE FOR HOUSE PRICES if ((feature.get("housepri_2")) > parseInt(sliderHprice.value)) { house_match_perc = 0; //Out of the cell interval } else {(((feature.get("housepri_2") == parseInt(sliderHprice.value)) || (parseInt(sliderHprice.value) > (feature.get("housepri_2"))))) house_match_perc = 100; //Within the cell interval } //UNIVERSITIES matching percentage uni_matchdiff = (uni_matchmax - uni_matchmin); cell_int_u = (feature.get("_univers_2")/1000) - (feature.get("_univers_1")/1000); // Getting the match percentage uni_match_perc = (uni_matchdiff * 100) / cell_int_u; console.log(grid100_id + ": Uni Match %: " + uni_match_perc); //SCHOOLS matching percentage sch_matchdiff = (sch_matchmax - sch_matchmin); cell_int_sch = (feature.get("_schoolsma")/1000) - (feature.get("_schoolsmi")/1000); // Getting the match percentage sch_match_perc = (sch_matchdiff * 100) / cell_int_sch; console.log(grid100_id + ": Schools Match %: " + sch_match_perc); //COASTLINE matching percentage coast_matchdiff = (coast_matchmax - coast_matchmin); cell_int_coast = (feature.get("_coastli_2")/1000) - (feature.get("_coastli_1")/1000); // Getting the match percentage coast_match_perc = (coast_matchdiff * 100) / cell_int_coast; console.log(grid100_id + ": Coasts Match %: " + coast_match_perc); //HOSPITALS matching percentage hos_matchdiff = (hos_matchmax - hos_matchmin); cell_int_hos = (feature.get("_hospita_2")/1000) - (feature.get("_hospita_1")/1000); // Getting the match percentage hos_match_perc = (hos_matchdiff * 100) / cell_int_hos; console.log(grid100_id + ": Hospitals Match %: " + hos_match_perc); //PARKS matching percentage parks_matchdiff = (parks_matchmax - parks_matchmin); cell_int_parks = (feature.get("_leisure_2")/1000) - (feature.get("_leisure_1")/1000); // Getting the match percentage parks_match_perc = (parks_matchdiff * 100) / cell_int_parks; console.log(grid100_id + ": Parks Match %: " + parks_match_perc); // ROADS matching percentage roads_matchdiff = (roads_matchmax - roads_matchmin); cell_int_roads = (feature.get("_roadsmax")/1000) - (feature.get("_roadsmin")/1000); // Getting the match percentage roads_match_perc = (roads_matchdiff * 100) / cell_int_roads; console.log(grid100_id + ": Roads Match %: " + roads_match_perc); // SUPERMARKETS matching percentage markets_matchdiff = (markets_matchmax - markets_matchmin); cell_int_markets = (feature.get("_superma_2")/1000) - (feature.get("_superma_1")/1000); // Getting the match percentage markets_match_perc = (markets_matchdiff * 100) / cell_int_markets; console.log(grid100_id + ": Markets Match %: " + markets_match_perc); // PUBLIC TRANSPORT STOPS matching percentage ptst_matchdiff = (ptst_matchmax - ptst_matchmin); cell_int_ptst = (feature.get("_pt_stop_2")/1000) - (feature.get("_pt_stop_1")/1000); // Getting the match percentage ptst_match_perc = (ptst_matchdiff * 100) / cell_int_ptst; console.log(grid100_id + ": PT Stops Match %: " + ptst_match_perc); // PUBLIC TRANSPORT STATIONS matching percentage ptsta_matchdiff = (ptsta_matchmax - ptsta_matchmin); cell_int_ptsta = (feature.get("_pt_stat_2")/1000) - (feature.get("_pt_stat_1")/1000); // Getting the match percentage ptsta_match_perc = (ptsta_matchdiff * 100) / cell_int_ptsta; console.log(grid100_id + ": PT Stats Match %: " + ptsta_match_perc); // RESTAURANTS matching percentage resto_matchdiff = (resto_matchmax - resto_matchmin); cell_int_resto = (feature.get("_restaur_2")/1000) - (feature.get("_restaur_1")/1000); // Getting the match percentage resto_match_perc = (resto_matchdiff * 100) / cell_int_resto; console.log(grid100_id + ": Restaurants Match %: " + resto_match_perc); // THEATRES matching percentage the_matchdiff = (the_matchmax - the_matchmin); cell_int_the = (feature.get("_theatre_2")/1000) - (feature.get("_theatre_1")/1000); // Getting the match percentage the_match_perc = (the_matchdiff * 100) / cell_int_the; console.log(grid100_id + ": Theatres Match %: " + the_match_perc); // CINEMAS matching percentage cin_matchdiff = (cin_matchmax - cin_matchmin); cell_int_cin = (feature.get("_cinemasma")/1000) - (feature.get("_cinemasmi")/1000); // Getting the match percentage cin_match_perc = ( cin_matchdiff * 100) / cell_int_cin; console.log(grid100_id + ": Cinemas Match %: " + cin_match_perc); // KINDERGARTENS matching percentage kin_matchdiff = (kin_matchmax - kin_matchmin); cell_int_kin = (feature.get("_kindermax")/1000) - (feature.get("_kindermin")/1000); // Getting the match percentage kin_match_perc = (kin_matchdiff * 100) / cell_int_kin; console.log(grid100_id + ": Kinder Match %: " + kin_match_perc); // INDUSTRIES matching percentage ind_matchdiff = (ind_matchmax - ind_matchmin); cell_int_ind = (feature.get("_industr_2")/1000) - (feature.get("_industr_1")/1000); // Getting the match percentage ind_match_perc = (ind_matchdiff * 100) / cell_int_ind; console.log(grid100_id + ": Industries Match %: " + ind_match_perc); // WATER BODIES matching percentage wat_matchdiff = (wat_matchmax - wat_matchmin); cell_int_wat = (feature.get("_waterbo_2")/1000) - (feature.get("_waterbo_1")/1000); // Getting the match percentage wat_match_perc = (wat_matchdiff * 100) / cell_int_wat; // OVERALL PERCENTAGE CELL MATCH var new_fuzzy_value_100km = (ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + ptsta_matchdiff + ptst_matchdiff + resto_matchdiff + markets_matchdiff + roads_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff)/ (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_ptsta + cell_int_ptst + cell_int_markets + cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u + cell_int_sch + cell_int_roads + cell_int_wat); feature.set("fuzzyvalue", new_fuzzy_value_100km); console.log("Cell " + grid100_id + " Fuzzy Value: " + new_fuzzy_value_100km); accessibility = (((roads_matchdiff + ptsta_matchdiff + ptst_matchdiff)*100 / (cell_int_ptsta + cell_int_ptst + cell_int_roads))); livability = ((ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + resto_matchdiff + markets_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff) * 100) / (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_markets+ cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u +cell_int_sch + cell_int_wat); suitability = house_match_perc; feature.set("accessibility", accessibility); feature.set("livability", livability); feature.set("suitability", suitability); }); features_30km.forEach(function(feature ){ var grid30_id = feature.get("id"); // MATCH PERCENTAGE FOR UNIVERSITIES // When user input doesn't match cell range if ((feature.get("_univers_1")/1000) > parseInt(sliderUni.value)) { uni_matchmax = 0; uni_matchmin = 0; } else if (parseInt(sliderUni.value) == (feature.get("_univers_1")/1000)) { uni_matchmax = 0; uni_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_univers_2")/1000) == parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } else if ((feature.get("_univers_2")/1000) > parseInt(sliderUni.value)) { uni_matchmax = parseInt(sliderUni.value); } else if ((feature.get("_univers_2")/1000) < parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_univers_1")/1000) == 0) { uni_matchmin = 0; } else if ((feature.get("_univers_1") /1000 > 0)) { uni_matchmin = (feature.get("_univers_1")/1000); } // MATCH PERCENTAGE FOR SCHOOLS // When user input doesn 't match cell range if ((feature.get("_schoolsmi")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = 0; sch_matchmin = 0; } else if (parseInt(sliderSchools.value) == (feature.get("_schoolsmi")/1000)) { sch_matchmax = 0; sch_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_schoolsma")/1000) == parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } else if ((feature.get("_schoolsma")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = parseInt(sliderSchools.value); } else if ((feature.get("_schoolsma")/1000) < parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_schoolsmi")/1000) == 0) { sch_matchmin = 0; } else if ((feature.get("_schoolsmi")/1000 > 0)) { sch_matchmin = (feature.get("_schoolsmi")/1000); } // MATCH PERCENTAGE FOR COASTLINE // When user input doesn 't match cell range if ((feature.get("_coastli_1")/1000) > parseInt(sliderCoasts.value)) { coast_matchmax = 0; coast_matchmin = 0; } else if (parseInt(sliderCoasts.value) == (feature.get("_coastli_1")/1000)) { coast_matchmax = 0; coast_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_coastli_2")/1000) == parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } else if ((feature.get("_coastli_2")/1000) > parseInt(sliderSchools.value)) { coast_matchmax = parseInt(sliderCoasts.value); } else if ((feature.get("_coastli_2")/1000) < parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_coastli_1")/1000) == 0) { coast_matchmin = 0; } else if ((feature.get("_coastli_1")/1000 > 0)) { coast_matchmin = (feature.get("_coastli_1")/1000); } // MATCH PERCENTAGE FOR HOSPITALS // When user input doesn 't match cell range if ((feature.get("_hospita_1")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = 0; hos_matchmin = 0; } else if (parseInt(sliderHospitals.value) == (feature.get("_hospita_1")/1000)) { hos_matchmax = 0; hos_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_hospita_2")/1000) == parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } else if ((feature.get("_hospita_2")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = parseInt(sliderHospitals.value); } else if ((feature.get("_hospita_2")/1000) < parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_hospita_1")/1000) == 0) { hos_matchmin = 0; } else if ((feature.get("_hospita_1")/1000 > 0)) { hos_matchmin = (feature.get("_hospita_1")/1000); } // MATCH PERCENTAGE FOR LEISURE PARKS // When user input doesn 't match cell range if ((feature.get("_leisure_1")/1000) > parseInt(sliderParks.value)) { parks_matchmax = 0; parks_matchmin = 0; } else if (parseInt(sliderParks.value) == (feature.get("_leisure_1") /1000)) { parks_matchmax = 0; parks_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_leisure_2")/1000) == parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } else if ((feature.get("_leisure_2")/1000) > parseInt(sliderParks.value)) { parks_matchmax = parseInt(sliderParks.value); } else if ((feature.get("_leisure_2")/1000) < parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_leisure_1")/1000) == 0) { parks_matchmin = 0; } else if ((feature.get("_leisure_1")/1000 > 0)) { parks_matchmin = (feature.get("_leisure_1")/1000); } // MATCH PERCENTAGE FOR ROADS // When user input doesn 't match cell range if ((feature.get("_roadsmin")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = 0; roads_matchmin = 0; } else if (parseInt(sliderRoads.value) == (feature.get("_roadsmin")/1000)) { roads_matchmax = 0; roads_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_roadsmax")/1000) == parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } else if ((feature.get("_roadsmax")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = parseInt(sliderRoads.value); } else if ((feature.get("_roadsmax")/1000) < parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_roadsmin")/1000) == 0) { roads_matchmin = 0; } else if ((feature.get("_roadsmin")/1000 > 0)) { roads_matchmin = (feature.get("_roadsmin")/1000); } // MATCH PERCENTAGE FOR SUPERMARKETS // When user input doesn 't match cell range if ((feature.get("_superma_1")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = 0; markets_matchmin = 0; } else if (parseInt(sliderMarkets.value) == (feature.get("_superma_1")/1000)) { markets_matchmax = 0; markets_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_superma_2")/1000) == parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } else if ((feature.get("_superma_2")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = parseInt(sliderMarkets.value); } else if ((feature.get("_superma_2")/1000) < parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_superma_1")/1000) == 0) { markets_matchmin = 0; } else if ((feature.get("_superma_1")/1000 > 0)) { markets_matchmin = (feature.get("_superma_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STOPS // When user input doesn't match cell range if ((feature.get("_pt_stop_1")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = 0; ptst_matchmin = 0; } else if (parseInt(sliderPstops.value) == (feature.get("_pt_stop_1")/1000)) { ptst_matchmax = 0; ptst_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stop_2")/1000) == parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } else if (( feature.get("_pt_stop_2")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = parseInt(sliderPstops.value); } else if ((feature.get("_pt_stop_2")/1000) < parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stop_1")/1000) == 0) { ptst_matchmin = 0; } else if ((feature.get("_pt_stop_1") /1000 > 0)) { ptst_matchmin = (feature.get("_pt_stop_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STATIONS // When user input doesn't match cell range if ((feature.get("_pt_stat_1")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } else if (parseInt(sliderPstations.value) == (feature.get("_pt_stat_1")/1000)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stat_2")/1000) == parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } else if (( feature.get("_pt_stat_2")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = parseInt(sliderPstations.value); } else if ((feature.get("_pt_stations_2")/1000) < parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stat_1")/1000) == 0) { ptsta_matchmin = 0; } else if ((feature.get("_pt_stat_1") /1000 > 0)) { ptsta_matchmin = (feature.get("_pt_stat_1")/1000); } // MATCH PERCENTAGE FOR RESTAURANTS // When user input doesn 't match cell range if ((feature.get("_restaur_1")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = 0; resto_matchmin = 0; } else if (parseInt(sliderRestuarants.value) == (feature.get("_restaur_1")/1000)) { resto_matchmax = 0; resto_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_restaur_2")/1000) == parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } else if ((feature.get("_restaur_2")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = parseInt(sliderRestuarants.value); } else if ((feature.get("_restaur_2")/1000) < parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_restaur_1")/1000) == 0) { resto_matchmin = 0; } else if ((feature.get("_restaur_1")/1000 > 0)) { resto_matchmin = (feature.get("_restaur_1")/1000); } // MATCH PERCENTAGE FOR THEATRES // When user input doesn 't match cell range if ((feature.get("_theatre_1")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = 0; the_matchmin = 0; } else if (parseInt(sliderTheatres.value) == (feature.get("_theatre_1")/1000)) { the_matchmax = 0; the_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_theatre_2")/1000) == parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } else if ((feature.get("_theatre_2")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = parseInt(sliderTheatres.value); } else if ((feature.get("_theatre_2")/1000) < parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_theatre_1")/1000) == 0) { the_matchmin = 0; } else if ((feature.get("_theatre_1")/1000 > 0)) { the_matchmin = (feature.get("_theatre_1")/1000); } // MATCH PERCENTAGE FOR CINEMAS // When user input doesn 't match cell range if ((feature.get("_cinemasmi")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = 0; cin_matchmin = 0; } else if (parseInt(sliderCinemas.value) == (feature.get("_cinemasmi")/1000)) { cin_matchmax = 0; cin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_cinemasma")/1000) == parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } else if ((feature.get("_cinemasma")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = parseInt(sliderCinemas.value); } else if ((feature.get("_cinemasma")/1000) < parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_cinemasmi")/1000) == 0) { cin_matchmin = 0; } else if ((feature.get("_cinemasmi")/1000 > 0)) { cin_matchmin = (feature.get("_cinemasmi")/1000); } // MATCH PERCENTAGE FOR KINDERGARTENS // When user input doesn 't match cell range if ((feature.get("_kindermin")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = 0; kin_matchmin = 0; } else if (parseInt(sliderKinder.value) == (feature.get("_kindermin")/1000)) { kin_matchmax = 0; kin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_kindermax")/1000) == parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } else if ((feature.get("_kindermax")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = parseInt(sliderKinder.value); } else if ((feature.get("_kindermax")/1000) < parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_kindermin")/1000) == 0) { kin_matchmin = 0; } else if ((feature.get("_kindermin")/1000 > 0)) { kin_matchmin = (feature.get("_kindermin")/1000); } // MATCH PERCENTAGE FOR INDUSTRIES // When user input doesn 't match cell range if ((feature.get("_industr_1")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = 0; ind_matchmin = 0; } else if (parseInt(sliderIndustry.value) == (feature.get("_industr_1")/1000)) { ind_matchmax = 0; ind_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_industr_2")/1000) == parseInt(sliderIndustry.value)) { } else if ((feature.get("_industr_2")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = parseInt(sliderIndustry.value); } else if ((feature.get("_industr_2")/1000) < parseInt(sliderIndustry.value)) { ind_matchmax = (feature.get("_industr_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_industr_1")/1000) == 0) { ind_matchmin = 0; } else if ((feature.get("_industr_1")/1000 > 0)) { ind_matchmin = (feature.get("_industr_1")/1000); } // MATCH PERCENTAGE FOR WATER BODIES // When user input doesn 't match cell range if ((feature.get("_waterbo_1")) > parseInt(sliderWater.value)) { wat_matchmax = 0; wat_matchmin = 0; } else if (parseInt(sliderWater.value) == (feature.get("_waterbo_1"))) { wat_matchmax = 0; wat_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_waterbo_2")) == parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } else if ((feature.get("_waterbo_2")) > parseInt(sliderWater.value)) { wat_matchmax = parseInt(sliderWater.value); } else if ((feature.get("_waterbo_2")) < parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } // Getting the minimum matching distance value else if ((feature.get("_waterbo_1")) == 0) { wat_matchmin = 0; } else if ((feature.get("_waterbo_1")) > 0){ wat_matchmin = (feature.get("_waterbo_1")); } // MATCH PERCENTAGE FOR HOUSE PRICES if ((feature.get("housepri_2")) > parseInt(sliderHprice.value)) { house_match_perc = 0; //Out of the cell interval } else {(((feature.get("housepri_2") == parseInt(sliderHprice.value)) || (parseInt(sliderHprice.value) > (feature.get("housepri_2"))))) house_match_perc = 100; //Within the cell interval } //UNIVERSITIES matching percentage uni_matchdiff = (uni_matchmax - uni_matchmin); cell_int_u = (feature.get("_univers_2")/1000) - (feature.get("_univers_1")/1000); // Getting the match percentage uni_match_perc = (uni_matchdiff * 100) / cell_int_u; //SCHOOLS matching percentage sch_matchdiff = (sch_matchmax - sch_matchmin); cell_int_sch = (feature.get("_schoolsma")/1000) - (feature.get("_schoolsmi")/1000); // Getting the match percentage sch_match_perc = (sch_matchdiff * 100) / cell_int_sch; //COASTLINE matching percentage coast_matchdiff = (coast_matchmax - coast_matchmin); cell_int_coast = (feature.get("_coastli_2")/1000) - (feature.get("_coastli_1")/1000); // Getting the match percentage coast_match_perc = (coast_matchdiff * 100) / cell_int_coast; //HOSPITALS matching percentage hos_matchdiff = (hos_matchmax - hos_matchmin); cell_int_hos = (feature.get("_hospita_2")/1000) - (feature.get("_hospita_1")/1000); // Getting the match percentage hos_match_perc = (hos_matchdiff * 100) / cell_int_hos; //PARKS matching percentage parks_matchdiff = (parks_matchmax - parks_matchmin); cell_int_parks = (feature.get("_leisure_2")/1000) - (feature.get("_leisure_1")/1000); // Getting the match percentage parks_match_perc = (parks_matchdiff * 100) / cell_int_parks; // ROADS matching percentage roads_matchdiff = (roads_matchmax - roads_matchmin); cell_int_roads = (feature.get("_roadsmax")/1000) - (feature.get("_roadsmin")/1000); // Getting the match percentage roads_match_perc = (roads_matchdiff * 100) / cell_int_roads; // SUPERMARKETS matching percentage markets_matchdiff = (markets_matchmax - markets_matchmin); cell_int_markets = (feature.get("_superma_2")/1000) - (feature.get("_superma_1")/1000); // Getting the match percentage markets_match_perc = (markets_matchdiff * 100) / cell_int_markets; // PUBLIC TRANSPORT STOPS matching percentage ptst_matchdiff = (ptst_matchmax - ptst_matchmin); cell_int_ptst = (feature.get("_pt_stop_2")/1000) - (feature.get("_pt_stop_1")/1000); // Getting the match percentage ptst_match_perc = (ptst_matchdiff * 100) / cell_int_ptst; // PUBLIC TRANSPORT STATIONS matching percentage ptsta_matchdiff = (ptsta_matchmax - ptsta_matchmin); cell_int_ptsta = (feature.get("_pt_stat_2")/1000) - (feature.get("_pt_stat_1")/1000); // Getting the match percentage ptsta_match_perc = (ptsta_matchdiff * 100) / cell_int_ptsta; // RESTAURANTS matching percentage resto_matchdiff = (resto_matchmax - resto_matchmin); cell_int_resto = (feature.get("_restaur_2")/1000) - (feature.get("_restaur_1")/1000); // Getting the match percentage resto_match_perc = (resto_matchdiff * 100) / cell_int_resto; // THEATRES matching percentage the_matchdiff = (the_matchmax - the_matchmin); cell_int_the = (feature.get("_theatre_2")/1000) - (feature.get("_theatre_1")/1000); // Getting the match percentage the_match_perc = (the_matchdiff * 100) / cell_int_the; // CINEMAS matching percentage cin_matchdiff = (cin_matchmax - cin_matchmin); cell_int_cin = (feature.get("_cinemasma")/1000) - (feature.get("_cinemasmi")/1000); // Getting the match percentage cin_match_perc = ( cin_matchdiff * 100) / cell_int_cin; // KINDERGARTENS matching percentage kin_matchdiff = (kin_matchmax - kin_matchmin); cell_int_kin = (feature.get("_kindermax")/1000) - (feature.get("_kindermin")/1000); // Getting the match percentage kin_match_perc = (kin_matchdiff * 100) / cell_int_kin; // INDUSTRIES matching percentage ind_matchdiff = (ind_matchmax - ind_matchmin); cell_int_ind = (feature.get("_industr_2")/1000) - (feature.get("_industr_1")/1000); // Getting the match percentage ind_match_perc = (ind_matchdiff * 100) / cell_int_ind; // WATER BODIES matching percentage wat_matchdiff = (wat_matchmax - wat_matchmin); cell_int_wat = (feature.get("_waterbo_2")/1000) - (feature.get("_waterbo_1")/1000); // Getting the match percentage wat_match_perc = (wat_matchdiff * 100) / cell_int_wat; // OVERALL PERCENTAGE CELL MATCH var new_fuzzy_value_30km = (ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + ptsta_matchdiff + ptst_matchdiff + resto_matchdiff + markets_matchdiff + roads_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff)/ (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_ptsta + cell_int_ptst + cell_int_markets + cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u + cell_int_sch + cell_int_roads + cell_int_wat); feature.set("fuzzyvalue", new_fuzzy_value_30km); console.log("Cell " + grid30_id + " Fuzzy Value: " + new_fuzzy_value_30km); accessibility = (((roads_matchdiff + ptsta_matchdiff + ptst_matchdiff)*100 / (cell_int_ptsta + cell_int_ptst + cell_int_roads))); livability = ((ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + resto_matchdiff + markets_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff) * 100) / (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_markets+ cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u +cell_int_sch + cell_int_wat); suitability = house_match_perc; feature.set("accessibility", accessibility); feature.set("livability", livability); feature.set("suitability", suitability); }); features_1km_fyn.forEach(function(feature ){ // MATCH PERCENTAGE FOR UNIVERSITIES // When user input doesn't match cell range if ((feature.get("_univers_1")/1000) > parseInt(sliderUni.value)) { uni_matchmax = 0; uni_matchmin = 0; } else if (parseInt(sliderUni.value) == (feature.get("_univers_1")/1000)) { uni_matchmax = 0; uni_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_univers_2")/1000) == parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } else if ((feature.get("_univers_2")/1000) > parseInt(sliderUni.value)) { uni_matchmax = parseInt(sliderUni.value); } else if ((feature.get("_univers_2")/1000) < parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_univers_1")/1000) == 0) { uni_matchmin = 0; } else if ((feature.get("_univers_1") /1000 > 0)) { uni_matchmin = (feature.get("_univers_1")/1000); } // MATCH PERCENTAGE FOR SCHOOLS // When user input doesn 't match cell range if ((feature.get("_schoolsmi")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = 0; sch_matchmin = 0; } else if (parseInt(sliderSchools.value) == (feature.get("_schoolsmi")/1000)) { sch_matchmax = 0; sch_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_schoolsma")/1000) == parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } else if ((feature.get("_schoolsma")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = parseInt(sliderSchools.value); } else if ((feature.get("_schoolsma")/1000) < parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_schoolsmi")/1000) == 0) { sch_matchmin = 0; } else if ((feature.get("_schoolsmi")/1000 > 0)) { sch_matchmin = (feature.get("_schoolsmi")/1000); } // MATCH PERCENTAGE FOR COASTLINE // When user input doesn 't match cell range if ((feature.get("_coastli_1")/1000) > parseInt(sliderCoasts.value)) { coast_matchmax = 0; coast_matchmin = 0; } else if (parseInt(sliderCoasts.value) == (feature.get("_coastli_1")/1000)) { coast_matchmax = 0; coast_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_coastli_2")/1000) == parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } else if ((feature.get("_coastli_2")/1000) > parseInt(sliderSchools.value)) { coast_matchmax = parseInt(sliderCoasts.value); } else if ((feature.get("_coastli_2")/1000) < parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_coastli_1")/1000) == 0) { coast_matchmin = 0; } else if ((feature.get("_coastli_1")/1000 > 0)) { coast_matchmin = (feature.get("_coastli_1")/1000); } // MATCH PERCENTAGE FOR HOSPITALS // When user input doesn 't match cell range if ((feature.get("_hospita_1")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = 0; hos_matchmin = 0; } else if (parseInt(sliderHospitals.value) == (feature.get("_hospita_1")/1000)) { hos_matchmax = 0; hos_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_hospita_2")/1000) == parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } else if ((feature.get("_hospita_2")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = parseInt(sliderHospitals.value); } else if ((feature.get("_hospita_2")/1000) < parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_hospita_1")/1000) == 0) { hos_matchmin = 0; } else if ((feature.get("_hospita_1")/1000 > 0)) { hos_matchmin = (feature.get("_hospita_1")/1000); } // MATCH PERCENTAGE FOR LEISURE PARKS // When user input doesn 't match cell range if ((feature.get("_leisure_1")/1000) > parseInt(sliderParks.value)) { parks_matchmax = 0; parks_matchmin = 0; } else if (parseInt(sliderParks.value) == (feature.get("_leisure_1") /1000)) { parks_matchmax = 0; parks_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_leisure_2")/1000) == parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } else if ((feature.get("_leisure_2")/1000) > parseInt(sliderParks.value)) { parks_matchmax = parseInt(sliderParks.value); } else if ((feature.get("_leisure_2")/1000) < parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_leisure_1")/1000) == 0) { parks_matchmin = 0; } else if ((feature.get("_leisure_1")/1000 > 0)) { parks_matchmin = (feature.get("_leisure_1")/1000); } // MATCH PERCENTAGE FOR ROADS // When user input doesn 't match cell range if ((feature.get("_roadsmin")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = 0; roads_matchmin = 0; } else if (parseInt(sliderRoads.value) == (feature.get("_roadsmin")/1000)) { roads_matchmax = 0; roads_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_roadsmax")/1000) == parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } else if ((feature.get("_roadsmax")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = parseInt(sliderRoads.value); } else if ((feature.get("_roadsmax")/1000) < parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_roadsmin")/1000) == 0) { roads_matchmin = 0; } else if ((feature.get("_roadsmin")/1000 > 0)) { roads_matchmin = (feature.get("_roadsmin")/1000); } // MATCH PERCENTAGE FOR SUPERMARKETS // When user input doesn 't match cell range if ((feature.get("_superma_1")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = 0; markets_matchmin = 0; } else if (parseInt(sliderMarkets.value) == (feature.get("_superma_1")/1000)) { markets_matchmax = 0; markets_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_superma_2")/1000) == parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } else if ((feature.get("_superma_2")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = parseInt(sliderMarkets.value); } else if ((feature.get("_superma_2")/1000) < parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_superma_1")/1000) == 0) { markets_matchmin = 0; } else if ((feature.get("_superma_1")/1000 > 0)) { markets_matchmin = (feature.get("_superma_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STOPS // When user input doesn't match cell range if ((feature.get("_pt_stop_1")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = 0; ptst_matchmin = 0; } else if (parseInt(sliderPstops.value) == (feature.get("_pt_stop_1")/1000)) { ptst_matchmax = 0; ptst_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stop_2")/1000) == parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } else if (( feature.get("_pt_stop_2")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = parseInt(sliderPstops.value); } else if ((feature.get("_pt_stop_2")/1000) < parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stop_1")/1000) == 0) { ptst_matchmin = 0; } else if ((feature.get("_pt_stop_1") /1000 > 0)) { ptst_matchmin = (feature.get("_pt_stop_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STATIONS // When user input doesn't match cell range if ((feature.get("_pt_stat_1")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } else if (parseInt(sliderPstations.value) == (feature.get("_pt_stat_1")/1000)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stat_2")/1000) == parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } else if (( feature.get("_pt_stat_2")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = parseInt(sliderPstations.value); } else if ((feature.get("_pt_stations_2")/1000) < parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stat_1")/1000) == 0) { ptsta_matchmin = 0; } else if ((feature.get("_pt_stat_1") /1000 > 0)) { ptsta_matchmin = (feature.get("_pt_stat_1")/1000); } // MATCH PERCENTAGE FOR RESTAURANTS // When user input doesn 't match cell range if ((feature.get("_restaur_1")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = 0; resto_matchmin = 0; } else if (parseInt(sliderRestuarants.value) == (feature.get("_restaur_1")/1000)) { resto_matchmax = 0; resto_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_restaur_2")/1000) == parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } else if ((feature.get("_restaur_2")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = parseInt(sliderRestuarants.value); } else if ((feature.get("_restaur_2")/1000) < parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_restaur_1")/1000) == 0) { resto_matchmin = 0; } else if ((feature.get("_restaur_1")/1000 > 0)) { resto_matchmin = (feature.get("_restaur_1")/1000); } // MATCH PERCENTAGE FOR THEATRES // When user input doesn 't match cell range if ((feature.get("_theatre_1")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = 0; the_matchmin = 0; } else if (parseInt(sliderTheatres.value) == (feature.get("_theatre_1")/1000)) { the_matchmax = 0; the_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_theatre_2")/1000) == parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } else if ((feature.get("_theatre_2")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = parseInt(sliderTheatres.value); } else if ((feature.get("_theatre_2")/1000) < parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_theatre_1")/1000) == 0) { the_matchmin = 0; } else if ((feature.get("_theatre_1")/1000 > 0)) { the_matchmin = (feature.get("_theatre_1")/1000); } // MATCH PERCENTAGE FOR CINEMAS // When user input doesn 't match cell range if ((feature.get("_cinemasmi")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = 0; cin_matchmin = 0; } else if (parseInt(sliderCinemas.value) == (feature.get("_cinemasmi")/1000)) { cin_matchmax = 0; cin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_cinemasma")/1000) == parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } else if ((feature.get("_cinemasma")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = parseInt(sliderCinemas.value); } else if ((feature.get("_cinemasma")/1000) < parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_cinemasmi")/1000) == 0) { cin_matchmin = 0; } else if ((feature.get("_cinemasmi")/1000 > 0)) { cin_matchmin = (feature.get("_cinemasmi")/1000); } // MATCH PERCENTAGE FOR KINDERGARTENS // When user input doesn 't match cell range if ((feature.get("_kindermin")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = 0; kin_matchmin = 0; } else if (parseInt(sliderKinder.value) == (feature.get("_kindermin")/1000)) { kin_matchmax = 0; kin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_kindermax")/1000) == parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } else if ((feature.get("_kindermax")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = parseInt(sliderKinder.value); } else if ((feature.get("_kindermax")/1000) < parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_kindermin")/1000) == 0) { kin_matchmin = 0; } else if ((feature.get("_kindermin")/1000 > 0)) { kin_matchmin = (feature.get("_kindermin")/1000); } // MATCH PERCENTAGE FOR INDUSTRIES // When user input doesn 't match cell range if ((feature.get("_industr_1")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = 0; ind_matchmin = 0; } else if (parseInt(sliderIndustry.value) == (feature.get("_industr_1")/1000)) { ind_matchmax = 0; ind_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_industr_2")/1000) == parseInt(sliderIndustry.value)) { } else if ((feature.get("_industr_2")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = parseInt(sliderIndustry.value); } else if ((feature.get("_industr_2")/1000) < parseInt(sliderIndustry.value)) { ind_matchmax = (feature.get("_industr_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_industr_1")/1000) == 0) { ind_matchmin = 0; } else if ((feature.get("_industr_1")/1000 > 0)) { ind_matchmin = (feature.get("_industr_1")/1000); } // MATCH PERCENTAGE FOR WATER BODIES // When user input doesn 't match cell range if ((feature.get("_waterbo_1")) > parseInt(sliderWater.value)) { wat_matchmax = 0; wat_matchmin = 0; } else if (parseInt(sliderWater.value) == (feature.get("_waterbo_1"))) { wat_matchmax = 0; wat_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_waterbo_2")) == parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } else if ((feature.get("_waterbo_2")) > parseInt(sliderWater.value)) { wat_matchmax = parseInt(sliderWater.value); } else if ((feature.get("_waterbo_2")) < parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } // Getting the minimum matching distance value else if ((feature.get("_waterbo_1")) == 0) { wat_matchmin = 0; } else if ((feature.get("_waterbo_1")) > 0){ wat_matchmin = (feature.get("_waterbo_1")); } // MATCH PERCENTAGE FOR HOUSE PRICES if ((feature.get("housepri_2")) > parseInt(sliderHprice.value)) { house_match_perc = 0; //Out of the cell interval } else {(((feature.get("housepri_2") == parseInt(sliderHprice.value)) || (parseInt(sliderHprice.value) > (feature.get("housepri_2"))))) house_match_perc = 100; //Within the cell interval } //UNIVERSITIES matching percentage uni_matchdiff = (uni_matchmax - uni_matchmin); cell_int_u = (feature.get("_univers_2")/1000) - (feature.get("_univers_1")/1000); // Getting the match percentage uni_match_perc = (uni_matchdiff * 100) / cell_int_u; //SCHOOLS matching percentage sch_matchdiff = (sch_matchmax - sch_matchmin); cell_int_sch = (feature.get("_schoolsma")/1000) - (feature.get("_schoolsmi")/1000); // Getting the match percentage sch_match_perc = (sch_matchdiff * 100) / cell_int_sch; //COASTLINE matching percentage coast_matchdiff = (coast_matchmax - coast_matchmin); cell_int_coast = (feature.get("_coastli_2")/1000) - (feature.get("_coastli_1")/1000); // Getting the match percentage coast_match_perc = (coast_matchdiff * 100) / cell_int_coast; //HOSPITALS matching percentage hos_matchdiff = (hos_matchmax - hos_matchmin); cell_int_hos = (feature.get("_hospita_2")/1000) - (feature.get("_hospita_1")/1000); // Getting the match percentage hos_match_perc = (hos_matchdiff * 100) / cell_int_hos; //PARKS matching percentage parks_matchdiff = (parks_matchmax - parks_matchmin); cell_int_parks = (feature.get("_leisure_2")/1000) - (feature.get("_leisure_1")/1000); // Getting the match percentage parks_match_perc = (parks_matchdiff * 100) / cell_int_parks; // ROADS matching percentage roads_matchdiff = (roads_matchmax - roads_matchmin); cell_int_roads = (feature.get("_roadsmax")/1000) - (feature.get("_roadsmin")/1000); // Getting the match percentage roads_match_perc = (roads_matchdiff * 100) / cell_int_roads; // SUPERMARKETS matching percentage markets_matchdiff = (markets_matchmax - markets_matchmin); cell_int_markets = (feature.get("_superma_2")/1000) - (feature.get("_superma_1")/1000); // Getting the match percentage markets_match_perc = (markets_matchdiff * 100) / cell_int_markets; // PUBLIC TRANSPORT STOPS matching percentage ptst_matchdiff = (ptst_matchmax - ptst_matchmin); cell_int_ptst = (feature.get("_pt_stop_2")/1000) - (feature.get("_pt_stop_1")/1000); // Getting the match percentage ptst_match_perc = (ptst_matchdiff * 100) / cell_int_ptst; // PUBLIC TRANSPORT STATIONS matching percentage ptsta_matchdiff = (ptsta_matchmax - ptsta_matchmin); cell_int_ptsta = (feature.get("_pt_stat_2")/1000) - (feature.get("_pt_stat_1")/1000); // Getting the match percentage ptsta_match_perc = (ptsta_matchdiff * 100) / cell_int_ptsta; // RESTAURANTS matching percentage resto_matchdiff = (resto_matchmax - resto_matchmin); cell_int_resto = (feature.get("_restaur_2")/1000) - (feature.get("_restaur_1")/1000); // Getting the match percentage resto_match_perc = (resto_matchdiff * 100) / cell_int_resto; // THEATRES matching percentage the_matchdiff = (the_matchmax - the_matchmin); cell_int_the = (feature.get("_theatre_2")/1000) - (feature.get("_theatre_1")/1000); // Getting the match percentage the_match_perc = (the_matchdiff * 100) / cell_int_the; // CINEMAS matching percentage cin_matchdiff = (cin_matchmax - cin_matchmin); cell_int_cin = (feature.get("_cinemasma")/1000) - (feature.get("_cinemasmi")/1000); // Getting the match percentage cin_match_perc = ( cin_matchdiff * 100) / cell_int_cin; // KINDERGARTENS matching percentage kin_matchdiff = (kin_matchmax - kin_matchmin); cell_int_kin = (feature.get("_kindermax")/1000) - (feature.get("_kindermin")/1000); // Getting the match percentage kin_match_perc = (kin_matchdiff * 100) / cell_int_kin; // INDUSTRIES matching percentage ind_matchdiff = (ind_matchmax - ind_matchmin); cell_int_ind = (feature.get("_industr_2")/1000) - (feature.get("_industr_1")/1000); // Getting the match percentage ind_match_perc = (ind_matchdiff * 100) / cell_int_ind; // WATER BODIES matching percentage wat_matchdiff = (wat_matchmax - wat_matchmin); cell_int_wat = (feature.get("_waterbo_2")/1000) - (feature.get("_waterbo_1")/1000); // Getting the match percentage wat_match_perc = (wat_matchdiff * 100) / cell_int_wat; // OVERALL PERCENTAGE CELL MATCH var new_fuzzy_value_1km_fyn = (ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + ptsta_matchdiff + ptst_matchdiff + resto_matchdiff + markets_matchdiff + roads_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff)/ (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_ptsta + cell_int_ptst + cell_int_markets + cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u + cell_int_sch + cell_int_roads + cell_int_wat); feature.set("fuzzyvalue", new_fuzzy_value_1km_fyn); accessibility = (((roads_matchdiff + ptsta_matchdiff + ptst_matchdiff)*100 / (cell_int_ptsta + cell_int_ptst + cell_int_roads))); livability = ((ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + resto_matchdiff + markets_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff) * 100) / (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_markets+ cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u +cell_int_sch + cell_int_wat); suitability = house_match_perc; feature.set("accessibility", accessibility); feature.set("livability", livability); feature.set("suitability", suitability); }); features_1km_hovestad.forEach(function(feature ){ // MATCH PERCENTAGE FOR UNIVERSITIES var new_uni var new_sch if ((feature.get("_univers_2")/1000) > parseInt(sliderUni.value)) { new_uni = 0; //Out of the cell interval console.log("error in new_uni= 0") } else if(((feature.get("_univers_2")/1000 == parseInt(sliderUni.value)) || (parseInt(sliderUni.value) > (feature.get("_univers_2"))))){ new_uni = 1; //Within the cell interval console.log("error in new_uni= 1") } // MATCH PERCENTAGE FOR SCHOOLS if ((feature.get("_schoolsma")/1000) > parseInt(sliderSchools.value)) { new_sch = 0; //Out of the cell interval console.log("error in new_sch= 0"); } else if(((feature.get("_schoolsma")/1000 == parseInt(sliderSchools.value)) || (parseInt(sliderSchools.value) > (feature.get("_schoolsma"))))){ new_sch = 1; //Within the cell interval console.log("error in new_sch= 1"); } // MATCH PERCENTAGE FOR HOUSE PRICES if ((feature.get("housepri_2")) > parseInt(sliderHprice.value)) { house_match_perc = 0; //Out of the cell interval } else if (((feature.get("housepri_2") == parseInt(sliderHprice.value)) || (parseInt(sliderHprice.value) > (feature.get("housepri_2"))))){ house_match_perc = 1; //Within the cell interval } // MATCH PERCENTAGE FOR KINDERGARTENS var new_kinder; if ((feature.get("_kindermax")/1000) > parseInt(sliderKinder.value)) { new_kinder = 0; //Out of the cell interval console.log("error in new_kinder = 0") } else if(((feature.get("_kindermax")/1000 == parseInt(sliderKinder.value)) || (parseInt(sliderKinder.value) > (feature.get("_kindermax"))))){ new_kinder = 1; //Within the cell interval console.log("error in new_kinder = 1") } // OVERALL PERCENTAGE CELL MATCH var new_fuzzy_value_1km_hovestad = ((new_uni + new_sch + house_match_perc + new_kinder)/4); feature.set("fuzzyvalue", new_fuzzy_value_1km_hovestad); console.log("1km Fuzzy: " + new_fuzzy_value_1km_hovestad); }); features_1km_midtjylland.forEach(function(feature ){ // MATCH PERCENTAGE FOR UNIVERSITIES // When user input doesn't match cell range if ((feature.get("_univers_1")/1000) > parseInt(sliderUni.value)) { uni_matchmax = 0; uni_matchmin = 0; } else if (parseInt(sliderUni.value) == (feature.get("_univers_1")/1000)) { uni_matchmax = 0; uni_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_univers_2")/1000) == parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } else if ((feature.get("_univers_2")/1000) > parseInt(sliderUni.value)) { uni_matchmax = parseInt(sliderUni.value); } else if ((feature.get("_univers_2")/1000) < parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_univers_1")/1000) == 0) { uni_matchmin = 0; } else if ((feature.get("_univers_1") /1000 > 0)) { uni_matchmin = (feature.get("_univers_1")/1000); } // MATCH PERCENTAGE FOR SCHOOLS // When user input doesn 't match cell range if ((feature.get("_schoolsmi")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = 0; sch_matchmin = 0; } else if (parseInt(sliderSchools.value) == (feature.get("_schoolsmi")/1000)) { sch_matchmax = 0; sch_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_schoolsma")/1000) == parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } else if ((feature.get("_schoolsma")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = parseInt(sliderSchools.value); } else if ((feature.get("_schoolsma")/1000) < parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_schoolsmi")/1000) == 0) { sch_matchmin = 0; } else if ((feature.get("_schoolsmi")/1000 > 0)) { sch_matchmin = (feature.get("_schoolsmi")/1000); } // MATCH PERCENTAGE FOR COASTLINE // When user input doesn 't match cell range if ((feature.get("_coastli_1")/1000) > parseInt(sliderCoasts.value)) { coast_matchmax = 0; coast_matchmin = 0; } else if (parseInt(sliderCoasts.value) == (feature.get("_coastli_1")/1000)) { coast_matchmax = 0; coast_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_coastli_2")/1000) == parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } else if ((feature.get("_coastli_2")/1000) > parseInt(sliderSchools.value)) { coast_matchmax = parseInt(sliderCoasts.value); } else if ((feature.get("_coastli_2")/1000) < parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_coastli_1")/1000) == 0) { coast_matchmin = 0; } else if ((feature.get("_coastli_1")/1000 > 0)) { coast_matchmin = (feature.get("_coastli_1")/1000); } // MATCH PERCENTAGE FOR HOSPITALS // When user input doesn 't match cell range if ((feature.get("_hospita_1")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = 0; hos_matchmin = 0; } else if (parseInt(sliderHospitals.value) == (feature.get("_hospita_1")/1000)) { hos_matchmax = 0; hos_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_hospita_2")/1000) == parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } else if ((feature.get("_hospita_2")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = parseInt(sliderHospitals.value); } else if ((feature.get("_hospita_2")/1000) < parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_hospita_1")/1000) == 0) { hos_matchmin = 0; } else if ((feature.get("_hospita_1")/1000 > 0)) { hos_matchmin = (feature.get("_hospita_1")/1000); } // MATCH PERCENTAGE FOR LEISURE PARKS // When user input doesn 't match cell range if ((feature.get("_leisure_1")/1000) > parseInt(sliderParks.value)) { parks_matchmax = 0; parks_matchmin = 0; } else if (parseInt(sliderParks.value) == (feature.get("_leisure_1") /1000)) { parks_matchmax = 0; parks_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_leisure_2")/1000) == parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } else if ((feature.get("_leisure_2")/1000) > parseInt(sliderParks.value)) { parks_matchmax = parseInt(sliderParks.value); } else if ((feature.get("_leisure_2")/1000) < parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_leisure_1")/1000) == 0) { parks_matchmin = 0; } else if ((feature.get("_leisure_1")/1000 > 0)) { parks_matchmin = (feature.get("_leisure_1")/1000); } // MATCH PERCENTAGE FOR ROADS // When user input doesn 't match cell range if ((feature.get("_roadsmin")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = 0; roads_matchmin = 0; } else if (parseInt(sliderRoads.value) == (feature.get("_roadsmin")/1000)) { roads_matchmax = 0; roads_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_roadsmax")/1000) == parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } else if ((feature.get("_roadsmax")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = parseInt(sliderRoads.value); } else if ((feature.get("_roadsmax")/1000) < parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_roadsmin")/1000) == 0) { roads_matchmin = 0; } else if ((feature.get("_roadsmin")/1000 > 0)) { roads_matchmin = (feature.get("_roadsmin")/1000); } // MATCH PERCENTAGE FOR SUPERMARKETS // When user input doesn 't match cell range if ((feature.get("_superma_1")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = 0; markets_matchmin = 0; } else if (parseInt(sliderMarkets.value) == (feature.get("_superma_1")/1000)) { markets_matchmax = 0; markets_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_superma_2")/1000) == parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } else if ((feature.get("_superma_2")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = parseInt(sliderMarkets.value); } else if ((feature.get("_superma_2")/1000) < parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_superma_1")/1000) == 0) { markets_matchmin = 0; } else if ((feature.get("_superma_1")/1000 > 0)) { markets_matchmin = (feature.get("_superma_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STOPS // When user input doesn't match cell range if ((feature.get("_pt_stop_1")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = 0; ptst_matchmin = 0; } else if (parseInt(sliderPstops.value) == (feature.get("_pt_stop_1")/1000)) { ptst_matchmax = 0; ptst_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stop_2")/1000) == parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } else if (( feature.get("_pt_stop_2")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = parseInt(sliderPstops.value); } else if ((feature.get("_pt_stop_2")/1000) < parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stop_1")/1000) == 0) { ptst_matchmin = 0; } else if ((feature.get("_pt_stop_1") /1000 > 0)) { ptst_matchmin = (feature.get("_pt_stop_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STATIONS // When user input doesn't match cell range if ((feature.get("_pt_stat_1")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } else if (parseInt(sliderPstations.value) == (feature.get("_pt_stat_1")/1000)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stat_2")/1000) == parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } else if (( feature.get("_pt_stat_2")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = parseInt(sliderPstations.value); } else if ((feature.get("_pt_stations_2")/1000) < parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stat_1")/1000) == 0) { ptsta_matchmin = 0; } else if ((feature.get("_pt_stat_1") /1000 > 0)) { ptsta_matchmin = (feature.get("_pt_stat_1")/1000); } // MATCH PERCENTAGE FOR RESTAURANTS // When user input doesn 't match cell range if ((feature.get("_restaur_1")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = 0; resto_matchmin = 0; } else if (parseInt(sliderRestuarants.value) == (feature.get("_restaur_1")/1000)) { resto_matchmax = 0; resto_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_restaur_2")/1000) == parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } else if ((feature.get("_restaur_2")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = parseInt(sliderRestuarants.value); } else if ((feature.get("_restaur_2")/1000) < parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_restaur_1")/1000) == 0) { resto_matchmin = 0; } else if ((feature.get("_restaur_1")/1000 > 0)) { resto_matchmin = (feature.get("_restaur_1")/1000); } // MATCH PERCENTAGE FOR THEATRES // When user input doesn 't match cell range if ((feature.get("_theatre_1")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = 0; the_matchmin = 0; } else if (parseInt(sliderTheatres.value) == (feature.get("_theatre_1")/1000)) { the_matchmax = 0; the_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_theatre_2")/1000) == parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } else if ((feature.get("_theatre_2")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = parseInt(sliderTheatres.value); } else if ((feature.get("_theatre_2")/1000) < parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_theatre_1")/1000) == 0) { the_matchmin = 0; } else if ((feature.get("_theatre_1")/1000 > 0)) { the_matchmin = (feature.get("_theatre_1")/1000); } // MATCH PERCENTAGE FOR CINEMAS // When user input doesn 't match cell range if ((feature.get("_cinemasmi")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = 0; cin_matchmin = 0; } else if (parseInt(sliderCinemas.value) == (feature.get("_cinemasmi")/1000)) { cin_matchmax = 0; cin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_cinemasma")/1000) == parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } else if ((feature.get("_cinemasma")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = parseInt(sliderCinemas.value); } else if ((feature.get("_cinemasma")/1000) < parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_cinemasmi")/1000) == 0) { cin_matchmin = 0; } else if ((feature.get("_cinemasmi")/1000 > 0)) { cin_matchmin = (feature.get("_cinemasmi")/1000); } // MATCH PERCENTAGE FOR KINDERGARTENS // When user input doesn 't match cell range if ((feature.get("_kindermin")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = 0; kin_matchmin = 0; } else if (parseInt(sliderKinder.value) == (feature.get("_kindermin")/1000)) { kin_matchmax = 0; kin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_kindermax")/1000) == parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } else if ((feature.get("_kindermax")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = parseInt(sliderKinder.value); } else if ((feature.get("_kindermax")/1000) < parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_kindermin")/1000) == 0) { kin_matchmin = 0; } else if ((feature.get("_kindermin")/1000 > 0)) { kin_matchmin = (feature.get("_kindermin")/1000); } // MATCH PERCENTAGE FOR INDUSTRIES // When user input doesn 't match cell range if ((feature.get("_industr_1")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = 0; ind_matchmin = 0; } else if (parseInt(sliderIndustry.value) == (feature.get("_industr_1")/1000)) { ind_matchmax = 0; ind_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_industr_2")/1000) == parseInt(sliderIndustry.value)) { } else if ((feature.get("_industr_2")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = parseInt(sliderIndustry.value); } else if ((feature.get("_industr_2")/1000) < parseInt(sliderIndustry.value)) { ind_matchmax = (feature.get("_industr_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_industr_1")/1000) == 0) { ind_matchmin = 0; } else if ((feature.get("_industr_1")/1000 > 0)) { ind_matchmin = (feature.get("_industr_1")/1000); } // MATCH PERCENTAGE FOR WATER BODIES // When user input doesn 't match cell range if ((feature.get("_waterbo_1")) > parseInt(sliderWater.value)) { wat_matchmax = 0; wat_matchmin = 0; } else if (parseInt(sliderWater.value) == (feature.get("_waterbo_1"))) { wat_matchmax = 0; wat_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_waterbo_2")) == parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } else if ((feature.get("_waterbo_2")) > parseInt(sliderWater.value)) { wat_matchmax = parseInt(sliderWater.value); } else if ((feature.get("_waterbo_2")) < parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } // Getting the minimum matching distance value else if ((feature.get("_waterbo_1")) == 0) { wat_matchmin = 0; } else if ((feature.get("_waterbo_1")) > 0){ wat_matchmin = (feature.get("_waterbo_1")); } // MATCH PERCENTAGE FOR HOUSE PRICES if ((feature.get("housepri_2")) > parseInt(sliderHprice.value)) { house_match_perc = 0; //Out of the cell interval } else {(((feature.get("housepri_2") == parseInt(sliderHprice.value)) || (parseInt(sliderHprice.value) > (feature.get("housepri_2"))))) house_match_perc = 100; //Within the cell interval } //UNIVERSITIES matching percentage uni_matchdiff = (uni_matchmax - uni_matchmin); cell_int_u = (feature.get("_univers_2")/1000) - (feature.get("_univers_1")/1000); // Getting the match percentage uni_match_perc = (uni_matchdiff * 100) / cell_int_u; //SCHOOLS matching percentage sch_matchdiff = (sch_matchmax - sch_matchmin); cell_int_sch = (feature.get("_schoolsma")/1000) - (feature.get("_schoolsmi")/1000); // Getting the match percentage sch_match_perc = (sch_matchdiff * 100) / cell_int_sch; //COASTLINE matching percentage coast_matchdiff = (coast_matchmax - coast_matchmin); cell_int_coast = (feature.get("_coastli_2")/1000) - (feature.get("_coastli_1")/1000); // Getting the match percentage coast_match_perc = (coast_matchdiff * 100) / cell_int_coast; //HOSPITALS matching percentage hos_matchdiff = (hos_matchmax - hos_matchmin); cell_int_hos = (feature.get("_hospita_2")/1000) - (feature.get("_hospita_1")/1000); // Getting the match percentage hos_match_perc = (hos_matchdiff * 100) / cell_int_hos; //PARKS matching percentage parks_matchdiff = (parks_matchmax - parks_matchmin); cell_int_parks = (feature.get("_leisure_2")/1000) - (feature.get("_leisure_1")/1000); // Getting the match percentage parks_match_perc = (parks_matchdiff * 100) / cell_int_parks; // ROADS matching percentage roads_matchdiff = (roads_matchmax - roads_matchmin); cell_int_roads = (feature.get("_roadsmax")/1000) - (feature.get("_roadsmin")/1000); // Getting the match percentage roads_match_perc = (roads_matchdiff * 100) / cell_int_roads; // SUPERMARKETS matching percentage markets_matchdiff = (markets_matchmax - markets_matchmin); cell_int_markets = (feature.get("_superma_2")/1000) - (feature.get("_superma_1")/1000); // Getting the match percentage markets_match_perc = (markets_matchdiff * 100) / cell_int_markets; // PUBLIC TRANSPORT STOPS matching percentage ptst_matchdiff = (ptst_matchmax - ptst_matchmin); cell_int_ptst = (feature.get("_pt_stop_2")/1000) - (feature.get("_pt_stop_1")/1000); // Getting the match percentage ptst_match_perc = (ptst_matchdiff * 100) / cell_int_ptst; // PUBLIC TRANSPORT STATIONS matching percentage ptsta_matchdiff = (ptsta_matchmax - ptsta_matchmin); cell_int_ptsta = (feature.get("_pt_stat_2")/1000) - (feature.get("_pt_stat_1")/1000); // Getting the match percentage ptsta_match_perc = (ptsta_matchdiff * 100) / cell_int_ptsta; // RESTAURANTS matching percentage resto_matchdiff = (resto_matchmax - resto_matchmin); cell_int_resto = (feature.get("_restaur_2")/1000) - (feature.get("_restaur_1")/1000); // Getting the match percentage resto_match_perc = (resto_matchdiff * 100) / cell_int_resto; // THEATRES matching percentage the_matchdiff = (the_matchmax - the_matchmin); cell_int_the = (feature.get("_theatre_2")/1000) - (feature.get("_theatre_1")/1000); // Getting the match percentage the_match_perc = (the_matchdiff * 100) / cell_int_the; // CINEMAS matching percentage cin_matchdiff = (cin_matchmax - cin_matchmin); cell_int_cin = (feature.get("_cinemasma")/1000) - (feature.get("_cinemasmi")/1000); // Getting the match percentage cin_match_perc = ( cin_matchdiff * 100) / cell_int_cin; // KINDERGARTENS matching percentage kin_matchdiff = (kin_matchmax - kin_matchmin); cell_int_kin = (feature.get("_kindermax")/1000) - (feature.get("_kindermin")/1000); // Getting the match percentage kin_match_perc = (kin_matchdiff * 100) / cell_int_kin; // INDUSTRIES matching percentage ind_matchdiff = (ind_matchmax - ind_matchmin); cell_int_ind = (feature.get("_industr_2")/1000) - (feature.get("_industr_1")/1000); // Getting the match percentage ind_match_perc = (ind_matchdiff * 100) / cell_int_ind; // WATER BODIES matching percentage wat_matchdiff = (wat_matchmax - wat_matchmin); cell_int_wat = (feature.get("_waterbo_2")/1000) - (feature.get("_waterbo_1")/1000); // Getting the match percentage wat_match_perc = (wat_matchdiff * 100) / cell_int_wat; // OVERALL PERCENTAGE CELL MATCH var new_fuzzy_value_1km_midtjylland = (ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + ptsta_matchdiff + ptst_matchdiff + resto_matchdiff + markets_matchdiff + roads_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff)/ (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_ptsta + cell_int_ptst + cell_int_markets + cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u + cell_int_sch + cell_int_roads + cell_int_wat); feature.set("fuzzyvalue", new_fuzzy_value_1km_midtjylland); accessibility = (((roads_matchdiff + ptsta_matchdiff + ptst_matchdiff)*100 / (cell_int_ptsta + cell_int_ptst + cell_int_roads))); livability = ((ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + resto_matchdiff + markets_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff) * 100) / (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_markets+ cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u +cell_int_sch + cell_int_wat); suitability = house_match_perc; feature.set("accessibility", accessibility); feature.set("livability", livability); feature.set("suitability", suitability); }); features_1km_midtjyllandw.forEach(function(feature ){ // MATCH PERCENTAGE FOR UNIVERSITIES // When user input doesn't match cell range if ((feature.get("_univers_1")/1000) > parseInt(sliderUni.value)) { uni_matchmax = 0; uni_matchmin = 0; } else if (parseInt(sliderUni.value) == (feature.get("_univers_1")/1000)) { uni_matchmax = 0; uni_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_univers_2")/1000) == parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } else if ((feature.get("_univers_2")/1000) > parseInt(sliderUni.value)) { uni_matchmax = parseInt(sliderUni.value); } else if ((feature.get("_univers_2")/1000) < parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_univers_1")/1000) == 0) { uni_matchmin = 0; } else if ((feature.get("_univers_1") /1000 > 0)) { uni_matchmin = (feature.get("_univers_1")/1000); } // MATCH PERCENTAGE FOR SCHOOLS // When user input doesn 't match cell range if ((feature.get("_schoolsmi")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = 0; sch_matchmin = 0; } else if (parseInt(sliderSchools.value) == (feature.get("_schoolsmi")/1000)) { sch_matchmax = 0; sch_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_schoolsma")/1000) == parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } else if ((feature.get("_schoolsma")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = parseInt(sliderSchools.value); } else if ((feature.get("_schoolsma")/1000) < parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_schoolsmi")/1000) == 0) { sch_matchmin = 0; } else if ((feature.get("_schoolsmi")/1000 > 0)) { sch_matchmin = (feature.get("_schoolsmi")/1000); } // MATCH PERCENTAGE FOR COASTLINE // When user input doesn 't match cell range if ((feature.get("_coastli_1")/1000) > parseInt(sliderCoasts.value)) { coast_matchmax = 0; coast_matchmin = 0; } else if (parseInt(sliderCoasts.value) == (feature.get("_coastli_1")/1000)) { coast_matchmax = 0; coast_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_coastli_2")/1000) == parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } else if ((feature.get("_coastli_2")/1000) > parseInt(sliderSchools.value)) { coast_matchmax = parseInt(sliderCoasts.value); } else if ((feature.get("_coastli_2")/1000) < parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_coastli_1")/1000) == 0) { coast_matchmin = 0; } else if ((feature.get("_coastli_1")/1000 > 0)) { coast_matchmin = (feature.get("_coastli_1")/1000); } // MATCH PERCENTAGE FOR HOSPITALS // When user input doesn 't match cell range if ((feature.get("_hospita_1")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = 0; hos_matchmin = 0; } else if (parseInt(sliderHospitals.value) == (feature.get("_hospita_1")/1000)) { hos_matchmax = 0; hos_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_hospita_2")/1000) == parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } else if ((feature.get("_hospita_2")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = parseInt(sliderHospitals.value); } else if ((feature.get("_hospita_2")/1000) < parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_hospita_1")/1000) == 0) { hos_matchmin = 0; } else if ((feature.get("_hospita_1")/1000 > 0)) { hos_matchmin = (feature.get("_hospita_1")/1000); } // MATCH PERCENTAGE FOR LEISURE PARKS // When user input doesn 't match cell range if ((feature.get("_leisure_1")/1000) > parseInt(sliderParks.value)) { parks_matchmax = 0; parks_matchmin = 0; } else if (parseInt(sliderParks.value) == (feature.get("_leisure_1") /1000)) { parks_matchmax = 0; parks_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_leisure_2")/1000) == parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } else if ((feature.get("_leisure_2")/1000) > parseInt(sliderParks.value)) { parks_matchmax = parseInt(sliderParks.value); } else if ((feature.get("_leisure_2")/1000) < parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_leisure_1")/1000) == 0) { parks_matchmin = 0; } else if ((feature.get("_leisure_1")/1000 > 0)) { parks_matchmin = (feature.get("_leisure_1")/1000); } // MATCH PERCENTAGE FOR ROADS // When user input doesn 't match cell range if ((feature.get("_roadsmin")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = 0; roads_matchmin = 0; } else if (parseInt(sliderRoads.value) == (feature.get("_roadsmin")/1000)) { roads_matchmax = 0; roads_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_roadsmax")/1000) == parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } else if ((feature.get("_roadsmax")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = parseInt(sliderRoads.value); } else if ((feature.get("_roadsmax")/1000) < parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_roadsmin")/1000) == 0) { roads_matchmin = 0; } else if ((feature.get("_roadsmin")/1000 > 0)) { roads_matchmin = (feature.get("_roadsmin")/1000); } // MATCH PERCENTAGE FOR SUPERMARKETS // When user input doesn 't match cell range if ((feature.get("_superma_1")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = 0; markets_matchmin = 0; } else if (parseInt(sliderMarkets.value) == (feature.get("_superma_1")/1000)) { markets_matchmax = 0; markets_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_superma_2")/1000) == parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } else if ((feature.get("_superma_2")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = parseInt(sliderMarkets.value); } else if ((feature.get("_superma_2")/1000) < parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_superma_1")/1000) == 0) { markets_matchmin = 0; } else if ((feature.get("_superma_1")/1000 > 0)) { markets_matchmin = (feature.get("_superma_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STOPS // When user input doesn't match cell range if ((feature.get("_pt_stop_1")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = 0; ptst_matchmin = 0; } else if (parseInt(sliderPstops.value) == (feature.get("_pt_stop_1")/1000)) { ptst_matchmax = 0; ptst_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stop_2")/1000) == parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } else if (( feature.get("_pt_stop_2")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = parseInt(sliderPstops.value); } else if ((feature.get("_pt_stop_2")/1000) < parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stop_1")/1000) == 0) { ptst_matchmin = 0; } else if ((feature.get("_pt_stop_1") /1000 > 0)) { ptst_matchmin = (feature.get("_pt_stop_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STATIONS // When user input doesn't match cell range if ((feature.get("_pt_stat_1")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } else if (parseInt(sliderPstations.value) == (feature.get("_pt_stat_1")/1000)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stat_2")/1000) == parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } else if (( feature.get("_pt_stat_2")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = parseInt(sliderPstations.value); } else if ((feature.get("_pt_stations_2")/1000) < parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stat_1")/1000) == 0) { ptsta_matchmin = 0; } else if ((feature.get("_pt_stat_1") /1000 > 0)) { ptsta_matchmin = (feature.get("_pt_stat_1")/1000); } // MATCH PERCENTAGE FOR RESTAURANTS // When user input doesn 't match cell range if ((feature.get("_restaur_1")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = 0; resto_matchmin = 0; } else if (parseInt(sliderRestuarants.value) == (feature.get("_restaur_1")/1000)) { resto_matchmax = 0; resto_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_restaur_2")/1000) == parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } else if ((feature.get("_restaur_2")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = parseInt(sliderRestuarants.value); } else if ((feature.get("_restaur_2")/1000) < parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_restaur_1")/1000) == 0) { resto_matchmin = 0; } else if ((feature.get("_restaur_1")/1000 > 0)) { resto_matchmin = (feature.get("_restaur_1")/1000); } // MATCH PERCENTAGE FOR THEATRES // When user input doesn 't match cell range if ((feature.get("_theatre_1")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = 0; the_matchmin = 0; } else if (parseInt(sliderTheatres.value) == (feature.get("_theatre_1")/1000)) { the_matchmax = 0; the_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_theatre_2")/1000) == parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } else if ((feature.get("_theatre_2")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = parseInt(sliderTheatres.value); } else if ((feature.get("_theatre_2")/1000) < parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_theatre_1")/1000) == 0) { the_matchmin = 0; } else if ((feature.get("_theatre_1")/1000 > 0)) { the_matchmin = (feature.get("_theatre_1")/1000); } // MATCH PERCENTAGE FOR CINEMAS // When user input doesn 't match cell range if ((feature.get("_cinemasmi")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = 0; cin_matchmin = 0; } else if (parseInt(sliderCinemas.value) == (feature.get("_cinemasmi")/1000)) { cin_matchmax = 0; cin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_cinemasma")/1000) == parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } else if ((feature.get("_cinemasma")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = parseInt(sliderCinemas.value); } else if ((feature.get("_cinemasma")/1000) < parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_cinemasmi")/1000) == 0) { cin_matchmin = 0; } else if ((feature.get("_cinemasmi")/1000 > 0)) { cin_matchmin = (feature.get("_cinemasmi")/1000); } // MATCH PERCENTAGE FOR KINDERGARTENS // When user input doesn 't match cell range if ((feature.get("_kindermin")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = 0; kin_matchmin = 0; } else if (parseInt(sliderKinder.value) == (feature.get("_kindermin")/1000)) { kin_matchmax = 0; kin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_kindermax")/1000) == parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } else if ((feature.get("_kindermax")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = parseInt(sliderKinder.value); } else if ((feature.get("_kindermax")/1000) < parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_kindermin")/1000) == 0) { kin_matchmin = 0; } else if ((feature.get("_kindermin")/1000 > 0)) { kin_matchmin = (feature.get("_kindermin")/1000); } // MATCH PERCENTAGE FOR INDUSTRIES // When user input doesn 't match cell range if ((feature.get("_industr_1")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = 0; ind_matchmin = 0; } else if (parseInt(sliderIndustry.value) == (feature.get("_industr_1")/1000)) { ind_matchmax = 0; ind_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_industr_2")/1000) == parseInt(sliderIndustry.value)) { } else if ((feature.get("_industr_2")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = parseInt(sliderIndustry.value); } else if ((feature.get("_industr_2")/1000) < parseInt(sliderIndustry.value)) { ind_matchmax = (feature.get("_industr_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_industr_1")/1000) == 0) { ind_matchmin = 0; } else if ((feature.get("_industr_1")/1000 > 0)) { ind_matchmin = (feature.get("_industr_1")/1000); } // MATCH PERCENTAGE FOR WATER BODIES // When user input doesn 't match cell range if ((feature.get("_waterbo_1")) > parseInt(sliderWater.value)) { wat_matchmax = 0; wat_matchmin = 0; } else if (parseInt(sliderWater.value) == (feature.get("_waterbo_1"))) { wat_matchmax = 0; wat_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_waterbo_2")) == parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } else if ((feature.get("_waterbo_2")) > parseInt(sliderWater.value)) { wat_matchmax = parseInt(sliderWater.value); } else if ((feature.get("_waterbo_2")) < parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } // Getting the minimum matching distance value else if ((feature.get("_waterbo_1")) == 0) { wat_matchmin = 0; } else if ((feature.get("_waterbo_1")) > 0){ wat_matchmin = (feature.get("_waterbo_1")); } // MATCH PERCENTAGE FOR HOUSE PRICES if ((feature.get("housepri_2")) > parseInt(sliderHprice.value)) { house_match_perc = 0; //Out of the cell interval } else {(((feature.get("housepri_2") == parseInt(sliderHprice.value)) || (parseInt(sliderHprice.value) > (feature.get("housepri_2"))))) house_match_perc = 100; //Within the cell interval } //UNIVERSITIES matching percentage uni_matchdiff = (uni_matchmax - uni_matchmin); cell_int_u = (feature.get("_univers_2")/1000) - (feature.get("_univers_1")/1000); // Getting the match percentage uni_match_perc = (uni_matchdiff * 100) / cell_int_u; //SCHOOLS matching percentage sch_matchdiff = (sch_matchmax - sch_matchmin); cell_int_sch = (feature.get("_schoolsma")/1000) - (feature.get("_schoolsmi")/1000); // Getting the match percentage sch_match_perc = (sch_matchdiff * 100) / cell_int_sch; //COASTLINE matching percentage coast_matchdiff = (coast_matchmax - coast_matchmin); cell_int_coast = (feature.get("_coastli_2")/1000) - (feature.get("_coastli_1")/1000); // Getting the match percentage coast_match_perc = (coast_matchdiff * 100) / cell_int_coast; //HOSPITALS matching percentage hos_matchdiff = (hos_matchmax - hos_matchmin); cell_int_hos = (feature.get("_hospita_2")/1000) - (feature.get("_hospita_1")/1000); // Getting the match percentage hos_match_perc = (hos_matchdiff * 100) / cell_int_hos; //PARKS matching percentage parks_matchdiff = (parks_matchmax - parks_matchmin); cell_int_parks = (feature.get("_leisure_2")/1000) - (feature.get("_leisure_1")/1000); // Getting the match percentage parks_match_perc = (parks_matchdiff * 100) / cell_int_parks; // ROADS matching percentage roads_matchdiff = (roads_matchmax - roads_matchmin); cell_int_roads = (feature.get("_roadsmax")/1000) - (feature.get("_roadsmin")/1000); // Getting the match percentage roads_match_perc = (roads_matchdiff * 100) / cell_int_roads; // SUPERMARKETS matching percentage markets_matchdiff = (markets_matchmax - markets_matchmin); cell_int_markets = (feature.get("_superma_2")/1000) - (feature.get("_superma_1")/1000); // Getting the match percentage markets_match_perc = (markets_matchdiff * 100) / cell_int_markets; // PUBLIC TRANSPORT STOPS matching percentage ptst_matchdiff = (ptst_matchmax - ptst_matchmin); cell_int_ptst = (feature.get("_pt_stop_2")/1000) - (feature.get("_pt_stop_1")/1000); // Getting the match percentage ptst_match_perc = (ptst_matchdiff * 100) / cell_int_ptst; // PUBLIC TRANSPORT STATIONS matching percentage ptsta_matchdiff = (ptsta_matchmax - ptsta_matchmin); cell_int_ptsta = (feature.get("_pt_stat_2")/1000) - (feature.get("_pt_stat_1")/1000); // Getting the match percentage ptsta_match_perc = (ptsta_matchdiff * 100) / cell_int_ptsta; // RESTAURANTS matching percentage resto_matchdiff = (resto_matchmax - resto_matchmin); cell_int_resto = (feature.get("_restaur_2")/1000) - (feature.get("_restaur_1")/1000); // Getting the match percentage resto_match_perc = (resto_matchdiff * 100) / cell_int_resto; // THEATRES matching percentage the_matchdiff = (the_matchmax - the_matchmin); cell_int_the = (feature.get("_theatre_2")/1000) - (feature.get("_theatre_1")/1000); // Getting the match percentage the_match_perc = (the_matchdiff * 100) / cell_int_the; // CINEMAS matching percentage cin_matchdiff = (cin_matchmax - cin_matchmin); cell_int_cin = (feature.get("_cinemasma")/1000) - (feature.get("_cinemasmi")/1000); // Getting the match percentage cin_match_perc = ( cin_matchdiff * 100) / cell_int_cin; // KINDERGARTENS matching percentage kin_matchdiff = (kin_matchmax - kin_matchmin); cell_int_kin = (feature.get("_kindermax")/1000) - (feature.get("_kindermin")/1000); // Getting the match percentage kin_match_perc = (kin_matchdiff * 100) / cell_int_kin; // INDUSTRIES matching percentage ind_matchdiff = (ind_matchmax - ind_matchmin); cell_int_ind = (feature.get("_industr_2")/1000) - (feature.get("_industr_1")/1000); // Getting the match percentage ind_match_perc = (ind_matchdiff * 100) / cell_int_ind; // WATER BODIES matching percentage wat_matchdiff = (wat_matchmax - wat_matchmin); cell_int_wat = (feature.get("_waterbo_2")/1000) - (feature.get("_waterbo_1")/1000); // Getting the match percentage wat_match_perc = (wat_matchdiff * 100) / cell_int_wat; // OVERALL PERCENTAGE CELL MATCH var new_fuzzy_value_1km_midtjyllandw = (ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + ptsta_matchdiff + ptst_matchdiff + resto_matchdiff + markets_matchdiff + roads_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff)/ (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_ptsta + cell_int_ptst + cell_int_markets + cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u + cell_int_sch + cell_int_roads + cell_int_wat); feature.set("fuzzyvalue", new_fuzzy_value_1km_midtjyllandw); accessibility = (((roads_matchdiff + ptsta_matchdiff + ptst_matchdiff)*100 / (cell_int_ptsta + cell_int_ptst + cell_int_roads))); livability = ((ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + resto_matchdiff + markets_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff) * 100) / (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_markets+ cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u +cell_int_sch + cell_int_wat); suitability = house_match_perc; feature.set("accessibility", accessibility); feature.set("livability", livability); feature.set("suitability", suitability); }); features_1km_sjælland.forEach(function(feature ){ // MATCH PERCENTAGE FOR UNIVERSITIES // When user input doesn't match cell range if ((feature.get("_univers_1")/1000) > parseInt(sliderUni.value)) { uni_matchmax = 0; uni_matchmin = 0; } else if (parseInt(sliderUni.value) == (feature.get("_univers_1")/1000)) { uni_matchmax = 0; uni_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_univers_2")/1000) == parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } else if ((feature.get("_univers_2")/1000) > parseInt(sliderUni.value)) { uni_matchmax = parseInt(sliderUni.value); } else if ((feature.get("_univers_2")/1000) < parseInt(sliderUni.value)) { uni_matchmax = (feature.get("_univers_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_univers_1")/1000) == 0) { uni_matchmin = 0; } else if ((feature.get("_univers_1") /1000 > 0)) { uni_matchmin = (feature.get("_univers_1")/1000); } // MATCH PERCENTAGE FOR SCHOOLS // When user input doesn 't match cell range if ((feature.get("_schoolsmi")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = 0; sch_matchmin = 0; } else if (parseInt(sliderSchools.value) == (feature.get("_schoolsmi")/1000)) { sch_matchmax = 0; sch_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_schoolsma")/1000) == parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } else if ((feature.get("_schoolsma")/1000) > parseInt(sliderSchools.value)) { sch_matchmax = parseInt(sliderSchools.value); } else if ((feature.get("_schoolsma")/1000) < parseInt(sliderSchools.value)) { sch_matchmax = (feature.get("_schoolsma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_schoolsmi")/1000) == 0) { sch_matchmin = 0; } else if ((feature.get("_schoolsmi")/1000 > 0)) { sch_matchmin = (feature.get("_schoolsmi")/1000); } // MATCH PERCENTAGE FOR COASTLINE // When user input doesn 't match cell range if ((feature.get("_coastli_1")/1000) > parseInt(sliderCoasts.value)) { coast_matchmax = 0; coast_matchmin = 0; } else if (parseInt(sliderCoasts.value) == (feature.get("_coastli_1")/1000)) { coast_matchmax = 0; coast_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_coastli_2")/1000) == parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } else if ((feature.get("_coastli_2")/1000) > parseInt(sliderSchools.value)) { coast_matchmax = parseInt(sliderCoasts.value); } else if ((feature.get("_coastli_2")/1000) < parseInt(sliderCoasts.value)) { coast_matchmax = (feature.get("_coastli_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_coastli_1")/1000) == 0) { coast_matchmin = 0; } else if ((feature.get("_coastli_1")/1000 > 0)) { coast_matchmin = (feature.get("_coastli_1")/1000); } // MATCH PERCENTAGE FOR HOSPITALS // When user input doesn 't match cell range if ((feature.get("_hospita_1")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = 0; hos_matchmin = 0; } else if (parseInt(sliderHospitals.value) == (feature.get("_hospita_1")/1000)) { hos_matchmax = 0; hos_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_hospita_2")/1000) == parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } else if ((feature.get("_hospita_2")/1000) > parseInt(sliderHospitals.value)) { hos_matchmax = parseInt(sliderHospitals.value); } else if ((feature.get("_hospita_2")/1000) < parseInt(sliderHospitals.value)) { hos_matchmax = (feature.get("_hospita_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_hospita_1")/1000) == 0) { hos_matchmin = 0; } else if ((feature.get("_hospita_1")/1000 > 0)) { hos_matchmin = (feature.get("_hospita_1")/1000); } // MATCH PERCENTAGE FOR LEISURE PARKS // When user input doesn 't match cell range if ((feature.get("_leisure_1")/1000) > parseInt(sliderParks.value)) { parks_matchmax = 0; parks_matchmin = 0; } else if (parseInt(sliderParks.value) == (feature.get("_leisure_1") /1000)) { parks_matchmax = 0; parks_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_leisure_2")/1000) == parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } else if ((feature.get("_leisure_2")/1000) > parseInt(sliderParks.value)) { parks_matchmax = parseInt(sliderParks.value); } else if ((feature.get("_leisure_2")/1000) < parseInt(sliderParks.value)) { parks_matchmax = (feature.get("_leisure_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_leisure_1")/1000) == 0) { parks_matchmin = 0; } else if ((feature.get("_leisure_1")/1000 > 0)) { parks_matchmin = (feature.get("_leisure_1")/1000); } // MATCH PERCENTAGE FOR ROADS // When user input doesn 't match cell range if ((feature.get("_roadsmin")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = 0; roads_matchmin = 0; } else if (parseInt(sliderRoads.value) == (feature.get("_roadsmin")/1000)) { roads_matchmax = 0; roads_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_roadsmax")/1000) == parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } else if ((feature.get("_roadsmax")/1000) > parseInt(sliderRoads.value)) { roads_matchmax = parseInt(sliderRoads.value); } else if ((feature.get("_roadsmax")/1000) < parseInt(sliderRoads.value)) { roads_matchmax = (feature.get("_roadsmax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_roadsmin")/1000) == 0) { roads_matchmin = 0; } else if ((feature.get("_roadsmin")/1000 > 0)) { roads_matchmin = (feature.get("_roadsmin")/1000); } // MATCH PERCENTAGE FOR SUPERMARKETS // When user input doesn 't match cell range if ((feature.get("_superma_1")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = 0; markets_matchmin = 0; } else if (parseInt(sliderMarkets.value) == (feature.get("_superma_1")/1000)) { markets_matchmax = 0; markets_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_superma_2")/1000) == parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } else if ((feature.get("_superma_2")/1000) > parseInt(sliderMarkets.value)) { markets_matchmax = parseInt(sliderMarkets.value); } else if ((feature.get("_superma_2")/1000) < parseInt(sliderMarkets.value)) { markets_matchmax = (feature.get("_superma_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_superma_1")/1000) == 0) { markets_matchmin = 0; } else if ((feature.get("_superma_1")/1000 > 0)) { markets_matchmin = (feature.get("_superma_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STOPS // When user input doesn't match cell range if ((feature.get("_pt_stop_1")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = 0; ptst_matchmin = 0; } else if (parseInt(sliderPstops.value) == (feature.get("_pt_stop_1")/1000)) { ptst_matchmax = 0; ptst_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stop_2")/1000) == parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } else if (( feature.get("_pt_stop_2")/1000) > parseInt(sliderPstops.value)) { ptst_matchmax = parseInt(sliderPstops.value); } else if ((feature.get("_pt_stop_2")/1000) < parseInt(sliderPstops.value)) { ptst_matchmax = (feature.get("_pt_stop_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stop_1")/1000) == 0) { ptst_matchmin = 0; } else if ((feature.get("_pt_stop_1") /1000 > 0)) { ptst_matchmin = (feature.get("_pt_stop_1")/1000); } // MATCH PERCENTAGE FOR PUBLIC TRANSPORT STATIONS // When user input doesn't match cell range if ((feature.get("_pt_stat_1")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } else if (parseInt(sliderPstations.value) == (feature.get("_pt_stat_1")/1000)) { ptsta_matchmax = 0; ptsta_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_pt_stat_2")/1000) == parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } else if (( feature.get("_pt_stat_2")/1000) > parseInt(sliderPstations.value)) { ptsta_matchmax = parseInt(sliderPstations.value); } else if ((feature.get("_pt_stations_2")/1000) < parseInt(sliderPstations.value)) { ptsta_matchmax = (feature.get("_pt_stat_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_pt_stat_1")/1000) == 0) { ptsta_matchmin = 0; } else if ((feature.get("_pt_stat_1") /1000 > 0)) { ptsta_matchmin = (feature.get("_pt_stat_1")/1000); } // MATCH PERCENTAGE FOR RESTAURANTS // When user input doesn 't match cell range if ((feature.get("_restaur_1")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = 0; resto_matchmin = 0; } else if (parseInt(sliderRestuarants.value) == (feature.get("_restaur_1")/1000)) { resto_matchmax = 0; resto_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_restaur_2")/1000) == parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } else if ((feature.get("_restaur_2")/1000) > parseInt(sliderRestuarants.value)) { resto_matchmax = parseInt(sliderRestuarants.value); } else if ((feature.get("_restaur_2")/1000) < parseInt(sliderRestuarants.value)) { resto_matchmax = (feature.get("_restaur_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_restaur_1")/1000) == 0) { resto_matchmin = 0; } else if ((feature.get("_restaur_1")/1000 > 0)) { resto_matchmin = (feature.get("_restaur_1")/1000); } // MATCH PERCENTAGE FOR THEATRES // When user input doesn 't match cell range if ((feature.get("_theatre_1")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = 0; the_matchmin = 0; } else if (parseInt(sliderTheatres.value) == (feature.get("_theatre_1")/1000)) { the_matchmax = 0; the_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_theatre_2")/1000) == parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } else if ((feature.get("_theatre_2")/1000) > parseInt(sliderTheatres.value)) { the_matchmax = parseInt(sliderTheatres.value); } else if ((feature.get("_theatre_2")/1000) < parseInt(sliderTheatres.value)) { the_matchmax = (feature.get("_theatre_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_theatre_1")/1000) == 0) { the_matchmin = 0; } else if ((feature.get("_theatre_1")/1000 > 0)) { the_matchmin = (feature.get("_theatre_1")/1000); } // MATCH PERCENTAGE FOR CINEMAS // When user input doesn 't match cell range if ((feature.get("_cinemasmi")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = 0; cin_matchmin = 0; } else if (parseInt(sliderCinemas.value) == (feature.get("_cinemasmi")/1000)) { cin_matchmax = 0; cin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_cinemasma")/1000) == parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } else if ((feature.get("_cinemasma")/1000) > parseInt(sliderCinemas.value)) { cin_matchmax = parseInt(sliderCinemas.value); } else if ((feature.get("_cinemasma")/1000) < parseInt(sliderCinemas.value)) { cin_matchmax = (feature.get("_cinemasma")/1000); } // Getting the minimum matching distance value else if ((feature.get("_cinemasmi")/1000) == 0) { cin_matchmin = 0; } else if ((feature.get("_cinemasmi")/1000 > 0)) { cin_matchmin = (feature.get("_cinemasmi")/1000); } // MATCH PERCENTAGE FOR KINDERGARTENS // When user input doesn 't match cell range if ((feature.get("_kindermin")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = 0; kin_matchmin = 0; } else if (parseInt(sliderKinder.value) == (feature.get("_kindermin")/1000)) { kin_matchmax = 0; kin_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_kindermax")/1000) == parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } else if ((feature.get("_kindermax")/1000) > parseInt(sliderKinder.value)) { kin_matchmax = parseInt(sliderKinder.value); } else if ((feature.get("_kindermax")/1000) < parseInt(sliderKinder.value)) { kin_matchmax = (feature.get("_kindermax")/1000); } // Getting the minimum matching distance value else if ((feature.get("_kindermin")/1000) == 0) { kin_matchmin = 0; } else if ((feature.get("_kindermin")/1000 > 0)) { kin_matchmin = (feature.get("_kindermin")/1000); } // MATCH PERCENTAGE FOR INDUSTRIES // When user input doesn 't match cell range if ((feature.get("_industr_1")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = 0; ind_matchmin = 0; } else if (parseInt(sliderIndustry.value) == (feature.get("_industr_1")/1000)) { ind_matchmax = 0; ind_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_industr_2")/1000) == parseInt(sliderIndustry.value)) { } else if ((feature.get("_industr_2")/1000) > parseInt(sliderIndustry.value)) { ind_matchmax = parseInt(sliderIndustry.value); } else if ((feature.get("_industr_2")/1000) < parseInt(sliderIndustry.value)) { ind_matchmax = (feature.get("_industr_2")/1000); } // Getting the minimum matching distance value else if ((feature.get("_industr_1")/1000) == 0) { ind_matchmin = 0; } else if ((feature.get("_industr_1")/1000 > 0)) { ind_matchmin = (feature.get("_industr_1")/1000); } // MATCH PERCENTAGE FOR WATER BODIES // When user input doesn 't match cell range if ((feature.get("_waterbo_1")) > parseInt(sliderWater.value)) { wat_matchmax = 0; wat_matchmin = 0; } else if (parseInt(sliderWater.value) == (feature.get("_waterbo_1"))) { wat_matchmax = 0; wat_matchmin = 0; } // Getting the maximum matching distance value else if ((feature.get("_waterbo_2")) == parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } else if ((feature.get("_waterbo_2")) > parseInt(sliderWater.value)) { wat_matchmax = parseInt(sliderWater.value); } else if ((feature.get("_waterbo_2")) < parseInt(sliderWater.value)) { wat_matchmax = (feature.get("_waterbo_2")); } // Getting the minimum matching distance value else if ((feature.get("_waterbo_1")) == 0) { wat_matchmin = 0; } else if((feature.get("_waterbo_1")) > 0){ wat_matchmin = (feature.get("_waterbo_1")); } // MATCH PERCENTAGE FOR HOUSE PRICES if ((feature.get("housepri_2")) > parseInt(sliderHprice.value)) { house_match_perc = 0; //Out of the cell interval } else {(((feature.get("housepri_2") == parseInt(sliderHprice.value)) || (parseInt(sliderHprice.value) > (feature.get("housepri_2"))))) house_match_perc = 100; //Within the cell interval } //UNIVERSITIES matching percentage uni_matchdiff = (uni_matchmax - uni_matchmin); cell_int_u = (feature.get("_univers_2")/1000) - (feature.get("_univers_1")/1000); // Getting the match percentage uni_match_perc = (uni_matchdiff * 100) / cell_int_u; //SCHOOLS matching percentage sch_matchdiff = (sch_matchmax - sch_matchmin); cell_int_sch = (feature.get("_schoolsma")/1000) - (feature.get("_schoolsmi")/1000); // Getting the match percentage sch_match_perc = (sch_matchdiff * 100) / cell_int_sch; //COASTLINE matching percentage coast_matchdiff = (coast_matchmax - coast_matchmin); cell_int_coast = (feature.get("_coastli_2")/1000) - (feature.get("_coastli_1")/1000); // Getting the match percentage coast_match_perc = (coast_matchdiff * 100) / cell_int_coast; //HOSPITALS matching percentage hos_matchdiff = (hos_matchmax - hos_matchmin); cell_int_hos = (feature.get("_hospita_2")/1000) - (feature.get("_hospita_1")/1000); // Getting the match percentage hos_match_perc = (hos_matchdiff * 100) / cell_int_hos; //PARKS matching percentage parks_matchdiff = (parks_matchmax - parks_matchmin); cell_int_parks = (feature.get("_leisure_2")/1000) - (feature.get("_leisure_1")/1000); // Getting the match percentage parks_match_perc = (parks_matchdiff * 100) / cell_int_parks; // ROADS matching percentage roads_matchdiff = (roads_matchmax - roads_matchmin); cell_int_roads = (feature.get("_roadsmax")/1000) - (feature.get("_roadsmin")/1000); // Getting the match percentage roads_match_perc = (roads_matchdiff * 100) / cell_int_roads; // SUPERMARKETS matching percentage markets_matchdiff = (markets_matchmax - markets_matchmin); cell_int_markets = (feature.get("_superma_2")/1000) - (feature.get("_superma_1")/1000); // Getting the match percentage markets_match_perc = (markets_matchdiff * 100) / cell_int_markets; // PUBLIC TRANSPORT STOPS matching percentage ptst_matchdiff = (ptst_matchmax - ptst_matchmin); cell_int_ptst = (feature.get("_pt_stop_2")/1000) - (feature.get("_pt_stop_1")/1000); // Getting the match percentage ptst_match_perc = (ptst_matchdiff * 100) / cell_int_ptst; // PUBLIC TRANSPORT STATIONS matching percentage ptsta_matchdiff = (ptsta_matchmax - ptsta_matchmin); cell_int_ptsta = (feature.get("_pt_stat_2")/1000) - (feature.get("_pt_stat_1")/1000); // Getting the match percentage ptsta_match_perc = (ptsta_matchdiff * 100) / cell_int_ptsta; // RESTAURANTS matching percentage resto_matchdiff = (resto_matchmax - resto_matchmin); cell_int_resto = (feature.get("_restaur_2")/1000) - (feature.get("_restaur_1")/1000); // Getting the match percentage resto_match_perc = (resto_matchdiff * 100) / cell_int_resto; // THEATRES matching percentage the_matchdiff = (the_matchmax - the_matchmin); cell_int_the = (feature.get("_theatre_2")/1000) - (feature.get("_theatre_1")/1000); // Getting the match percentage the_match_perc = (the_matchdiff * 100) / cell_int_the; // CINEMAS matching percentage cin_matchdiff = (cin_matchmax - cin_matchmin); cell_int_cin = (feature.get("_cinemasma")/1000) - (feature.get("_cinemasmi")/1000); // Getting the match percentage cin_match_perc = ( cin_matchdiff * 100) / cell_int_cin; // KINDERGARTENS matching percentage kin_matchdiff = (kin_matchmax - kin_matchmin); cell_int_kin = (feature.get("_kindermax")/1000) - (feature.get("_kindermin")/1000); // Getting the match percentage kin_match_perc = (kin_matchdiff * 100) / cell_int_kin; // INDUSTRIES matching percentage ind_matchdiff = (ind_matchmax - ind_matchmin); cell_int_ind = (feature.get("_industr_2")/1000) - (feature.get("_industr_1")/1000); // Getting the match percentage ind_match_perc = (ind_matchdiff * 100) / cell_int_ind; // WATER BODIES matching percentage wat_matchdiff = (wat_matchmax - wat_matchmin); cell_int_wat = (feature.get("_waterbo_2")/1000) - (feature.get("_waterbo_1")/1000); // Getting the match percentage wat_match_perc = (wat_matchdiff * 100) / cell_int_wat; // OVERALL PERCENTAGE CELL MATCH var new_fuzzy_value_1km_sjælland = (ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + ptsta_matchdiff + ptst_matchdiff + resto_matchdiff + markets_matchdiff + roads_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff)/ (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_ptsta + cell_int_ptst + cell_int_markets + cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u + cell_int_sch + cell_int_roads + cell_int_wat); feature.set("fuzzyvalue", new_fuzzy_value_1km_sjælland); accessibility = (((roads_matchdiff + ptsta_matchdiff + ptst_matchdiff)*100 / (cell_int_ptsta + cell_int_ptst + cell_int_roads))); livability = ((ind_matchdiff + kin_matchdiff + cin_matchdiff + the_matchdiff + resto_matchdiff + markets_matchdiff + parks_matchdiff + uni_matchdiff + sch_matchdiff + coast_matchdiff + hos_matchdiff + wat_matchdiff) * 100) / (cell_int_ind + cell_int_kin + cell_int_cin + cell_int_the + cell_int_resto + cell_int_markets+ cell_int_coast + cell_int_hos + cell_int_parks + cell_int_u +cell_int_sch + cell_int_wat); suitability = house_match_perc; feature.set("accessibility", accessibility); feature.set("livability", livability); feature.set("suitability", suitability); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function glyphsMainSearchInput(searchSetID, str, e) {\n var searchset = document.getElementById(searchSetID);\n if(!searchset) { return; }\n \n var searchInput = document.getElementById(searchSetID + \"_inputID\");\n if(searchInput.show_default_message) { return; }\n\n if(!str) {\n if(searchInput) { str = searchInput.value; }\n }\n str = trim_string(str);\n if(!str) {\n eedbClearSearchResults(searchSetID);\n return;\n }\n\n if(gLyphsParseLocation(str)) { \n var charCode;\n if(e && e.which) charCode=e.which;\n else if(e) charCode = e.keyCode;\n if((charCode==13) || (e.button==0)) { \n gLyphsInitLocation(str);\n reloadRegion(); \n //dhtmlHistory.add(\"#config=\"+current_region.configUUID +\";loc=\"+current_region.asm+\"::\"+current_region.chrom+\":\"+current_region.start+\"..\"+current_region.end);\n gLyphsChangeDhtmlHistoryLocation();\n }\n eedbEmptySearchResults(searchSetID);\n return;\n }\n\n eedbEmptySearchResults(searchSetID);\n\n var searchDivs = allBrowserGetElementsByClassName(searchset,\"EEDBsearch\");\n for(i=0; i<searchDivs.length; i++) {\n var searchDiv = searchDivs[i];\n searchDiv.exact_match_autoclick = false;\n if(current_region.init_search_term) { searchDiv.exact_match_autoclick = true; }\n eedbSearchSpecificDB(searchSetID, str, e, searchDiv);\n }\n\n}", "function initiate_search() {\n let values = $('#repo').val().split('/').filter(Boolean);\n let len = values.length;\n\n if (len < 1) {\n $('#' + UF_ID_MSG).html('Please enter a valid query: it should contain two strings separated by a \"/\"');\n return; // abort\n }\n\n disable_btn();\n clear_old_data();\n request_fork_page(1, values[len-2], values[len-1], token);\n}", "function buttonSearch(){\n\tsearchTerm = this.attributes[2].value; \n\tsearchTerm = searchTerm.replace(/\\s+/g, '+').toLowerCase();\n\t\t\n \tdisplayGifs ();\n}", "function chooseGin() {\n removeDrinkImg();\n removeDrinkInfo();\n liquorSearch(\"gin\");\n}", "function searchButtonClicked() {\n if (!processConfiguration()) {\n window.alert(\"Error on configuration. Be sure to add valid access tokens to configuration first to perform a search.\");\n return\n }\n //nothing entered...\n searchString = processSearchString(document.getElementById(\"input\").value);\n if (searchString == \"\") {\n return;\n }\n sources = [];\n projects = [];\n connectorAPIs = [];\n connectorManager = new ConnectorManager(token_config['GitHub'], token_config['GitLab']);\n //resetting the necessary values\n getSources();\n getConnectors();\n currentPage = 1;\n maxPage = 1;\n receivedProjects = 0;\n rowCounter = 0;\n //the date is used to ignore newly created projects\n //-> would lead to displacements when changing pages\n date = new Date(Date.now()).toISOString().replace(/[\\..+Z]+/g, \"+00:00\");\n document.getElementById(\"lastSearchedOutput\").innerHTML = searchString;\n initiateSearch();\n}", "function search() {\n\tevent.preventDefault();\n\tvar x, numResults, javaScript, Python, JSON, SQL;\n\tx = document.getElementById(\"form1\");\n\tfor (var i = 0; i < 5; i++ ) {\n\t\tif(x.elements[i].type == \"checkbox\")\n\t\t\t\tconsole.log(x.elements[i].value + \" : \" + x.elements[i].checked );\n\t\telse\n\t\t\tconsole.log( x.elements[i].name + \" input was: \" + x.elements[i].value);\n\t}\n\thttpRequest = createHttpRequestObject(); \n\thttpRequest.open(\"GET\", \"https://api.github.com/gists/public\", true)\n\thttpRequest.send();\n\thttpRequest.onreadystatechange = alertContents; \n}", "function search() {\n\t\n}", "function displayNewSearchResults(event) {\n let searchTerm = event.target.value;\n let currentSearch = giphy[\"query\"][\"q\"];\n if (searchTerm !== currentSearch && searchTerm !== \"\") {\n giphy[\"query\"][\"q\"] = searchTerm;\n updateOffset(true);\n update();\n }\n}", "function check_paper_search_form() {\n \n}", "function gf(I) {\n if (inputText.length > 0) {\n if (searchStore[1][I] == \"games\") {\n gtsah(searchStore[2][I]);\n } else if (searchStore[1][I] == \"apps\") {\n afbb(searchStore[2][I]);\n } else if (searchStore[1][I] == \"projects\") {\n floatingProject[0].style.display = \"flex\";\n makeCard(fpic, searchStore[2][I], 0);\n body.style.overflow = \"hidden\";\n pt_back_btn.o(\"click\", () => {\n floatingProject[0].style.display = \"none\";\n body.style.overflow = \"scroll\";\n removeClass([$(\"#account\")], \"click\");\n while (fpic.firstChild) {\n fpic.removeChild(fpic.firstChild);\n }\n });\n }\n inputIs[0].value = \"\";\n iaad(\"deactive\");\n $(\"#deleteText\")[0].style.display = \"none\";\n }\n trueResult = [];\n }", "function handleSearchSubmit() {\n\t$('#rep-state-search').on('click', function (event) {\n\t\tevent.preventDefault();\n\n\t\tlet userState = $('#state-select').val();\n\t\t$(\"#pick-rep\").show();\n\t\tgetProPublicaFedHouse(userState);\n\t getProPublicaFedSenate(userState);\n\t});\n}", "function gLyphsSearchInterface(glyphsGB) {\n if(zenbu_embedded_view) { return; }\n if(!glyphsGB) { return; }\n if(!glyphsGB.main_div) { return; }\n\n if(!glyphsGB.searchFrame) { \n glyphsGB.searchFrame = document.createElement('div');\n if(glyphsGB.main_div.firstChild) {\n glyphsGB.main_div.insertBefore(glyphsGB.searchFrame, glyphsGB.main_div.firstChild);\n } else {\n glyphsGB.main_div.appendChild(glyphsGB.searchFrame);\n }\n }\n if(!glyphsGB.searchInput) { \n var searchInput = document.createElement(\"input\");\n glyphsGB.searchInput = searchInput;\n searchInput.type = \"text\";\n searchInput.className = \"sliminput\";\n searchInput.autocomplete = \"off\";\n searchInput.default_message = \"search for annotations (eg EGR1 or kinase) or set location (eg: chr19:36373808-36403118)\";\n searchInput.onkeyup = function(evnt) { glyphsMainSearchInput(glyphsGB, this.value, evnt); } \n searchInput.onclick = function() { gLyphsClearDefaultSearchMessage(glyphsGB); }\n searchInput.onfocus = function() { gLyphsClearDefaultSearchMessage(glyphsGB); }\n searchInput.onblur = function() { gLyphsSearchUnfocus(glyphsGB); }\n //searchInput.onmouseout = function() { gLyphsSearchUnfocus(glyphsGB); } \n searchInput.value = searchInput.default_message; \n searchInput.style.color = \"lightgray\";\n searchInput.show_default_message = true;\n }\n if(!glyphsGB.searchResults) { \n glyphsGB.searchResults = document.createElement('div');\n glyphsGB.searchResults.glyphsGB = glyphsGB;\n glyphsGB.searchResults.default_message = \"search for annotations (eg EGR1 or kinase) or set location (eg: chr19:36373808-36403118)\";\n }\n if(!glyphsGB.searchMessage) {\n var msgDiv = document.createElement(\"div\");\n glyphsGB.searchMessage = msgDiv;\n }\n\n if(!glyphsGB.searchbox_enabled) { \n glyphsGB.searchFrame.style.display = \"none\";\n return; \n }\n\n glyphsGB.searchFrame.innerHTML = \"\";\n glyphsGB.searchFrame.style.display = \"block\";\n glyphsGB.searchResults.innerHTML = \"\";\n glyphsGB.searchResults.style.display = \"none\";\n\n var searchFrame = glyphsGB.searchFrame;\n \n var form = searchFrame.appendChild(document.createElement('form'));\n form.setAttribute(\"onsubmit\", \"return false;\");\n\n var span1 = form.appendChild(document.createElement('span'));\n \n var searchInput = glyphsGB.searchInput;\n form.appendChild(searchInput);\n\n var buttonSpan = form.appendChild(document.createElement('span'));\n var button1 = buttonSpan.appendChild(document.createElement('input'));\n button1.type = \"button\";\n button1.className = \"slimbutton\";\n button1.value = \"search\";\n button1.onclick = function(envt) { glyphsMainSearchInput(glyphsGB, '', envt); }\n\n var button2 = buttonSpan.appendChild(document.createElement('input'));\n button2.type = \"button\";\n button2.className = \"slimbutton\";\n button2.value = \"clear\";\n button2.onclick = function() { gLyphsClearSearchResults(glyphsGB); }\n \n searchFrame.appendChild(glyphsGB.searchResults); //moves to correct location\n searchFrame.appendChild(glyphsGB.searchMessage); //moves to correct location\n \n //set width\n var buttonsRect = buttonSpan.getBoundingClientRect();\n console.log(\"search buttons width: \"+buttonsRect.width);\n console.log(\"search_input width: \"+(glyphsGB.display_width - buttonsRect.width));\n searchInput.style.width = ((glyphsGB.display_width - buttonsRect.width)*0.80) +\"px\"; //glyphsGB.display_width;\n searchInput.style.margin = \"0px 0px 5px 0px\";\n \n //gLyphsClearSearchResults(glyphsGB);\n}", "function runSearch(e) {\n if (e.target.value === \"\") {\n // On empty string, remove all search results\n // Otherwise this may show all results as everything is a \"match\"\n applySearchResults([]);\n } else {\n const tokens = e.target.value.split(\" \");\n const moddedTokens = tokens.map(function (token) {\n // \"*\" + token + \"*\"\n return token;\n })\n const searchTerm = moddedTokens.join(\" \");\n const searchResults = idx.search(searchTerm);\n const mapResults = searchResults.map(function (result) {\n const resultUrl = docMap.get(result.ref);\n return { name: result.ref, url: resultUrl };\n })\n\n applySearchResults(mapResults);\n }\n\n}", "function buttonStatus() {\n\t/*Debe habilitarse el botón de búsqueda cuando se ingrese texto con una \n\tcantidad mayor a dos caracteres en el campo de búsqueda.*/\n\tif (search.value.length >= 2 ) {\n\t\tsubmit.disabled = false \n\t}else {\n\t\tsubmit.disabled = true\n\t\tfilterData = globalData\n\t\tpageFilter(filterData)\n\t}\n}", "function draw_search(env, after) {\n\tenv.$template('search');\n\tenv.$output({title : 'Search'});\n\tafter();\n}", "function search() {\n $.var.currentSupplier = $.var.search;\n $.var.currentID = 0;\n $.var.search.query = $(\"#searchable\").val();\n if ($.var.search.query.trim().length === 0) { // if either no string, or string of only spaces\n $.var.search.query = \" \"; // set query to standard query used on loadpage\n }\n $.var.search.updateWebgroupRoot();\n}", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "function track_search_ga_event() {\n\t\tvar formName = '#form_topsearch';\n\t\tvar selected_option_id = $.trim( $( formName + \" #topsearch_type\" ).val() );\n\t\tvar div_id = 'tab' + selected_option_id;\n\t\tvar option_text = $.trim( $( '#' + div_id ).find('a').text() );\n\n\t\tGAEventTracker( 'SEARCHUSAGE', 'NO_OF_USERS', 'RESULTCLICK' ); \n\t\tGAEventTracker( 'SEARCHUSAGE', 'RESULTCLICK', option_text.toUpperCase() );\n\t}", "function performSearch() {\n giphiesPage.searchInput().type('drake');\n giphiesPage.searchButton().click();\n\n firstGiph = giphiesPage.allGiphies().first();\n }", "function input_listener() {\n\tlet input = document.getElementById(\"search_bar\").value.toLowerCase();\n\n\tflags_input = [];\n\tflags.forEach(row => {\n\t\tif(row.Country.substring(0, input.length).toLowerCase()===input) {\n\t\t\tflags_input.push(row);\n\t\t}\n\t});\n\tflag_number = flags_input.length;\n\n\n\t//Loading the flags\n\tassign_flags(flags_input, flag_number)\n\n\t//Refreshes the map to link it to the new buttons\n\tmap.off();\n\tmap.remove();\n\n}", "function submitSearch() {\n hitSelected = document.getElementsByClassName('aa-cursor')[0];\n\n if (hitSelected && searchQuery) {\n const articleUrl = hitSelected.querySelector('a').href;\n window.location.assign(articleUrl);\n } else if (!hitSelected && searchQuery && hits) {\n window.location.assign(`{{ site.url }}/search?query=${searchQuery}`);\n }\n }", "function handleSubmit() {\n //Take the search term string entered by the user in the input field, add it to the baseUrl, make a fetch request to that new url, and append the results of what we searched for to the DOM in the correct element, wrapped in li tags\n}", "function runSearch() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"GREETINGS! WHAT WOULD YOU LIKE TO DO?\",\n choices: [\n \"ADD Department, Role, and/or Employee\",\n \"VIEW CURRENT Department, Role, and/or Employee's\",\n \"UPDATE An Employee Role\",\n ],\n })\n //==============PATH TO THE 'ADD' SELECTOR============//\n .then(function (answer) {\n switch (answer.action) {\n case \"ADD Department, Role, and/or Employee\":\n addInformation();\n break;\n //===============PATH TO THE 'VIEW' SELECTOR==========//\n case \"VIEW CURRENT Department, Role, and/or Employee's\":\n viewInformation();\n break;\n //===============PATH TO THE 'UPDATE' SELECTOR========//\n case \"UPDATE An Employee Role\":\n updateInformation();\n break;\n }\n });\n}", "function outSearchResult(){\n highlightShip(oldMmsi);\n jumpto(oldCoordinates);\n}", "function SearchFormScoopAndSubmit(){\n \n var solrquery = \"\";\n var and = \"\";\n var q = (typeof $(\"#freequery\").val() == 'undefined') ? '' : $(\"#freequery\").val();\n \n $(\".facet-search-value\").each(function(index, value){\n if ($( this ).val() !== \"\"){\n solrquery += and + $( this ).attr(\"id\") + ':{' + $( this ).val() + '}';\n and = \" AND \";\n }\n });\n \n geoquery = getGoogleCoordinates(solrquery, and, function(finalsolrquery){\n var modified_arguments = \"q=\" + q + \"&\" + \"free=\" + finalsolrquery;\n window.location.href = search_url + \"?\" + modified_arguments;\n });\n \n }", "function clicked() {\n search()\n; }", "function searchProduct(){\r\n \r\n var go = \"Thing(?i)\";\r\n \r\n submitProduct(go); \r\n \r\n }", "function clickSearchButton(e){\n _self.getDefaultPlace(_self.scope.inputSearch.value); \n }", "function search() {\n\tconsole.log(\"Googling \\\"\" + box.value + \"\\\"\");\n\tconsole.log(\"Encoded query: \\n\" + encodeURIComponent(box.value));\n\tdocument.location.href = \"https://www.google.com/?gws_rd=ssl#safe=off&q=\" + encodeURIComponent(box.value);\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n }", "function search(){\n let query;\n if(searchLocation===\"location\"){\n searchLocation(\"\")\n }\n query=`https://ontrack-team3.herokuapp.com/students/search?location=${searchLocation}&className=${searchClass}&term=${searchName}` \n prop.urlFunc(query);\n }", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function submit() {\n var name = this.search.value.trim();\n location.hash = name ? encodeURIComponent(name) : \"!\";\n this.search.value = \"\";\n d3.event.preventDefault();\n}", "function searchTerm(){\n \n }", "function clickSearchBox(object){\n let searchText = document.querySelector(\".form-inline input[type='text']\").value;\n document.location = page.RESULT + '?searchWords='+searchText.toLowerCase();\n}", "function search(term, force_search){\n var source = jQuery.extend(true, [], gon.source); // deep copy - we don't change the gon.source array\n force_search = force_search || false;\n\n // Search for booking id (actually tx id)\n if (term.indexOf(\"BID=\") === 0){\n searchTermOld = term;\n var booking_id = term.substr(4);\n search_for_id_update_gantt(booking_id, source);\n }\n else{\n search_booking_id = 0;\n\n // Show all devices again\n if (term.length < 3){\n term = \"\";\n if (searchTermOld !== term || force_search){\n searchTermOld = term;\n $('#poolTool_search').css(\"background-color\", \"white\");\n $('#poolTool_search').css(\"color\", \"black\");\n updateGanttChart(source);\n gon.search_source = source;\n search_update_booking_dialog();\n $('.home-fluid-thumbnail-grid-item').show();\n }\n }\n\n if (searchTermOld !== term || force_search){\n searchTermOld = term;\n\n search_update_gantt(term, source);\n search_update_booking_dialog();\n }\n }\n }", "function triangleSearch(){\n\tif (input.value == \"\") return;\n\t\t\n\t$(displayText).text(\"\");\n\t$(\"#selections\").text(\"\");\n\t$(\"#results\").hide();\n\t$(\"#show-subterms\").hide();\n\tshowLoader();\n\t$(\"#path-subresults\").hide();\n\n\tvar termA = termBank.getSynonym(input.value);\n\tvar type = selectBar.value;\n\t\n\t_withSubterms = subtermsCheckbox.checked;\n\tif(_withSubterms){\n\t\tqueryNeo4j(getMentionsWithSubtermsPayload(termA, type), triangleSearchOnSuccess);\n\t}else{\n\t\tqueryNeo4j(getMentionsPayload(termA, type), triangleSearchOnSuccess);\n\t}\t\n}", "function newSearch() {\n window.location.href = \"../list/?service=\" + svcSearch +\"&range=\" + distSearch+\"/\"\n }", "function dm_search(d_o1,ev,smId){var s=d_o1.value;d_ce=_dmvi(smId);var fromItem=null;if(ev.keyCode==13){fromItem=d_o1.prevItem;}if(!d_ce||s==\"-\"||d_o1.frase==s&&!fromItem){return;}_dmOOa(d_ce);d_o1.style.backgroundColor=\"\";d_o1.frase=s;if(!s){return;}d_iv=_dmlO(d_ce,s,dmSearch==2,fromItem);if(d_iv&&d_iv==fromItem){d_iv=_dmlO(d_ce,s,dmSearch==2,null);}if(d_iv){_dIO(d_iv);d_o1.prevItem=d_iv;}else{d_o1.style.backgroundColor=\"red\";d_o1.prevItem=null;}}", "function displayIngredientSearch(clicked) {\n var clicked_recipe = document.getElementById(clicked).innerHTML,\n results_string = \"\",\n r_list = globe.getRecipes(),\n i,\n j;\n\n globe.hint_span.innerHTML = \" Recipes containing \" + clicked_recipe;\n globe.user_search.value = \"\";\n removeLink();\n \n for (i = 0; i < r_list.length; i += 1) {\n for (j = 0; j < r_list[i].ingredients.length; j += 1) {\n if (r_list[i].ingredients[j].ingredient === clicked_recipe) {\n\n results_string += \"<p id=\\\"\" + i.toString() + \"\\\">\" + r_list[i].toMake + \"</p>\";\n globe.addID(i.toString());\n break;\n }\n }\n }\n\n globe.results_div.innerHTML = results_string;\n globe.search_type_name.checked = true;\n globe.search_type_ingredient.checked = false;\n createLink();\n}", "handleSubmit(event) {\n event.preventDefault();\n history.pushState(null, null, `/proposals?search=${event.target[0].value}`)\n location.replace(`/proposals?search=${event.target[0].value}`)\n trackSearch('Searched: ' + event.target[0].value )\n }", "function onSearchTerm(evt) {\n var text = evt.target.value;\n doSearch(text, $('#types .btn-primary').text());\n }", "function updateGanttChart_with_search(){\n var value = $('#poolTool_search').val();\n search(value, true);\n }", "function doSearch() {\n\n //This full path is used for redirect users to seek search pages\n var NavToPath = \"DateRange=\";\n if (selectedValue(\"DateRange\"))\n NavToPath = NavToPath + selectedValue(\"DateRange\");\n else\n NavToPath = NavToPath + '31';\n\n if (selectedValue(\"catparentlocation\")) {\n var location = selectedValue(\"catparentlocation\").split('|');\n for (var i = 0; i < location.length; i++) {\n switch (location[i + 1]) {\n case '1': NavToPath = NavToPath + \"&catlocation=\" + location[i];\n break;\n case '13': NavToPath = NavToPath + \"&catstate=\" + location[i];\n break;\n case '12': NavToPath = NavToPath + \"&catnation=\" + location[i];\n break;\n }\n }\n }\n if (selectedValue(\"catchildlocation\") && selectedValue(\"catchildlocation\") != 0 && selectedValue(\"catchildlocation\") != 'Any Area') {\n if (selectedValue(\"catchildlocation\").indexOf(\"|\") > -1) {\n var areaSplit = selectedValue(\"catchildlocation\").split('|');\n for (var k = 0; k < areaSplit.length; k++) {\n switch (areaSplit[k + 1]) {\n case '1': NavToPath = NavToPath + \"&catlocation=\" + areaSplit[k];\n break;\n case '11': NavToPath = NavToPath + \"&catarea=\" + areaSplit[k];\n break;\n }\n }\n }\n else\n NavToPath = NavToPath + \"&catarea=\" + selectedValue(\"catchildlocation\");\n }\n if (selectedValue(\"catindustry\") && selectedValue(\"catindustry\") != 0)\n NavToPath = NavToPath + \"&catindustry=\" + selectedValue(\"catindustry\");\n if (selectedValue(\"catoccupation\") && selectedValue(\"catoccupation\") != 0 && selectedValue(\"catoccupation\") != 'Any Sub-Classification')\n NavToPath = NavToPath + \"&catoccupation=\" + selectedValue(\"catoccupation\");\n if (selectedValue(\"Keywords\"))\n NavToPath = NavToPath + \"&Keywords=\" + selectedValue(\"Keywords\");\n if (selectedValue(\"catworktype\") && selectedValue(\"catworktype\") != 0)\n NavToPath = NavToPath + \"&catworktype=\" + selectedValue(\"catworktype\");\n var navToLocation = mainSeekSiteAddress + \"/jobsearch/index.ascx?\" + NavToPath;\n\n //Adds advertiser id if it's selected from a drop down\n if (selectedValue(\"AdvertiserID\") && selectedValue(\"AdvertiserID\") != 0)\n navToLocation = navToLocation + \"&AdvertiserID=\" + selectedValue(\"AdvertiserID\");\n else\n navToLocation = navToLocation + '&' + Settings[\"Advertiser\"];\n\n if (typeof target == 'object') {\n if (document.getElementById(\"JSresults\")) {\n document.getElementById(\"JSresults\").src = navToLocation;\n }\n else {\n target.location.href = navToLocation;\n }\n }\n else {\n if (target == 'blank')\n window.open(navToLocation, 'Job_Search_Results');\n else if (target == '/alliances/gough-recruitment/index.htm')\n window.open(mainSeekSiteAddress + target + '?' + NavToPath, 'Job_Search_Results');\n else if (target == 'http://www.scotfordfennessy.com.au/search_jobs.php')\n window.location.href = target + '?' + NavToPath;\n }\n}", "function teeee(entry,type) {\n //document.getElementById(\"CompleteSym\").innerHTML = entry.innerText;\n if (type > 0) {\n searchLocus.value = entry.innerText;\n getParalog();\n } else if (type == 0) {\n searchSym.value = entry.innerText;\n getParalog(1);\n }\n}", "searchClicked(_) {\n flikrSearch(this.state.term).fork(this.showError,this.updateResults)\n }", "function doFind() {\n //Set the search text to the value in the box\n if (this.id == 'search') {\n findParams.searchText = dom.byId(\"roadName\").value;\n whichSearch = \"grid\";\n } else if (this.id == 'search2') {\n findParams.searchText = dom.byId(\"parcelInfo\").value;\n whichSearch = \"grid1\";\n }\n findTask.execute(findParams, showResults);\n }", "function search_genomes (search_term) {\n\tcoge.services.search_genomes(search_term, { fast: true })\n\t\t.done(function(result) { // success\n\t\t\tif (result && result.genomes) {\n\t\t\t\tvar transformed = result.genomes.map(function(obj) {\n\t\t\t\t\tvar label = obj.info.replace(/&reg;/g, \"\\u00ae\"); // (R) symbol\n\t\t\t\t\treturn { label: label, value: obj.id };\n\t\t\t\t});\n\t\t\t\tif (focus == 'x') {\n\t\t\t\t\t$('#edit_xgenome')\n\t\t\t\t\t\t.autocomplete({source: transformed})\n\t\t\t\t\t\t.autocomplete(\"search\");\n\t\t\t\t} else if (focus == 'y') {\n\t\t\t\t\t$('#edit_ygenome')\n\t\t\t\t\t\t.autocomplete({source: transformed})\n\t\t\t\t\t\t.autocomplete(\"search\");\n\t\t\t\t} else if (focus == 'z') {\n\t\t\t\t\t$('#edit_zgenome')\n\t\t\t\t\t\t.autocomplete({source: transformed})\n\t\t\t\t\t\t.autocomplete(\"search\");\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t})\n\t\t.fail(function() { // error\n\t\t\t//TODO\n\t\t});\n}", "function updateSn(text) {\n resetSr(Cdp.search);\n\n // Clear markers and selection on map to show it's map search OR sn search\n markers.clearMarkers();\n vectors.destroyFeatures();\n precis.destroyFeatures();\n\n //filter.type = 'by_sn';\n //filter.prm = obj;\n //loadResults(search_type);\n Cdp.search.filters = new Object(); // Reset global object to remove previous filters\n Cdp.search.filters.sn = text;\n loadMyResults(Cdp.search);\n}", "function search(_event) {\r\n let inputName = document.getElementById(\"searchname\");\r\n let inputMatrikel = document.getElementById(\"searchmatrikel\");\r\n let query = \"command=search\";\r\n query += \"&nameSearch=\" + inputName.value;\r\n query += \"&matrikelSearch=\" + inputMatrikel.value;\r\n console.log(query);\r\n sendRequest(query, handleSearchResponse);\r\n }", "updateSearchTerm ( e ) {\n this.cardFetch( e.target.value );\n }", "function button_Find()\n {\n var orderBy = \"CATENTRY.PARTNUMBER\";\n \n var itemPartNumber = cutspace(CONTENTS.ItemFindCriteriaFORM.itemPartNumber.value);\n var partNumberCaseSensitive = false;\n var partNumberLike = CONTENTS.ItemFindCriteriaFORM.partNumberLike.options[CONTENTS.ItemFindCriteriaFORM.partNumberLike.selectedIndex].value;\n\n \n var itemName = cutspace(CONTENTS.ItemFindCriteriaFORM.itemName.value);\n var nameCaseSensitive = false;\n var nameLike = CONTENTS.ItemFindCriteriaFORM.nameLike.options[CONTENTS.ItemFindCriteriaFORM.nameLike.selectedIndex].value;\n\n \n var itemShortDescription = cutspace(CONTENTS.ItemFindCriteriaFORM.itemShortDescription.value);\n var shortDescriptionCaseSensitive = false;\n var shortDescriptionLike = CONTENTS.ItemFindCriteriaFORM.shortDescriptionLike.options[CONTENTS.ItemFindCriteriaFORM.shortDescriptionLike.selectedIndex].value;\n \n var langid = CONTENTS.ItemFindCriteriaFORM.langid.value;\n var parentCategoryID = CONTENTS.ItemFindCriteriaFORM.parentCategoryID.value;\n if (parentCategoryID != \"\")\n \t parentCategoryID = strToInteger(parentCategoryID, langid);\n var parentProductID = CONTENTS.ItemFindCriteriaFORM.parentProductID.value;\n if (parentProductID != \"\")\n parentProductID = strToInteger(parentProductID, langid)\n \n if (CONTENTS.validatePanelData()) {\n var resultTitle = CONTENTS.getResultTitle();\n \n var startindex = 0;\n var listsize = 16;\n\n \n var aurl = \"/webapp/wcs/tools/servlet/DynamicListSCView\";\n\n var p = new Object();\n p[\"ActionXMLFile\"] = \"catalog.itemFindActions\";\n p[\"cmd\"] = \"ItemFindResults\";\n p[\"startindex\"] = startindex;\n p[\"listsize\"] = listsize;\n p[\"orderby\"] = orderBy;\n p[\"selected\"] = \"SELECTED\";\n p[\"refnum\"]=0;\n p[\"itemPartNumber\"] = itemPartNumber;\n p[\"partNumberCaseSensitive\"] = partNumberCaseSensitive;\n p[\"partNumberLike\"] = partNumberLike;\n p[\"itemName\"] = itemName;\n p[\"nameCaseSensitive\"] = nameCaseSensitive;\n p[\"nameLike\"] = nameLike;\n p[\"itemShortDescription\"] = itemShortDescription;\n p[\"shortDescriptionCaseSensitive\"] = shortDescriptionCaseSensitive;\n p[\"shortDescriptionLike\"] = shortDescriptionLike;\n p[\"parentCategoryID\"] = parentCategoryID;\n p[\"parentProductID\"] = parentProductID;\n \n\n top.setContent(resultTitle, aurl, true, p);\n \n }\n \n }", "function s() {\n var form = d.querySelector(\"#search form\"),\n selector = form.select.options[select.selectedIndex].index,\n text = form.querySelector(\"input\"),\n afterSkip = selector;\n for (i = 0; i <= selector; ++i) {\n if (!searches[i].enabled) {\n \t afterSkip++;\n \t selector++;\n }\n }\n form.method\t = searches[afterSkip].method;\n form.action = searches[afterSkip].url;\n text.name = searches[afterSkip].query;\n d.getElementById('searchbox').focus();\n}", "search() {\n console.log(\"Search text: \" + this.searchText);\n var localSearchResultsGenes = [];\n var nonGenes = [];\n\n this.checkGenes(localSearchResultsGenes, nonGenes);\n var nonGeneStr = nonGenes.join(\" \");\n console.log(\"Checking non genes: \" + nonGeneStr);\n \n var searchResults = this.searchStudyIndex(nonGenes);\n var studiesIntersected = this.intersection(searchResults);\n var localSearchResultsStudies = this.extractStudyDetails(studiesIntersected);\n this.searchResultsGenes = localSearchResultsGenes;\n this.searchResultsStudies = localSearchResultsStudies;\n\n this.setSearchResultsSummaryMsg();\n this.currentStudySelected = null;\n this.studyGroupSelected = 0;\n }", "function clickedSearch(e) {\n var newSearch = e.target.textContent;\n getSearchResults(newSearch);\n}", "function onclickForSearchButton(event)\n{\n //console.log(event);\n \n var q = document.getElementById('search-query').value; //escape here?\n \n //some kanji searches are going to be legitimately only one char.\n //we need a trim() function instead...\n if(q.length < 1)\n {\n return;\n }\n \n buttonSpinnerVisible(true);\n \n var matches = doEdictQueryOn(q);\n}", "function gLyphsTrackSearchScripts(trackID, cmd) {\n var glyphTrack = gLyphTrack_array[trackID];\n if(glyphTrack == null) { return; }\n \n var scriptsDiv = document.getElementById(trackID + \"_script_search_div\");\n if(scriptsDiv == null) { return; }\n \n glyphTrack.predef_scripts = new Array();\n\n if(cmd == \"clear\") {\n scriptsDiv.innerHTML = \"please enter search term\";\n return;\n }\n \n if(cmd == \"search\") {\n var seachInput = document.getElementById(trackID + \"_script_search_inputID\");\n var filter = \"\";\n if(seachInput) { filter = seachInput.value; }\n gLyphsFetchPredefinedScripts(trackID, filter);\n }\n\n if(cmd == \"all\") {\n gLyphsFetchPredefinedScripts(trackID, \"\");\n } \n}", "function SearchUserObject() {\n concatResult();\n window.searchQuery = searchInput.value;\n CreateURI(centerLat, centerLng);\n}", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "function searchGoogle(word) {\r\n var query = word.selectionText;\r\n\r\n}", "function gLyphsTrackSearchScripts(trackID, cmd) {\n var glyphTrack = glyphsTrack_global_track_hash[trackID];\n if(glyphTrack == null) { return; }\n \n var scriptsDiv = document.getElementById(trackID + \"_script_search_div\");\n if(scriptsDiv == null) { return; }\n \n glyphTrack.predef_scripts = new Array();\n\n if(cmd == \"clear\") {\n scriptsDiv.innerHTML = \"please enter search term\";\n return;\n }\n \n if(cmd == \"search\") {\n var seachInput = document.getElementById(trackID + \"_script_search_inputID\");\n var filter = \"\";\n if(seachInput) { filter = seachInput.value; }\n gLyphsFetchPredefinedScripts(trackID, filter);\n }\n\n if(cmd == \"all\") {\n gLyphsFetchPredefinedScripts(trackID, \"\");\n } \n}", "function searchAll() {\n clearAllButAvatars();\n document.getElementById(\"terms\").innerHTML = \"\";\n var input = document.querySelector(\"#queryfield\").value;\n var tokens = input.split(\" \");\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n var formattedToken = token.replace(/\\W/g, '')\n if (formattedToken.trim() !== '') {\n addSearchButton(formattedToken);\n }\n }\n}", "function main() {\r\n // Note, jQ replaces $ to avoid conflicts.\r\n\r\n \r\n jQ(\"#search_form\").submit( function ( event ) {\r\n\t\r\n\twindow.location = \"/tagged/\" + jQ(\"#search_query\").val();\r\n \r\n\tevent.preventDefault();\r\n });\r\n}", "function subSearchToggleFunction(subSearchIdName){\n\n cl(\"TOGGLE CLICKING RUN\")\n const subSearchClicked = document.getElementById(subSearchIdName)\n cl(subSearchClicked)\n\n const episodesHeaderBox = document.getElementById(\"thirdBox\");\n subSearchInputBoxToggle();\n\n if (subSearchClicked.id === \"subSearchOne\") {\n cl(\"Series Search\")\n // if (searchByEpisodesToggle === false) {\n // subSearchTwo.classList.add(\"noSelect\");\n // } \n\n if (searchBySeriesToggle === true){\n searchBySeriesToggle = false;\n const subSearchOne = document.getElementById(\"subSearchOne\")\n subSearchOne.classList.remove(\"Clicked\")\n subSearchInputBoxToggle();\n } else {\n searchBySeriesToggle = true; \n searchByEpisodesToggle = false; \n subSearchClicked.classList.add(\"Clicked\");\n const subSearchTwo = document.getElementById(\"subSearchTwo\")\n subSearchTwo.classList.remove(\"Clicked\")\n subSearchInputBoxToggle();\n }\n\n\n } else if ((subSearchClicked.id === \"subSearchTwo\") && (episodesHeaderBox.classList.contains(\"showing\"))){\n cl(\"Episode Search\")\n \n if (searchByEpisodesToggle === true){\n searchByEpisodesToggle = false;\n subSearchClicked.classList.remove(\"Clicked\");\n subSearchInputBoxToggle();\n } else {\n searchBySeriesToggle = false; \n searchByEpisodesToggle = true; \n subSearchClicked.classList.add(\"Clicked\");\n const subSearchOne = document.getElementById(\"subSearchOne\")\n subSearchOne.classList.remove(\"Clicked\")\n subSearchInputBoxToggle();\n } \n } \n \n subSearchInputBoxToggle();\n \n}", "function onTargetLGTBIQClick() {\n console.log(\"Clicked onTargetLGTBIClick\");\n // update the UI\n w3.toggleClass('#targetLGTBIQ', 'w3-red');\n w3.removeClass('#targetChildren', 'w3-red');\n w3.removeClass('#targetWomen', 'w3-red');\n w3.removeClass('#targetOrigin', 'w3-red');\n // toggle this filter and disable the others\n targetLGTBIQ = !targetLGTBIQ;\n targetChildren = false;\n targetWomen = false;\n targetOrigin = false;\n // trigger the find operation\n findLocationsInDatabase(\"FILTER\", -1);\n}", "function searchCityForGoogleSugg(custCity, keyCodeInput, panelName) {\r\n keyCode = keyCodeInput;\r\n panelNameToAddCustCity = panelName;\r\n document.getElementById(\"ajaxLoadSrchCustToAddGirviDiv\").style.visibility = \"visible\";\r\n var poststr = \"custCity=\" + encodeURIComponent(custCity) +\r\n \"&panelName=\" + encodeURIComponent(panelName);\r\n search_city_for_panel('include/php/omInputFieldGoogleSuggestion.php', poststr);\r\n}", "function opensearch(){\n\tsummer.openWin({\n\t\tid : \"search\",\n\t\turl : \"comps/summer-component-contacts/www/html/search.html\"\n\t});\n}", "function searchDiagram() { // called by button\n\tvar input = document.getElementById(\"SearchBox\");\n\tif (!input) return;\n\tinput.focus();\n\n\tmyDiagram.startTransaction(\"highlight search\");\n\n\tif (input.value) {\n\t\t// search four different data properties for the string, any of which may match for success\n\t\t// create a case insensitive RegExp from what the user typed\n\t\tvar regex = new RegExp(input.value, \"i\");\n\t\tvar results = myDiagram.findNodesByExample({ topText: regex });\n\t\tmyDiagram.selectCollection(results);\n\t\t// try to center the diagram at the first node that was found\n\t\tif (results.count > 0) myDiagram.centerRect(results.first().actualBounds);\n\t} else { // empty string only clears highlighteds collection\n\t\tmyDiagram.clearSelection();\n\t}\n\n\tmyDiagram.commitTransaction(\"highlight search\");\n}", "function searchHandler(globalToysArray, event) {\n const serachingToy = event.target.value.trim().toLocaleLowerCase()\n const searchingToy = globalToysArray.filter(toy => {\n return toy.name.trim().toLocaleLowerCase().includes(serachingToy)\n })\n recomendedToysContainer.innerHTML = ''\n bestsellerToysContainer.innerHTML = ''\n renderToysCard(searchingToy, serachingToy)\n\n}", "function dosearch() {\n // Now find transfers\n drawChart();\n}", "function XayDungChuoiGiaTriSearch() {\n var chuoiSearch = \"\";\n chuoiSearch = $(\"#textboxsearch\").val().trim().replace(\"_\", \"\");\n $(\"#groupbuttondate button\").each(function (index) {\n if ($(this).hasClass(\"btn-primary\")) {\n var fd = \"\", td = \"\";\n if ($(this).attr(\"name\") == \"other\") {\n fd = $(\"#startdate\").val();\n td = $(\"#enddate\").val();\n if (fd == \"\" || td == \"\") {\n var today = new Date();\n fd = td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n }\n chuoiSearch += \"_\" + fd + \"_\" + td + \"_false\";\n }\n else {\n chuoiSearch += GetDateForQuery(index);\n }\n }\n });\n\n $(\"#checkliststatus input[type='checkbox']\").each(function (index) {\n chuoiSearch += \"_\" + this.checked;\n });\n $(\"#checklistpriority input[type='checkbox']\").each(function (index) {\n chuoiSearch += \"_\" + this.checked;\n });\n $(\"#checklistbug input[type='checkbox']\").each(function (index) {\n chuoiSearch += \"_\" + this.checked;\n });\n $(\"#ListSearchForTask\").load($(\"#buttonsearch\").attr(\"data-button-search\") + \"?q=\" + chuoiSearch + \"&pid=\" + $(\"#hiddenprojectid\").val() + \"&page=\");\n}" ]
[ "0.62385285", "0.6066653", "0.5963924", "0.5963754", "0.59636915", "0.5899621", "0.586253", "0.5840317", "0.57780284", "0.57727027", "0.57611465", "0.5751414", "0.5722691", "0.5721347", "0.5705847", "0.5699681", "0.5687383", "0.56703925", "0.5662239", "0.5662072", "0.5647238", "0.56460154", "0.5631898", "0.56101674", "0.5608168", "0.560386", "0.5600269", "0.5584623", "0.5575911", "0.55614173", "0.5557728", "0.55544883", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.5544544", "0.55410415", "0.5536075", "0.55359244", "0.55111694", "0.54979223", "0.549146", "0.5491418", "0.5490093", "0.5483812", "0.54836416", "0.5480338", "0.54791206", "0.54790765", "0.5475436", "0.54750866", "0.5469172", "0.54668045", "0.5462455", "0.54562205", "0.5446876", "0.54398763", "0.5439258", "0.54315984", "0.5431059", "0.543", "0.5420705", "0.5418885", "0.5401274", "0.53990555", "0.53969616", "0.5395651", "0.53919125", "0.5390129", "0.5389289", "0.5387606", "0.5385754", "0.5382654", "0.5382127" ]
0.56525123
20
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { self.min = state.attributes.min_temp self.max = state.attributes.max_temp self.level = state.attributes.temperature if ("units" in self.parameters) { self.set_field(self, "units", self.parameters.units) } else { self.set_field(self, "units", state.attributes["unit_of_measurement"]) } set_view(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\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 }", "is_available() {\n return this._time_until_arrival === 0;\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "get state() { return this._state; }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function PendingPlayerState() { }", "function getState() {\n return currentState\n }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\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}", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\n }" ]
[ "0.73287344", "0.73287344", "0.6968565", "0.6968565", "0.6968565", "0.6968565", "0.6926128", "0.6789413", "0.66253674", "0.6582287", "0.65430224", "0.64888936", "0.64888936", "0.64888936", "0.6190595", "0.61709887", "0.6154469", "0.6125979", "0.5983027", "0.5983027", "0.59440786", "0.59340304", "0.5870546", "0.5813025", "0.5766564", "0.57494885", "0.55708766", "0.555826", "0.55579376", "0.55426913", "0.55315953", "0.5531125", "0.5523095", "0.54847574", "0.5467727", "0.5461427", "0.5438862", "0.54335624", "0.54092395", "0.5361421", "0.53488183", "0.5340812", "0.5328171", "0.5328101", "0.53154767", "0.5307317", "0.530489", "0.53013617", "0.52979136", "0.5284578", "0.52806866", "0.5279393", "0.524995", "0.5233951", "0.52231663", "0.5220229", "0.51965934", "0.5183381", "0.51687664", "0.5162449", "0.51562303", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51270235", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.51230234", "0.5115831", "0.51144266", "0.51115763", "0.51069224", "0.5105438", "0.50957084", "0.5091158", "0.50900614", "0.5084766", "0.5083711", "0.5077806", "0.5075652", "0.5073771", "0.5072241", "0.5064793", "0.50619537", "0.50589156", "0.5056893" ]
0.6310257
14
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnChange(self, state) { if (self.state != self.ViewModel.TextValue()) { self.state = self.ViewModel.TextValue() args = self.parameters.post_service args["value"] = self.state self.call_service(self, args) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "is_available() {\n return this._time_until_arrival === 0;\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() {\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "get state() { return this._state; }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function PendingPlayerState() { }", "function getState() {\n return currentState\n }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\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}", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\n }" ]
[ "0.73263496", "0.73263496", "0.69666564", "0.69666564", "0.69666564", "0.69666564", "0.69242686", "0.67867565", "0.6622723", "0.65812755", "0.65421313", "0.64862347", "0.64862347", "0.64862347", "0.6309391", "0.61906636", "0.6169924", "0.61518246", "0.6123605", "0.5981676", "0.5981676", "0.59421873", "0.5932553", "0.5869572", "0.5811763", "0.5764933", "0.5746332", "0.556938", "0.555641", "0.5555897", "0.5540687", "0.55305237", "0.5530093", "0.5522056", "0.54850596", "0.5466556", "0.54611707", "0.5437682", "0.54325587", "0.5408254", "0.53596854", "0.5348431", "0.533953", "0.53275734", "0.532602", "0.5314587", "0.53055376", "0.5303056", "0.5300407", "0.5296953", "0.52829117", "0.5279252", "0.5278641", "0.5247946", "0.5232341", "0.52217716", "0.5218495", "0.519629", "0.51826835", "0.51684505", "0.5160943", "0.5155316", "0.51273805", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.51218396", "0.51157993", "0.51140946", "0.51108533", "0.510516", "0.5104229", "0.5093132", "0.5090761", "0.50883734", "0.5083589", "0.5083242", "0.50764996", "0.50758314", "0.5073467", "0.5071194", "0.5064031", "0.5060456", "0.50572383", "0.50564873" ]
0.0
-1
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { self.set_field(self, "state", self.map_state(self, state.state)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "is_available() {\n return this._time_until_arrival === 0;\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() {\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "get state() { return this._state; }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function getState() {\n return currentState\n }", "function PendingPlayerState() { }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\n });\n }", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\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}" ]
[ "0.69686985", "0.69686985", "0.69686985", "0.69686985", "0.69259375", "0.67887646", "0.6624645", "0.6582675", "0.6543231", "0.64882874", "0.64882874", "0.64882874", "0.6310826", "0.61924905", "0.61697924", "0.6152262", "0.61256355", "0.59825474", "0.59825474", "0.59441656", "0.59334165", "0.58703524", "0.5812972", "0.5767012", "0.5748212", "0.5572398", "0.55584735", "0.5557278", "0.5542185", "0.55319697", "0.553168", "0.5523791", "0.5485897", "0.546795", "0.54612017", "0.54394805", "0.5432816", "0.54087967", "0.5362138", "0.5349434", "0.53403175", "0.5328465", "0.53275925", "0.5314701", "0.5307756", "0.5303114", "0.5300636", "0.5298146", "0.5284738", "0.528118", "0.5280208", "0.5248322", "0.5234217", "0.5223634", "0.52198535", "0.51990974", "0.5183913", "0.51713073", "0.5161884", "0.5157174", "0.5127759", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51230013", "0.5116265", "0.5115621", "0.5112343", "0.5108151", "0.51054466", "0.50952965", "0.50936013", "0.50914204", "0.5086041", "0.50854415", "0.5078339", "0.5077041", "0.50749135", "0.50737333", "0.50647634", "0.50607073", "0.50582945", "0.50582737" ]
0.73284537
1
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state
function OnStateAvailable(self, state) { self.state = state.state; set_view(self, self.state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\n }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\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 }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "prepareState() {\n /* ... */\n }", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\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 }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "get state() {\n return this._wantedState;\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 }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\n }", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "is_available() {\n return this._time_until_arrival === 0;\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "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}", "function CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "function State() {\n\n }", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "function isInitState( state ) { \n return ( _.isUndefined( state.data ) && _.isUndefined( state.lm ) && _.isUndefined( state.error ) );\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() {\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 isFinalState() {\n return getReachableStates().every((state) => state === currentState);\n }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "function expectStateInit(ae) {\n\n expect(ae.state).toBe(States.init);\n\n expect(ae.isUnstarted).toBe(false);\n expect(ae.isExecuting).toBe(true);\n\n expectStatesSharedUnsettled(ae);\n }", "function initial_state(state){\n let servers = Object.keys(state[\"val\"][\"configTerm\"]);\n return forall((sid) => state[\"val\"][\"configTerm\"][sid]==0 && state[\"val\"][\"configVersion\"][sid]==1, servers)\n}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\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}", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "function PendingPlayerState() { }", "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 }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "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 }", "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}", "function readyStateHandler() {\n if (isEqualIgnoreCase(\"loaded\", element.readyState) ||\n isEqualIgnoreCase(\"complete\", element.readyState)) {\n callback({type: \"load\"});\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 }", "get available() {\n return this.state.timeout === 0;\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\n });\n }", "setReady() {\n this.currentState = cpState.READY;\n }", "get _isReady() {\n return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined;\n }", "initInteractionState() {\n this.dirty = false;\n this.prefilled = !this._isEmpty();\n }" ]
[ "0.7310421", "0.7310421", "0.69752914", "0.69752914", "0.69752914", "0.69752914", "0.6930684", "0.6647277", "0.65827876", "0.6552943", "0.64757675", "0.62965363", "0.61546206", "0.61418915", "0.60739774", "0.60511327", "0.6046045", "0.5944369", "0.5944369", "0.5784949", "0.5782592", "0.576858", "0.5716709", "0.55685043", "0.55540144", "0.55431604", "0.5489555", "0.5476908", "0.54687464", "0.54545355", "0.54542786", "0.54501617", "0.5447874", "0.54476273", "0.5421135", "0.5383652", "0.53735936", "0.5339438", "0.5307829", "0.53025156", "0.52933997", "0.5285958", "0.5277074", "0.5271567", "0.52624774", "0.52450836", "0.52312547", "0.522904", "0.521425", "0.5200156", "0.5199649", "0.5182718", "0.5177254", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.5163001", "0.5162625", "0.51614624", "0.5156224", "0.51527685", "0.5136315", "0.512369", "0.5118892", "0.51155996", "0.5113242", "0.5105685", "0.51047516", "0.50978297", "0.5095854", "0.50948954", "0.50945324", "0.50921977", "0.50921977", "0.5083367", "0.50808096", "0.5070529", "0.50697225", "0.50676453", "0.5067178", "0.50528836", "0.50458777" ]
0.64265186
12
The OnStateUpdate function will be called when the specific entity receives a state update its new values will be available in self.state[] and returned in the state parameter
function OnStateUpdate(self, state) { if (!("ignore_state" in self.parameters) || self.parameters.ignore_state === 0) { self.state = state.state; set_view(self, self.state) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "stateChanged(state) {\n this._name = state.profile.name;\n this._position = state.profile.position;\n this._skill = state.profile.skill;\n this._saved = state.profile.saved;\n }", "update() {\n BaseState.update.call(this);\n }", "function updateState() {\n gState.push({\n board: copyMat(gBoard),\n shownCount: gGame.shownCount,\n markedCount: gGame.markedCount,\n lives: gGame.lives,\n safeClick: gGame.safeClick,\n hints: gGame.hints,\n manualMode: gGame.isManualOn,\n gManualMode: gManualMode.isManualOn\n });\n}", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function updateState() {\n //create our state object and notify our listener\n var state = {\n currentUniverseTime: new Date(currentUniverseTime)\n };\n\n fireStateChanged(state);\n\n // call update() again in a certain number of milliseconds\n updateStateTimeout = setTimeout(function () {\n updateState();\n }, timeBetweenStateUpdatesMs);\n }", "stateChanged(state) { }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n\n delay_time = self.parameters.update_delay;\n if (delay_time !== undefined) {\n if (self.timeout !== undefined) {\n clearTimeout(self.timeout);\n }\n\n self.timeout = setTimeout(function() {set_view(self, self.state)}, delay_time * 1000);\n } else {\n set_view(self, self.state);\n }\n }", "_onChangeState() {\n\n\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n\n set_view(self, self.state, self.level)\n }", "function setEntityState(entity,state) {\n entity.state = state\n server.baseServer.broadcast('server','entity',{uuid:entity.uuid, state:state})\n }", "function _updateState(state, payload) {\n $log.debug(\"=== State changed ===\");\n $log.info(state);\n $log.debug(payload);\n\n $rootScope.$emit(HOTEL_STATES, {\n state: state,\n payload: angular.copy(payload)\n });\n }", "stateChanged(_state) { }", "stateChange(state){\n\t\tLogger.info(`Ably realtime state changed to: ${state.current}`);\n\t}", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "stateChanged(state) {\n }", "async updateState(state) {\n let key = this.ctx.stub.createCompositeKey(this.name, [state.getKey()]);\n let data = Utils.serialize(state);\n await this.ctx.stub.putState(key, data);\n }", "changeState(state) {\r\n for (let key in this.states){\r\n // console.log(this.states[key])\r\n if (key==state) {\r\n this.statesStack.append(this.state);\r\n this.state=state;\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n } \r\n throw new Error();\r\n }", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function updateEntityState (entity, nextState) {\n\t entity.pendingState = assign(entity.pendingState, nextState)\n\t entity.dirty = true\n\t invalidate()\n\t }", "_onChange() {\n this.setState(getAllState())\n }", "getUpdatedState(props, state) {\n return this.state.getUpdatedState(props, state);\n }", "get state() { return this._state; }", "getState(){\n super.getState();\n this.state['amount'] = this.#amount;\n\n return this.state;\n }", "handle() {\n if(!this.enabled)\n return;\n\n Object.assign(this.previousState, this.state); // Save the previous state\n this.update(); // Update the current state\n this.notify();\n }", "function updateEntityState (entity, nextState) {\n entity.pendingState = assign(entity.pendingState, nextState)\n entity.dirty = true\n invalidate()\n }", "updateState(newState) {\n this.setState(newState);\n }", "_stateChanged(state) {\n console.log(state);\n }", "stateChanged(state) {\n this._competitors = competitorsWithEventsSelector(state);\n this._couples = couplesSelector(state);\n this._events = EventsWithCouplesSelector(state);\n this._offbeat = state.form.offbeat.competing;\n this._offbeat_team = OffbeatTeamSelector(state);\n this._basic_information = state.form.basic_information;\n this._form = state.form;\n this._total_entry_fee = total_entry_fee(this._competitors);\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function onStateUpdate(nState) {\n for (var pid in state.players) {\n if (!(pid in nState.players)) // player vanishes\n onPlayerQuit(pid);\n }\n\n for (var pid in nState.players) {\n if (pid == ws._id) continue; // skip ourself\n\n if (!(pid in state.players)) { // player appears\n onPlayerJoin(pid, nState.players[pid]);\n }\n\n var p = nState.players[pid];\n if (p.state == 'player') { // update non-ghost\n onPlayerUpdate(pid, p);\n }\n }\n}", "function OnStateUpdate(self, state)\n {\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n }", "get state() {\n return this._obj.state;\n }", "get state(){return this._state;}", "get state(){return this._state;}", "get state(){return this._state;}", "stateChanged(state){\n this.targetFood = state.targetFood;\n }", "changeState(state) {\r\n if(this.getStates().indexOf(state) != -1){\r\n if(this.prevState[this.prevState.length - 1] != this.state)\r\n this.prevState.push(this.state);\r\n this.state = state;\r\n }else throw new Error(\"\")\r\n }", "setState(updateObject) {\n this.setChangeFlags({stateChanged: true});\n Object.assign(this.state, updateObject);\n this.setNeedsRedraw();\n }", "function getState() {\n return state;\n }", "stateChanged(state) {\n this._clicks = state.counter.clicks;\n this._value = state.counter.value;\n }", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "get state() {\r\n return this._state;\r\n }", "getState() {\n return this.state;\n }", "function updateState(state) {\n cellClientProps = updateCellClientProps(state, cellClientProps);\n //draw a white background\n background(255, 255, 255);\n\n for (var playerId in state.players) {\n if (state.players.hasOwnProperty(playerId)) {\n let plyr = state.players[playerId];\n let color = plyr.blob.color;\n stroke(color[0],color[1],color[2]);\n for (var i=0; i<plyr.blob.cellInds.length; i++) {\n let c = cellClientProps.ps[plyr.blob.cellInds[i]];\n let a = plyr.blob.amts[i];\n strokeWeight(sqrt(a));\n point(c.x,c.y);\n }\n }\n }\n\n stroke(0);strokeWeight(12);\n for (let i=0; i<cellClientProps.ps.length; i++) {\n let p = cellClientProps.ps[i];\n point(p.x,p.y);\n }\n image(pointer, mouseX, mouseY);\n}", "enterState(oldState){}", "getState() {\n return state;\n }", "function state_update(st) {\n state = st;\n if (callback) {\n callback(st);\n }\n}", "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "get_state() {\n return this.state;\n }", "_onChange() {\n this.setState(getUserState());\n }", "function State() {\n\n }", "function statehandler(key, value) {\n // console.log(\"key:\",key,\"value:\",value)\n // console.log(\"old state:\", user)\n setUser({...user, [key]: value});\n // console.log(\"latest state:\", user)\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "function History_UpdateLastStateLoaded()\n{\n\t//by default the last loaded State is the current one\n\tthis.LastLoadedStateIndex = this.CurrentStateIndex;\n\t//get the current State\n\tvar wi4State = __SIMULATOR.StateManager.CurrentState;\n\t//create a map of previously processed ids\n\tvar mapIds = {};\n\t//create a copy of states loaded\n\tvar states = this.States.slice();\n\t//while the state is valid\n\twhile (wi4State != null)\n\t{\n\t\t//get the next default action StateId\n\t\tvar nextStateId = wi4State.ListOfPaths.length > 0 ? wi4State.ListOfPaths[0].Destiny : null;\n\t\t//no id? or already processed?\n\t\tif (!nextStateId || mapIds[nextStateId])\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//mark id as processed\n\t\tmapIds[nextStateId] = true;\n\t\t//get the State\n\t\twi4State = __CACHE.Has_State(nextStateId);\n\t\t//invalid?\n\t\tif (!wi4State)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//not yet ready?\n\t\tif (!wi4State.Optimised)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//increment last loaded State index\n\t\tthis.LastLoadedStateIndex++;\n\t\t//push this message into our array\n\t\tstates.push(wi4State);\n\t}\n\t//now update the controller\n\t__SIMULATOR.NotifyControllerHistory(states);\n}", "function getState() {\n return currentState\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "function updateState(stateChange) {\n if (isNaN(stateChange)) {\n console.error(\"Invalid state change\");\n return;\n }\n currState += stateChange;\n currState = currState % states.length;\n console.assert(\n currState >= 0 && currState < states.length,\n \"currState got out of bounds on updateState: \",\n currState\n );\n clearButtons();\n switch (getRoomName()) {\n case \"START\":\n buildStartRoom();\n break;\n case \"GAME\":\n buildGameRoom();\n break;\n case \"RESULTS\":\n buildResultsRoom();\n break;\n }\n}", "updateState(stateChange){\n this.setState(stateChange);\n }", "function getState () {\n\t\treturn currentState;\n\t}", "function getState () {\n return state\n }", "function getState () {\n return state\n }", "async updateState() {\n const stateResponses = await Promise.all([\n this.bulb.getLightState(),\n this.bulb.getDeviceInfo()\n ]).catch(err => {\n console.error(err.message);\n generateErrorQRCode(`Could not get status of ${deviceName}`);\n });\n const newState = lifxStateToCapstone_Yeet(\n stateResponses[0],\n stateResponses[1]\n );\n\n if (!_.isEqual(this.bulbState, newState)) {\n // the light bulb state has changed\n console.debug(\"State has changed\");\n this.bulbState = newState;\n // TODO: remove console.log once we can correctly pad the image. Instead\n // of logging this object, we will display it on the e-ink display.\n generateQRCode(this.bulbState);\n }\n }", "get State() {\r\n return _state;\r\n }", "get State() {\r\n return _state;\r\n }", "getState() {\n return this._state;\n }", "get state() {return this._p.state;}", "setStateInternal(id, value) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n this.log.info('update state ' + obj + ' with value:' + value);\n currentStateValues[obj] = value;\n }", "componentDidUpdate() {\n // debugging\n console.log('___STATE____', this.state);\n }", "drawState(){\n if(this.getTracer().stateStructure && this.getNode(this.currentId)){\n NodeStateService.process(this.getNode(this.currentId).state_variables);\n }\n }", "subscriberState(EventName, data){\n let key = EventName\n let val = data\n let obj = {}\n obj[key] = val\n //console.log('players in ListPlayers class');\n //console.log(this.state.players);\n this.setState(obj);\n }", "function getState() {\n return currentState\n }", "changeState(state) {\r\n if(this.config.states[state]) {\r\n this.currentState = state;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('changeState');\r\n } else {\r\n throw new Error('This state does not exist');\r\n }\r\n }", "onStateChange() {\n\t\tthis.forceUpdate();\n\t}", "function updateState(data) {\n updateVoteFinishArea(data.state);\n}", "stateChangedCallback(yfct,value)\n { \n \n // memorize the new state\n this._state = (value ==\"B\" ); \n console.log(\"relay change (\"+value+\", state is now \"+this._state);\n // notify the NEEO server about the change\n this.notifyNEEOServer({uniqueDeviceId: this._neeoID, component:this._hwdID, value:this._state} );\n // this.notifyNEEOServer({uniqueDeviceId: \"default\" , component:this._hwdID, value:this._state } );\n }", "function updateStateMaps() {\n // XXX\n }", "_handleComponentChange() {\n this.setState(this._getStateFromStore());\n }", "changeState(state) {\r\n\r\n\r\n if (!this.statuses.includes(state)) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = state;\r\n this.history2 = [];\r\n\r\n\r\n }", "componentDidUpdate() {\n this.lastStateUpdate = Date.now();\n StateLoader.updateLocalStorage(this.state);\n }", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "changeState(state) {\r\n if (state !== \"hungry\" && state !== \"busy\" &&\r\n state !== \"sleeping\" && state !== \"normal\") {\r\n throw new Error()\r\n }\r\n\r\n this.state = state;\r\n this.states.push(this.state);\r\n return this.state\r\n }", "updateState(update) {\n\t\t// console.log(\"Fetching player updates\");\n\n\t\t// Get the ID of the player who triggered this update\n\t\tlet pid = update.pid;\n\t\tlet player = this.stage.getPlayer(pid);\n\n\t\t// Only clients with a player that is still alive can make updates\n\t\tif (player) {\n\t\t\tif (update.type == \"move\") {\n\t\t\t\tplayer.setMovementDirection(update.x, update.y);\n\t\t\t} else if (update.type == \"cursor\") {\n\t\t\t\tplayer.setCursorDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"click\") {\n\t\t\t\tplayer.setFiringDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"weapon-toggle\") {\n\t\t\t\tplayer.setWeapon(update.toggle);\n\t\t\t}\n\t\t}\n\t}", "enterState (state = this.Data) {\n this.State = state;\n }", "function getState() {\n return currentState\n }" ]
[ "0.7009249", "0.6854143", "0.6796559", "0.67764664", "0.6762307", "0.6726108", "0.6551494", "0.6517411", "0.6496623", "0.6496623", "0.6473126", "0.6460814", "0.6446271", "0.6438854", "0.6411804", "0.641117", "0.632063", "0.63070124", "0.63041973", "0.63024896", "0.6285687", "0.6282901", "0.628104", "0.627067", "0.62476736", "0.62404203", "0.6172067", "0.6154974", "0.6142231", "0.61388123", "0.61327153", "0.6121822", "0.6115633", "0.6104822", "0.61030465", "0.60980844", "0.60934246", "0.60934246", "0.60934246", "0.60660166", "0.60615766", "0.6060927", "0.60519516", "0.60519516", "0.60519516", "0.60496974", "0.6023807", "0.6005847", "0.5994711", "0.5993796", "0.5991715", "0.59719425", "0.59649", "0.5949132", "0.59482145", "0.5947851", "0.59436685", "0.59432244", "0.59413767", "0.59409845", "0.5926324", "0.59227335", "0.59098405", "0.59098405", "0.59098405", "0.5903514", "0.589688", "0.588925", "0.588925", "0.588925", "0.588925", "0.5885848", "0.588332", "0.58812135", "0.5879982", "0.587767", "0.587767", "0.5869462", "0.5868884", "0.5868884", "0.586702", "0.585054", "0.58504295", "0.58471316", "0.58458686", "0.5845328", "0.58441925", "0.5842933", "0.58426845", "0.5841338", "0.5841334", "0.58386236", "0.5838005", "0.58234054", "0.5822489", "0.58123696", "0.5810053", "0.5810002", "0.58078086", "0.5804817" ]
0.6545107
7
Set view is a helper function to set all aspects of the widget to its current state it is called by widget code when an update occurs or some other event that requires a an update of the view
function set_view(self, state, level) { if (state === self.parameters.state_active || ("active_map" in self.parameters && self.parameters.active_map.includes(state))) { self.set_icon(self, "icon", self.icons.icon_on); self.set_field(self, "icon_style", self.css.icon_style_active) } else { self.set_icon(self, "icon", self.icons.icon_off); self.set_field(self, "icon_style", self.css.icon_style_inactive) } if ("state_text" in self.parameters && self.parameters.state_text === 1) { self.set_field(self, "state_text", self.map_state(self, state)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function setView(newState) {\r\n _updateView(null, newState);\r\n }", "setView(initView) {\n this.view = initView;\n }", "function setView(view){\n\t\t\t\tif(this.currentView){\n\t\t\t\t\tthis.currentView.close();\n\t\t\t\t}\n\t\t\t\tthis.currentView = view;\n\t\t\t\t$('#mainContent').html(view.render().$el);\n\t\t\t}", "updateView() {\n this.viewValue = this.getViewFromValue();\n this.renderView();\n }", "function updateView(newView){\n currentView.value = newView;\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "changeView(option) {\n this.setState({\n view: option,\n });\n }", "changeView(view, data) {\n this.setState({\n currentView: view,\n viewData: data\n });\n }", "set View(value) {}", "setView(state, val = true){\n state.updateView = Math.random();\n }", "function switchView(view){\n setState('vis.0.control.instance', 'FFFFFFFF');\n setState('vis.0.control.data', view);\n setState('vis.0.control.command', 'changeView');\n}", "changeView(view) {\n\n // Close and unbind any existing page view\n if (this.currentView && _.isFunction(this.currentView.close)) {\n this.currentView.close();\n }\n\n // Establish the requested view into scope\n this.currentView = view;\n \n // Re-delegate events (unbound when closed)\n //this.currentView.delegateEvents(this.currentView.events)\n\n Backbone.Radio.channel('app').request('layout').showChildView('main', view);\n }", "changeView(event) {\n this.setState({ view: !this.state.view });\n }", "changeView(value){\n value ? this.setState({view:true}) : this.setState({view:false});\n }", "function set_view(self, state, level)\n {\n\n if (state == \"on\")\n {\n // Set Icon will set the style correctly for an icon\n self.set_icon(self, \"icon\", self.icons.icon_on)\n // Set view will set the view for the appropriate field\n self.set_field(self, \"icon_style\", self.css.icon_style_active)\n }\n else\n {\n self.set_icon(self, \"icon\", self.icons.icon_off)\n self.set_field(self, \"icon_style\", self.css.icon_style_inactive)\n }\n if (typeof level == 'undefined')\n {\n self.set_field(self, \"level\", 0)\n }\n else\n {\n self.set_field(self, \"level\", Math.ceil((level*100/255) / 10) * 10)\n }\n }", "function updateViews(event) {\n manageContentObjectsByState(event.currentState);\n fillElements(event.currentState);\n setNavigationButtonsDisabledState(event.currentState);\n resetViews();\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n\n delay_time = self.parameters.update_delay;\n if (delay_time !== undefined) {\n if (self.timeout !== undefined) {\n clearTimeout(self.timeout);\n }\n\n self.timeout = setTimeout(function() {set_view(self, self.state)}, delay_time * 1000);\n } else {\n set_view(self, self.state);\n }\n }", "changeView(view) {\n if (view === 'base') {\n this.setState({\n view: view,\n closest: null\n });\n } else {\n this.setState({\n view: view\n });\n }\n }", "changeView0() {\n this.setState({view: 0});\n }", "function setNewViewState(viewstate) {\n\n\n console.log('D: setting header to: ' + viewstate.header);\n viewModel.viewState.header(viewstate.header);\n\n console.log('D: setting content to: ' + viewstate.content);\n viewModel.viewState.content(viewstate.content);\n\n console.log('D: setting footer to:' + viewstate.footer);\n viewModel.viewState.footer(viewstate.footer);\n }", "setState(newState) {\n if (this.updateState != 0 /* Idle */)\n throw new Error(\"Calls to EditorView.setState are not allowed while an update is in progress\");\n if (this.destroyed) {\n this.viewState.state = newState;\n return;\n }\n this.updateState = 2 /* Updating */;\n let hadFocus = this.hasFocus;\n try {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.viewState = new ViewState(newState);\n this.plugins = newState.facet(viewPlugin).map(spec => new PluginInstance(spec));\n this.pluginMap.clear();\n for (let plugin of this.plugins)\n plugin.update(this);\n this.docView = new DocView(this);\n this.inputState.ensureHandlers(this, this.plugins);\n this.mountStyles();\n this.updateAttrs();\n this.bidiCache = [];\n }\n finally {\n this.updateState = 0 /* Idle */;\n }\n if (hadFocus)\n this.focus();\n this.requestMeasure();\n }", "viewChanged(newValue, oldValue) {\n this.changes.view = newValue;\n requestUpdate(this);\n }", "function setActiveView(view) {\n app.activeView = view;\n }", "updateView() {\n this.render()\n }", "function SetViewChanging(changing) {\n viewChangeInProgress = changing;\n}", "changeView (view) {\n this.setState({role: view});\n }", "_onChangeView() {\n this.emit(`view`);\n }", "function setView(viewId){\n\tif(viewId){\n\t\t$.fn.viewAs = viewId;\n\t} else {\n\t\tif($.fn.viewAs == 'viewAsIcon'){\n\t\t\t$.fn.viewAs = 'viewAsList';\n\t\t} else {\n\t\t\t$.fn.viewAs = 'viewAsIcon';\n\t\t}\n\t}\n\t\n\t// remove selected class from both\n\t$('#viewAsIcon').removeClass('selected');\n\t$('#viewAsList').removeClass('selected');\n\t\n\t// add selected class to one\n\t$('#' + $.fn.viewAs).addClass('selected');\n\t\n\t// toggle view classes\n\t$('#items').attr('class', $.fn.viewAs);\n}", "setupView() {\n if (this.view === null) { // If this is called, then user has not overwritten this function\n throw new Error(\"RealtimeMultiplayerGame.AbstractClientGame.setupView - Override this method, then call MyClientGame.superclass.setupView()\");\n }\n this.fieldController.setView(this.view);\n }", "_applyItemView(value, old) {\n if (value) {\n this.getStateManager().setState(\"itemView\", value);\n } else {\n this.getStateManager().removeState(\"itemView\");\n }\n }", "function set_view(self, state, level)\n {\n if (\"icons\" in self.parameters)\n {\n if (state in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons[state].icon);\n self.set_field(self, \"icon_style\", self.parameters.icons[state].style)\n }\n else if (\"default\" in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons.default.icon);\n self.set_field(self, \"icon_style\", self.parameters.icons.default.style)\n }\n else\n {\n self.set_icon(self, \"icon\", \"fa-circle-thin\");\n self.set_field(self, \"icon_style\", \"color: white\")\n }\n\n }\n\n if (\"state_text\" in self.parameters && self.parameters.state_text == 1)\n {\n self.set_field(self, \"state_text\", self.map_state(self, state))\n }\n }", "function set_view(self, state, level)\n {\n if (\"icons\" in self.parameters)\n {\n if (state in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons[state].icon);\n self.set_field(self, \"icon_style\", self.parameters.icons[state].style);\n set_service_call(self, self.parameters.icons[state]);\n }\n else if (\"default\" in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons.default.icon);\n self.set_field(self, \"icon_style\", self.parameters.icons.default.style);\n set_service_call(self, self.parameters.default);\n }\n else\n {\n self.set_icon(self, \"icon\", \"fa-circle-thin\");\n self.set_field(self, \"icon_style\", \"color: white\");\n set_service_call(self, {});\n }\n\n }\n\n if (\"state_text\" in self.parameters && self.parameters.state_text == 1)\n {\n self.set_field(self, \"state_text\", self.map_state(self, state))\n }\n }", "function refreshView() {\n\tchangeView(currentView[0], currentView[1], true);\n}", "setView() {\n this.view = new ol.View({\n projection: this.projection,\n center: ol.extent.getCenter(this.extent),\n zoom: 1,\n maxZoom: 8,\n maxResolution: 1.4\n });\n }", "_viewEvent(view) {\n\t if (view !== this._view) {\n\t // Action for different view - ignore it\n\t return;\n\t }\n\t // Change visible view if it doesn't match view.\n\t // Function also calls _triggerChange(true)\n\t if (this._changeVisibleView()) {\n\t return;\n\t }\n\t // Something changed in visible view\n\t this._triggerChange(false);\n\t }", "set mainview(value) {\n if (value) {\n this.node.setAttribute(\"mainview\", true);\n } else {\n this.node.removeAttribute(\"mainview\");\n }\n }", "static view(v) {\n // Add history\n window.history.replaceState(State.preserve(), document.title);\n // Change views\n for (let view of Array.from(arguments)) {\n // Store view\n let element = UI.find(view);\n // Store parent\n let parent = element.parentNode;\n // Hide all\n for (let child of parent.children) {\n UI.hide(child);\n }\n // Show view\n UI.show(element);\n }\n // Add history\n window.history.pushState(State.preserve(), document.title);\n }", "function updateViewState(viewState) {\n var currentViewState = jq(document).data(\"ViewState\");\n if (currentViewState) {\n jq.extend(currentViewState, viewState);\n }\n else {\n jq(document).data(\"ViewState\", viewState);\n }\n}", "gotView({ game }) {\n this.setState(game);\n }", "changeView() {\n\t\tthis.state.view === \"signup\" ? this.setState({view: \"signin\"}) : this.setState({view: \"signup\"});\n\t\tthis.setState({errorMessage: \"\"});\n\t}", "function toggleView(view) {\n\t\tsetActiveView(view);\n\t}", "function handleShow(view){\r\n view._isShown = true;\r\n triggerDOMRefresh(view);\r\n }", "requestView(){\t\t\n\t\tthis.trigger('requestView');\n\t}", "function init(vew) {\n\n // the view this controller is controlling\n view = vew;\n\n // put the view in an initial state\n view.init();\n }", "setupReviewView(view) {\n }", "onViewChange() {\n \n }", "setViewXml(viewXml) {\r\n return this.clone(View, \"SetViewXml\").postCore({\r\n body: jsS({\r\n viewXml,\r\n }),\r\n });\r\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function handleShow(view) {\n view._isShown = true;\n triggerDOMRefresh(view);\n }", "OnChangeView(view_id) {\n this.setState({\n activeView: view_id\n });\n\n if (this.state.activeView === \"homeScreen\") {\n if (window.location.hash) {\n this.OnChangePanel(\"party-info\");\n }\n }\n }", "changeView() {\n console.log('changing the view');\n //when this function is called, change the view in the state\n //if the state is 'Homepage'\n if (this.state.view === 'Homepage') {\n //then set it to Carousel\n this.setState({\n view: 'Carousel'\n });\n //else if the state is 'Carousel'\n } else if (this.state.view === 'Carousel') {\n //then set it to 'Homepage\n this.setState({\n view: 'Homepage'\n });\n }\n }", "function OnStateUpdate(self, state)\n {\n if (!(\"ignore_state\" in self.parameters) || self.parameters.ignore_state === 0)\n {\n self.state = state.state;\n set_view(self, self.state)\n }\n }", "function changeView(newViewName) {\n\t\tif (!currentView || newViewName != currentView.name) {\n\t\t\tignoreWindowResize++; // because setMinHeight might change the\n\t\t\t// height before render (and subsequently\n\t\t\t// setSize) is reached\n\n\t\t\tunselect();\n\n\t\t\tvar oldView = currentView;\n\t\t\tvar newViewElement;\n\n\t\t\tif (oldView) {\n\t\t\t\t(oldView.beforeHide || noop)(); // called before changing\n\t\t\t\t// min-height. if called after,\n\t\t\t\t// scroll state is reset (in\n\t\t\t\t// Opera)\n\t\t\t\tsetMinHeight(content, content.height());\n\t\t\t\toldView.element.hide();\n\n\t\t\t} else {\n\t\t\t\tsetMinHeight(content, 1); // needs to be 1 (not 0) for IE7, or\n\t\t\t\t// else view dimensions\n\t\t\t\t// miscalculated\n\t\t\t}\n\t\t\tcontent.css('overflow', 'hidden');\n\t\t\tcurrentView = viewInstances[newViewName];\n\t\t\tif (currentView) {\n\t\t\t\tcurrentView.element.show();\n\t\t\t} else {\n\t\t\t\tcurrentView = viewInstances[newViewName] = new fcViews[newViewName](\n\t\t\t\t\t\tnewViewElement = absoluteViewElement = $(\n\t\t\t\t\t\t\t\t\"<div class='fc-view fc-view-\" + newViewName\n\t\t\t\t\t\t\t\t\t\t+ \"' style='position:absolute'/>\")\n\t\t\t\t\t\t\t\t.appendTo(content), t // the calendar object\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (oldView) {\n\t\t\t\theader.deactivateButton(oldView.name);\n\t\t\t}\n\t\t\theader.activateButton(newViewName);\n\t\t\t// alert(\"selectedWeek: \"+selectedWeek);\n\t\t\trenderView(); // after height has been set, will make\n\t\t\t// absoluteViewElement's position=relative, then set\n\t\t\t// to null\n\t\t\t/*\n\t\t\t * if (!oldView && selectedWeek != 0) { for ( var i = 0; i <\n\t\t\t * selectedWeek; i++) { renderView(1); } }\n\t\t\t */\n\t\t\tcontent.css('overflow', '');\n\t\t\tif (oldView) {\n\t\t\t\tsetMinHeight(content, 1);\n\t\t\t}\n\n\t\t\tif (!newViewElement) {\n\t\t\t\t(currentView.afterShow || noop)(); // called after setting\n\t\t\t\t// min-height/overflow, so\n\t\t\t\t// in final scroll state\n\t\t\t\t// (for Opera)\n\t\t\t}\n\n\t\t\tignoreWindowResize--;\n\t\t}\n\t}", "handleViewChange(view, changed_attrib, new_value) {\n if (debug && false) console.log('handleViewChange', view, changed_attrib, new_value);\n // check that we've got a valid sequence number\n if (!view.seq.length) {\n console.error('Received an invalid sequence number, aborting handleViewChange');\n return;\n }\n // compose state update leaf\n const updated_view = {};\n updated_view[changed_attrib] = new_value;\n const chain = ViewManager.calculateViewChangeChain(view, updated_view);\n // use immutability-helper to create an update copy of the state then apply to state\n const new_state = {views: update(this.state.views, chain)};\n this.setState(new_state);\n }", "updateView() {\n if (!Object(_yuion_svg_viewer__WEBPACK_IMPORTED_MODULE_3__[\"getViewer\"])(this.viewer) || this.loading) {\n return this.timeout('update_view', () => this.updateView());\n }\n try {\n Object(_yuion_svg_viewer__WEBPACK_IMPORTED_MODULE_3__[\"updateViewer\"])(this.viewer, {\n styles: this.styles,\n features: this.feature_list,\n labels: this.labels,\n actions: this.actions,\n });\n }\n catch (e) { }\n }", "function viewShown() {\n activate();\n }", "handleSetViews( value ) {\n\t\t// force update button to be clickable\n\t\twp.data.dispatch( 'core/editor' ).editPost( { meta: { _pvc_post_views: value } } );\n\n\t\tthis.setState( () => {\n\t\t\treturn {\n\t\t\t\tpostViews: value\n\t\t\t}\n\t\t} );\n\t}", "updateView() {\n // we update the selected task id\n const theId = document.getElementsByClassName('grid-row-selected')[0].attr('id');\n this.newTaskId = theId.replace('item_row_view_', '');\n\n // add a timer button\n this.addTimerButton();\n\n // get our timer history\n // this.getTimerHistory(this.newTaskId);\n\n }", "showCreator() {\n this.setState({ viewSelector: 1 })\n }", "function initializeViewState(viewState) {\n jq(document).data(\"ViewState\", viewState);\n}", "function View() {\n var self = this;\n this.currentDate = new Date();\n }", "setButtonState() {\n // this.view.setButtonState(this.runner.busy,this.synchronizing,this.synchronize_type)\n }", "onChangeDefaultView(value) {this.props.setTempSettings(\"defaultView\", value)}", "onViewChanged() {\n this.camera = this.graph.views.get(this.viewIndexToNames[this.selectedView]);\n this.interface.setActiveCamera(this.camera);\n }", "get view() {\n return this._view;\n }", "get view() {\n return this._view;\n }", "function handleRender(view){\r\n view._isRendered = true;\r\n triggerDOMRefresh(view);\r\n }", "bindView(_view) {\n if (!this.viewIds.includes(_view.viewId)) {\n this.viewIds.push(_view.viewId);\n }\n this._updateFlexibleDimensions();\n return this;\n }", "function setViewState(key, value) {\n var viewState = jq(document).data(\"ViewState\");\n if (!viewState) {\n viewState = new Object();\n jq(document).data(\"ViewState\", viewState);\n }\n viewState[key] = value;\n}", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "switchView() {\n this.setState({ showSignUp: !this.state.showSignUp });\n }", "_onViewChange() {\n if (this._pointControllers) {\n this._pointControllers.forEach((pointController) => {\n pointController.setDefaultView();\n });\n }\n }", "toggleView(){\n this.setState((prevState) => {\n const view = prevState.view === \"create\" ? \"display\" : \"create\";\n return {view};\n })\n }", "function setViewEngine(selectedViewEngine){\n ViewEngine = selectedViewEngine;\n}", "function handleRender(view) {\n view._isRendered = true;\n triggerDOMRefresh(view);\n }", "function start_view() {\n editor_visibility(true);\n button_visibility('view-mode');\n d3.json(resource_url(), editor_callback);\n}", "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\tcalcSize();\n\t\trenderView(viewType, scrollState);\n\n\t\tthawContentHeight();\n\t\tignoreWindowResize--;\n\t}", "_showView(view) {\n this._hideAll();\n view.show();\n view.css('visibility', 'visible');\n }", "function updateView() {\n var listview = document.getElementById(\"listview1\").winControl;\n\n // Set the properties on the list view to use the itemDataSource\n listview.itemDataSource = dataSource;\n listview.itemTemplate = renderer;\n }", "function reinitView() {\n\t\t\tignoreWindowResize++;\n\t\t\tfreezeContentHeight();\n\n\t\t\tvar viewType = currentView.type;\n\t\t\tvar scrollState = currentView.queryScroll();\n\t\t\tclearView();\n\t\t\trenderView(viewType, scrollState);\n\n\t\t\tunfreezeContentHeight();\n\t\t\tignoreWindowResize--;\n\t\t}", "function updateView() {\n if (!$scope.$$phase) $scope.$apply();\n }", "changeView(){\n if (this.compare) {\n // clear array with plans to compare\n this.$store.dispatch('clearCompare');\n } else {\n // clear 'add to compare' checkboxes\n let checkboxes = document.getElementsByClassName('checkbox-recomm');\n for(let i = 0; i < checkboxes.length; ++i){\n checkboxes[i].checked = false;\n }\n }\n this.$store.dispatch('changeView');\n\n // reset scroll offsets\n this.tableOffsetLeft = this.filtersWidth;\n this.windowOffsetLeft = 0;\n }", "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\trenderView(viewType, scrollState);\n\n\t\tunfreezeContentHeight();\n\t\tignoreWindowResize--;\n\t}", "function change_view(view)\n{\n\tif(view_mode == 'errors')\n\t\treturn; // You cannot escape Errors View!\n\tswitch(view)\n\t{\n\t\tcase 'loader':\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#loader_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'errors':\n\t\t\t// TODO: Flash menacingly.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#errors_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'galaxy':\n\t\t\t// TODO: Zoom out from Sector View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#galaxy_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'sector':\n\t\t\t// TODO: Zoom in from Galaxy View, or out from System View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#sector_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'system':\n\t\t\t// TODO: Zoom in from Sector View, or out from Object View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#system_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'object':\n\t\t\t// TODO: Zoom in from System View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#object_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Cannot change_view() to: ' + view);\n\t}\n\tview_mode = view;\n}", "function toggleView(view) {\n var show = model.views[view];\n model.views[view] = !show;\n }", "setSettingsView (settingsView) {\n this.settingsView = settingsView\n\n if (this.panels.length > 0) {\n for (let panel in this.panels) {\n this.addPanelToSettingsView(panel)\n }\n }\n }", "function switchToView(view) {\n switch (view) {\n case 'edit-form': showElement(['edit-form']); hideElement(['listing', 'main-controls']); break;\n case 'listing': hideElement(['edit-form']); showElement(['listing', 'main-controls']); renderList(); break;\n }\n}", "createView() {\n const doc2 = createDocument(this.options.content, this.schema, this.options.parseOptions);\n const selection = resolveFocusPosition(doc2, this.options.autofocus);\n this.view = new EditorView(this.options.element, {\n ...this.options.editorProps,\n dispatchTransaction: this.dispatchTransaction.bind(this),\n state: EditorState.create({\n doc: doc2,\n selection: selection || void 0\n })\n });\n const newState = this.state.reconfigure({\n plugins: this.extensionManager.plugins\n });\n this.view.updateState(newState);\n this.createNodeViews();\n const dom = this.view.dom;\n dom.editor = this;\n }", "setViewXml(viewXml) {\n return spPost(this.clone(View, \"SetViewXml\"), body({ viewXml }));\n }", "@action update_current_view(data) {\n this.page_state.update_current_view(data);\n }", "refresh() {\n this.views.forEach(_responder => {\n if (_responder.value !== this.value && !_responder._valueIsBeingSet) {\n _responder._valueIsBeingSet = true;\n _responder.setValue(this.value);\n _responder._valueIsBeingSet = false;\n }\n });\n }", "refresh() {\n this.views.forEach(_responder => {\n if (_responder.value !== this.value && !_responder._valueIsBeingSet) {\n _responder._valueIsBeingSet = true;\n _responder.setValue(this.value);\n _responder._valueIsBeingSet = false;\n }\n });\n }", "function setViewModified(bool) {\n // log.d('modified =' + bool);\n viewModified = bool;\n if (bool) saveButton.show(true);\n else {saveButton.hide(true);} \n }", "function restoreView(viewToRestore){contextLView=viewToRestore;}" ]
[ "0.7733251", "0.7733251", "0.7733251", "0.77318", "0.72683024", "0.70956314", "0.7093537", "0.7048044", "0.6952537", "0.6938064", "0.679264", "0.675826", "0.6750861", "0.6725923", "0.66904855", "0.66389334", "0.6533543", "0.6526951", "0.65169847", "0.6506038", "0.64756083", "0.647012", "0.64442635", "0.6440855", "0.64299786", "0.63608646", "0.63262856", "0.6309233", "0.62669027", "0.6196832", "0.6180918", "0.6180688", "0.61784124", "0.61747974", "0.6173325", "0.6165001", "0.61202717", "0.6116917", "0.60538876", "0.6053794", "0.6035718", "0.6013137", "0.6003478", "0.5996691", "0.59911305", "0.59840864", "0.59730566", "0.59606224", "0.59546834", "0.5933524", "0.5906336", "0.5906336", "0.5906336", "0.58983934", "0.58854556", "0.5882569", "0.5877255", "0.58674955", "0.583172", "0.58138543", "0.5811233", "0.5810891", "0.57956517", "0.579316", "0.5791812", "0.57900995", "0.577394", "0.5749482", "0.5743518", "0.57381016", "0.57381016", "0.5737009", "0.5713945", "0.5712975", "0.5697417", "0.5697417", "0.5695529", "0.56874204", "0.5681001", "0.56748474", "0.5673147", "0.56691784", "0.5661133", "0.5660758", "0.56435263", "0.5639942", "0.5631582", "0.5621657", "0.56203485", "0.5608797", "0.5596629", "0.5594688", "0.55869615", "0.5580518", "0.5564162", "0.5551423", "0.5549505", "0.5549505", "0.5540876", "0.55356133" ]
0.6245171
29
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state
function OnStateAvailable(self, state) { self.entity = state.entity_id; self.level = state.attributes.volume_level; set_view(self, state) if ("dump_capabilities" in self.parameters && self.parameters["dump_capabilities"] == "1") { display_supported_functions(self) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\n }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\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 }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "prepareState() {\n /* ... */\n }", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "get state() {\n return this._wantedState;\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 }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\n }", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "is_available() {\n return this._time_until_arrival === 0;\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "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}", "function State() {\n\n }", "function CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "function isInitState( state ) { \n return ( _.isUndefined( state.data ) && _.isUndefined( state.lm ) && _.isUndefined( state.error ) );\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() {\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 isFinalState() {\n return getReachableStates().every((state) => state === currentState);\n }", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function expectStateInit(ae) {\n\n expect(ae.state).toBe(States.init);\n\n expect(ae.isUnstarted).toBe(false);\n expect(ae.isExecuting).toBe(true);\n\n expectStatesSharedUnsettled(ae);\n }", "function initial_state(state){\n let servers = Object.keys(state[\"val\"][\"configTerm\"]);\n return forall((sid) => state[\"val\"][\"configTerm\"][sid]==0 && state[\"val\"][\"configVersion\"][sid]==1, servers)\n}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\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}", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get idle ()\n {\n return this.waiting === this.entities.length;\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 PendingPlayerState() { }", "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 }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "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 }", "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}", "function readyStateHandler() {\n if (isEqualIgnoreCase(\"loaded\", element.readyState) ||\n isEqualIgnoreCase(\"complete\", element.readyState)) {\n callback({type: \"load\"});\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 }", "get available() {\n return this.state.timeout === 0;\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "setReady() {\n this.currentState = cpState.READY;\n }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\n });\n }", "get _isReady() {\n return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined;\n }", "initInteractionState() {\n this.dirty = false;\n this.prefilled = !this._isEmpty();\n }" ]
[ "0.73103726", "0.73103726", "0.69755137", "0.69755137", "0.69755137", "0.69755137", "0.693129", "0.6648063", "0.65828377", "0.65529156", "0.64256227", "0.64256227", "0.64256227", "0.6296636", "0.6154816", "0.6140548", "0.60751325", "0.60498303", "0.60464376", "0.594488", "0.594488", "0.57846725", "0.57831687", "0.5768873", "0.57140064", "0.55653775", "0.5551579", "0.55445427", "0.54863334", "0.5476671", "0.54695266", "0.54549474", "0.54522634", "0.5449544", "0.54483515", "0.5445607", "0.5418579", "0.5381588", "0.53706497", "0.53408414", "0.53103065", "0.5304097", "0.5290873", "0.5283052", "0.5276257", "0.52699995", "0.52588856", "0.5247708", "0.5232696", "0.5227415", "0.5213522", "0.5197256", "0.5196667", "0.51790977", "0.5176259", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.51616436", "0.516123", "0.51610774", "0.5154754", "0.5151565", "0.5134419", "0.51202613", "0.511831", "0.5118235", "0.51099247", "0.51065487", "0.5105524", "0.50968665", "0.50950664", "0.50939393", "0.5092119", "0.5091403", "0.5091403", "0.5085337", "0.5079993", "0.5072135", "0.5068756", "0.50675577", "0.5065092", "0.50554544", "0.5044247" ]
0.6476712
10
The OnStateUpdate function will be called when the specific entity receives a state update its new values will be available in self.state[] and returned in the state parameter
function OnStateUpdate(self, state) { self.level = state.attributes.volume_level; set_view(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "stateChanged(state) {\n this._name = state.profile.name;\n this._position = state.profile.position;\n this._skill = state.profile.skill;\n this._saved = state.profile.saved;\n }", "update() {\n BaseState.update.call(this);\n }", "function OnStateUpdate(self, state)\n {\n if (!(\"ignore_state\" in self.parameters) || self.parameters.ignore_state === 0)\n {\n self.state = state.state;\n set_view(self, self.state)\n }\n }", "function updateState() {\n gState.push({\n board: copyMat(gBoard),\n shownCount: gGame.shownCount,\n markedCount: gGame.markedCount,\n lives: gGame.lives,\n safeClick: gGame.safeClick,\n hints: gGame.hints,\n manualMode: gGame.isManualOn,\n gManualMode: gManualMode.isManualOn\n });\n}", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function updateState() {\n //create our state object and notify our listener\n var state = {\n currentUniverseTime: new Date(currentUniverseTime)\n };\n\n fireStateChanged(state);\n\n // call update() again in a certain number of milliseconds\n updateStateTimeout = setTimeout(function () {\n updateState();\n }, timeBetweenStateUpdatesMs);\n }", "stateChanged(state) { }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n\n delay_time = self.parameters.update_delay;\n if (delay_time !== undefined) {\n if (self.timeout !== undefined) {\n clearTimeout(self.timeout);\n }\n\n self.timeout = setTimeout(function() {set_view(self, self.state)}, delay_time * 1000);\n } else {\n set_view(self, self.state);\n }\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n\n set_view(self, self.state, self.level)\n }", "_onChangeState() {\n\n\n }", "function setEntityState(entity,state) {\n entity.state = state\n server.baseServer.broadcast('server','entity',{uuid:entity.uuid, state:state})\n }", "function _updateState(state, payload) {\n $log.debug(\"=== State changed ===\");\n $log.info(state);\n $log.debug(payload);\n\n $rootScope.$emit(HOTEL_STATES, {\n state: state,\n payload: angular.copy(payload)\n });\n }", "stateChanged(_state) { }", "stateChange(state){\n\t\tLogger.info(`Ably realtime state changed to: ${state.current}`);\n\t}", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "stateChanged(state) {\n }", "async updateState(state) {\n let key = this.ctx.stub.createCompositeKey(this.name, [state.getKey()]);\n let data = Utils.serialize(state);\n await this.ctx.stub.putState(key, data);\n }", "changeState(state) {\r\n for (let key in this.states){\r\n // console.log(this.states[key])\r\n if (key==state) {\r\n this.statesStack.append(this.state);\r\n this.state=state;\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n } \r\n throw new Error();\r\n }", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function updateEntityState (entity, nextState) {\n\t entity.pendingState = assign(entity.pendingState, nextState)\n\t entity.dirty = true\n\t invalidate()\n\t }", "_onChange() {\n this.setState(getAllState())\n }", "getUpdatedState(props, state) {\n return this.state.getUpdatedState(props, state);\n }", "get state() { return this._state; }", "getState(){\n super.getState();\n this.state['amount'] = this.#amount;\n\n return this.state;\n }", "handle() {\n if(!this.enabled)\n return;\n\n Object.assign(this.previousState, this.state); // Save the previous state\n this.update(); // Update the current state\n this.notify();\n }", "function updateEntityState (entity, nextState) {\n entity.pendingState = assign(entity.pendingState, nextState)\n entity.dirty = true\n invalidate()\n }", "updateState(newState) {\n this.setState(newState);\n }", "_stateChanged(state) {\n console.log(state);\n }", "stateChanged(state) {\n this._competitors = competitorsWithEventsSelector(state);\n this._couples = couplesSelector(state);\n this._events = EventsWithCouplesSelector(state);\n this._offbeat = state.form.offbeat.competing;\n this._offbeat_team = OffbeatTeamSelector(state);\n this._basic_information = state.form.basic_information;\n this._form = state.form;\n this._total_entry_fee = total_entry_fee(this._competitors);\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function onStateUpdate(nState) {\n for (var pid in state.players) {\n if (!(pid in nState.players)) // player vanishes\n onPlayerQuit(pid);\n }\n\n for (var pid in nState.players) {\n if (pid == ws._id) continue; // skip ourself\n\n if (!(pid in state.players)) { // player appears\n onPlayerJoin(pid, nState.players[pid]);\n }\n\n var p = nState.players[pid];\n if (p.state == 'player') { // update non-ghost\n onPlayerUpdate(pid, p);\n }\n }\n}", "function OnStateUpdate(self, state)\n {\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n }", "get state() {\n return this._obj.state;\n }", "get state(){return this._state;}", "get state(){return this._state;}", "get state(){return this._state;}", "stateChanged(state){\n this.targetFood = state.targetFood;\n }", "changeState(state) {\r\n if(this.getStates().indexOf(state) != -1){\r\n if(this.prevState[this.prevState.length - 1] != this.state)\r\n this.prevState.push(this.state);\r\n this.state = state;\r\n }else throw new Error(\"\")\r\n }", "setState(updateObject) {\n this.setChangeFlags({stateChanged: true});\n Object.assign(this.state, updateObject);\n this.setNeedsRedraw();\n }", "function getState() {\n return state;\n }", "stateChanged(state) {\n this._clicks = state.counter.clicks;\n this._value = state.counter.value;\n }", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "get state() {\r\n return this._state;\r\n }", "getState() {\n return this.state;\n }", "function updateState(state) {\n cellClientProps = updateCellClientProps(state, cellClientProps);\n //draw a white background\n background(255, 255, 255);\n\n for (var playerId in state.players) {\n if (state.players.hasOwnProperty(playerId)) {\n let plyr = state.players[playerId];\n let color = plyr.blob.color;\n stroke(color[0],color[1],color[2]);\n for (var i=0; i<plyr.blob.cellInds.length; i++) {\n let c = cellClientProps.ps[plyr.blob.cellInds[i]];\n let a = plyr.blob.amts[i];\n strokeWeight(sqrt(a));\n point(c.x,c.y);\n }\n }\n }\n\n stroke(0);strokeWeight(12);\n for (let i=0; i<cellClientProps.ps.length; i++) {\n let p = cellClientProps.ps[i];\n point(p.x,p.y);\n }\n image(pointer, mouseX, mouseY);\n}", "getState() {\n return state;\n }", "enterState(oldState){}", "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "function state_update(st) {\n state = st;\n if (callback) {\n callback(st);\n }\n}", "get_state() {\n return this.state;\n }", "_onChange() {\n this.setState(getUserState());\n }", "function State() {\n\n }", "function statehandler(key, value) {\n // console.log(\"key:\",key,\"value:\",value)\n // console.log(\"old state:\", user)\n setUser({...user, [key]: value});\n // console.log(\"latest state:\", user)\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "function History_UpdateLastStateLoaded()\n{\n\t//by default the last loaded State is the current one\n\tthis.LastLoadedStateIndex = this.CurrentStateIndex;\n\t//get the current State\n\tvar wi4State = __SIMULATOR.StateManager.CurrentState;\n\t//create a map of previously processed ids\n\tvar mapIds = {};\n\t//create a copy of states loaded\n\tvar states = this.States.slice();\n\t//while the state is valid\n\twhile (wi4State != null)\n\t{\n\t\t//get the next default action StateId\n\t\tvar nextStateId = wi4State.ListOfPaths.length > 0 ? wi4State.ListOfPaths[0].Destiny : null;\n\t\t//no id? or already processed?\n\t\tif (!nextStateId || mapIds[nextStateId])\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//mark id as processed\n\t\tmapIds[nextStateId] = true;\n\t\t//get the State\n\t\twi4State = __CACHE.Has_State(nextStateId);\n\t\t//invalid?\n\t\tif (!wi4State)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//not yet ready?\n\t\tif (!wi4State.Optimised)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//increment last loaded State index\n\t\tthis.LastLoadedStateIndex++;\n\t\t//push this message into our array\n\t\tstates.push(wi4State);\n\t}\n\t//now update the controller\n\t__SIMULATOR.NotifyControllerHistory(states);\n}", "function getState() {\n return currentState\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "function updateState(stateChange) {\n if (isNaN(stateChange)) {\n console.error(\"Invalid state change\");\n return;\n }\n currState += stateChange;\n currState = currState % states.length;\n console.assert(\n currState >= 0 && currState < states.length,\n \"currState got out of bounds on updateState: \",\n currState\n );\n clearButtons();\n switch (getRoomName()) {\n case \"START\":\n buildStartRoom();\n break;\n case \"GAME\":\n buildGameRoom();\n break;\n case \"RESULTS\":\n buildResultsRoom();\n break;\n }\n}", "updateState(stateChange){\n this.setState(stateChange);\n }", "function getState () {\n\t\treturn currentState;\n\t}", "function getState () {\n return state\n }", "function getState () {\n return state\n }", "async updateState() {\n const stateResponses = await Promise.all([\n this.bulb.getLightState(),\n this.bulb.getDeviceInfo()\n ]).catch(err => {\n console.error(err.message);\n generateErrorQRCode(`Could not get status of ${deviceName}`);\n });\n const newState = lifxStateToCapstone_Yeet(\n stateResponses[0],\n stateResponses[1]\n );\n\n if (!_.isEqual(this.bulbState, newState)) {\n // the light bulb state has changed\n console.debug(\"State has changed\");\n this.bulbState = newState;\n // TODO: remove console.log once we can correctly pad the image. Instead\n // of logging this object, we will display it on the e-ink display.\n generateQRCode(this.bulbState);\n }\n }", "get State() {\r\n return _state;\r\n }", "get State() {\r\n return _state;\r\n }", "getState() {\n return this._state;\n }", "setStateInternal(id, value) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n this.log.info('update state ' + obj + ' with value:' + value);\n currentStateValues[obj] = value;\n }", "get state() {return this._p.state;}", "componentDidUpdate() {\n // debugging\n console.log('___STATE____', this.state);\n }", "drawState(){\n if(this.getTracer().stateStructure && this.getNode(this.currentId)){\n NodeStateService.process(this.getNode(this.currentId).state_variables);\n }\n }", "subscriberState(EventName, data){\n let key = EventName\n let val = data\n let obj = {}\n obj[key] = val\n //console.log('players in ListPlayers class');\n //console.log(this.state.players);\n this.setState(obj);\n }", "function getState() {\n return currentState\n }", "onStateChange() {\n\t\tthis.forceUpdate();\n\t}", "function updateState(data) {\n updateVoteFinishArea(data.state);\n}", "changeState(state) {\r\n if(this.config.states[state]) {\r\n this.currentState = state;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('changeState');\r\n } else {\r\n throw new Error('This state does not exist');\r\n }\r\n }", "stateChangedCallback(yfct,value)\n { \n \n // memorize the new state\n this._state = (value ==\"B\" ); \n console.log(\"relay change (\"+value+\", state is now \"+this._state);\n // notify the NEEO server about the change\n this.notifyNEEOServer({uniqueDeviceId: this._neeoID, component:this._hwdID, value:this._state} );\n // this.notifyNEEOServer({uniqueDeviceId: \"default\" , component:this._hwdID, value:this._state } );\n }", "function updateStateMaps() {\n // XXX\n }", "_handleComponentChange() {\n this.setState(this._getStateFromStore());\n }", "componentDidUpdate() {\n this.lastStateUpdate = Date.now();\n StateLoader.updateLocalStorage(this.state);\n }", "changeState(state) {\r\n\r\n\r\n if (!this.statuses.includes(state)) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = state;\r\n this.history2 = [];\r\n\r\n\r\n }", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "updateState(update) {\n\t\t// console.log(\"Fetching player updates\");\n\n\t\t// Get the ID of the player who triggered this update\n\t\tlet pid = update.pid;\n\t\tlet player = this.stage.getPlayer(pid);\n\n\t\t// Only clients with a player that is still alive can make updates\n\t\tif (player) {\n\t\t\tif (update.type == \"move\") {\n\t\t\t\tplayer.setMovementDirection(update.x, update.y);\n\t\t\t} else if (update.type == \"cursor\") {\n\t\t\t\tplayer.setCursorDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"click\") {\n\t\t\t\tplayer.setFiringDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"weapon-toggle\") {\n\t\t\t\tplayer.setWeapon(update.toggle);\n\t\t\t}\n\t\t}\n\t}", "changeState(state) {\r\n if (state !== \"hungry\" && state !== \"busy\" &&\r\n state !== \"sleeping\" && state !== \"normal\") {\r\n throw new Error()\r\n }\r\n\r\n this.state = state;\r\n this.states.push(this.state);\r\n return this.state\r\n }", "enterState (state = this.Data) {\n this.State = state;\n }", "function getState() {\n return currentState\n }" ]
[ "0.70077926", "0.6852809", "0.6795396", "0.6775392", "0.67612934", "0.6724651", "0.6551379", "0.65442294", "0.6517035", "0.6495464", "0.6495464", "0.64726466", "0.64598566", "0.6443647", "0.6438235", "0.64101493", "0.64096826", "0.631815", "0.6304705", "0.6301794", "0.629913", "0.628467", "0.6283835", "0.62784815", "0.6268991", "0.6246019", "0.62381226", "0.61717844", "0.61534935", "0.6142991", "0.61364895", "0.61318946", "0.6119981", "0.6115325", "0.6104216", "0.61005306", "0.60961306", "0.6092122", "0.6092122", "0.6092122", "0.6065779", "0.6060487", "0.6059047", "0.6049608", "0.6049608", "0.6049608", "0.60471195", "0.60219324", "0.6005837", "0.59933263", "0.59911203", "0.59894466", "0.59698904", "0.59637105", "0.5948652", "0.5946607", "0.59460926", "0.59429985", "0.59420836", "0.5939905", "0.5939373", "0.59234464", "0.5920863", "0.59078604", "0.59078604", "0.59078604", "0.5902503", "0.58953506", "0.58881", "0.58881", "0.58881", "0.58881", "0.58845013", "0.5882263", "0.58801806", "0.5878432", "0.587636", "0.587636", "0.5868487", "0.58674645", "0.58674645", "0.58658296", "0.5849003", "0.5848066", "0.58466893", "0.58439267", "0.584376", "0.5842555", "0.5841973", "0.5840734", "0.5840389", "0.58396", "0.5837634", "0.5836762", "0.58225584", "0.5820587", "0.58116406", "0.5811298", "0.58086586", "0.5804936", "0.5803278" ]
0.0
-1
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { self.min = state.attributes.min self.max = state.attributes.max self.step = state.attributes.step self.level = state.state if ("units" in self.parameters) { self.set_field(self, "unit", self.parameters.units) } set_view(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\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 }", "is_available() {\n return this._time_until_arrival === 0;\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "get state() { return this._state; }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function PendingPlayerState() { }", "function getState() {\n return currentState\n }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\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}", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\n }" ]
[ "0.73287344", "0.73287344", "0.6968565", "0.6968565", "0.6968565", "0.6968565", "0.6926128", "0.6789413", "0.66253674", "0.65430224", "0.64888936", "0.64888936", "0.64888936", "0.6310257", "0.6190595", "0.61709887", "0.6154469", "0.6125979", "0.5983027", "0.5983027", "0.59440786", "0.59340304", "0.5870546", "0.5813025", "0.5766564", "0.57494885", "0.55708766", "0.555826", "0.55579376", "0.55426913", "0.55315953", "0.5531125", "0.5523095", "0.54847574", "0.5467727", "0.5461427", "0.5438862", "0.54335624", "0.54092395", "0.5361421", "0.53488183", "0.5340812", "0.5328171", "0.5328101", "0.53154767", "0.5307317", "0.530489", "0.53013617", "0.52979136", "0.5284578", "0.52806866", "0.5279393", "0.524995", "0.5233951", "0.52231663", "0.5220229", "0.51965934", "0.5183381", "0.51687664", "0.5162449", "0.51562303", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51270235", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.51230234", "0.5115831", "0.51144266", "0.51115763", "0.51069224", "0.5105438", "0.50957084", "0.5091158", "0.50900614", "0.5084766", "0.5083711", "0.5077806", "0.5075652", "0.5073771", "0.5072241", "0.5064793", "0.50619537", "0.50589156", "0.5056893" ]
0.6582287
9
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { drawChart(self, state) set_value(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "is_available() {\n return this._time_until_arrival === 0;\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() {\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "get state() { return this._state; }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function PendingPlayerState() { }", "function getState() {\n return currentState\n }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\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}", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\n }" ]
[ "0.73263496", "0.73263496", "0.69666564", "0.69666564", "0.69666564", "0.69666564", "0.69242686", "0.67867565", "0.6622723", "0.65812755", "0.65421313", "0.64862347", "0.64862347", "0.64862347", "0.6309391", "0.61906636", "0.6169924", "0.61518246", "0.6123605", "0.5981676", "0.5981676", "0.59421873", "0.5932553", "0.5869572", "0.5764933", "0.5746332", "0.556938", "0.555641", "0.5555897", "0.5540687", "0.55305237", "0.5530093", "0.5522056", "0.54850596", "0.5466556", "0.54611707", "0.5437682", "0.54325587", "0.5408254", "0.53596854", "0.5348431", "0.533953", "0.53275734", "0.532602", "0.5314587", "0.53055376", "0.5303056", "0.5300407", "0.5296953", "0.52829117", "0.5279252", "0.5278641", "0.5247946", "0.5232341", "0.52217716", "0.5218495", "0.519629", "0.51826835", "0.51684505", "0.5160943", "0.5155316", "0.51273805", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.51218396", "0.51157993", "0.51140946", "0.51108533", "0.510516", "0.5104229", "0.5093132", "0.5090761", "0.50883734", "0.5083589", "0.5083242", "0.50764996", "0.50758314", "0.5073467", "0.5071194", "0.5064031", "0.5060456", "0.50572383", "0.50564873" ]
0.5811763
24
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state
function OnStateAvailable(self, state) { self.state = state.state; self.access_token = state.attributes.access_token refresh_frame(self) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\n }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\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 }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "prepareState() {\n /* ... */\n }", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "get state() {\n return this._wantedState;\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 }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\n }", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "is_available() {\n return this._time_until_arrival === 0;\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "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}", "function State() {\n\n }", "function CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "function isInitState( state ) { \n return ( _.isUndefined( state.data ) && _.isUndefined( state.lm ) && _.isUndefined( state.error ) );\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() {\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 isFinalState() {\n return getReachableStates().every((state) => state === currentState);\n }", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function expectStateInit(ae) {\n\n expect(ae.state).toBe(States.init);\n\n expect(ae.isUnstarted).toBe(false);\n expect(ae.isExecuting).toBe(true);\n\n expectStatesSharedUnsettled(ae);\n }", "function initial_state(state){\n let servers = Object.keys(state[\"val\"][\"configTerm\"]);\n return forall((sid) => state[\"val\"][\"configTerm\"][sid]==0 && state[\"val\"][\"configVersion\"][sid]==1, servers)\n}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\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}", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get idle ()\n {\n return this.waiting === this.entities.length;\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 PendingPlayerState() { }", "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 }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "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 }", "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}", "function readyStateHandler() {\n if (isEqualIgnoreCase(\"loaded\", element.readyState) ||\n isEqualIgnoreCase(\"complete\", element.readyState)) {\n callback({type: \"load\"});\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 }", "get available() {\n return this.state.timeout === 0;\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "setReady() {\n this.currentState = cpState.READY;\n }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\n });\n }", "get _isReady() {\n return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined;\n }", "initInteractionState() {\n this.dirty = false;\n this.prefilled = !this._isEmpty();\n }" ]
[ "0.73103726", "0.73103726", "0.69755137", "0.69755137", "0.69755137", "0.69755137", "0.693129", "0.6648063", "0.65828377", "0.65529156", "0.6476712", "0.64256227", "0.64256227", "0.64256227", "0.6296636", "0.6154816", "0.6140548", "0.60751325", "0.60498303", "0.60464376", "0.594488", "0.594488", "0.57831687", "0.5768873", "0.57140064", "0.55653775", "0.5551579", "0.55445427", "0.54863334", "0.5476671", "0.54695266", "0.54549474", "0.54522634", "0.5449544", "0.54483515", "0.5445607", "0.5418579", "0.5381588", "0.53706497", "0.53408414", "0.53103065", "0.5304097", "0.5290873", "0.5283052", "0.5276257", "0.52699995", "0.52588856", "0.5247708", "0.5232696", "0.5227415", "0.5213522", "0.5197256", "0.5196667", "0.51790977", "0.5176259", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5168804", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.5165517", "0.51616436", "0.516123", "0.51610774", "0.5154754", "0.5151565", "0.5134419", "0.51202613", "0.511831", "0.5118235", "0.51099247", "0.51065487", "0.5105524", "0.50968665", "0.50950664", "0.50939393", "0.5092119", "0.5091403", "0.5091403", "0.5085337", "0.5079993", "0.5072135", "0.5068756", "0.50675577", "0.5065092", "0.50554544", "0.5044247" ]
0.57846725
22
The OnStateUpdate function will be called when the specific entity receives a state update its new values will be available in self.state[] and returned in the state parameter
function OnStateUpdate(self, state) { self.state = state.state; self.access_token = state.attributes.access_token refresh_frame(self) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "stateChanged(state) {\n this._name = state.profile.name;\n this._position = state.profile.position;\n this._skill = state.profile.skill;\n this._saved = state.profile.saved;\n }", "update() {\n BaseState.update.call(this);\n }", "function OnStateUpdate(self, state)\n {\n if (!(\"ignore_state\" in self.parameters) || self.parameters.ignore_state === 0)\n {\n self.state = state.state;\n set_view(self, self.state)\n }\n }", "function updateState() {\n gState.push({\n board: copyMat(gBoard),\n shownCount: gGame.shownCount,\n markedCount: gGame.markedCount,\n lives: gGame.lives,\n safeClick: gGame.safeClick,\n hints: gGame.hints,\n manualMode: gGame.isManualOn,\n gManualMode: gManualMode.isManualOn\n });\n}", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function updateState() {\n //create our state object and notify our listener\n var state = {\n currentUniverseTime: new Date(currentUniverseTime)\n };\n\n fireStateChanged(state);\n\n // call update() again in a certain number of milliseconds\n updateStateTimeout = setTimeout(function () {\n updateState();\n }, timeBetweenStateUpdatesMs);\n }", "stateChanged(state) { }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n\n delay_time = self.parameters.update_delay;\n if (delay_time !== undefined) {\n if (self.timeout !== undefined) {\n clearTimeout(self.timeout);\n }\n\n self.timeout = setTimeout(function() {set_view(self, self.state)}, delay_time * 1000);\n } else {\n set_view(self, self.state);\n }\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n\n set_view(self, self.state, self.level)\n }", "_onChangeState() {\n\n\n }", "function setEntityState(entity,state) {\n entity.state = state\n server.baseServer.broadcast('server','entity',{uuid:entity.uuid, state:state})\n }", "function _updateState(state, payload) {\n $log.debug(\"=== State changed ===\");\n $log.info(state);\n $log.debug(payload);\n\n $rootScope.$emit(HOTEL_STATES, {\n state: state,\n payload: angular.copy(payload)\n });\n }", "stateChanged(_state) { }", "stateChange(state){\n\t\tLogger.info(`Ably realtime state changed to: ${state.current}`);\n\t}", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "stateChanged(state) {\n }", "async updateState(state) {\n let key = this.ctx.stub.createCompositeKey(this.name, [state.getKey()]);\n let data = Utils.serialize(state);\n await this.ctx.stub.putState(key, data);\n }", "changeState(state) {\r\n for (let key in this.states){\r\n // console.log(this.states[key])\r\n if (key==state) {\r\n this.statesStack.append(this.state);\r\n this.state=state;\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n } \r\n throw new Error();\r\n }", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function updateEntityState (entity, nextState) {\n\t entity.pendingState = assign(entity.pendingState, nextState)\n\t entity.dirty = true\n\t invalidate()\n\t }", "_onChange() {\n this.setState(getAllState())\n }", "getUpdatedState(props, state) {\n return this.state.getUpdatedState(props, state);\n }", "get state() { return this._state; }", "getState(){\n super.getState();\n this.state['amount'] = this.#amount;\n\n return this.state;\n }", "handle() {\n if(!this.enabled)\n return;\n\n Object.assign(this.previousState, this.state); // Save the previous state\n this.update(); // Update the current state\n this.notify();\n }", "function updateEntityState (entity, nextState) {\n entity.pendingState = assign(entity.pendingState, nextState)\n entity.dirty = true\n invalidate()\n }", "updateState(newState) {\n this.setState(newState);\n }", "_stateChanged(state) {\n console.log(state);\n }", "stateChanged(state) {\n this._competitors = competitorsWithEventsSelector(state);\n this._couples = couplesSelector(state);\n this._events = EventsWithCouplesSelector(state);\n this._offbeat = state.form.offbeat.competing;\n this._offbeat_team = OffbeatTeamSelector(state);\n this._basic_information = state.form.basic_information;\n this._form = state.form;\n this._total_entry_fee = total_entry_fee(this._competitors);\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function onStateUpdate(nState) {\n for (var pid in state.players) {\n if (!(pid in nState.players)) // player vanishes\n onPlayerQuit(pid);\n }\n\n for (var pid in nState.players) {\n if (pid == ws._id) continue; // skip ourself\n\n if (!(pid in state.players)) { // player appears\n onPlayerJoin(pid, nState.players[pid]);\n }\n\n var p = nState.players[pid];\n if (p.state == 'player') { // update non-ghost\n onPlayerUpdate(pid, p);\n }\n }\n}", "function OnStateUpdate(self, state)\n {\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n }", "get state() {\n return this._obj.state;\n }", "get state(){return this._state;}", "get state(){return this._state;}", "get state(){return this._state;}", "stateChanged(state){\n this.targetFood = state.targetFood;\n }", "changeState(state) {\r\n if(this.getStates().indexOf(state) != -1){\r\n if(this.prevState[this.prevState.length - 1] != this.state)\r\n this.prevState.push(this.state);\r\n this.state = state;\r\n }else throw new Error(\"\")\r\n }", "setState(updateObject) {\n this.setChangeFlags({stateChanged: true});\n Object.assign(this.state, updateObject);\n this.setNeedsRedraw();\n }", "function getState() {\n return state;\n }", "stateChanged(state) {\n this._clicks = state.counter.clicks;\n this._value = state.counter.value;\n }", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "get state() {\r\n return this._state;\r\n }", "getState() {\n return this.state;\n }", "function updateState(state) {\n cellClientProps = updateCellClientProps(state, cellClientProps);\n //draw a white background\n background(255, 255, 255);\n\n for (var playerId in state.players) {\n if (state.players.hasOwnProperty(playerId)) {\n let plyr = state.players[playerId];\n let color = plyr.blob.color;\n stroke(color[0],color[1],color[2]);\n for (var i=0; i<plyr.blob.cellInds.length; i++) {\n let c = cellClientProps.ps[plyr.blob.cellInds[i]];\n let a = plyr.blob.amts[i];\n strokeWeight(sqrt(a));\n point(c.x,c.y);\n }\n }\n }\n\n stroke(0);strokeWeight(12);\n for (let i=0; i<cellClientProps.ps.length; i++) {\n let p = cellClientProps.ps[i];\n point(p.x,p.y);\n }\n image(pointer, mouseX, mouseY);\n}", "getState() {\n return state;\n }", "enterState(oldState){}", "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "function state_update(st) {\n state = st;\n if (callback) {\n callback(st);\n }\n}", "get_state() {\n return this.state;\n }", "_onChange() {\n this.setState(getUserState());\n }", "function State() {\n\n }", "function statehandler(key, value) {\n // console.log(\"key:\",key,\"value:\",value)\n // console.log(\"old state:\", user)\n setUser({...user, [key]: value});\n // console.log(\"latest state:\", user)\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "function History_UpdateLastStateLoaded()\n{\n\t//by default the last loaded State is the current one\n\tthis.LastLoadedStateIndex = this.CurrentStateIndex;\n\t//get the current State\n\tvar wi4State = __SIMULATOR.StateManager.CurrentState;\n\t//create a map of previously processed ids\n\tvar mapIds = {};\n\t//create a copy of states loaded\n\tvar states = this.States.slice();\n\t//while the state is valid\n\twhile (wi4State != null)\n\t{\n\t\t//get the next default action StateId\n\t\tvar nextStateId = wi4State.ListOfPaths.length > 0 ? wi4State.ListOfPaths[0].Destiny : null;\n\t\t//no id? or already processed?\n\t\tif (!nextStateId || mapIds[nextStateId])\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//mark id as processed\n\t\tmapIds[nextStateId] = true;\n\t\t//get the State\n\t\twi4State = __CACHE.Has_State(nextStateId);\n\t\t//invalid?\n\t\tif (!wi4State)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//not yet ready?\n\t\tif (!wi4State.Optimised)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//increment last loaded State index\n\t\tthis.LastLoadedStateIndex++;\n\t\t//push this message into our array\n\t\tstates.push(wi4State);\n\t}\n\t//now update the controller\n\t__SIMULATOR.NotifyControllerHistory(states);\n}", "function getState() {\n return currentState\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "function updateState(stateChange) {\n if (isNaN(stateChange)) {\n console.error(\"Invalid state change\");\n return;\n }\n currState += stateChange;\n currState = currState % states.length;\n console.assert(\n currState >= 0 && currState < states.length,\n \"currState got out of bounds on updateState: \",\n currState\n );\n clearButtons();\n switch (getRoomName()) {\n case \"START\":\n buildStartRoom();\n break;\n case \"GAME\":\n buildGameRoom();\n break;\n case \"RESULTS\":\n buildResultsRoom();\n break;\n }\n}", "updateState(stateChange){\n this.setState(stateChange);\n }", "function getState () {\n\t\treturn currentState;\n\t}", "function getState () {\n return state\n }", "function getState () {\n return state\n }", "async updateState() {\n const stateResponses = await Promise.all([\n this.bulb.getLightState(),\n this.bulb.getDeviceInfo()\n ]).catch(err => {\n console.error(err.message);\n generateErrorQRCode(`Could not get status of ${deviceName}`);\n });\n const newState = lifxStateToCapstone_Yeet(\n stateResponses[0],\n stateResponses[1]\n );\n\n if (!_.isEqual(this.bulbState, newState)) {\n // the light bulb state has changed\n console.debug(\"State has changed\");\n this.bulbState = newState;\n // TODO: remove console.log once we can correctly pad the image. Instead\n // of logging this object, we will display it on the e-ink display.\n generateQRCode(this.bulbState);\n }\n }", "get State() {\r\n return _state;\r\n }", "get State() {\r\n return _state;\r\n }", "getState() {\n return this._state;\n }", "setStateInternal(id, value) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n this.log.info('update state ' + obj + ' with value:' + value);\n currentStateValues[obj] = value;\n }", "get state() {return this._p.state;}", "componentDidUpdate() {\n // debugging\n console.log('___STATE____', this.state);\n }", "drawState(){\n if(this.getTracer().stateStructure && this.getNode(this.currentId)){\n NodeStateService.process(this.getNode(this.currentId).state_variables);\n }\n }", "subscriberState(EventName, data){\n let key = EventName\n let val = data\n let obj = {}\n obj[key] = val\n //console.log('players in ListPlayers class');\n //console.log(this.state.players);\n this.setState(obj);\n }", "function getState() {\n return currentState\n }", "onStateChange() {\n\t\tthis.forceUpdate();\n\t}", "function updateState(data) {\n updateVoteFinishArea(data.state);\n}", "changeState(state) {\r\n if(this.config.states[state]) {\r\n this.currentState = state;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('changeState');\r\n } else {\r\n throw new Error('This state does not exist');\r\n }\r\n }", "stateChangedCallback(yfct,value)\n { \n \n // memorize the new state\n this._state = (value ==\"B\" ); \n console.log(\"relay change (\"+value+\", state is now \"+this._state);\n // notify the NEEO server about the change\n this.notifyNEEOServer({uniqueDeviceId: this._neeoID, component:this._hwdID, value:this._state} );\n // this.notifyNEEOServer({uniqueDeviceId: \"default\" , component:this._hwdID, value:this._state } );\n }", "function updateStateMaps() {\n // XXX\n }", "_handleComponentChange() {\n this.setState(this._getStateFromStore());\n }", "componentDidUpdate() {\n this.lastStateUpdate = Date.now();\n StateLoader.updateLocalStorage(this.state);\n }", "changeState(state) {\r\n\r\n\r\n if (!this.statuses.includes(state)) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = state;\r\n this.history2 = [];\r\n\r\n\r\n }", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "updateState(update) {\n\t\t// console.log(\"Fetching player updates\");\n\n\t\t// Get the ID of the player who triggered this update\n\t\tlet pid = update.pid;\n\t\tlet player = this.stage.getPlayer(pid);\n\n\t\t// Only clients with a player that is still alive can make updates\n\t\tif (player) {\n\t\t\tif (update.type == \"move\") {\n\t\t\t\tplayer.setMovementDirection(update.x, update.y);\n\t\t\t} else if (update.type == \"cursor\") {\n\t\t\t\tplayer.setCursorDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"click\") {\n\t\t\t\tplayer.setFiringDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"weapon-toggle\") {\n\t\t\t\tplayer.setWeapon(update.toggle);\n\t\t\t}\n\t\t}\n\t}", "changeState(state) {\r\n if (state !== \"hungry\" && state !== \"busy\" &&\r\n state !== \"sleeping\" && state !== \"normal\") {\r\n throw new Error()\r\n }\r\n\r\n this.state = state;\r\n this.states.push(this.state);\r\n return this.state\r\n }", "enterState (state = this.Data) {\n this.State = state;\n }", "function getState() {\n return currentState\n }" ]
[ "0.70077926", "0.6852809", "0.6795396", "0.6775392", "0.67612934", "0.6724651", "0.6551379", "0.65442294", "0.6517035", "0.6495464", "0.6495464", "0.64726466", "0.64598566", "0.6443647", "0.6438235", "0.64101493", "0.64096826", "0.631815", "0.6304705", "0.6301794", "0.629913", "0.628467", "0.6283835", "0.62784815", "0.6268991", "0.6246019", "0.62381226", "0.61717844", "0.61534935", "0.6142991", "0.61364895", "0.61318946", "0.6119981", "0.6115325", "0.6104216", "0.61005306", "0.60961306", "0.6092122", "0.6092122", "0.6092122", "0.6065779", "0.6060487", "0.6059047", "0.6049608", "0.6049608", "0.6049608", "0.60471195", "0.60219324", "0.6005837", "0.59933263", "0.59911203", "0.59894466", "0.59698904", "0.59637105", "0.5948652", "0.5946607", "0.59460926", "0.59429985", "0.59420836", "0.5939905", "0.5939373", "0.59234464", "0.5920863", "0.59078604", "0.59078604", "0.59078604", "0.5902503", "0.58953506", "0.58881", "0.58881", "0.58881", "0.58881", "0.58845013", "0.5882263", "0.58801806", "0.5878432", "0.587636", "0.587636", "0.5868487", "0.58674645", "0.58674645", "0.58658296", "0.5849003", "0.5848066", "0.58466893", "0.58439267", "0.584376", "0.5842555", "0.5841973", "0.5840734", "0.5840389", "0.58396", "0.5837634", "0.5836762", "0.58225584", "0.5820587", "0.58116406", "0.5811298", "0.58086586", "0.5804936", "0.5803278" ]
0.0
-1
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { self.state = state.state self.minvalue = state.attributes.min self.maxvalue = state.attributes.max self.stepvalue = state.attributes.step set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state) set_value(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\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 }", "is_available() {\n return this._time_until_arrival === 0;\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "get state() { return this._state; }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function PendingPlayerState() { }", "function getState() {\n return currentState\n }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\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}", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\n }" ]
[ "0.73287344", "0.73287344", "0.6968565", "0.6968565", "0.6968565", "0.6968565", "0.6926128", "0.6789413", "0.66253674", "0.6582287", "0.64888936", "0.64888936", "0.64888936", "0.6310257", "0.6190595", "0.61709887", "0.6154469", "0.6125979", "0.5983027", "0.5983027", "0.59440786", "0.59340304", "0.5870546", "0.5813025", "0.5766564", "0.57494885", "0.55708766", "0.555826", "0.55579376", "0.55426913", "0.55315953", "0.5531125", "0.5523095", "0.54847574", "0.5467727", "0.5461427", "0.5438862", "0.54335624", "0.54092395", "0.5361421", "0.53488183", "0.5340812", "0.5328171", "0.5328101", "0.53154767", "0.5307317", "0.530489", "0.53013617", "0.52979136", "0.5284578", "0.52806866", "0.5279393", "0.524995", "0.5233951", "0.52231663", "0.5220229", "0.51965934", "0.5183381", "0.51687664", "0.5162449", "0.51562303", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51278377", "0.51270235", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.5124444", "0.51230234", "0.5115831", "0.51144266", "0.51115763", "0.51069224", "0.5105438", "0.50957084", "0.5091158", "0.50900614", "0.5084766", "0.5083711", "0.5077806", "0.5075652", "0.5073771", "0.5072241", "0.5064793", "0.50619537", "0.50589156", "0.5056893" ]
0.65430224
10
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { set_value(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "is_available() {\n return this._time_until_arrival === 0;\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() {\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "get state() { return this._state; }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function PendingPlayerState() { }", "function getState() {\n return currentState\n }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\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}", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\n }" ]
[ "0.73263496", "0.73263496", "0.69242686", "0.67867565", "0.6622723", "0.65812755", "0.65421313", "0.64862347", "0.64862347", "0.64862347", "0.6309391", "0.61906636", "0.6169924", "0.61518246", "0.6123605", "0.5981676", "0.5981676", "0.59421873", "0.5932553", "0.5869572", "0.5811763", "0.5764933", "0.5746332", "0.556938", "0.555641", "0.5555897", "0.5540687", "0.55305237", "0.5530093", "0.5522056", "0.54850596", "0.5466556", "0.54611707", "0.5437682", "0.54325587", "0.5408254", "0.53596854", "0.5348431", "0.533953", "0.53275734", "0.532602", "0.5314587", "0.53055376", "0.5303056", "0.5300407", "0.5296953", "0.52829117", "0.5279252", "0.5278641", "0.5247946", "0.5232341", "0.52217716", "0.5218495", "0.519629", "0.51826835", "0.51684505", "0.5160943", "0.5155316", "0.51273805", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.51218396", "0.51157993", "0.51140946", "0.51108533", "0.510516", "0.5104229", "0.5093132", "0.5090761", "0.50883734", "0.5083589", "0.5083242", "0.50764996", "0.50758314", "0.5073467", "0.5071194", "0.5064031", "0.5060456", "0.50572383", "0.50564873" ]
0.69666564
3
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { set_value(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "is_available() {\n return this._time_until_arrival === 0;\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() {\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "get state() { return this._state; }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function getState() {\n return currentState\n }", "function PendingPlayerState() { }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\n });\n }", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\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}" ]
[ "0.73284537", "0.73284537", "0.69259375", "0.67887646", "0.6624645", "0.6582675", "0.6543231", "0.64882874", "0.64882874", "0.64882874", "0.6310826", "0.61924905", "0.61697924", "0.6152262", "0.61256355", "0.59825474", "0.59825474", "0.59441656", "0.59334165", "0.58703524", "0.5812972", "0.5767012", "0.5748212", "0.5572398", "0.55584735", "0.5557278", "0.5542185", "0.55319697", "0.553168", "0.5523791", "0.5485897", "0.546795", "0.54612017", "0.54394805", "0.5432816", "0.54087967", "0.5362138", "0.5349434", "0.53403175", "0.5328465", "0.53275925", "0.5314701", "0.5307756", "0.5303114", "0.5300636", "0.5298146", "0.5284738", "0.528118", "0.5280208", "0.5248322", "0.5234217", "0.5223634", "0.52198535", "0.51990974", "0.5183913", "0.51713073", "0.5161884", "0.5157174", "0.5127759", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51230013", "0.5116265", "0.5115621", "0.5112343", "0.5108151", "0.51054466", "0.50952965", "0.50936013", "0.50914204", "0.5086041", "0.50854415", "0.5078339", "0.5077041", "0.50749135", "0.50737333", "0.50647634", "0.50607073", "0.50582945", "0.50582737" ]
0.69686985
4
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state
function OnStateAvailable(self, state) { self.state = state.state; set_view(self, self.state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\n }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\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 }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "prepareState() {\n /* ... */\n }", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\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 }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "get state() {\n return this._wantedState;\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 }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\n }", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "is_available() {\n return this._time_until_arrival === 0;\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "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}", "function CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "function State() {\n\n }", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "function isInitState( state ) { \n return ( _.isUndefined( state.data ) && _.isUndefined( state.lm ) && _.isUndefined( state.error ) );\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() {\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 isFinalState() {\n return getReachableStates().every((state) => state === currentState);\n }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "function expectStateInit(ae) {\n\n expect(ae.state).toBe(States.init);\n\n expect(ae.isUnstarted).toBe(false);\n expect(ae.isExecuting).toBe(true);\n\n expectStatesSharedUnsettled(ae);\n }", "function initial_state(state){\n let servers = Object.keys(state[\"val\"][\"configTerm\"]);\n return forall((sid) => state[\"val\"][\"configTerm\"][sid]==0 && state[\"val\"][\"configVersion\"][sid]==1, servers)\n}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\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}", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "function PendingPlayerState() { }", "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 }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "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 }", "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}", "function readyStateHandler() {\n if (isEqualIgnoreCase(\"loaded\", element.readyState) ||\n isEqualIgnoreCase(\"complete\", element.readyState)) {\n callback({type: \"load\"});\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 }", "get available() {\n return this.state.timeout === 0;\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\n });\n }", "setReady() {\n this.currentState = cpState.READY;\n }", "get _isReady() {\n return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined;\n }", "initInteractionState() {\n this.dirty = false;\n this.prefilled = !this._isEmpty();\n }" ]
[ "0.7310421", "0.7310421", "0.69752914", "0.69752914", "0.69752914", "0.69752914", "0.6930684", "0.6647277", "0.65827876", "0.6552943", "0.64757675", "0.62965363", "0.61546206", "0.61418915", "0.60739774", "0.60511327", "0.6046045", "0.5944369", "0.5944369", "0.5784949", "0.5782592", "0.576858", "0.5716709", "0.55685043", "0.55540144", "0.55431604", "0.5489555", "0.5476908", "0.54687464", "0.54545355", "0.54542786", "0.54501617", "0.5447874", "0.54476273", "0.5421135", "0.5383652", "0.53735936", "0.5339438", "0.5307829", "0.53025156", "0.52933997", "0.5285958", "0.5277074", "0.5271567", "0.52624774", "0.52450836", "0.52312547", "0.522904", "0.521425", "0.5200156", "0.5199649", "0.5182718", "0.5177254", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51695925", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.51662654", "0.5163001", "0.5162625", "0.51614624", "0.5156224", "0.51527685", "0.5136315", "0.512369", "0.5118892", "0.51155996", "0.5113242", "0.5105685", "0.51047516", "0.50978297", "0.5095854", "0.50948954", "0.50945324", "0.50921977", "0.50921977", "0.5083367", "0.50808096", "0.5070529", "0.50697225", "0.50676453", "0.5067178", "0.50528836", "0.50458777" ]
0.64265186
13
The OnStateUpdate function will be called when the specific entity receives a state update its new values will be available in self.state[] and returned in the state parameter
function OnStateUpdate(self, state) { self.state = state.state; set_view(self, self.state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "stateChanged(state) {\n this._name = state.profile.name;\n this._position = state.profile.position;\n this._skill = state.profile.skill;\n this._saved = state.profile.saved;\n }", "update() {\n BaseState.update.call(this);\n }", "function OnStateUpdate(self, state)\n {\n if (!(\"ignore_state\" in self.parameters) || self.parameters.ignore_state === 0)\n {\n self.state = state.state;\n set_view(self, self.state)\n }\n }", "function updateState() {\n gState.push({\n board: copyMat(gBoard),\n shownCount: gGame.shownCount,\n markedCount: gGame.markedCount,\n lives: gGame.lives,\n safeClick: gGame.safeClick,\n hints: gGame.hints,\n manualMode: gGame.isManualOn,\n gManualMode: gManualMode.isManualOn\n });\n}", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function updateState() {\n //create our state object and notify our listener\n var state = {\n currentUniverseTime: new Date(currentUniverseTime)\n };\n\n fireStateChanged(state);\n\n // call update() again in a certain number of milliseconds\n updateStateTimeout = setTimeout(function () {\n updateState();\n }, timeBetweenStateUpdatesMs);\n }", "stateChanged(state) { }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n\n delay_time = self.parameters.update_delay;\n if (delay_time !== undefined) {\n if (self.timeout !== undefined) {\n clearTimeout(self.timeout);\n }\n\n self.timeout = setTimeout(function() {set_view(self, self.state)}, delay_time * 1000);\n } else {\n set_view(self, self.state);\n }\n }", "_onChangeState() {\n\n\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n\n set_view(self, self.state, self.level)\n }", "function setEntityState(entity,state) {\n entity.state = state\n server.baseServer.broadcast('server','entity',{uuid:entity.uuid, state:state})\n }", "function _updateState(state, payload) {\n $log.debug(\"=== State changed ===\");\n $log.info(state);\n $log.debug(payload);\n\n $rootScope.$emit(HOTEL_STATES, {\n state: state,\n payload: angular.copy(payload)\n });\n }", "stateChanged(_state) { }", "stateChange(state){\n\t\tLogger.info(`Ably realtime state changed to: ${state.current}`);\n\t}", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "stateChanged(state) {\n }", "async updateState(state) {\n let key = this.ctx.stub.createCompositeKey(this.name, [state.getKey()]);\n let data = Utils.serialize(state);\n await this.ctx.stub.putState(key, data);\n }", "changeState(state) {\r\n for (let key in this.states){\r\n // console.log(this.states[key])\r\n if (key==state) {\r\n this.statesStack.append(this.state);\r\n this.state=state;\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n } \r\n throw new Error();\r\n }", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function updateEntityState (entity, nextState) {\n\t entity.pendingState = assign(entity.pendingState, nextState)\n\t entity.dirty = true\n\t invalidate()\n\t }", "_onChange() {\n this.setState(getAllState())\n }", "getUpdatedState(props, state) {\n return this.state.getUpdatedState(props, state);\n }", "get state() { return this._state; }", "getState(){\n super.getState();\n this.state['amount'] = this.#amount;\n\n return this.state;\n }", "handle() {\n if(!this.enabled)\n return;\n\n Object.assign(this.previousState, this.state); // Save the previous state\n this.update(); // Update the current state\n this.notify();\n }", "function updateEntityState (entity, nextState) {\n entity.pendingState = assign(entity.pendingState, nextState)\n entity.dirty = true\n invalidate()\n }", "updateState(newState) {\n this.setState(newState);\n }", "_stateChanged(state) {\n console.log(state);\n }", "stateChanged(state) {\n this._competitors = competitorsWithEventsSelector(state);\n this._couples = couplesSelector(state);\n this._events = EventsWithCouplesSelector(state);\n this._offbeat = state.form.offbeat.competing;\n this._offbeat_team = OffbeatTeamSelector(state);\n this._basic_information = state.form.basic_information;\n this._form = state.form;\n this._total_entry_fee = total_entry_fee(this._competitors);\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function onStateUpdate(nState) {\n for (var pid in state.players) {\n if (!(pid in nState.players)) // player vanishes\n onPlayerQuit(pid);\n }\n\n for (var pid in nState.players) {\n if (pid == ws._id) continue; // skip ourself\n\n if (!(pid in state.players)) { // player appears\n onPlayerJoin(pid, nState.players[pid]);\n }\n\n var p = nState.players[pid];\n if (p.state == 'player') { // update non-ghost\n onPlayerUpdate(pid, p);\n }\n }\n}", "function OnStateUpdate(self, state)\n {\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n }", "get state() {\n return this._obj.state;\n }", "get state(){return this._state;}", "get state(){return this._state;}", "get state(){return this._state;}", "stateChanged(state){\n this.targetFood = state.targetFood;\n }", "changeState(state) {\r\n if(this.getStates().indexOf(state) != -1){\r\n if(this.prevState[this.prevState.length - 1] != this.state)\r\n this.prevState.push(this.state);\r\n this.state = state;\r\n }else throw new Error(\"\")\r\n }", "setState(updateObject) {\n this.setChangeFlags({stateChanged: true});\n Object.assign(this.state, updateObject);\n this.setNeedsRedraw();\n }", "function getState() {\n return state;\n }", "stateChanged(state) {\n this._clicks = state.counter.clicks;\n this._value = state.counter.value;\n }", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "get state() {\r\n return this._state;\r\n }", "getState() {\n return this.state;\n }", "function updateState(state) {\n cellClientProps = updateCellClientProps(state, cellClientProps);\n //draw a white background\n background(255, 255, 255);\n\n for (var playerId in state.players) {\n if (state.players.hasOwnProperty(playerId)) {\n let plyr = state.players[playerId];\n let color = plyr.blob.color;\n stroke(color[0],color[1],color[2]);\n for (var i=0; i<plyr.blob.cellInds.length; i++) {\n let c = cellClientProps.ps[plyr.blob.cellInds[i]];\n let a = plyr.blob.amts[i];\n strokeWeight(sqrt(a));\n point(c.x,c.y);\n }\n }\n }\n\n stroke(0);strokeWeight(12);\n for (let i=0; i<cellClientProps.ps.length; i++) {\n let p = cellClientProps.ps[i];\n point(p.x,p.y);\n }\n image(pointer, mouseX, mouseY);\n}", "enterState(oldState){}", "getState() {\n return state;\n }", "function state_update(st) {\n state = st;\n if (callback) {\n callback(st);\n }\n}", "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "get_state() {\n return this.state;\n }", "_onChange() {\n this.setState(getUserState());\n }", "function State() {\n\n }", "function statehandler(key, value) {\n // console.log(\"key:\",key,\"value:\",value)\n // console.log(\"old state:\", user)\n setUser({...user, [key]: value});\n // console.log(\"latest state:\", user)\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "function History_UpdateLastStateLoaded()\n{\n\t//by default the last loaded State is the current one\n\tthis.LastLoadedStateIndex = this.CurrentStateIndex;\n\t//get the current State\n\tvar wi4State = __SIMULATOR.StateManager.CurrentState;\n\t//create a map of previously processed ids\n\tvar mapIds = {};\n\t//create a copy of states loaded\n\tvar states = this.States.slice();\n\t//while the state is valid\n\twhile (wi4State != null)\n\t{\n\t\t//get the next default action StateId\n\t\tvar nextStateId = wi4State.ListOfPaths.length > 0 ? wi4State.ListOfPaths[0].Destiny : null;\n\t\t//no id? or already processed?\n\t\tif (!nextStateId || mapIds[nextStateId])\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//mark id as processed\n\t\tmapIds[nextStateId] = true;\n\t\t//get the State\n\t\twi4State = __CACHE.Has_State(nextStateId);\n\t\t//invalid?\n\t\tif (!wi4State)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//not yet ready?\n\t\tif (!wi4State.Optimised)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//increment last loaded State index\n\t\tthis.LastLoadedStateIndex++;\n\t\t//push this message into our array\n\t\tstates.push(wi4State);\n\t}\n\t//now update the controller\n\t__SIMULATOR.NotifyControllerHistory(states);\n}", "function getState() {\n return currentState\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "function updateState(stateChange) {\n if (isNaN(stateChange)) {\n console.error(\"Invalid state change\");\n return;\n }\n currState += stateChange;\n currState = currState % states.length;\n console.assert(\n currState >= 0 && currState < states.length,\n \"currState got out of bounds on updateState: \",\n currState\n );\n clearButtons();\n switch (getRoomName()) {\n case \"START\":\n buildStartRoom();\n break;\n case \"GAME\":\n buildGameRoom();\n break;\n case \"RESULTS\":\n buildResultsRoom();\n break;\n }\n}", "updateState(stateChange){\n this.setState(stateChange);\n }", "function getState () {\n\t\treturn currentState;\n\t}", "function getState () {\n return state\n }", "function getState () {\n return state\n }", "async updateState() {\n const stateResponses = await Promise.all([\n this.bulb.getLightState(),\n this.bulb.getDeviceInfo()\n ]).catch(err => {\n console.error(err.message);\n generateErrorQRCode(`Could not get status of ${deviceName}`);\n });\n const newState = lifxStateToCapstone_Yeet(\n stateResponses[0],\n stateResponses[1]\n );\n\n if (!_.isEqual(this.bulbState, newState)) {\n // the light bulb state has changed\n console.debug(\"State has changed\");\n this.bulbState = newState;\n // TODO: remove console.log once we can correctly pad the image. Instead\n // of logging this object, we will display it on the e-ink display.\n generateQRCode(this.bulbState);\n }\n }", "get State() {\r\n return _state;\r\n }", "get State() {\r\n return _state;\r\n }", "getState() {\n return this._state;\n }", "get state() {return this._p.state;}", "setStateInternal(id, value) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n this.log.info('update state ' + obj + ' with value:' + value);\n currentStateValues[obj] = value;\n }", "componentDidUpdate() {\n // debugging\n console.log('___STATE____', this.state);\n }", "drawState(){\n if(this.getTracer().stateStructure && this.getNode(this.currentId)){\n NodeStateService.process(this.getNode(this.currentId).state_variables);\n }\n }", "subscriberState(EventName, data){\n let key = EventName\n let val = data\n let obj = {}\n obj[key] = val\n //console.log('players in ListPlayers class');\n //console.log(this.state.players);\n this.setState(obj);\n }", "function getState() {\n return currentState\n }", "changeState(state) {\r\n if(this.config.states[state]) {\r\n this.currentState = state;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('changeState');\r\n } else {\r\n throw new Error('This state does not exist');\r\n }\r\n }", "onStateChange() {\n\t\tthis.forceUpdate();\n\t}", "function updateState(data) {\n updateVoteFinishArea(data.state);\n}", "stateChangedCallback(yfct,value)\n { \n \n // memorize the new state\n this._state = (value ==\"B\" ); \n console.log(\"relay change (\"+value+\", state is now \"+this._state);\n // notify the NEEO server about the change\n this.notifyNEEOServer({uniqueDeviceId: this._neeoID, component:this._hwdID, value:this._state} );\n // this.notifyNEEOServer({uniqueDeviceId: \"default\" , component:this._hwdID, value:this._state } );\n }", "function updateStateMaps() {\n // XXX\n }", "_handleComponentChange() {\n this.setState(this._getStateFromStore());\n }", "changeState(state) {\r\n\r\n\r\n if (!this.statuses.includes(state)) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = state;\r\n this.history2 = [];\r\n\r\n\r\n }", "componentDidUpdate() {\n this.lastStateUpdate = Date.now();\n StateLoader.updateLocalStorage(this.state);\n }", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "changeState(state) {\r\n if (state !== \"hungry\" && state !== \"busy\" &&\r\n state !== \"sleeping\" && state !== \"normal\") {\r\n throw new Error()\r\n }\r\n\r\n this.state = state;\r\n this.states.push(this.state);\r\n return this.state\r\n }", "updateState(update) {\n\t\t// console.log(\"Fetching player updates\");\n\n\t\t// Get the ID of the player who triggered this update\n\t\tlet pid = update.pid;\n\t\tlet player = this.stage.getPlayer(pid);\n\n\t\t// Only clients with a player that is still alive can make updates\n\t\tif (player) {\n\t\t\tif (update.type == \"move\") {\n\t\t\t\tplayer.setMovementDirection(update.x, update.y);\n\t\t\t} else if (update.type == \"cursor\") {\n\t\t\t\tplayer.setCursorDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"click\") {\n\t\t\t\tplayer.setFiringDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"weapon-toggle\") {\n\t\t\t\tplayer.setWeapon(update.toggle);\n\t\t\t}\n\t\t}\n\t}", "enterState (state = this.Data) {\n this.State = state;\n }", "function getState() {\n return currentState\n }" ]
[ "0.7009249", "0.6854143", "0.6796559", "0.67764664", "0.6726108", "0.6551494", "0.6545107", "0.6517411", "0.6496623", "0.6496623", "0.6473126", "0.6460814", "0.6446271", "0.6438854", "0.6411804", "0.641117", "0.632063", "0.63070124", "0.63041973", "0.63024896", "0.6285687", "0.6282901", "0.628104", "0.627067", "0.62476736", "0.62404203", "0.6172067", "0.6154974", "0.6142231", "0.61388123", "0.61327153", "0.6121822", "0.6115633", "0.6104822", "0.61030465", "0.60980844", "0.60934246", "0.60934246", "0.60934246", "0.60660166", "0.60615766", "0.6060927", "0.60519516", "0.60519516", "0.60519516", "0.60496974", "0.6023807", "0.6005847", "0.5994711", "0.5993796", "0.5991715", "0.59719425", "0.59649", "0.5949132", "0.59482145", "0.5947851", "0.59436685", "0.59432244", "0.59413767", "0.59409845", "0.5926324", "0.59227335", "0.59098405", "0.59098405", "0.59098405", "0.5903514", "0.589688", "0.588925", "0.588925", "0.588925", "0.588925", "0.5885848", "0.588332", "0.58812135", "0.5879982", "0.587767", "0.587767", "0.5869462", "0.5868884", "0.5868884", "0.586702", "0.585054", "0.58504295", "0.58471316", "0.58458686", "0.5845328", "0.58441925", "0.5842933", "0.58426845", "0.5841338", "0.5841334", "0.58386236", "0.5838005", "0.58234054", "0.5822489", "0.58123696", "0.5810053", "0.5810002", "0.58078086", "0.5804817" ]
0.6762307
4
Set view is a helper function to set all aspects of the widget to its current state it is called by widget code when an update occurs or some other event that requires a an update of the view
function set_view(self, state, level) { if ("icons" in self.parameters) { if (state in self.parameters.icons) { self.set_icon(self, "icon", self.parameters.icons[state].icon); self.set_field(self, "icon_style", self.parameters.icons[state].style) } else if ("default" in self.parameters.icons) { self.set_icon(self, "icon", self.parameters.icons.default.icon); self.set_field(self, "icon_style", self.parameters.icons.default.style) } else { self.set_icon(self, "icon", "fa-circle-thin"); self.set_field(self, "icon_style", "color: white") } } if ("state_text" in self.parameters && self.parameters.state_text == 1) { self.set_field(self, "state_text", self.map_state(self, state)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function setView(newState) {\r\n _updateView(null, newState);\r\n }", "setView(initView) {\n this.view = initView;\n }", "function setView(view){\n\t\t\t\tif(this.currentView){\n\t\t\t\t\tthis.currentView.close();\n\t\t\t\t}\n\t\t\t\tthis.currentView = view;\n\t\t\t\t$('#mainContent').html(view.render().$el);\n\t\t\t}", "updateView() {\n this.viewValue = this.getViewFromValue();\n this.renderView();\n }", "function updateView(newView){\n currentView.value = newView;\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "changeView(option) {\n this.setState({\n view: option,\n });\n }", "changeView(view, data) {\n this.setState({\n currentView: view,\n viewData: data\n });\n }", "set View(value) {}", "setView(state, val = true){\n state.updateView = Math.random();\n }", "function switchView(view){\n setState('vis.0.control.instance', 'FFFFFFFF');\n setState('vis.0.control.data', view);\n setState('vis.0.control.command', 'changeView');\n}", "changeView(view) {\n\n // Close and unbind any existing page view\n if (this.currentView && _.isFunction(this.currentView.close)) {\n this.currentView.close();\n }\n\n // Establish the requested view into scope\n this.currentView = view;\n \n // Re-delegate events (unbound when closed)\n //this.currentView.delegateEvents(this.currentView.events)\n\n Backbone.Radio.channel('app').request('layout').showChildView('main', view);\n }", "changeView(event) {\n this.setState({ view: !this.state.view });\n }", "changeView(value){\n value ? this.setState({view:true}) : this.setState({view:false});\n }", "function set_view(self, state, level)\n {\n\n if (state == \"on\")\n {\n // Set Icon will set the style correctly for an icon\n self.set_icon(self, \"icon\", self.icons.icon_on)\n // Set view will set the view for the appropriate field\n self.set_field(self, \"icon_style\", self.css.icon_style_active)\n }\n else\n {\n self.set_icon(self, \"icon\", self.icons.icon_off)\n self.set_field(self, \"icon_style\", self.css.icon_style_inactive)\n }\n if (typeof level == 'undefined')\n {\n self.set_field(self, \"level\", 0)\n }\n else\n {\n self.set_field(self, \"level\", Math.ceil((level*100/255) / 10) * 10)\n }\n }", "function updateViews(event) {\n manageContentObjectsByState(event.currentState);\n fillElements(event.currentState);\n setNavigationButtonsDisabledState(event.currentState);\n resetViews();\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n\n delay_time = self.parameters.update_delay;\n if (delay_time !== undefined) {\n if (self.timeout !== undefined) {\n clearTimeout(self.timeout);\n }\n\n self.timeout = setTimeout(function() {set_view(self, self.state)}, delay_time * 1000);\n } else {\n set_view(self, self.state);\n }\n }", "changeView(view) {\n if (view === 'base') {\n this.setState({\n view: view,\n closest: null\n });\n } else {\n this.setState({\n view: view\n });\n }\n }", "changeView0() {\n this.setState({view: 0});\n }", "function setNewViewState(viewstate) {\n\n\n console.log('D: setting header to: ' + viewstate.header);\n viewModel.viewState.header(viewstate.header);\n\n console.log('D: setting content to: ' + viewstate.content);\n viewModel.viewState.content(viewstate.content);\n\n console.log('D: setting footer to:' + viewstate.footer);\n viewModel.viewState.footer(viewstate.footer);\n }", "setState(newState) {\n if (this.updateState != 0 /* Idle */)\n throw new Error(\"Calls to EditorView.setState are not allowed while an update is in progress\");\n if (this.destroyed) {\n this.viewState.state = newState;\n return;\n }\n this.updateState = 2 /* Updating */;\n let hadFocus = this.hasFocus;\n try {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.viewState = new ViewState(newState);\n this.plugins = newState.facet(viewPlugin).map(spec => new PluginInstance(spec));\n this.pluginMap.clear();\n for (let plugin of this.plugins)\n plugin.update(this);\n this.docView = new DocView(this);\n this.inputState.ensureHandlers(this, this.plugins);\n this.mountStyles();\n this.updateAttrs();\n this.bidiCache = [];\n }\n finally {\n this.updateState = 0 /* Idle */;\n }\n if (hadFocus)\n this.focus();\n this.requestMeasure();\n }", "viewChanged(newValue, oldValue) {\n this.changes.view = newValue;\n requestUpdate(this);\n }", "function setActiveView(view) {\n app.activeView = view;\n }", "updateView() {\n this.render()\n }", "function SetViewChanging(changing) {\n viewChangeInProgress = changing;\n}", "changeView (view) {\n this.setState({role: view});\n }", "function set_view(self, state, level)\n {\n if (state === self.parameters.state_active || (\"active_map\" in self.parameters && self.parameters.active_map.includes(state)))\n {\n self.set_icon(self, \"icon\", self.icons.icon_on);\n self.set_field(self, \"icon_style\", self.css.icon_style_active)\n }\n else\n {\n self.set_icon(self, \"icon\", self.icons.icon_off);\n self.set_field(self, \"icon_style\", self.css.icon_style_inactive)\n }\n if (\"state_text\" in self.parameters && self.parameters.state_text === 1)\n {\n self.set_field(self, \"state_text\", self.map_state(self, state))\n }\n }", "_onChangeView() {\n this.emit(`view`);\n }", "function setView(viewId){\n\tif(viewId){\n\t\t$.fn.viewAs = viewId;\n\t} else {\n\t\tif($.fn.viewAs == 'viewAsIcon'){\n\t\t\t$.fn.viewAs = 'viewAsList';\n\t\t} else {\n\t\t\t$.fn.viewAs = 'viewAsIcon';\n\t\t}\n\t}\n\t\n\t// remove selected class from both\n\t$('#viewAsIcon').removeClass('selected');\n\t$('#viewAsList').removeClass('selected');\n\t\n\t// add selected class to one\n\t$('#' + $.fn.viewAs).addClass('selected');\n\t\n\t// toggle view classes\n\t$('#items').attr('class', $.fn.viewAs);\n}", "setupView() {\n if (this.view === null) { // If this is called, then user has not overwritten this function\n throw new Error(\"RealtimeMultiplayerGame.AbstractClientGame.setupView - Override this method, then call MyClientGame.superclass.setupView()\");\n }\n this.fieldController.setView(this.view);\n }", "_applyItemView(value, old) {\n if (value) {\n this.getStateManager().setState(\"itemView\", value);\n } else {\n this.getStateManager().removeState(\"itemView\");\n }\n }", "function set_view(self, state, level)\n {\n if (\"icons\" in self.parameters)\n {\n if (state in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons[state].icon);\n self.set_field(self, \"icon_style\", self.parameters.icons[state].style);\n set_service_call(self, self.parameters.icons[state]);\n }\n else if (\"default\" in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons.default.icon);\n self.set_field(self, \"icon_style\", self.parameters.icons.default.style);\n set_service_call(self, self.parameters.default);\n }\n else\n {\n self.set_icon(self, \"icon\", \"fa-circle-thin\");\n self.set_field(self, \"icon_style\", \"color: white\");\n set_service_call(self, {});\n }\n\n }\n\n if (\"state_text\" in self.parameters && self.parameters.state_text == 1)\n {\n self.set_field(self, \"state_text\", self.map_state(self, state))\n }\n }", "function refreshView() {\n\tchangeView(currentView[0], currentView[1], true);\n}", "setView() {\n this.view = new ol.View({\n projection: this.projection,\n center: ol.extent.getCenter(this.extent),\n zoom: 1,\n maxZoom: 8,\n maxResolution: 1.4\n });\n }", "_viewEvent(view) {\n\t if (view !== this._view) {\n\t // Action for different view - ignore it\n\t return;\n\t }\n\t // Change visible view if it doesn't match view.\n\t // Function also calls _triggerChange(true)\n\t if (this._changeVisibleView()) {\n\t return;\n\t }\n\t // Something changed in visible view\n\t this._triggerChange(false);\n\t }", "set mainview(value) {\n if (value) {\n this.node.setAttribute(\"mainview\", true);\n } else {\n this.node.removeAttribute(\"mainview\");\n }\n }", "static view(v) {\n // Add history\n window.history.replaceState(State.preserve(), document.title);\n // Change views\n for (let view of Array.from(arguments)) {\n // Store view\n let element = UI.find(view);\n // Store parent\n let parent = element.parentNode;\n // Hide all\n for (let child of parent.children) {\n UI.hide(child);\n }\n // Show view\n UI.show(element);\n }\n // Add history\n window.history.pushState(State.preserve(), document.title);\n }", "function updateViewState(viewState) {\n var currentViewState = jq(document).data(\"ViewState\");\n if (currentViewState) {\n jq.extend(currentViewState, viewState);\n }\n else {\n jq(document).data(\"ViewState\", viewState);\n }\n}", "gotView({ game }) {\n this.setState(game);\n }", "changeView() {\n\t\tthis.state.view === \"signup\" ? this.setState({view: \"signin\"}) : this.setState({view: \"signup\"});\n\t\tthis.setState({errorMessage: \"\"});\n\t}", "function toggleView(view) {\n\t\tsetActiveView(view);\n\t}", "function handleShow(view){\r\n view._isShown = true;\r\n triggerDOMRefresh(view);\r\n }", "requestView(){\t\t\n\t\tthis.trigger('requestView');\n\t}", "function init(vew) {\n\n // the view this controller is controlling\n view = vew;\n\n // put the view in an initial state\n view.init();\n }", "setupReviewView(view) {\n }", "onViewChange() {\n \n }", "setViewXml(viewXml) {\r\n return this.clone(View, \"SetViewXml\").postCore({\r\n body: jsS({\r\n viewXml,\r\n }),\r\n });\r\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function handleShow(view) {\n view._isShown = true;\n triggerDOMRefresh(view);\n }", "OnChangeView(view_id) {\n this.setState({\n activeView: view_id\n });\n\n if (this.state.activeView === \"homeScreen\") {\n if (window.location.hash) {\n this.OnChangePanel(\"party-info\");\n }\n }\n }", "changeView() {\n console.log('changing the view');\n //when this function is called, change the view in the state\n //if the state is 'Homepage'\n if (this.state.view === 'Homepage') {\n //then set it to Carousel\n this.setState({\n view: 'Carousel'\n });\n //else if the state is 'Carousel'\n } else if (this.state.view === 'Carousel') {\n //then set it to 'Homepage\n this.setState({\n view: 'Homepage'\n });\n }\n }", "function OnStateUpdate(self, state)\n {\n if (!(\"ignore_state\" in self.parameters) || self.parameters.ignore_state === 0)\n {\n self.state = state.state;\n set_view(self, self.state)\n }\n }", "function changeView(newViewName) {\n\t\tif (!currentView || newViewName != currentView.name) {\n\t\t\tignoreWindowResize++; // because setMinHeight might change the\n\t\t\t// height before render (and subsequently\n\t\t\t// setSize) is reached\n\n\t\t\tunselect();\n\n\t\t\tvar oldView = currentView;\n\t\t\tvar newViewElement;\n\n\t\t\tif (oldView) {\n\t\t\t\t(oldView.beforeHide || noop)(); // called before changing\n\t\t\t\t// min-height. if called after,\n\t\t\t\t// scroll state is reset (in\n\t\t\t\t// Opera)\n\t\t\t\tsetMinHeight(content, content.height());\n\t\t\t\toldView.element.hide();\n\n\t\t\t} else {\n\t\t\t\tsetMinHeight(content, 1); // needs to be 1 (not 0) for IE7, or\n\t\t\t\t// else view dimensions\n\t\t\t\t// miscalculated\n\t\t\t}\n\t\t\tcontent.css('overflow', 'hidden');\n\t\t\tcurrentView = viewInstances[newViewName];\n\t\t\tif (currentView) {\n\t\t\t\tcurrentView.element.show();\n\t\t\t} else {\n\t\t\t\tcurrentView = viewInstances[newViewName] = new fcViews[newViewName](\n\t\t\t\t\t\tnewViewElement = absoluteViewElement = $(\n\t\t\t\t\t\t\t\t\"<div class='fc-view fc-view-\" + newViewName\n\t\t\t\t\t\t\t\t\t\t+ \"' style='position:absolute'/>\")\n\t\t\t\t\t\t\t\t.appendTo(content), t // the calendar object\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (oldView) {\n\t\t\t\theader.deactivateButton(oldView.name);\n\t\t\t}\n\t\t\theader.activateButton(newViewName);\n\t\t\t// alert(\"selectedWeek: \"+selectedWeek);\n\t\t\trenderView(); // after height has been set, will make\n\t\t\t// absoluteViewElement's position=relative, then set\n\t\t\t// to null\n\t\t\t/*\n\t\t\t * if (!oldView && selectedWeek != 0) { for ( var i = 0; i <\n\t\t\t * selectedWeek; i++) { renderView(1); } }\n\t\t\t */\n\t\t\tcontent.css('overflow', '');\n\t\t\tif (oldView) {\n\t\t\t\tsetMinHeight(content, 1);\n\t\t\t}\n\n\t\t\tif (!newViewElement) {\n\t\t\t\t(currentView.afterShow || noop)(); // called after setting\n\t\t\t\t// min-height/overflow, so\n\t\t\t\t// in final scroll state\n\t\t\t\t// (for Opera)\n\t\t\t}\n\n\t\t\tignoreWindowResize--;\n\t\t}\n\t}", "handleViewChange(view, changed_attrib, new_value) {\n if (debug && false) console.log('handleViewChange', view, changed_attrib, new_value);\n // check that we've got a valid sequence number\n if (!view.seq.length) {\n console.error('Received an invalid sequence number, aborting handleViewChange');\n return;\n }\n // compose state update leaf\n const updated_view = {};\n updated_view[changed_attrib] = new_value;\n const chain = ViewManager.calculateViewChangeChain(view, updated_view);\n // use immutability-helper to create an update copy of the state then apply to state\n const new_state = {views: update(this.state.views, chain)};\n this.setState(new_state);\n }", "updateView() {\n if (!Object(_yuion_svg_viewer__WEBPACK_IMPORTED_MODULE_3__[\"getViewer\"])(this.viewer) || this.loading) {\n return this.timeout('update_view', () => this.updateView());\n }\n try {\n Object(_yuion_svg_viewer__WEBPACK_IMPORTED_MODULE_3__[\"updateViewer\"])(this.viewer, {\n styles: this.styles,\n features: this.feature_list,\n labels: this.labels,\n actions: this.actions,\n });\n }\n catch (e) { }\n }", "function viewShown() {\n activate();\n }", "handleSetViews( value ) {\n\t\t// force update button to be clickable\n\t\twp.data.dispatch( 'core/editor' ).editPost( { meta: { _pvc_post_views: value } } );\n\n\t\tthis.setState( () => {\n\t\t\treturn {\n\t\t\t\tpostViews: value\n\t\t\t}\n\t\t} );\n\t}", "updateView() {\n // we update the selected task id\n const theId = document.getElementsByClassName('grid-row-selected')[0].attr('id');\n this.newTaskId = theId.replace('item_row_view_', '');\n\n // add a timer button\n this.addTimerButton();\n\n // get our timer history\n // this.getTimerHistory(this.newTaskId);\n\n }", "showCreator() {\n this.setState({ viewSelector: 1 })\n }", "function initializeViewState(viewState) {\n jq(document).data(\"ViewState\", viewState);\n}", "function View() {\n var self = this;\n this.currentDate = new Date();\n }", "setButtonState() {\n // this.view.setButtonState(this.runner.busy,this.synchronizing,this.synchronize_type)\n }", "onChangeDefaultView(value) {this.props.setTempSettings(\"defaultView\", value)}", "onViewChanged() {\n this.camera = this.graph.views.get(this.viewIndexToNames[this.selectedView]);\n this.interface.setActiveCamera(this.camera);\n }", "get view() {\n return this._view;\n }", "get view() {\n return this._view;\n }", "function handleRender(view){\r\n view._isRendered = true;\r\n triggerDOMRefresh(view);\r\n }", "bindView(_view) {\n if (!this.viewIds.includes(_view.viewId)) {\n this.viewIds.push(_view.viewId);\n }\n this._updateFlexibleDimensions();\n return this;\n }", "function setViewState(key, value) {\n var viewState = jq(document).data(\"ViewState\");\n if (!viewState) {\n viewState = new Object();\n jq(document).data(\"ViewState\", viewState);\n }\n viewState[key] = value;\n}", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "switchView() {\n this.setState({ showSignUp: !this.state.showSignUp });\n }", "_onViewChange() {\n if (this._pointControllers) {\n this._pointControllers.forEach((pointController) => {\n pointController.setDefaultView();\n });\n }\n }", "toggleView(){\n this.setState((prevState) => {\n const view = prevState.view === \"create\" ? \"display\" : \"create\";\n return {view};\n })\n }", "function setViewEngine(selectedViewEngine){\n ViewEngine = selectedViewEngine;\n}", "function handleRender(view) {\n view._isRendered = true;\n triggerDOMRefresh(view);\n }", "function start_view() {\n editor_visibility(true);\n button_visibility('view-mode');\n d3.json(resource_url(), editor_callback);\n}", "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\tcalcSize();\n\t\trenderView(viewType, scrollState);\n\n\t\tthawContentHeight();\n\t\tignoreWindowResize--;\n\t}", "_showView(view) {\n this._hideAll();\n view.show();\n view.css('visibility', 'visible');\n }", "function updateView() {\n var listview = document.getElementById(\"listview1\").winControl;\n\n // Set the properties on the list view to use the itemDataSource\n listview.itemDataSource = dataSource;\n listview.itemTemplate = renderer;\n }", "function reinitView() {\n\t\t\tignoreWindowResize++;\n\t\t\tfreezeContentHeight();\n\n\t\t\tvar viewType = currentView.type;\n\t\t\tvar scrollState = currentView.queryScroll();\n\t\t\tclearView();\n\t\t\trenderView(viewType, scrollState);\n\n\t\t\tunfreezeContentHeight();\n\t\t\tignoreWindowResize--;\n\t\t}", "function updateView() {\n if (!$scope.$$phase) $scope.$apply();\n }", "changeView(){\n if (this.compare) {\n // clear array with plans to compare\n this.$store.dispatch('clearCompare');\n } else {\n // clear 'add to compare' checkboxes\n let checkboxes = document.getElementsByClassName('checkbox-recomm');\n for(let i = 0; i < checkboxes.length; ++i){\n checkboxes[i].checked = false;\n }\n }\n this.$store.dispatch('changeView');\n\n // reset scroll offsets\n this.tableOffsetLeft = this.filtersWidth;\n this.windowOffsetLeft = 0;\n }", "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\trenderView(viewType, scrollState);\n\n\t\tunfreezeContentHeight();\n\t\tignoreWindowResize--;\n\t}", "function change_view(view)\n{\n\tif(view_mode == 'errors')\n\t\treturn; // You cannot escape Errors View!\n\tswitch(view)\n\t{\n\t\tcase 'loader':\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#loader_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'errors':\n\t\t\t// TODO: Flash menacingly.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#errors_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'galaxy':\n\t\t\t// TODO: Zoom out from Sector View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#galaxy_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'sector':\n\t\t\t// TODO: Zoom in from Galaxy View, or out from System View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#sector_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'system':\n\t\t\t// TODO: Zoom in from Sector View, or out from Object View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#system_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'object':\n\t\t\t// TODO: Zoom in from System View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#object_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Cannot change_view() to: ' + view);\n\t}\n\tview_mode = view;\n}", "function toggleView(view) {\n var show = model.views[view];\n model.views[view] = !show;\n }", "setSettingsView (settingsView) {\n this.settingsView = settingsView\n\n if (this.panels.length > 0) {\n for (let panel in this.panels) {\n this.addPanelToSettingsView(panel)\n }\n }\n }", "function switchToView(view) {\n switch (view) {\n case 'edit-form': showElement(['edit-form']); hideElement(['listing', 'main-controls']); break;\n case 'listing': hideElement(['edit-form']); showElement(['listing', 'main-controls']); renderList(); break;\n }\n}", "createView() {\n const doc2 = createDocument(this.options.content, this.schema, this.options.parseOptions);\n const selection = resolveFocusPosition(doc2, this.options.autofocus);\n this.view = new EditorView(this.options.element, {\n ...this.options.editorProps,\n dispatchTransaction: this.dispatchTransaction.bind(this),\n state: EditorState.create({\n doc: doc2,\n selection: selection || void 0\n })\n });\n const newState = this.state.reconfigure({\n plugins: this.extensionManager.plugins\n });\n this.view.updateState(newState);\n this.createNodeViews();\n const dom = this.view.dom;\n dom.editor = this;\n }", "setViewXml(viewXml) {\n return spPost(this.clone(View, \"SetViewXml\"), body({ viewXml }));\n }", "@action update_current_view(data) {\n this.page_state.update_current_view(data);\n }", "refresh() {\n this.views.forEach(_responder => {\n if (_responder.value !== this.value && !_responder._valueIsBeingSet) {\n _responder._valueIsBeingSet = true;\n _responder.setValue(this.value);\n _responder._valueIsBeingSet = false;\n }\n });\n }", "refresh() {\n this.views.forEach(_responder => {\n if (_responder.value !== this.value && !_responder._valueIsBeingSet) {\n _responder._valueIsBeingSet = true;\n _responder.setValue(this.value);\n _responder._valueIsBeingSet = false;\n }\n });\n }", "function setViewModified(bool) {\n // log.d('modified =' + bool);\n viewModified = bool;\n if (bool) saveButton.show(true);\n else {saveButton.hide(true);} \n }", "function restoreView(viewToRestore){contextLView=viewToRestore;}" ]
[ "0.7733251", "0.7733251", "0.7733251", "0.77318", "0.72683024", "0.70956314", "0.7093537", "0.7048044", "0.6952537", "0.6938064", "0.679264", "0.675826", "0.6750861", "0.6725923", "0.66904855", "0.66389334", "0.6533543", "0.6526951", "0.65169847", "0.6506038", "0.64756083", "0.647012", "0.64442635", "0.6440855", "0.64299786", "0.63608646", "0.63262856", "0.6309233", "0.62669027", "0.6245171", "0.6196832", "0.6180918", "0.6180688", "0.61784124", "0.6173325", "0.6165001", "0.61202717", "0.6116917", "0.60538876", "0.6053794", "0.6035718", "0.6013137", "0.6003478", "0.5996691", "0.59911305", "0.59840864", "0.59730566", "0.59606224", "0.59546834", "0.5933524", "0.5906336", "0.5906336", "0.5906336", "0.58983934", "0.58854556", "0.5882569", "0.5877255", "0.58674955", "0.583172", "0.58138543", "0.5811233", "0.5810891", "0.57956517", "0.579316", "0.5791812", "0.57900995", "0.577394", "0.5749482", "0.5743518", "0.57381016", "0.57381016", "0.5737009", "0.5713945", "0.5712975", "0.5697417", "0.5697417", "0.5695529", "0.56874204", "0.5681001", "0.56748474", "0.5673147", "0.56691784", "0.5661133", "0.5660758", "0.56435263", "0.5639942", "0.5631582", "0.5621657", "0.56203485", "0.5608797", "0.5596629", "0.5594688", "0.55869615", "0.5580518", "0.5564162", "0.5551423", "0.5549505", "0.5549505", "0.5540876", "0.55356133" ]
0.61747974
34
The OnStateUpdate function will be called when the specific entity receives a state update its new values will be available in self.state[] and returned in the state parameter
function OnStateUpdate(self, state) { set_view(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "stateChanged(state) {\n this._name = state.profile.name;\n this._position = state.profile.position;\n this._skill = state.profile.skill;\n this._saved = state.profile.saved;\n }", "update() {\n BaseState.update.call(this);\n }", "function OnStateUpdate(self, state)\n {\n if (!(\"ignore_state\" in self.parameters) || self.parameters.ignore_state === 0)\n {\n self.state = state.state;\n set_view(self, self.state)\n }\n }", "function updateState() {\n gState.push({\n board: copyMat(gBoard),\n shownCount: gGame.shownCount,\n markedCount: gGame.markedCount,\n lives: gGame.lives,\n safeClick: gGame.safeClick,\n hints: gGame.hints,\n manualMode: gGame.isManualOn,\n gManualMode: gManualMode.isManualOn\n });\n}", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function updateState() {\n //create our state object and notify our listener\n var state = {\n currentUniverseTime: new Date(currentUniverseTime)\n };\n\n fireStateChanged(state);\n\n // call update() again in a certain number of milliseconds\n updateStateTimeout = setTimeout(function () {\n updateState();\n }, timeBetweenStateUpdatesMs);\n }", "stateChanged(state) { }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n\n delay_time = self.parameters.update_delay;\n if (delay_time !== undefined) {\n if (self.timeout !== undefined) {\n clearTimeout(self.timeout);\n }\n\n self.timeout = setTimeout(function() {set_view(self, self.state)}, delay_time * 1000);\n } else {\n set_view(self, self.state);\n }\n }", "_onChangeState() {\n\n\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n\n set_view(self, self.state, self.level)\n }", "function setEntityState(entity,state) {\n entity.state = state\n server.baseServer.broadcast('server','entity',{uuid:entity.uuid, state:state})\n }", "function _updateState(state, payload) {\n $log.debug(\"=== State changed ===\");\n $log.info(state);\n $log.debug(payload);\n\n $rootScope.$emit(HOTEL_STATES, {\n state: state,\n payload: angular.copy(payload)\n });\n }", "stateChanged(_state) { }", "stateChange(state){\n\t\tLogger.info(`Ably realtime state changed to: ${state.current}`);\n\t}", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "stateChanged(state) {\n }", "async updateState(state) {\n let key = this.ctx.stub.createCompositeKey(this.name, [state.getKey()]);\n let data = Utils.serialize(state);\n await this.ctx.stub.putState(key, data);\n }", "changeState(state) {\r\n for (let key in this.states){\r\n // console.log(this.states[key])\r\n if (key==state) {\r\n this.statesStack.append(this.state);\r\n this.state=state;\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n } \r\n throw new Error();\r\n }", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function updateEntityState (entity, nextState) {\n\t entity.pendingState = assign(entity.pendingState, nextState)\n\t entity.dirty = true\n\t invalidate()\n\t }", "_onChange() {\n this.setState(getAllState())\n }", "getUpdatedState(props, state) {\n return this.state.getUpdatedState(props, state);\n }", "get state() { return this._state; }", "getState(){\n super.getState();\n this.state['amount'] = this.#amount;\n\n return this.state;\n }", "handle() {\n if(!this.enabled)\n return;\n\n Object.assign(this.previousState, this.state); // Save the previous state\n this.update(); // Update the current state\n this.notify();\n }", "function updateEntityState (entity, nextState) {\n entity.pendingState = assign(entity.pendingState, nextState)\n entity.dirty = true\n invalidate()\n }", "updateState(newState) {\n this.setState(newState);\n }", "_stateChanged(state) {\n console.log(state);\n }", "stateChanged(state) {\n this._competitors = competitorsWithEventsSelector(state);\n this._couples = couplesSelector(state);\n this._events = EventsWithCouplesSelector(state);\n this._offbeat = state.form.offbeat.competing;\n this._offbeat_team = OffbeatTeamSelector(state);\n this._basic_information = state.form.basic_information;\n this._form = state.form;\n this._total_entry_fee = total_entry_fee(this._competitors);\n }", "function onStateUpdate(nState) {\n for (var pid in state.players) {\n if (!(pid in nState.players)) // player vanishes\n onPlayerQuit(pid);\n }\n\n for (var pid in nState.players) {\n if (pid == ws._id) continue; // skip ourself\n\n if (!(pid in state.players)) { // player appears\n onPlayerJoin(pid, nState.players[pid]);\n }\n\n var p = nState.players[pid];\n if (p.state == 'player') { // update non-ghost\n onPlayerUpdate(pid, p);\n }\n }\n}", "function OnStateUpdate(self, state)\n {\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n }", "get state() {\n return this._obj.state;\n }", "get state(){return this._state;}", "get state(){return this._state;}", "get state(){return this._state;}", "stateChanged(state){\n this.targetFood = state.targetFood;\n }", "changeState(state) {\r\n if(this.getStates().indexOf(state) != -1){\r\n if(this.prevState[this.prevState.length - 1] != this.state)\r\n this.prevState.push(this.state);\r\n this.state = state;\r\n }else throw new Error(\"\")\r\n }", "setState(updateObject) {\n this.setChangeFlags({stateChanged: true});\n Object.assign(this.state, updateObject);\n this.setNeedsRedraw();\n }", "function getState() {\n return state;\n }", "stateChanged(state) {\n this._clicks = state.counter.clicks;\n this._value = state.counter.value;\n }", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "get state() {\r\n return this._state;\r\n }", "getState() {\n return this.state;\n }", "function updateState(state) {\n cellClientProps = updateCellClientProps(state, cellClientProps);\n //draw a white background\n background(255, 255, 255);\n\n for (var playerId in state.players) {\n if (state.players.hasOwnProperty(playerId)) {\n let plyr = state.players[playerId];\n let color = plyr.blob.color;\n stroke(color[0],color[1],color[2]);\n for (var i=0; i<plyr.blob.cellInds.length; i++) {\n let c = cellClientProps.ps[plyr.blob.cellInds[i]];\n let a = plyr.blob.amts[i];\n strokeWeight(sqrt(a));\n point(c.x,c.y);\n }\n }\n }\n\n stroke(0);strokeWeight(12);\n for (let i=0; i<cellClientProps.ps.length; i++) {\n let p = cellClientProps.ps[i];\n point(p.x,p.y);\n }\n image(pointer, mouseX, mouseY);\n}", "getState() {\n return state;\n }", "enterState(oldState){}", "function state_update(st) {\n state = st;\n if (callback) {\n callback(st);\n }\n}", "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "get_state() {\n return this.state;\n }", "_onChange() {\n this.setState(getUserState());\n }", "function State() {\n\n }", "function statehandler(key, value) {\n // console.log(\"key:\",key,\"value:\",value)\n // console.log(\"old state:\", user)\n setUser({...user, [key]: value});\n // console.log(\"latest state:\", user)\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "function History_UpdateLastStateLoaded()\n{\n\t//by default the last loaded State is the current one\n\tthis.LastLoadedStateIndex = this.CurrentStateIndex;\n\t//get the current State\n\tvar wi4State = __SIMULATOR.StateManager.CurrentState;\n\t//create a map of previously processed ids\n\tvar mapIds = {};\n\t//create a copy of states loaded\n\tvar states = this.States.slice();\n\t//while the state is valid\n\twhile (wi4State != null)\n\t{\n\t\t//get the next default action StateId\n\t\tvar nextStateId = wi4State.ListOfPaths.length > 0 ? wi4State.ListOfPaths[0].Destiny : null;\n\t\t//no id? or already processed?\n\t\tif (!nextStateId || mapIds[nextStateId])\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//mark id as processed\n\t\tmapIds[nextStateId] = true;\n\t\t//get the State\n\t\twi4State = __CACHE.Has_State(nextStateId);\n\t\t//invalid?\n\t\tif (!wi4State)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//not yet ready?\n\t\tif (!wi4State.Optimised)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//increment last loaded State index\n\t\tthis.LastLoadedStateIndex++;\n\t\t//push this message into our array\n\t\tstates.push(wi4State);\n\t}\n\t//now update the controller\n\t__SIMULATOR.NotifyControllerHistory(states);\n}", "function getState() {\n return currentState\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "function updateState(stateChange) {\n if (isNaN(stateChange)) {\n console.error(\"Invalid state change\");\n return;\n }\n currState += stateChange;\n currState = currState % states.length;\n console.assert(\n currState >= 0 && currState < states.length,\n \"currState got out of bounds on updateState: \",\n currState\n );\n clearButtons();\n switch (getRoomName()) {\n case \"START\":\n buildStartRoom();\n break;\n case \"GAME\":\n buildGameRoom();\n break;\n case \"RESULTS\":\n buildResultsRoom();\n break;\n }\n}", "updateState(stateChange){\n this.setState(stateChange);\n }", "function getState () {\n\t\treturn currentState;\n\t}", "function getState () {\n return state\n }", "function getState () {\n return state\n }", "async updateState() {\n const stateResponses = await Promise.all([\n this.bulb.getLightState(),\n this.bulb.getDeviceInfo()\n ]).catch(err => {\n console.error(err.message);\n generateErrorQRCode(`Could not get status of ${deviceName}`);\n });\n const newState = lifxStateToCapstone_Yeet(\n stateResponses[0],\n stateResponses[1]\n );\n\n if (!_.isEqual(this.bulbState, newState)) {\n // the light bulb state has changed\n console.debug(\"State has changed\");\n this.bulbState = newState;\n // TODO: remove console.log once we can correctly pad the image. Instead\n // of logging this object, we will display it on the e-ink display.\n generateQRCode(this.bulbState);\n }\n }", "get State() {\r\n return _state;\r\n }", "get State() {\r\n return _state;\r\n }", "getState() {\n return this._state;\n }", "get state() {return this._p.state;}", "setStateInternal(id, value) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n this.log.info('update state ' + obj + ' with value:' + value);\n currentStateValues[obj] = value;\n }", "componentDidUpdate() {\n // debugging\n console.log('___STATE____', this.state);\n }", "subscriberState(EventName, data){\n let key = EventName\n let val = data\n let obj = {}\n obj[key] = val\n //console.log('players in ListPlayers class');\n //console.log(this.state.players);\n this.setState(obj);\n }", "drawState(){\n if(this.getTracer().stateStructure && this.getNode(this.currentId)){\n NodeStateService.process(this.getNode(this.currentId).state_variables);\n }\n }", "function getState() {\n return currentState\n }", "onStateChange() {\n\t\tthis.forceUpdate();\n\t}", "function updateState(data) {\n updateVoteFinishArea(data.state);\n}", "stateChangedCallback(yfct,value)\n { \n \n // memorize the new state\n this._state = (value ==\"B\" ); \n console.log(\"relay change (\"+value+\", state is now \"+this._state);\n // notify the NEEO server about the change\n this.notifyNEEOServer({uniqueDeviceId: this._neeoID, component:this._hwdID, value:this._state} );\n // this.notifyNEEOServer({uniqueDeviceId: \"default\" , component:this._hwdID, value:this._state } );\n }", "changeState(state) {\r\n if(this.config.states[state]) {\r\n this.currentState = state;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('changeState');\r\n } else {\r\n throw new Error('This state does not exist');\r\n }\r\n }", "function updateStateMaps() {\n // XXX\n }", "_handleComponentChange() {\n this.setState(this._getStateFromStore());\n }", "componentDidUpdate() {\n this.lastStateUpdate = Date.now();\n StateLoader.updateLocalStorage(this.state);\n }", "changeState(state) {\r\n\r\n\r\n if (!this.statuses.includes(state)) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = state;\r\n this.history2 = [];\r\n\r\n\r\n }", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "updateState(update) {\n\t\t// console.log(\"Fetching player updates\");\n\n\t\t// Get the ID of the player who triggered this update\n\t\tlet pid = update.pid;\n\t\tlet player = this.stage.getPlayer(pid);\n\n\t\t// Only clients with a player that is still alive can make updates\n\t\tif (player) {\n\t\t\tif (update.type == \"move\") {\n\t\t\t\tplayer.setMovementDirection(update.x, update.y);\n\t\t\t} else if (update.type == \"cursor\") {\n\t\t\t\tplayer.setCursorDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"click\") {\n\t\t\t\tplayer.setFiringDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"weapon-toggle\") {\n\t\t\t\tplayer.setWeapon(update.toggle);\n\t\t\t}\n\t\t}\n\t}", "changeState(state) {\r\n if (state !== \"hungry\" && state !== \"busy\" &&\r\n state !== \"sleeping\" && state !== \"normal\") {\r\n throw new Error()\r\n }\r\n\r\n this.state = state;\r\n this.states.push(this.state);\r\n return this.state\r\n }", "enterState (state = this.Data) {\n this.State = state;\n }", "function getState() {\n return currentState\n }" ]
[ "0.7009522", "0.6854083", "0.679671", "0.6775288", "0.67625326", "0.67257464", "0.65530324", "0.65453386", "0.6517903", "0.64969283", "0.64969283", "0.6472901", "0.6461478", "0.6445605", "0.6439849", "0.6411765", "0.64113086", "0.6320047", "0.6305521", "0.6303993", "0.63011974", "0.6285632", "0.6284591", "0.6280596", "0.6270914", "0.6246118", "0.6239657", "0.61725473", "0.6155058", "0.61431676", "0.6138279", "0.6132828", "0.61209667", "0.6116015", "0.6104993", "0.61025494", "0.60972434", "0.60658765", "0.606212", "0.60600364", "0.6051956", "0.6051956", "0.6051956", "0.6048435", "0.6022469", "0.60068446", "0.59943426", "0.59936243", "0.59907275", "0.5971437", "0.59647834", "0.59493846", "0.59478444", "0.59472966", "0.59439963", "0.59439296", "0.5941543", "0.59415174", "0.59245205", "0.59220004", "0.5909356", "0.5909356", "0.5909356", "0.5903821", "0.58957964", "0.5888869", "0.5888869", "0.5888869", "0.5888869", "0.588627", "0.58828354", "0.5882214", "0.58791727", "0.5877675", "0.5877675", "0.5869419", "0.5869174", "0.5869174", "0.5867154", "0.5850606", "0.5850367", "0.5848188", "0.584502", "0.5844067", "0.58434814", "0.5842789", "0.5841803", "0.5841512", "0.584139", "0.5838419", "0.5837626", "0.58232874", "0.5821397", "0.58128065", "0.5811242", "0.58091545", "0.580657", "0.5804049" ]
0.6093604
39
If forecast is disabled don't monitor the forecast sensors
function check_if_forecast_sensor(show_forecast, entity) { if (show_forecast) { return true } else if(entity.substring(entity.length - 2) === "_1") { return false } else { return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tryStopMonitoringSensors() {\n if (statusOn === true) {\n stopMonitoringPrompt();\n }\n}", "function uponEStopDisabled() {\n\tif (feedholdActivated == true) {\n\t\tsocket.emit('write', options.port, \"~\")\n\t\tclearInterval(feedHoldTimer);\n\t\tbuttonLED.writeSync(0);\n\t\tconsole.log(\"RESUME\");\n\t\tfeedholdActivated = false;\n\t}\n}", "function updateStatusToFarenheit() {\n isItCelsius = false;\n}", "function monitorTemperature() {\n var prev = 0;\n \n setInterval(function() {\n var currentTemp = board.getTemperature();\n var currentLight = board.getLight();\n board.message(\"Temperature: \" + currentTemp);\n board.message(\"Light Level: \" + currentLight, 1);\n\n // check if fire alarm should be triggered\n if (prev < config.ALARM_THRESHOLD && currentTemp >= config.ALARM_THRESHOLD) {\n events.emit(\"start-alarm\");\n }\n\n if (prev >= config.ALARM_THRESHOLD && currentTemp < config.ALARM_THRESHOLD) {\n events.emit(\"stop-alarm\");\n }\n\n prev = currentTemp;\n \n //AUTOMATION LOGIC\n /**\n\n //TOO COLD\n if ( flueTemp < 150 ){\n fireStatus = low;\n\n //// Fire is just starting\n if( flameSensor == true ){\n notify(\"Keep an eye on it.\");\n damper.position = 100;\n }\n\n //fire is dying\n if( flameSensor == false ){\n alarm();\n notify(\"Low fire. Creosote danger. Add wood.\");\n damper.position = 0;\n\n }\n }\n\n // JUST RIGHT\n if ( flueTemp > 150 && flueTemp <= 400){\n fireStatus = good;\n alarm();\n notify(\"Nice fire.\")\n damper.position = 50;\n }\n\n //TOO HOT\n if ( flueTemp > 400 && flueTemp <= 600){\n fireStatus = hot;\n if( flameSensor == true ){\n alarm();\n notify(\"The fire is too hot. Adjusting damper.\"\n) damper.position = 20;\n }\n if( flameSensor == false ){\n alarm();\n notify(\"Your fire is out but your chimney is on fire.\"\n) damper.position = 0;\n }\n }\n\n **/\n \n \n //monitor Button\n //readButtonValue(); \n\n \n \n \n \n \n }, 500);\n}", "function sensor_IsAvailableChanged(args) {\n if (sensor.isAvailable) {\n console.log(\"status changed: Running\");\n }\n else {\n console.log(\"status changed: Kinect not available!\");\n }\n }", "function auto() {\n if (forecast.lock == true) {\n forecast.lock = false;\n document.getElementById('toggle').src = \"../../static/images/controls/play_animation.png\";\n // clear forecast.run\n window.clearInterval(forecast.run);\n }\n else if (forecast.lock == false) {\n forecast.lock = true;\n document.getElementById('toggle').src = \"../../static/images/controls/pause.png\";\n // set forecast.run\n if ( document.getElementById('radio-once').checked ) {\n if ( forecast.ImgNum >= forecast.OpsImgs.length-1) { \n forecast.ImgNum = 0;\n document.getElementById('forecast-slider').value = forecast.ImgNum;\n }\n forecast.fwd = true;\n forecast.run = setTimeout(loopOnceFwd, forecast.delay);\n }\n if ( document.getElementById('radio-loop').checked ) {\n forecast.fwd = true;\n forecast.run = setTimeout(loopContinuous, forecast.delay);\n }\n if ( document.getElementById('radio-reflect').checked ) {\n forecast.run = setTimeout(loopReflect, forecast.delay);\n }\n // changeSpd(0);\n }\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 pollSensorSerial() {\n let intervalPoll = setInterval(function () {\n that.stateMachine.sensorPiso.Get_state(function (err, dta) { });\n if(that.stateMachine.isDispense===false){\n clearInterval(intervalPoll);\n intervalPoll = null\n }\n }, 500);\n }", "function setUseWatchdog(params) {\n amatriadata.useControlWatchdog = false;\n amatriadata.useControlWatchdog = (params[1] == 'true' || params[1] == 'TRUE');\n if(amatriadata.useControlWatchdog == true) {\n console.log(Date(Date.now()) + \" Activated control watchdog via OSC\");\n } else { \n console.log(Date(Date.now()) + \" Deactivated control watchdog via OSC\");\n if(watchdog_timeout_id) {\n clearTimeout(watchdog_timeout_id);\n clearTimeout(watchdog_warning_id);\n }\n }\n rewriteData(amatriadata);\n}", "function uponEStopEnabled() {\n\tif (feedholdActivated == false) {\n\t\tsocket.emit('write', options.port, \"!\")\n\t\tconsole.log(\"FEED HOLD!\");\n\t\tfeedHoldTimer = setInterval(uponFeedHoldTimer, FEEDHOLD_LEDBLINK_INTERVAL);\n\t\tfeedholdActivated = true;\n\t}\n}", "function ambientDigitalWatch() {\n flagDigital = false;\n clearInterval(interval);\n updateTime();\n }", "function disableautoupdate() {\r\n console.log(\"Log auto update: DISABLED\");\r\n $(\"#autoUpdateSlider\").attr(\"data-enabled\", \"false\");\r\n clearInterval(nIntervId[\"logRefresh\"]);\r\n clearInterval(nIntervId);\r\n clearInterval(refreshblockUI, settings.rflog);\r\n clearInterval(refreshblockUI);\r\n logInterval = false;\r\n}", "function Sensor_IsAvailableChanged(args) {\n if (sensor.isAvailable) {\n document.getElementById(\"statustext\").innerHTML = \"Running\";\n }\n else {\n document.getElementById(\"statustext\").innerHTML = \"Kinect not available!\";\n }\n }", "forecastEvent () {\n // Eeeesh :/\n }", "function toggleData() {\n $log.debug('toggleData');\n $scope.forecastData = $scope.forecastData ? false : true;\n $scope.locationInfo = $scope.locationInfo ? false : true;\n }", "trackVolatile() {\n if (watcher !== void 0) {\n watcher.needsRefresh = true;\n }\n }", "maybeEnableMetering_() {\n const {services} = this.platformConfig_;\n const meteringPlatform = services.find(\n (service) => service['enableMetering']\n );\n\n if (meteringPlatform) {\n this.metering_ = new Metering({\n platformKey: meteringPlatform.serviceId,\n });\n }\n }", "function noWeather() {\n app.textContent = 'Unable to get weather data at this time.';\n }", "onDeviceIdle () {\n if (this.waitSleep && this.fsmStatus === FSM_WAITING) {\n this.waitSleep = false\n if (this.fsmWaitingBreaker) {\n logger.info('device is idle, recheck dnd mode')\n this.fsmWaitingBreaker()\n }\n }\n }", "onDisable() {}", "function NTSCEvent()\r\n{\r\n try\r\n {\r\n gb_use_ntsc_arduino = this.checked() ? true : false; \r\n }\r\n catch(err)\r\n { \r\n DebugLog(err.message.toString());\r\n } \r\n}", "static async compareWithWeather(thermostatAccessToken, SMART_DEVICES_URL, WEATHER_API_ID, PROJECT_ID, DEVICE_ID, BASE_WEATHER_API_URL, LAT, LON, TEMP_MAX, TEMP_MIN, TEMP_PREF) {\n try {\n\n //check current thermostat mode:\n const thermostatResponse = await this.getBasicInfo(thermostatAccessToken, SMART_DEVICES_URL, PROJECT_ID);\n //get the current weather\n const weatherResponse = await axios.get(`${BASE_WEATHER_API_URL}?lat=${LAT}&lon=${LON}&appid=${WEATHER_API_ID}&units=imperial`);\n const weatherTemp = weatherResponse.data.main.feels_like;\n console.log(weatherResponse.data);\n\n if (thermostatResponse.data.devices[0].traits['sdm.devices.traits.ThermostatMode'].mode === \"COOL\") {\n //if ac is running & climate inside is warmer than outside, turn it off\n\n console.log(\"checking current weather data...\");\n\n let thermoTemp = this.convertCelsiusToFahrenheit(thermostatResponse.data.devices[0].traits['sdm.devices.traits.ThermostatTemperatureSetpoint'].coolCelsius);\n if (thermoTemp && thermoTemp > weatherTemp) {\n console.log(\"temp outside is lower than the house temp, powering off the ac\");\n\n const data = {\n \"command\": \"sdm.devices.commands.ThermostatMode.SetMode\",\n \"params\": {\n \"mode\": \"OFF\"\n }\n }\n const headerContent = { Authorization: `Bearer ${thermostatAccessToken}` };\n await axios.post(`${SMART_DEVICES_URL}/${PROJECT_ID}/devices/${DEVICE_ID}:executeCommand`, data, { headers: headerContent });\n } else {\n console.log('temp outside is warmer than it is inside')\n }\n } else {\n //if ac is not running & climate outside is warmer than the preferred max, turn it on\n //currently not checking the last temp, just if its over 72\n if (weatherTemp > TEMP_MAX) {\n console.log(\"powering on the ac\");\n\n const data = {\n \"command\": \"sdm.devices.commands.ThermostatMode.SetMode\",\n \"params\": {\n \"mode\": \"COOL\"\n }\n }\n const headerContent = { Authorization: `Bearer ${thermostatAccessToken}` };\n await axios.post(`${SMART_DEVICES_URL}/${PROJECT_ID}/devices/${DEVICE_ID}:executeCommand`, data, { headers: headerContent });\n } else if (weatherTemp < TEMP_MIN) {\n //the weather temp is less than what is set to be the min temp pref\n console.log(\"powering on the heater\")\n const data = {\n \"command\": \"sdm.devices.commands.ThermostatMode.SetMode\",\n \"params\": {\n \"mode\": \"HEAT\"\n }\n }\n const headerContent = { Authorization: `Bearer ${thermostatAccessToken}` };\n await axios.post(`${SMART_DEVICES_URL}/${PROJECT_ID}/devices/${DEVICE_ID}:executeCommand`, data, { headers: headerContent });\n } else {\n console.log(\"thermostat is already off, no changes made\");\n }\n }\n } catch (e) {\n console.log(e);\n }\n }", "function turnOffNow() {\n if (isPastTime(config.turnOffTime)) {\n if (DEBUG) { console.log(\"Turning OFF lights now...\" + moment().local().format('LLL')); }\n client.publish(config.turnOffTopic, \"{}\");\n turnedOn = false;\n setTimeout(turnOnNow, 43200000); // start to check 12 hrs from now.\n } else {\n setTimeout(turnOffNow, 60000);\n }\n}", "updateScheduledState(callback) {\n if (isScheduled) {\n series([staging, production].map(FunctionName=> {\n return function update(callback) {\n if (state === 'disabled') {\n setTimeout(function rateLimit() {\n cloudwatch.disableRule({\n Name: FunctionName,\n }, callback)\n }, 200)\n }\n else {\n setTimeout(function rateLimit() {\n cloudwatch.enableRule({\n Name: FunctionName,\n }, callback)\n }, 200)\n }\n }\n }), callback)\n }\n else {\n callback()\n }\n }", "function noInstallStatus () { // Timeout, we will never get the install event, assume justInstalled = false\r\n console.log(\"No install event\");\r\n getInstallStatusTimerID = undefined;\r\n justInstalled = false;\r\n gis_resolve(justInstalled);\r\n}", "function onTick() {\n var notis;\n if (notTicked) {\n notis = notTicked;\n notTicked = undefined;\n notis.forEach(doNotify);\n }\n }", "function sensorFunc() {\n\t// calls the success callback if the sesnor is there otherwise calls error\n\t// callback\n\ttizen.humanactivitymonitor.getHumanActivityData(\"HRM\",\n\t\t\tsuccessCallbackHeart, errorCallback); // HeartRate API\n}", "function check() {\n clearTimeout(timer)\n\n if (device.present) {\n // We might get multiple status updates in rapid succession,\n // so let's wait for a while\n switch (device.type) {\n case 'device':\n case 'emulator':\n willStop = false\n timer = setTimeout(work, 100)\n break\n default:\n willStop = true\n timer = setTimeout(stop, 100)\n break\n }\n }\n else {\n stop()\n }\n }", "function on() {\r\n document.getElementById(\"on\").disabled = true;\r\n document.getElementById(\"off\").disabled = false;\r\n document.getElementById(\"data\").rows[\"seconds\"].innerHTML = \"Reading Data...\";\r\n document.getElementById(\"data\").rows[\"longitude\"].innerHTML = \"Start pushed...\";\r\n}", "function onOffline() {\n\tdeviceIsOnLine = false;\n}", "async updateStatus() {\n let [ status, pressure, holidayStatus ] = await Promise.all([\n this.client.status(),\n this.client.pressure(),\n this.client.holidayMode(),\n ]);\n\n // Update modes and temperatures.\n if (status) {\n // Target temperature depends on the user mode: manual or program.\n let temp = Number(status[ status['user mode'] === 'manual' ? 'temp manual setpoint' : 'temp setpoint' ])\n this.log('...updating status');\n await Promise.all([\n this.setValue(Capabilities.CLOCK_PROGRAMME, status['user mode'] === 'clock'),\n this.setValue(Capabilities.FIREPLACE_MODE, status['fireplace mode']),\n this.setValue(Capabilities.OPERATING_MODE, status['boiler indicator']),\n this.setValue(Capabilities.CENTRAL_HEATING, status['boiler indicator'] === 'central heating'),\n this.setValue(Capabilities.INDOOR_TEMP, status['in house temp']),\n this.setValue(Capabilities.OUTDOOR_TEMP, status['outdoor temp']),\n this.setValue(Capabilities.TARGET_TEMP, temp),\n this.setValue(Capabilities.THERMOSTAT_MODE, {\n 'central heating' : 'heat',\n 'hot water' : 'heat', // hmm...\n }[status['boiler indicator']] || 'off'),\n ]);\n }\n\n if (holidayStatus) {\n this.setValue(Capabilities.HOLIDAY_MODE, holidayStatus.value === 'on');\n }\n\n // Update pressure.\n if (pressure && pressure.unit === 'bar') {\n this.log('...updating pressure', pressure);\n let value = pressure.pressure;\n let alarmActive = value < this.settings.pressureTooLow || value > this.settings.pressureTooHigh;\n\n // If the pressure alarm should be active, but it isn't yet, trigger the flow card.\n if (alarmActive && ! this.getCapabilityValue(Capabilities.ALARM_PRESSURE)) {\n this.log(`...activating pressure alarm (lower limit = ${ this.settings.pressureTooLow }, upper limit = ${ this.settings.pressureTooHigh})`);\n this.driver._triggers[Capabilities.ALARM_PRESSURE].trigger(this, { [ Capabilities.PRESSURE ] : value });\n }\n\n await Promise.all([\n this.setValue(Capabilities.PRESSURE, value),\n this.setValue(Capabilities.ALARM_PRESSURE, alarmActive)\n ]);\n }\n }", "function killSensors() {\n stopAccelInterval();\n stopMicInterval();\n return true;\n}", "function turnOffWater(){\n console.log(\"Turn water OFF\")\n var request = http.get('http://'+edison_hostname+':8080/turn_off_water', function(res) {\n }).on('error', function(e) {\n console.error(e);\n });\n request.setTimeout( 10000, function( ) {\n console.error(\"turnOffWater Timeout Error: no response for sensor network gateway\");\n data_new_status = \"Error: turnOffWater Failed. no response for Sensor Network Gateway\"\n });\n}", "function statusOnline(){\n offline = false;\n $('#create-room-dropdown').prop('disabled', false);\n $('#offlineIcon').hide();\n $('#connect').prop('disabled', false);\n $('#annotationToggle').prop('disabled', false);\n $('#canvas-clear').prop('disabled', false);\n}", "_enabledChanged(newValue){if(this.annyang){if(newValue){if(this.auto){this.annyang.start({autoRestart:!0,continuous:!0})}else{this.annyang.start()}}else{this.annyang.abort()}}}", "disable(){\n this.presence.status = AVAILABLE;\n }", "function checkLightAndGesture() {\n\n // Check for no light and new gestures\n sensorThread = setInterval(function() {\n \n // Check light sensor\n var light = gs.readAmbientLight();\n if (DEBUG >= 2) {\n console.log(\"Light: \" + light);\n }\n if ((display === false) && (light >= LIGHT_THRESHOLD_HIGH)) {\n if (DEBUG >= 1) {\n console.log(\"Lights on. Finding weather.\");\n }\n display = true;\n updateWeather();\n } else if ((display === true) && (light <= LIGHT_THRESHOLD_LOW)) {\n if (DEBUG >= 1) {\n console.log(\"Lights off. Goodbye.\");\n }\n display = false;\n state = STATE_CURRENT;\n clearTime();\n clearString();\n lcdTime = null;\n lcdString = null;\n }\n\n // Check for gestures and update state if gesture found\n if (display) {\n if (gs.isGestureAvailable()) {\n switch(gs.readGesture()) {\n case apds9960.DIR_LEFT:\n state = (state + 3) % 2;\n if (DEBUG >= 1) {\n console.log(\"LEFT gesture. Now state \" + state);\n }\n updateWeather();\n break;\n case apds9960.DIR_RIGHT:\n state = (state + 1) % 2;\n if (DEBUG >= 1) {\n console.log(\"RIGHT gesture. Now state \" + state);\n }\n updateWeather();\n break;\n default:\n break;\n }\n }\n }\n }, WAIT_GESTURE);\n}", "function disableTelemetry() {\n clearInterval(REPORTING_INTERVAL);\n}", "function __checkEnemyFactoryProductionTick()\n{\n\tfor (var flabel in __camFactoryInfo)\n\t{\n\t\tif (getObject(flabel) !== null && __camFactoryInfo[flabel].enabled === true)\n\t\t{\n\t\t\t__camContinueProduction(flabel);\n\t\t}\n\t}\n}", "function onOffline() {\n $rootScope.$apply(function() {\n $rootScope.online = false;\n });\n }", "function checkIfOnlineUntilWeAre() {\n if (!navigator.onLine) {\n setTimeout(checkIfOnlineUntilWeAre.bind(this), 3000)\n } else {\n this.$apollo.skipAll = false\n }\n}", "function readSensors(done) {\n async.series([\n updateTempIndoor,\n updateTempExternal\n ], done);\n }", "function watchLiveTradingEvents(){\n\tweb3[selectedProvider].eth.net.isListening().then(async () => {\n\t\tif(eventSubscription !== null){ return; }\n\t\teventSubscription = tradingContract.events.allEvents({ fromBlock: 'latest' }).on('data', function (event){\n\t\t\tconst eventName = event.event.toString();\n\n\t\t\tif(eventName !== \"TradeOpenedMarket\" && eventName !== \"TradeCanceledMarket\"\n\t\t\t&& eventName !== \"TradeClosedMarket\" && eventName !== \"TradeLimitExecuted\"\n\t\t\t&& eventName !== \"TpSlUpdated\" && eventName !== \"TradeLimitOpened\"\n\t\t\t&& eventName !== \"TradeLimitCanceled\"){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tevent.triedTimes = 1;\n\n\t\t\tsetTimeout(() => {\n\t\t\t\trefreshOpenTrades(event);\n\t\t\t}, process.env.EVENT_CONFIRMATIONS_SEC*1000);\n\t\t});\n\n\t\tconsole.log(\"Watching trading events\");\n\t}).catch(() => {\n\t\tsetTimeout(() => { watchLiveTradingEvents(); }, 2*1000);\n\t});\n}", "loadTemp() {\n\t\tthis.loadMaxCurrentMinTemp();\n\t\tapiCall('iot/api/temp/hour')\n\t\t\t.then((response) => {\n\t\t\t\tthis.tempData = response;\n\t\t\t\tthis.drawChartTemp();\n\t\t\t});\n\t\twindow.clearInterval(this.interval);\n\t\tthis.interval = window.setInterval(this.loadMaxCurrentMinTemp.bind(this), 1000);\n\t}", "function uponFeedHoldTimer() {\n\tif (buttonLED.readSync() == 1)\n\t\tbuttonLED.writeSync(0);\n\telse\n\t\tbuttonLED.writeSync(1);\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "onEnable() {}", "onOutsideGoodWeather() {\n throw new NotImplementedException();\n }", "function watchBridge() {\n setInterval(() => {\n getBridgeStatus().then(\n () => {\n writeBridgeStatus();\n },\n () => {\n writeBridgeStatus();\n },\n );\n }, 3000);\n}", "function fanSchedule() {\n for (let fan in fans) {\n if (!fans[fan].offSchedule) {\n fans[fan].on = !fans[fan].on\n }\n if (fans[fan].offSchedule) {\n fans[fan].offSchedule = false\n }\n }\n}", "populateForecast() {\n this.forecastService.getForecast()\n .then(data => {\n this.forecastData = data\n this.serviceActive = true;\n }).catch((err) => {\n this.serviceActive = false;\n });\n this.timeService.getTime()\n .then(time => this.lastUpdated = time.format(\"HH:mm:ss\"));\n }", "onInsideGoodWeather() {\n throw new NotImplementedException();\n }", "function trueOrFalse() {\n if (todayWeather === undefined) {\n return false;\n } else {\n return true;\n }\n }", "healthCheck() {\n\t\tlet now = new Date();\n\n\t\t// Iterate over sensors\n\t\tthis.Sensors.forEach((sensor, key) => {\n\t\t\t// Only remove if there is no Homey device associated\n\t\t\tif (sensor.display !== undefined && sensor.raw !== undefined) {\n\t\t\t\tif (!sensor.display.paired && (now - sensor.raw.lastupdate > this.inactiveTime)) {\n\t\t\t\t\tthis.driver.log('Removing', key, 'from display list');\n\t\t\t\t\tthis.Sensors.delete(key);\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t// Iterate over devices\n\t\tthis.Devices.forEach((device, key) => {\n\t\t\t// Check if the device needs to be set unavailable\n\t\t\tlet last = device.getSetting('update');\n\t\t\tlet lastUTC = device.getStoreValue('update');\n\t\t\t// Due to a Homey bug that converts the Date type to String in the store, we have to parse the value\n\t\t\tif (device.getAvailable() && now - Date.parse(lastUTC) > this.inactiveTime) {\n\t\t\t\tthis.driver.log('Marking', key, 'as inactive');\n\t\t\t\tdevice.setUnavailable(this.driver.homey.__('error.no_data', { since: last }))\n\t\t\t\t\t.catch(err => this.driver.error('Cannot mark device as unavailable', err.message))\n\t\t\t\tif (this.activityNotifications & INACTIVE) {\n\t\t\t\t\tthis.driver.homey.notifications.createNotification({\n\t\t\t\t\t\texcerpt: this.driver.homey.__('notification.inactive', { name: device.getName() })\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}", "function statusOffline(){\n offline = true;\n $('#create-room-dropdown').prop('disabled', true);\n $('#offlineIcon').show();\n $('#connect').prop('disabled', true);\n $('#annotationToggle').prop('disabled', true);\n $('#canvas-clear').prop('disabled', true);\n}", "function uponDisabled() {\n\tenableSwitchPushed = false;\n\tbuttonLED.writeSync(0);\n\tconsole.log(\"DISABLED\")\n}", "function periodicActivity() {\n myLed.write(ledState ? 1 : 0);\n ledState = !ledState;\n}", "function _disableWeekends(data, mode) {\n var date = data.date,\n mode = data.mode;\n return mode === 'day' && (date.getDay() === 0 || date.getDay() === 6);\n }", "function check_status() {\n if (!window.controller.settings.en) {\n change_status(0,window.controller.options.sdt,\"red\",\"<p id='running-text' style='text-align:center'>\"+_(\"System Disabled\")+\"</p>\");\n return;\n }\n\n if (window.controller.settings.rd) {\n change_status(0,window.controller.options.sdt,\"red\",\"<p id='running-text' style='text-align:center'>\"+_(\"Rain delay until\")+\" \"+(new Date(window.controller.settings.rdst*1000).toUTCString().slice(0,-4))+\"</p>\");\n return;\n }\n\n if (window.controller.settings.urs && window.controller.settings.rs) {\n change_status(0,window.controller.options.sdt,\"red\",\"<p id='running-text' style='text-align:center'>\"+_(\"Rain detected\")+\"</p>\");\n return;\n }\n\n // Handle open stations\n var open = {};\n $.each(window.controller.status, function (i, stn) {\n if (stn) open[i] = stn;\n });\n\n if (window.controller.options.mas) delete open[window.controller.options.mas-1];\n\n // Handle more than 1 open station\n if (Object.keys(open).length >= 2) {\n var ptotal = 0;\n $.each(open,function (key){\n var tmp = window.controller.settings.ps[key][1];\n if (tmp > ptotal) ptotal = tmp;\n });\n\n var sample = Object.keys(open)[0],\n pid = window.controller.settings.ps[sample][0],\n pname = pidname(pid),\n line = \"<img id='running-icon' width='11px' height='11px' src='img/running.png' /><p id='running-text'>\";\n\n line += pname+\" \"+_(\"is running on\")+\" \"+Object.keys(open).length+\" \"+_(\"stations\")+\" \";\n if (pid!=255&&pid!=99) line += \"<span id='countdown' class='nobr'>(\"+sec2hms(ptotal)+\" \"+_(\"remaining\")+\")</span>\";\n line += \"</p>\";\n change_status(ptotal,window.controller.options.sdt,\"green\",line);\n return;\n }\n\n // Handle a single station open\n var match = false,\n i = 0;\n $.each(window.controller.stations.snames,function (station,name){\n if (window.controller.settings.ps[i][0] && window.controller.status[i] && window.controller.options.mas != i+1) {\n match = true;\n var pid = window.controller.settings.ps[i][0],\n pname = pidname(pid),\n line = \"<img id='running-icon' width='11px' height='11px' src='img/running.png' /><p id='running-text'>\";\n line += pname+\" \"+_(\"is running on station\")+\" <span class='nobr'>\"+name+\"</span> \";\n if (pid!=255&&pid!=99) line += \"<span id='countdown' class='nobr'>(\"+sec2hms(window.controller.settings.ps[i][1])+\" \"+_(\"remaining\")+\")</span>\";\n line += \"</p>\";\n change_status(window.controller.settings.ps[i][1],window.controller.options.sdt,\"green\",line);\n return false;\n }\n i++;\n });\n\n if (match) return;\n\n if (window.controller.settings.mm) {\n change_status(0,window.controller.options.sdt,\"red\",\"<p id='running-text' style='text-align:center'>\"+_(\"Manual mode enabled\")+\"</p>\");\n return;\n }\n\n $(\"#footer-running\").slideUp();\n}", "function disable() {\n $scope.placeholderText = 'Sorry, I\\'m Temporarily Unavailable';\n $scope.idea = '';\n $scope.engineInfo = '';\n $scope.engineUrl = '';\n $scope.getFailed = true;\n }", "function noNetworkDetected(){\n //We have no network and the current network status in the app is network, meaning we have to switch to local load and load local tiles\n if(networkMode == \"network\"){\n onOffline();\n }\n else{\n console.log(\"No network change or unknown error\");\n } \n}", "async function turnOffDeskLampIfNeeded() {\n const {\n autoTurnOffDeskLamp,\n autoTurnOffDeskLampDelay,\n } = await db.getConfig();\n const motionSensorState = await getMotionSensorState();\n const bedTime = await isBedTime();\n\n logger.debug(`turnOffDeskLampIfNeeded()`, {\n autoTurnOffDeskLamp,\n motionSensorState,\n isBedTime: bedTime,\n });\n\n if (autoTurnOffDeskLamp && motionSensorState) {\n const motionSensorLastStateChangeDiff =\n Date.now() - motionSensorState.lastChange;\n if (\n bedTime &&\n motionSensorState.on === false &&\n motionSensorLastStateChangeDiff > 1000 * autoTurnOffDeskLampDelay\n ) {\n logger.info('switching off device: deskLamp');\n mqttClient.publish(topics.deskLamp.cmnd(), '0');\n }\n }\n}", "function waitForNewValue() {\n io.socket.on('newDeviceState', function (deviceState) {\n // if the device is the current device, push the value in the graph\n if (vm.currentDeviceType && deviceState.devicetype === vm.currentDeviceType.id) {\n dataDt.unshift({ x: deviceState.datetime, y: deviceState.value });\n dataDT.pop();\n filter.end = moment(deviceState.datetime).format('YYYY-MM-DD HH:mm:ss');\n filter.start = moment(deviceState.datetime).subtract(globalTime, globalTimeRange).format('YYYY-MM-DD HH:mm:ss');\n $('#daterangepicker').data('daterangepicker').setStartDate(moment(filter.start).format('l[, ]LTS'));\n $('#daterangepicker').data('daterangepicker').setEndDate(moment(filter.end).format('l[, ]LTS'));\n vm.chart.update();\n }\n });\n }", "function disabled(data) {\n var date = data.date,\n mode = data.mode;\n return mode === 'day' && (date.getDay() === 0 || date.getDay() === 6);\n }", "function event_day_status() {\n\tif( $(\"#event_all_day\").is(\":checked\")){\n\t\tblock_hours_event();\n\t} else {\n\t\tunblock_hours_event();\n\t}\n\n\tfunction unblock_hours_event(){\n\t\t$('#event_starts_at_4i').attr('disabled', false);\n\t\t$('#event_starts_at_5i').attr('disabled', false);\n\t\t$('#event_ends_at_4i').attr('disabled', false);\t\t\n\t\t$('#event_ends_at_5i').attr('disabled', false);\n\t}\n\tfunction block_hours_event(){\n\t\t$('#event_starts_at_4i').attr('disabled', true);\n\t\t$('#event_starts_at_5i').attr('disabled', true);\n\t\t$('#event_ends_at_4i').attr('disabled', true);\t\t\n\t\t$('#event_ends_at_5i').attr('disabled', true);\n\t}\n}", "function init_old_status(sensor, clock_time)\r\n{\r\n sensor.old = false; // start with the assumption msg is not old, update will correct if needed\r\n update_old_status(sensor, clock_time);\r\n}", "function onHotFieldChanged() {\n\t\tif (me.getIsHot()) {\n\t\t\tme.makeIntraPageDTRRequest(false);\n\t\t}\n\t}", "_onStop(){\n\t\tthis._isWatching = false\n\t}", "async function turnOnDeskLampIfNeeded() {\n const { autoTurnOnDeskLamp } = await db.getConfig();\n const motionSensorState = await getMotionSensorState();\n\n logger.debug(`turnOnDeskLampIfNeeded()`, {\n autoTurnOnDeskLamp,\n motionSensorState,\n isNightTime: isNightTime(),\n });\n\n if (\n autoTurnOnDeskLamp &&\n isNightTime() &&\n motionSensorState &&\n motionSensorState.on === true\n ) {\n logger.info('switching on device: deskLamp');\n mqttClient.publish(topics.deskLamp.cmnd(), '1');\n }\n}", "function regularActivityMonitor() {\n service.user.active = true;\n service.user.action = Date.now();\n\n publish(EVENT_ACTIVITY);\n\n if (service.user.warning) {\n service.user.warning = false;\n publish(EVENT_KEEPALIVE);\n }\n }", "void turnOff() {\r\n isOn = false;\r\n System.out.println(\"Light on? \" + isOn);\r\n }", "function shown(model) {\n return bool_flag_exists(/* InternalPowerEnabled */0, model);\n }", "function set_temperatures_offline(){\n\t\tlog_temperatures(\"Set temperatures offline\");\n \t$.each(temperatures, function(i, item) {\n\t\t\tif ( item.type==\"text\" ){\n\t\t\t\tlog_temperatures(\"Set temperatures offline - text\");\n \t\t\t$(\"#\"+item.id).text(\"--\");\n \t\t}\n \t\tif ( item.type==\"color\" ){\n\t\t\t\tlog_temperatures(\"Set temperatures offline - color\");\n\t\t\t\t$(\"#\"+item.id).css( item.style, \"#CECECE\" );\n \t\t}\n\t\t\tif( item.type==\"value %\" ){\n\t\t\t\t\tlog_temperatures(\"Set temperatures offline - value %\");\n \t\t\t\t$(\"#\"+item.id).css( item.style, '0%' );\n \t\t} \t\t\t\n\t\t\tif( item.type==\"value 100-%\" ){\n\t\t\t\t\tlog_temperatures(\"Set temperatures offline - value 100-%\");\n \t\t\t\t$(\"#\"+item.id).css( item.style, '100%' );\n \t\t}\n\t\t\tif ( item.type==\"create\" ){\n\t\t\t\tlog_temperatures(\"Set temperatures offline - create\");\n\t\t\t\tif (!isset (() => item.min)) var min=-30;\n\t\t\t\telse var min=item.min;\n\t\t\t\tif (!isset (() => item.max)) var max=90;\n\t\t\t\telse var max=item.max;\n\t\t\t\tif (!isset (() => item.styleX)) var styleX=\"style1\";\n\t\t\t\telse var styleX=item.styleX;\n\t\t\t\ttemperature_update(min, item.id, styleX, min, max);\n\t\t\t\t$(\"#\"+item.id+\"-text\").text(\"--°C\");\n\t\t\t}\n \t});\n }", "function flightFeederCheck() {\n $.ajax('/status.json', {\n success: function(data) {\n if (data.type === \"flightfeeder\") {\n isFlightFeeder = true;\n updatePiAwareOrFlightFeeder();\n }\n }\n })\n}", "function switchwater() {\n clearTimeout(timeout);\n if (this.value === \"on\") {\n showpies()\n d3.select(\".waterswitchlabel\").text(\"hide\");\n }else if(this.value === \"off\"){\n hidepies()\n d3.select(\".waterswitchlabel\").text(\"show\");\n }\n }", "function stopPolling() {\n\t\tticking = false;\n\t}", "function resetVariblesWhenDisable (condition) {\n if (condition) {\n controls = nav = touch = mouseDrag = arrowKeys = autoplay = autoplayHoverPause = autoplayResetOnVisibility = false;\n }\n }", "isSleepFlagSet() {\r\n return sleepTortuga;\r\n }", "function isDisabled() {\n return $scope.tacos <= 0 || // you need positive tacos!\n\n $scope.future || // the time selected is in the future\n\n // also disabled if nothing has changed for existing event\n ($scope.event && $scope.tacos === $scope.event.tacos &&\n $scope.time && $scope.time.unix === $scope.event.time)\n }", "function disableMonitoring($list) {\n var monitor = $list.data('nextlist.nextwebMonitor');\n\n // If a monitor has been set up, stop it\n\n if (monitor) {\n $list.data('nextlist.nextwebMonitor', false);\n\n monitor.stop().get();\n }\n }", "function startWeatherStationApp() {\n\n let PerformanceData = new ConnectionPerformance();\n\n // Get the weather data straight away first\n getWeatherData(PerformanceData);\n\n // Get the bom comparison data\n getBomData();\n\n // Start the refresh timer\n setInterval(getWeatherData, (PerformanceData.RefreshInterval * 1000), PerformanceData);\n\n}", "function enableRunState() {\n\t\t\tif ($scope.actualState == 'RDY' && neumaticaRB.checked) {\n\t\t\t\t$scope.isTestOrReadyDisabled = false;\n\t\t\t} else {\n\t\t\t\t$scope.isTestOrReadyDisabled = true;\n\t\t\t}\n\t\t}", "function activateSmart(){\r\n setInterval(function() {\r\n modeSmart()\r\n console.log(\"Smart Mode ON\");\r\n }, 1000);\r\n}", "function setLiveFeed() {\n var candle = {\n startTime: moment.utc(lastCandle),\n baseVolume: 0.0,\n counterVolume: 0.0,\n count: 0,\n open: 0.0,\n high: 0.0,\n low: 0.0,\n close: 0.0,\n vwap: 0.0,\n openTime: Infinity,\n closeTime: 0\n }\n\n var interval\n\n switch (chartInterval) {\n case ('se'):\n interval = 'second'\n break\n case ('mi'):\n interval = 'minute'\n break\n case ('ho'):\n interval = 'hour'\n break\n case ('da'):\n interval = 'day'\n break\n case ('we'):\n interval = 'week'\n break\n case ('mo'):\n interval = 'month'\n break\n default:\n interval = chartInterval\n }\n\n var viewOptions = {\n base: base,\n counter: counter,\n timeIncrement: interval,\n timeMultiple: multiple,\n incompleteApiRow: candle\n }\n\n if (liveFeed) {\n liveFeed.updateViewOpts(viewOptions)\n } else {\n liveFeed = new OffersExercisedListener(viewOptions, liveUpdate)\n }\n }", "function timebase() {\n\t//timebased will interupt all other routines once started, until shutdown\n\t\n\t//TODO: turn timebase off completely by killing the interval function.\n\tif (timebase_status != \"running\") {\n\t\treturn;\n\t}\n\n\tvar current_hour = date.getHours();\n\tvar current_month = date.getMonth();\n\n\t//Daytime (7:00 - 19:00)\n\tif (current_hour >= 7 && current_hour < 18+season_sunset_offset) {\n\t\t//TODO: fade in from sunrise to sunrise+1hr\n\t\t\n\t\t//TODO: change hue/sat value in feedback loop from color zone sensor!\n\t\t\n\t\t//Turn on when active.\n\t\tif (hasActive(detectionData)) {\n\t\t\tstateChange('on');\n\t\t}\n\t//Nighttime (19:00 - 2:00)\n\t} else if (current_hour >= 18+season_sunset_offset || current_hour < 2) {\n\t\t//TODO: Flux full transition from 19:00 to 21:30\n\t\t\n\t\t//Turn on when active.\n\t\tif (hasActive(detectionData)) {\n\t\t\tstateChange('on');\n\t\t}\n\t}\n\t//Supernight (2:00 - 7:00)\n\telse if (current_hour >= 2 && current_hour < 7) {\n\t\t//Turn on when active.\n\t\t//TODO: only 10% brightness.\n\t\tif (hasActive(detectionData)) {\n\t\t\tstateChange('on'); //TODO: Per zone.\n\t\t}\n\t}\n\n\t//TODO: grab realtime sunrise/set data from internet\n\t//Sunrise accent effect\n\tif (0) {\n\t\t//TODO: Flash accents red, yellow, blue\n\t}\n\n\t//Sunset accent effect\n\tif (0) {\n\t\t//TODO: Flash accents red, yellow, blue\n\t}\n\n\t//TODO: grab data from ical file off the internet every day. \n\t//Calendar effects\n\tif (0) { //if event_start\n\t\t//TODO: Flash accents red, yellow, blue\n\t}\n\n\t//check for securityMode\n\tif (hasActive(detectionData) && securityMode) {\n\t\t//disable it\n\t\tsecurityMode = false;\n\t\t//TODO: Flash welcome home accent pattern.\n\t}\n\n\t//Seasonal changes\n\t//Summer- push sunset back.\n\tif (current_month > 4 || current_month < 9) {\n\t\tseason_sunset_offset = 1.5;\n\t}\n\t\n\t//TODO: Update the light/history database here.\n\t//TODO: Check if database has no records for last 24 hours\n\t//Security Mode: simulate house\n\tif (0) {\n\t\tvar securityMode = true;\n\t\t//TODO: Implment security mode\n\t}\n\t//TODO: Parse duke api for warnings\n\tif (0) {\n\t\t//TODO: Check if it's an updated posting or not, and if so, flash accents red/yellow every 30s until disabled.\n\t}\n\n}", "function onOfflineChanged(isOfflineParam) {\r\n if(isOfflineParam === false) {\r\n isOnline = true;\r\n tryStartRealtimeSync();\r\n }\r\n else {\r\n synchronizer.tryStopRealtimeSync();\r\n isOnline = false;\r\n }\r\n }", "set silenceEvents(status) {\n eventStates.silenceEvents = status? true : false;\n }", "function setLiveFeed() {\n var point = {\n startTime: getAlignedCandle(),\n baseVolume: 0.0,\n counterVolume: 0.0,\n count: 0,\n open: 0.0,\n high: 0.0,\n low: 0.0,\n close: 0.0,\n vwap: 0.0,\n openTime: null,\n closeTime: null\n };\n\n var viewOptions = {\n base: self.base,\n counter: self.counter,\n timeIncrement: 'minute',\n timeMultiple: 15,\n incompleteApiRow: point\n };\n\n liveFeed = new OffersExercisedListener(viewOptions, liveUpdate);\n }", "function AbrirMonitor()\n{\t \n //Monitor de impresiones\n if(ventana_monitor== null)\t\t\t\n ventana_monitor=\"VentanaMonitor\";\n}", "sendStopImpedanceToServer() {\n var message = {};\n this.sendMessageToServer('stopImpedance', message);\n this.top.getDataer().impedanceEnabled = false;\n }", "function temp_sensor() {\r\n var celsius = temp.value();\r\n var fahrenheit = celsius * 9.0/5.0 + 32.0;\r\n console.log(celsius + \" degrees Celsius, or \" +\r\n Math.round(fahrenheit) + \" degrees Fahrenheit\");\r\n\r\n deviceClient.publish(\"status\",\"json\",'{\"d\" : { \"temperature\" : '+ celsius +'}}');\r\n setTimeout(temp_sensor,1000);\r\n\r\n}" ]
[ "0.6020743", "0.5971603", "0.594338", "0.5810529", "0.5806425", "0.5798015", "0.5741471", "0.57410043", "0.57284427", "0.56932485", "0.5642147", "0.5587132", "0.55635566", "0.5557027", "0.5530844", "0.5482341", "0.5441158", "0.54361045", "0.5406808", "0.53965837", "0.5382067", "0.5356996", "0.5355889", "0.53520924", "0.53375095", "0.5335469", "0.53310776", "0.5325361", "0.5324852", "0.53157294", "0.53065825", "0.5298285", "0.52882826", "0.5279502", "0.5247286", "0.5246275", "0.5241815", "0.5237317", "0.5237074", "0.5215147", "0.52143246", "0.5212746", "0.5208857", "0.5193814", "0.51796407", "0.5159848", "0.5159848", "0.5159848", "0.5159848", "0.5159848", "0.5159848", "0.5159848", "0.5159848", "0.5159848", "0.5158769", "0.5153386", "0.5127874", "0.51270765", "0.5112454", "0.50980365", "0.5097783", "0.5096882", "0.5094599", "0.5072232", "0.50719947", "0.50677055", "0.5064897", "0.5061226", "0.5055127", "0.504047", "0.50369155", "0.5036619", "0.50265867", "0.5024868", "0.50210017", "0.50083405", "0.5008159", "0.50048894", "0.5002842", "0.5002352", "0.49843633", "0.49822378", "0.49803823", "0.49799788", "0.49754187", "0.49741343", "0.49665895", "0.49613276", "0.49600843", "0.49596447", "0.49555236", "0.4943814", "0.49432266", "0.4942485", "0.49380377", "0.49361834", "0.49361482", "0.49341375", "0.49259013" ]
0.5816751
4
Function Definitions The OnStateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateUpdate(self, state) { set_view(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\n }", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\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 }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "prepareState() {\n /* ... */\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "function StateManager_Notify_CallBack(itemLoaded, state)\n{\n\t//switch according to state\n\tswitch (state)\n\t{\n\t\tcase __STATE_MANAGER_ON_STATE_READY:\n\t\t\t//is the state fully loaded?\n\t\t\tif (!itemLoaded.Optimise(this, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t\t{\n\t\t\t\t//break out\n\t\t\t\tbreak;\n\t\t\t}\n\t\t//fallthrough\n\t\tcase __STATE_MANAGER_ON_STATE_OPTIMISED:\n\t\t\t//state is ready, set it\n\t\t\tthis.CurrentState = itemLoaded;\n\t\t\t//and process it\n\t\t\tthis.ProcessState();\n\t\t\t//forward this to the background downloader\n\t\t\tthis.DownloadInBackground(itemLoaded);\n\t\t\tbreak;\n\t\tcase __STATE_MANAGER_BACKGROUND_ON_STATE_READY:\n\t\t\t//is the state fully loaded?\n\t\t\tif (!itemLoaded.Optimise(this, __STATE_MANAGER_BACKGROUND_ON_STATE_OPTIMISED))\n\t\t\t{\n\t\t\t\t//break out\n\t\t\t\tbreak;\n\t\t\t}\n\t\t//fallthrough\n\t\tcase __STATE_MANAGER_BACKGROUND_ON_STATE_OPTIMISED:\n\t\t\t//forward this to the background downloader\n\t\t\tthis.DownloadInBackground(itemLoaded);\n\t\t\tbreak;\n\t}\n}", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function State() {\n\n }", "function readyStateHandler() {\n if (isEqualIgnoreCase(\"loaded\", element.readyState) ||\n isEqualIgnoreCase(\"complete\", element.readyState)) {\n callback({type: \"load\"});\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "function setEntityState(entity,state) {\n entity.state = state\n server.baseServer.broadcast('server','entity',{uuid:entity.uuid, state:state})\n }", "async onReady() {\n // Initialize your adapter here\n\n // The adapters config (in the instance object everything under the attribute \"native\") is accessible via\n // this.config:\n \n // initialize internal copy of state variables\n this.setStateInternal('custom_run', 120); // set to 2 min\n this.setStateInternal('custom_suspend', 0); // set to invalid UNIX epoche - no effect\n this.setStateInternal('zone', 1); // set to zone 1\n\n // initialize hc information from controller when api key has been set via config page\n this.readHydrawiseStatus();\n\n /*\n For every state in the system there has to be also an object of type state\n Here a simple template for a boolean variable named \"testVariable\"\n Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables\n */\n\n /* await this.setObjectNotExistsAsync('testVariable', {\n type: 'state',\n common: {\n name: 'testVariable',\n type: 'boolean',\n role: 'indicator',\n read: true,\n write: true,\n },\n native: {},\n });\n */\n\n // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.\n // this.subscribeStates('testVariable');\n // You can also add a subscription for multiple states. The following line watches all states starting with \"lights.\"\n // this.subscribeStates('lights.*');\n // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system:\n // this.subscribeStates('*');\n\n this.subscribeStates('*');\n\n /*\n setState examples\n you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd)\n */\n // the variable testVariable is set to true as command (ack=false)\n\n // -- await this.setStateAsync('testVariable', true);\n\n // same thing, but the value is flagged \"ack\"\n // ack should be always set to true if the value is received from or acknowledged from the target system\n\n // -- await this.setStateAsync('testVariable', { val: true, ack: true });\n\n // same thing, but the state is deleted after 30s (getState will return null afterwards)\n\n // -- await this.setStateAsync('testVariable', { val: true, ack: true, expire: 30 });\n\n // examples for the checkPassword/checkGroup functions\n // let result = await this.checkPasswordAsync('admin', 'iobroker');\n // this.log.info('check user admin pw iobroker: ' + result);\n // result = await this.checkGroupAsync('admin', 'admin');\n // this.log.info('check group user admin group admin: ' + result);\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "_onChangeState() {\n\n\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\n }", "stateChanged(state) {\n this._competitors = competitorsWithEventsSelector(state);\n this._couples = couplesSelector(state);\n this._events = EventsWithCouplesSelector(state);\n this._offbeat = state.form.offbeat.competing;\n this._offbeat_team = OffbeatTeamSelector(state);\n this._basic_information = state.form.basic_information;\n this._form = state.form;\n this._total_entry_fee = total_entry_fee(this._competitors);\n }", "function respondToState(){\n\t\t_oldUrl = _currentUrl;\n\t\tif(_useAPI) _currentUrl = cleanUrl(window.location.pathname || \"\");\n\t\telse _currentUrl = cleanUrl(window.location.hash || \"\");\n\t\t//Remove slash in beginning\n\t\tif(_currentUrl == \"/\") _currentUrl = \"\";\n\t\telse if(_currentUrl.indexOf(\"/\") == 0) _currentUrl = _currentUrl.substr(1);\n\t\t//Add slash in end\n\t\tif(_currentUrl.substr(_currentUrl.length-1) != \"/\") _currentUrl = _currentUrl+\"/\";\n\t\tif(_allowCookies || _firstTime) track(); //Track first page. After that only when cookies have been accepted.\n\t\tsetCanonical();\n\t\treadParameters();\n\t\tif(!_firstTime && _oldUrl == _currentUrl){\n\t\t\t//console.log(\"Same url firing statechange\", _oldUrl);\n\t\t\twindow.dispatchEvent(GLBCustomEvent(\"subPageChange\", 0));\n\t\t\treturn;\n\t\t}\n\t\t_firstTime = false;\n\t\tsetTitle();\n\t\t//Pages listening can animIn/Out\n\t\twindow.dispatchEvent(GLBCustomEvent(\"pageChange\", 0));\n\t}", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "function CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "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 }", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "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 }", "during_setup(e) {\n\t\tlet state = e.state;\n\t\tif (state === undefined) state = this.old_state;\n\t\tthis.enter(state);\n\t}", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function setupStateEvents() {\n\n state.listenTo(engineChannel, 'setup', function(engineOptions) {\n state.set(engineOptions);\n });\n\n state.listenTo(engineChannel, \"ready\", function(args) {\n state.set({\n state: state.states.READY,\n });\n\n // autoplay after ready\n // needs timeout, otherwise players sometimes\n // won't work, should not be done on mobile\n // as a user interaction is requred there to start\n // the player\n if (state.get(\"autoplay\")) {\n setTimeout(function() {\n engineChannel.command(\"play\");\n }, 200);\n }\n\n // auto open marker when set\n // do not auto open marker on mobile\n if (state.get(\"auto_open_marker\") && state.get(\"platform\") !== state.platforms.MOBILE) {\n setTimeout(function() {\n showMarkerContent(state.get(\"auto_open_marker\"));\n }, 200);\n }\n });\n\n state.listenTo(engineChannel, \"playing\", function() {\n state.set({\n state: state.states.PLAYING,\n has_played: true,\n reduced_ui: false\n });\n });\n\n state.listenTo(engineChannel, \"paused\", function() {\n state.set({\n state: state.states.PAUSED,\n controls_collapsed: false\n });\n });\n\n state.listenTo(engineChannel, \"ended\", function() {\n state.set({\n state: state.states.ENDED,\n play_progress: state.duration\n });\n\n // show endscreen\n if (state.get(\"mode\") === state.modes.PLAYER ||\n state.get(\"mode\") === state.modes.PREVIEW) {\n state.set({\n endscreen_showing: true\n });\n }\n });\n\n\n state.listenTo(engineChannel, \"buffering\", function() {\n state.set({\n state: state.states.BUFFERING,\n });\n });\n\n state.listenTo(engineChannel, \"volume_change\", function(volume) {\n state.set({\n volume: volume\n });\n });\n\n state.listenTo(engineChannel, \"buffer_progress\", function(progress) {\n updateBufferProgress(progress);\n });\n\n state.listenTo(engineChannel, \"play_progress\", function(progress) {\n updatePlayProgress(progress);\n });\n\n state.listenTo(engineChannel, \"duration_change\", function(duration) {\n state.set({\n 'duration': duration\n });\n video.set({\n 'duration': duration\n });\n });\n\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "async onReady() {\n\t\tthis.log.debug(\"[onReady] deleteDeadLinkedObjects: '\" + this.config.deleteDeadLinkedObjects + \"'\");\n\n\n\t\t// Initialize your adapter here\n\t\tawait this.initialObjects()\n\n\t\t// subscribe für alle Objekt, um Änderungen die diesen Adapter betreffen mitzubekommen\n\t\tthis.subscribeForeignObjects(\"*\");\n\n\t\t// The adapters config (in the instance object everything under the attribute \"native\") is accessible via\n\t\t// this.config:\n\t\t// this.log.info(\"config option1: \" + this.config.option1);\n\t\t// this.log.info(\"config option2: \" + this.config.option2);\n\n\n\n\t\t/*\n\t\tFor every state in the system there has to be also an object of type state\n\t\tHere a simple template for a boolean variable named \"testVariable\"\n\t\tBecause every adapter instance uses its own unique namespace variable names can't collide with other adapters variables\n\t\t*/\n\t\t// await this.setObjectAsync(\"testVariable\", {\n\t\t// \ttype: \"state\",\n\t\t// \tcommon: {\n\t\t// \t\tname: \"testVariable\",\n\t\t// \t\ttype: \"boolean\",\n\t\t// \t\trole: \"indicator\",\n\t\t// \t\tread: true,\n\t\t// \t\twrite: true,\n\t\t// \t},\n\t\t// \tnative: {},\n\t\t// });\n\n\n\n\t\t/*\n\t\tsetState examples\n\t\tyou will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd)\n\t\t*/\n\t\t// the variable testVariable is set to true as command (ack=false)\n\t\t// await this.setStateAsync(\"testVariable\", true);\n\n\t\t// same thing, but the value is flagged \"ack\"\n\t\t// ack should be always set to true if the value is received from or acknowledged from the target system\n\t\t// await this.setStateAsync(\"testVariable\", { val: true, ack: true });\n\n\t\t// same thing, but the state is deleted after 30s (getState will return null afterwards)\n\t\t// await this.setStateAsync(\"testVariable\", { val: true, ack: true, expire: 30 });\n\n\t\t// examples for the checkPassword/checkGroup functions\n\t\t// let result = await this.checkPasswordAsync(\"admin\", \"iobroker\");\n\t\t// this.log.info(\"check user admin pw ioboker: \" + result);\n\n\t\t// result = await this.checkGroupAsync(\"admin\", \"admin\");\n\t\t// this.log.info(\"check group user admin group admin: \" + result);\n\t}", "function PendingPlayerState() { }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "function State() { }", "stateChanged(state) { }", "function sensor_IsAvailableChanged(args) {\n if (sensor.isAvailable) {\n console.log(\"status changed: Running\");\n }\n else {\n console.log(\"status changed: Kinect not available!\");\n }\n }", "function stateChange(e) {\n setArticleParams();\n getArticle();\n }", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\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 }", "setStateForList(readyList, newState) {\n for (let i = 0; i < readyList.length; i++) {\n let listItem = readyList[i];\n this.dependencyGraph.setBootDependencyState(listItem.name, newState);\n }\n }", "get state() {\n return this._wantedState;\n }", "function WI4_State_Notify_CallBack(item, state)\n{\n\t//switch according to state\n\tswitch (state)\n\t{\n\t\tcase __WI4_LESSON_STATE_RESOURCES_DOWNLOADED:\n\t\t\t//proceed directly to sim optimisation\n\t\t\tthis.InitialiseSimulation();\n\t\t\tbreak;\n\t\tcase __WI4_LESSON_STATE_SIM_READY:\n\t\t\t//proceed directly to sim optimisation\n\t\t\tthis.InitialiseTutorial();\n\t\t\tbreak;\n\t\tcase __WI4_LESSON_STATE_TUT_READY:\n\t\t\t//proceed directly to sim optimisation\n\t\t\tthis.Fire_Optimised();\n\t\t\tbreak;\n\t}\n}", "function updateState() {\n //create our state object and notify our listener\n var state = {\n currentUniverseTime: new Date(currentUniverseTime)\n };\n\n fireStateChanged(state);\n\n // call update() again in a certain number of milliseconds\n updateStateTimeout = setTimeout(function () {\n updateState();\n }, timeBetweenStateUpdatesMs);\n }", "async updateState() {\n const stateResponses = await Promise.all([\n this.bulb.getLightState(),\n this.bulb.getDeviceInfo()\n ]).catch(err => {\n console.error(err.message);\n generateErrorQRCode(`Could not get status of ${deviceName}`);\n });\n const newState = lifxStateToCapstone_Yeet(\n stateResponses[0],\n stateResponses[1]\n );\n\n if (!_.isEqual(this.bulbState, newState)) {\n // the light bulb state has changed\n console.debug(\"State has changed\");\n this.bulbState = newState;\n // TODO: remove console.log once we can correctly pad the image. Instead\n // of logging this object, we will display it on the e-ink display.\n generateQRCode(this.bulbState);\n }\n }", "setStateForList(readyList, newState) {\n for (let i = 0; i < readyList.length; i++) {\n let listItem = readyList[i];\n this.dependencyGraphs[this.currentStage].setBootDependencyState(listItem.name, newState);\n }\n }", "setReady() {\n this.currentState = cpState.READY;\n }", "get readyState() {\n return internalSlots.get(this).readyState;\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}", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "function readyState(state) {\n switch (state) {\n case 0: return 'UNSENT'; // UNSENT\tClient has been created. open() not called yet.\n case 1: return 'OPENED'; // open() has been called.\n case 2: return 'HEADERS_RECEIVED'; // send() has been called, and headers and status are available.\n case 3: return 'LOADING'; // Downloading; responseText holds partial data.\n case 4: return 'DONE';\n }\n return 'Unknown';\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function History_UpdateLastStateLoaded()\n{\n\t//by default the last loaded State is the current one\n\tthis.LastLoadedStateIndex = this.CurrentStateIndex;\n\t//get the current State\n\tvar wi4State = __SIMULATOR.StateManager.CurrentState;\n\t//create a map of previously processed ids\n\tvar mapIds = {};\n\t//create a copy of states loaded\n\tvar states = this.States.slice();\n\t//while the state is valid\n\twhile (wi4State != null)\n\t{\n\t\t//get the next default action StateId\n\t\tvar nextStateId = wi4State.ListOfPaths.length > 0 ? wi4State.ListOfPaths[0].Destiny : null;\n\t\t//no id? or already processed?\n\t\tif (!nextStateId || mapIds[nextStateId])\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//mark id as processed\n\t\tmapIds[nextStateId] = true;\n\t\t//get the State\n\t\twi4State = __CACHE.Has_State(nextStateId);\n\t\t//invalid?\n\t\tif (!wi4State)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//not yet ready?\n\t\tif (!wi4State.Optimised)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//increment last loaded State index\n\t\tthis.LastLoadedStateIndex++;\n\t\t//push this message into our array\n\t\tstates.push(wi4State);\n\t}\n\t//now update the controller\n\t__SIMULATOR.NotifyControllerHistory(states);\n}", "async setState(state) {\n\n const chrChanged = !this.state || this.state.chr1 !== state.chr1 || this.state.chr2 !== state.chr2\n this.state = state\n // Possibly adjust pixel size\n const minPS = await this.minPixelSize(this.state.chr1, this.state.chr2, this.state.zoom)\n this.state.pixelSize = Math.max(state.pixelSize, minPS)\n\n let hicEvent = new HICEvent(\"LocusChange\", {\n state: this.state,\n resolutionChanged: true,\n chrChanged: chrChanged\n })\n\n this.update(hicEvent)\n this.eventBus.post(hicEvent)\n }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "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 }" ]
[ "0.7704675", "0.7704675", "0.73346126", "0.73346126", "0.73346126", "0.73346126", "0.72721875", "0.7176626", "0.7009106", "0.6889444", "0.6889444", "0.6889444", "0.6869495", "0.67982274", "0.67252123", "0.6632525", "0.6394417", "0.6394417", "0.63082206", "0.6292552", "0.61473835", "0.6141956", "0.59371936", "0.5918141", "0.59059924", "0.58960885", "0.5803056", "0.57755524", "0.57596254", "0.5748427", "0.5707672", "0.5691283", "0.56559426", "0.5655815", "0.5622376", "0.56165963", "0.55958396", "0.554972", "0.55478", "0.55150586", "0.5504355", "0.5490838", "0.5488543", "0.5488449", "0.54419744", "0.54259205", "0.5409937", "0.54086024", "0.53987914", "0.5368141", "0.53581536", "0.5353007", "0.5345357", "0.5344242", "0.53414637", "0.53403467", "0.533912", "0.53329515", "0.5322322", "0.5321859", "0.5320879", "0.53183985", "0.53143656", "0.53058773", "0.5304894", "0.53038764", "0.52968043", "0.52940226", "0.5288475", "0.5267473", "0.52664065", "0.52583325", "0.5252063", "0.5242772", "0.52391726", "0.52386475", "0.5234952", "0.52320004", "0.52235335", "0.5222854", "0.52226156", "0.5211871", "0.52058023", "0.52056354", "0.5184789", "0.51796967", "0.5175523", "0.5169247", "0.5162064", "0.5162064", "0.5162064", "0.5162064", "0.5162064", "0.5162064", "0.5162064", "0.51613766", "0.51613766", "0.51613766", "0.51613766", "0.51613766", "0.51613766" ]
0.0
-1
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { activateChart(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "is_available() {\n return this._time_until_arrival === 0;\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() {\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "get state() { return this._state; }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function PendingPlayerState() { }", "function getState() {\n return currentState\n }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\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}", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\n }" ]
[ "0.73263496", "0.73263496", "0.69666564", "0.69666564", "0.69666564", "0.69666564", "0.69242686", "0.67867565", "0.6622723", "0.65812755", "0.65421313", "0.64862347", "0.64862347", "0.64862347", "0.6309391", "0.61906636", "0.6169924", "0.61518246", "0.6123605", "0.59421873", "0.5932553", "0.5869572", "0.5811763", "0.5764933", "0.5746332", "0.556938", "0.555641", "0.5555897", "0.5540687", "0.55305237", "0.5530093", "0.5522056", "0.54850596", "0.5466556", "0.54611707", "0.5437682", "0.54325587", "0.5408254", "0.53596854", "0.5348431", "0.533953", "0.53275734", "0.532602", "0.5314587", "0.53055376", "0.5303056", "0.5300407", "0.5296953", "0.52829117", "0.5279252", "0.5278641", "0.5247946", "0.5232341", "0.52217716", "0.5218495", "0.519629", "0.51826835", "0.51684505", "0.5160943", "0.5155316", "0.51273805", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.51263195", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.5122927", "0.51218396", "0.51157993", "0.51140946", "0.51108533", "0.510516", "0.5104229", "0.5093132", "0.5090761", "0.50883734", "0.5083589", "0.5083242", "0.50764996", "0.50758314", "0.5073467", "0.5071194", "0.5064031", "0.5060456", "0.50572383", "0.50564873" ]
0.5981676
20
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { set_value(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "is_available() {\n return this._time_until_arrival === 0;\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() {\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "get state() { return this._state; }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function getState() {\n return currentState\n }", "function PendingPlayerState() { }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\n });\n }", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\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}" ]
[ "0.73284537", "0.73284537", "0.69259375", "0.67887646", "0.6624645", "0.6582675", "0.6543231", "0.64882874", "0.64882874", "0.64882874", "0.6310826", "0.61924905", "0.61697924", "0.6152262", "0.61256355", "0.59825474", "0.59825474", "0.59441656", "0.59334165", "0.58703524", "0.5812972", "0.5767012", "0.5748212", "0.5572398", "0.55584735", "0.5557278", "0.5542185", "0.55319697", "0.553168", "0.5523791", "0.5485897", "0.546795", "0.54612017", "0.54394805", "0.5432816", "0.54087967", "0.5362138", "0.5349434", "0.53403175", "0.5328465", "0.53275925", "0.5314701", "0.5307756", "0.5303114", "0.5300636", "0.5298146", "0.5284738", "0.528118", "0.5280208", "0.5248322", "0.5234217", "0.5223634", "0.52198535", "0.51990974", "0.5183913", "0.51713073", "0.5161884", "0.5157174", "0.5127759", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.5127462", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51240295", "0.51230013", "0.5116265", "0.5115621", "0.5112343", "0.5108151", "0.51054466", "0.50952965", "0.50936013", "0.50914204", "0.5086041", "0.50854415", "0.5078339", "0.5077041", "0.50749135", "0.50737333", "0.50647634", "0.50607073", "0.50582945", "0.50582737" ]
0.69686985
5
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnChange(self, state) { date = self.ViewModel.DateValue() time = self.ViewModel.TimeValue() args = self.parameters.post_service if (self.has_date && self.has_time) { args["datetime"] = self.state datetime = new Date(self.state); args["date"] = date; args["time"] = time; } else if (self.has_date) { args["date"] = date; } else { args["time"] = time; } self.call_service(self, args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "is_available() {\n return this._time_until_arrival === 0;\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() {\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "get state() { return this._state; }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function PendingPlayerState() { }", "function getState() {\n return currentState\n }", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\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}", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\n }" ]
[ "0.73274463", "0.73274463", "0.6967985", "0.6967985", "0.6967985", "0.6967985", "0.6925284", "0.6787534", "0.6623425", "0.6582334", "0.6542602", "0.64877796", "0.64877796", "0.64877796", "0.6310058", "0.619203", "0.6170058", "0.6153031", "0.61245376", "0.59818846", "0.59818846", "0.5943621", "0.5933697", "0.5870427", "0.5811876", "0.5766914", "0.5748227", "0.5570774", "0.55581635", "0.5558034", "0.5541886", "0.5531565", "0.5530949", "0.55225515", "0.5484103", "0.5468354", "0.5461506", "0.5438742", "0.54325235", "0.54093593", "0.5362142", "0.5349483", "0.53398705", "0.5329074", "0.53271854", "0.53151745", "0.5307406", "0.53042686", "0.5299711", "0.52986187", "0.5285319", "0.52817124", "0.52805424", "0.5248744", "0.5234892", "0.52231735", "0.521873", "0.51973176", "0.5183866", "0.5169534", "0.5162706", "0.51578194", "0.5128252", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512205", "0.51165766", "0.51158655", "0.51134557", "0.5106774", "0.5104787", "0.5095654", "0.50918406", "0.50904435", "0.5085502", "0.50843567", "0.5076612", "0.50762933", "0.50742906", "0.5072274", "0.50646263", "0.506271", "0.5059175", "0.50572634" ]
0.0
-1
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state
function OnStateAvailable(self, state) { self.state = state.state; if ("brightness" in state.attributes) { self.level = state.attributes.brightness } else { self.level = 0 } set_view(self, self.state, self.level) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n self.options = state.attributes.options;\n set_options(self, self.options, state);\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\n }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\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 }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "prepareState() {\n /* ... */\n }", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "get state() {\n return this._wantedState;\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 }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\n }", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "is_available() {\n return this._time_until_arrival === 0;\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "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}", "function State() {\n\n }", "function CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "function isInitState( state ) { \n return ( _.isUndefined( state.data ) && _.isUndefined( state.lm ) && _.isUndefined( state.error ) );\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() {\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 isFinalState() {\n return getReachableStates().every((state) => state === currentState);\n }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "function expectStateInit(ae) {\n\n expect(ae.state).toBe(States.init);\n\n expect(ae.isUnstarted).toBe(false);\n expect(ae.isExecuting).toBe(true);\n\n expectStatesSharedUnsettled(ae);\n }", "function initial_state(state){\n let servers = Object.keys(state[\"val\"][\"configTerm\"]);\n return forall((sid) => state[\"val\"][\"configTerm\"][sid]==0 && state[\"val\"][\"configVersion\"][sid]==1, servers)\n}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\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}", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "function PendingPlayerState() { }", "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 }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "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 }", "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}", "function readyStateHandler() {\n if (isEqualIgnoreCase(\"loaded\", element.readyState) ||\n isEqualIgnoreCase(\"complete\", element.readyState)) {\n callback({type: \"load\"});\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 }", "get available() {\n return this.state.timeout === 0;\n }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "setReady() {\n this.currentState = cpState.READY;\n }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\n });\n }", "get _isReady() {\n return this._renderer != undefined && this._element != undefined && this._changeDetector != undefined;\n }", "initInteractionState() {\n this.dirty = false;\n this.prefilled = !this._isEmpty();\n }" ]
[ "0.73120666", "0.73120666", "0.6977355", "0.6977355", "0.6977355", "0.6977355", "0.69324744", "0.6648962", "0.65847546", "0.65548795", "0.6477568", "0.64274395", "0.64274395", "0.64274395", "0.6298585", "0.61558354", "0.61416197", "0.60750127", "0.6050499", "0.5945708", "0.5945708", "0.5785237", "0.57843417", "0.57686096", "0.5715075", "0.5565749", "0.5552406", "0.55439645", "0.54876244", "0.5476721", "0.5470085", "0.54559875", "0.545179", "0.54497206", "0.5448856", "0.5446182", "0.5419496", "0.5382453", "0.5371824", "0.5340469", "0.5309876", "0.53038085", "0.52908224", "0.5283825", "0.5277284", "0.5270195", "0.5260563", "0.5247656", "0.523289", "0.5227561", "0.5214361", "0.5198322", "0.5197657", "0.5180513", "0.51769507", "0.51696837", "0.51696837", "0.51696837", "0.51696837", "0.51696837", "0.51696837", "0.51696837", "0.51696837", "0.51696837", "0.51696837", "0.5166392", "0.5166392", "0.5166392", "0.5166392", "0.5166392", "0.5166392", "0.5166392", "0.5166392", "0.5166392", "0.5161896", "0.5161497", "0.5161385", "0.5156102", "0.51514626", "0.5134924", "0.51215863", "0.5119225", "0.5117464", "0.51107603", "0.51049894", "0.5104933", "0.50977606", "0.5095956", "0.50955176", "0.5093299", "0.5092408", "0.5092408", "0.5085803", "0.50808823", "0.5072297", "0.50691265", "0.5068526", "0.5065393", "0.5055002", "0.5044604" ]
0.6047937
19
The OnStateUpdate function will be called when the specific entity receives a state update its new values will be available in self.state[] and returned in the state parameter
function OnStateUpdate(self, state) { self.state = state.state; if ("brightness" in state.attributes) { self.level = state.attributes.brightness } else { self.level = 0 } set_view(self, self.state, self.level) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "stateChanged(state) {\n this._name = state.profile.name;\n this._position = state.profile.position;\n this._skill = state.profile.skill;\n this._saved = state.profile.saved;\n }", "update() {\n BaseState.update.call(this);\n }", "function OnStateUpdate(self, state)\n {\n if (!(\"ignore_state\" in self.parameters) || self.parameters.ignore_state === 0)\n {\n self.state = state.state;\n set_view(self, self.state)\n }\n }", "function updateState() {\n gState.push({\n board: copyMat(gBoard),\n shownCount: gGame.shownCount,\n markedCount: gGame.markedCount,\n lives: gGame.lives,\n safeClick: gGame.safeClick,\n hints: gGame.hints,\n manualMode: gGame.isManualOn,\n gManualMode: gManualMode.isManualOn\n });\n}", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "function updateState() {\n //create our state object and notify our listener\n var state = {\n currentUniverseTime: new Date(currentUniverseTime)\n };\n\n fireStateChanged(state);\n\n // call update() again in a certain number of milliseconds\n updateStateTimeout = setTimeout(function () {\n updateState();\n }, timeBetweenStateUpdatesMs);\n }", "stateChanged(state) { }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n\n delay_time = self.parameters.update_delay;\n if (delay_time !== undefined) {\n if (self.timeout !== undefined) {\n clearTimeout(self.timeout);\n }\n\n self.timeout = setTimeout(function() {set_view(self, self.state)}, delay_time * 1000);\n } else {\n set_view(self, self.state);\n }\n }", "_onChangeState() {\n\n\n }", "function setEntityState(entity,state) {\n entity.state = state\n server.baseServer.broadcast('server','entity',{uuid:entity.uuid, state:state})\n }", "function _updateState(state, payload) {\n $log.debug(\"=== State changed ===\");\n $log.info(state);\n $log.debug(payload);\n\n $rootScope.$emit(HOTEL_STATES, {\n state: state,\n payload: angular.copy(payload)\n });\n }", "stateChanged(_state) { }", "stateChange(state){\n\t\tLogger.info(`Ably realtime state changed to: ${state.current}`);\n\t}", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "stateChanged(state) {\n }", "async updateState(state) {\n let key = this.ctx.stub.createCompositeKey(this.name, [state.getKey()]);\n let data = Utils.serialize(state);\n await this.ctx.stub.putState(key, data);\n }", "changeState(state) {\r\n for (let key in this.states){\r\n // console.log(this.states[key])\r\n if (key==state) {\r\n this.statesStack.append(this.state);\r\n this.state=state;\r\n this.undoStack.clear();\r\n return this;\r\n }\r\n } \r\n throw new Error();\r\n }", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "function updateEntityState (entity, nextState) {\n\t entity.pendingState = assign(entity.pendingState, nextState)\n\t entity.dirty = true\n\t invalidate()\n\t }", "_onChange() {\n this.setState(getAllState())\n }", "getUpdatedState(props, state) {\n return this.state.getUpdatedState(props, state);\n }", "get state() { return this._state; }", "getState(){\n super.getState();\n this.state['amount'] = this.#amount;\n\n return this.state;\n }", "handle() {\n if(!this.enabled)\n return;\n\n Object.assign(this.previousState, this.state); // Save the previous state\n this.update(); // Update the current state\n this.notify();\n }", "function updateEntityState (entity, nextState) {\n entity.pendingState = assign(entity.pendingState, nextState)\n entity.dirty = true\n invalidate()\n }", "updateState(newState) {\n this.setState(newState);\n }", "_stateChanged(state) {\n console.log(state);\n }", "stateChanged(state) {\n this._competitors = competitorsWithEventsSelector(state);\n this._couples = couplesSelector(state);\n this._events = EventsWithCouplesSelector(state);\n this._offbeat = state.form.offbeat.competing;\n this._offbeat_team = OffbeatTeamSelector(state);\n this._basic_information = state.form.basic_information;\n this._form = state.form;\n this._total_entry_fee = total_entry_fee(this._competitors);\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function onStateUpdate(nState) {\n for (var pid in state.players) {\n if (!(pid in nState.players)) // player vanishes\n onPlayerQuit(pid);\n }\n\n for (var pid in nState.players) {\n if (pid == ws._id) continue; // skip ourself\n\n if (!(pid in state.players)) { // player appears\n onPlayerJoin(pid, nState.players[pid]);\n }\n\n var p = nState.players[pid];\n if (p.state == 'player') { // update non-ghost\n onPlayerUpdate(pid, p);\n }\n }\n}", "function OnStateUpdate(self, state)\n {\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n }", "get state() {\n return this._obj.state;\n }", "get state(){return this._state;}", "get state(){return this._state;}", "get state(){return this._state;}", "stateChanged(state){\n this.targetFood = state.targetFood;\n }", "changeState(state) {\r\n if(this.getStates().indexOf(state) != -1){\r\n if(this.prevState[this.prevState.length - 1] != this.state)\r\n this.prevState.push(this.state);\r\n this.state = state;\r\n }else throw new Error(\"\")\r\n }", "setState(updateObject) {\n this.setChangeFlags({stateChanged: true});\n Object.assign(this.state, updateObject);\n this.setNeedsRedraw();\n }", "function getState() {\n return state;\n }", "stateChanged(state) {\n this._clicks = state.counter.clicks;\n this._value = state.counter.value;\n }", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "get state() {\r\n return this._state;\r\n }", "getState() {\n return this.state;\n }", "function updateState(state) {\n cellClientProps = updateCellClientProps(state, cellClientProps);\n //draw a white background\n background(255, 255, 255);\n\n for (var playerId in state.players) {\n if (state.players.hasOwnProperty(playerId)) {\n let plyr = state.players[playerId];\n let color = plyr.blob.color;\n stroke(color[0],color[1],color[2]);\n for (var i=0; i<plyr.blob.cellInds.length; i++) {\n let c = cellClientProps.ps[plyr.blob.cellInds[i]];\n let a = plyr.blob.amts[i];\n strokeWeight(sqrt(a));\n point(c.x,c.y);\n }\n }\n }\n\n stroke(0);strokeWeight(12);\n for (let i=0; i<cellClientProps.ps.length; i++) {\n let p = cellClientProps.ps[i];\n point(p.x,p.y);\n }\n image(pointer, mouseX, mouseY);\n}", "getState() {\n return state;\n }", "enterState(oldState){}", "function state_update(st) {\n state = st;\n if (callback) {\n callback(st);\n }\n}", "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "get_state() {\n return this.state;\n }", "_onChange() {\n this.setState(getUserState());\n }", "function State() {\n\n }", "function statehandler(key, value) {\n // console.log(\"key:\",key,\"value:\",value)\n // console.log(\"old state:\", user)\n setUser({...user, [key]: value});\n // console.log(\"latest state:\", user)\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "function History_UpdateLastStateLoaded()\n{\n\t//by default the last loaded State is the current one\n\tthis.LastLoadedStateIndex = this.CurrentStateIndex;\n\t//get the current State\n\tvar wi4State = __SIMULATOR.StateManager.CurrentState;\n\t//create a map of previously processed ids\n\tvar mapIds = {};\n\t//create a copy of states loaded\n\tvar states = this.States.slice();\n\t//while the state is valid\n\twhile (wi4State != null)\n\t{\n\t\t//get the next default action StateId\n\t\tvar nextStateId = wi4State.ListOfPaths.length > 0 ? wi4State.ListOfPaths[0].Destiny : null;\n\t\t//no id? or already processed?\n\t\tif (!nextStateId || mapIds[nextStateId])\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//mark id as processed\n\t\tmapIds[nextStateId] = true;\n\t\t//get the State\n\t\twi4State = __CACHE.Has_State(nextStateId);\n\t\t//invalid?\n\t\tif (!wi4State)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//not yet ready?\n\t\tif (!wi4State.Optimised)\n\t\t{\n\t\t\t//end loop\n\t\t\tbreak;\n\t\t}\n\t\t//increment last loaded State index\n\t\tthis.LastLoadedStateIndex++;\n\t\t//push this message into our array\n\t\tstates.push(wi4State);\n\t}\n\t//now update the controller\n\t__SIMULATOR.NotifyControllerHistory(states);\n}", "function getState() {\n return currentState\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "function updateState(stateChange) {\n if (isNaN(stateChange)) {\n console.error(\"Invalid state change\");\n return;\n }\n currState += stateChange;\n currState = currState % states.length;\n console.assert(\n currState >= 0 && currState < states.length,\n \"currState got out of bounds on updateState: \",\n currState\n );\n clearButtons();\n switch (getRoomName()) {\n case \"START\":\n buildStartRoom();\n break;\n case \"GAME\":\n buildGameRoom();\n break;\n case \"RESULTS\":\n buildResultsRoom();\n break;\n }\n}", "updateState(stateChange){\n this.setState(stateChange);\n }", "function getState () {\n\t\treturn currentState;\n\t}", "function getState () {\n return state\n }", "function getState () {\n return state\n }", "async updateState() {\n const stateResponses = await Promise.all([\n this.bulb.getLightState(),\n this.bulb.getDeviceInfo()\n ]).catch(err => {\n console.error(err.message);\n generateErrorQRCode(`Could not get status of ${deviceName}`);\n });\n const newState = lifxStateToCapstone_Yeet(\n stateResponses[0],\n stateResponses[1]\n );\n\n if (!_.isEqual(this.bulbState, newState)) {\n // the light bulb state has changed\n console.debug(\"State has changed\");\n this.bulbState = newState;\n // TODO: remove console.log once we can correctly pad the image. Instead\n // of logging this object, we will display it on the e-ink display.\n generateQRCode(this.bulbState);\n }\n }", "get State() {\r\n return _state;\r\n }", "get State() {\r\n return _state;\r\n }", "getState() {\n return this._state;\n }", "setStateInternal(id, value) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n this.log.info('update state ' + obj + ' with value:' + value);\n currentStateValues[obj] = value;\n }", "get state() {return this._p.state;}", "componentDidUpdate() {\n // debugging\n console.log('___STATE____', this.state);\n }", "subscriberState(EventName, data){\n let key = EventName\n let val = data\n let obj = {}\n obj[key] = val\n //console.log('players in ListPlayers class');\n //console.log(this.state.players);\n this.setState(obj);\n }", "drawState(){\n if(this.getTracer().stateStructure && this.getNode(this.currentId)){\n NodeStateService.process(this.getNode(this.currentId).state_variables);\n }\n }", "function getState() {\n return currentState\n }", "onStateChange() {\n\t\tthis.forceUpdate();\n\t}", "stateChangedCallback(yfct,value)\n { \n \n // memorize the new state\n this._state = (value ==\"B\" ); \n console.log(\"relay change (\"+value+\", state is now \"+this._state);\n // notify the NEEO server about the change\n this.notifyNEEOServer({uniqueDeviceId: this._neeoID, component:this._hwdID, value:this._state} );\n // this.notifyNEEOServer({uniqueDeviceId: \"default\" , component:this._hwdID, value:this._state } );\n }", "changeState(state) {\r\n if(this.config.states[state]) {\r\n this.currentState = state;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('changeState');\r\n } else {\r\n throw new Error('This state does not exist');\r\n }\r\n }", "function updateState(data) {\n updateVoteFinishArea(data.state);\n}", "function updateStateMaps() {\n // XXX\n }", "_handleComponentChange() {\n this.setState(this._getStateFromStore());\n }", "componentDidUpdate() {\n this.lastStateUpdate = Date.now();\n StateLoader.updateLocalStorage(this.state);\n }", "changeState(state) {\r\n\r\n\r\n if (!this.statuses.includes(state)) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = state;\r\n this.history2 = [];\r\n\r\n\r\n }", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "updateState(update) {\n\t\t// console.log(\"Fetching player updates\");\n\n\t\t// Get the ID of the player who triggered this update\n\t\tlet pid = update.pid;\n\t\tlet player = this.stage.getPlayer(pid);\n\n\t\t// Only clients with a player that is still alive can make updates\n\t\tif (player) {\n\t\t\tif (update.type == \"move\") {\n\t\t\t\tplayer.setMovementDirection(update.x, update.y);\n\t\t\t} else if (update.type == \"cursor\") {\n\t\t\t\tplayer.setCursorDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"click\") {\n\t\t\t\tplayer.setFiringDirection(update.x, update.y, update.width, update.height);\n\t\t\t} else if (update.type == \"weapon-toggle\") {\n\t\t\t\tplayer.setWeapon(update.toggle);\n\t\t\t}\n\t\t}\n\t}", "changeState(state) {\r\n if (state !== \"hungry\" && state !== \"busy\" &&\r\n state !== \"sleeping\" && state !== \"normal\") {\r\n throw new Error()\r\n }\r\n\r\n this.state = state;\r\n this.states.push(this.state);\r\n return this.state\r\n }", "enterState (state = this.Data) {\n this.State = state;\n }", "function getState() {\n return currentState\n }" ]
[ "0.7009509", "0.68534744", "0.6797191", "0.6777667", "0.6762109", "0.67258936", "0.6550916", "0.6545304", "0.65175915", "0.6496347", "0.6496347", "0.64727676", "0.6461663", "0.6445238", "0.6439589", "0.64118975", "0.6320825", "0.6306055", "0.6303542", "0.63016874", "0.6285365", "0.6282825", "0.6280129", "0.62705064", "0.6246279", "0.6239824", "0.617191", "0.6155313", "0.6142576", "0.61382014", "0.61327434", "0.6120884", "0.61152405", "0.61039984", "0.61022425", "0.60981375", "0.609331", "0.609331", "0.609331", "0.60666794", "0.6062125", "0.60605764", "0.6051542", "0.6051542", "0.6051542", "0.604841", "0.6022636", "0.60055393", "0.59946054", "0.5993105", "0.5990769", "0.5971433", "0.5964639", "0.5949758", "0.59476376", "0.59469056", "0.5943617", "0.5943289", "0.5941285", "0.59409046", "0.5925987", "0.59224075", "0.5909337", "0.5909337", "0.5909337", "0.5903117", "0.5896227", "0.5888899", "0.5888899", "0.5888899", "0.5888899", "0.5885988", "0.5882826", "0.5881032", "0.58793634", "0.5877613", "0.5877613", "0.58693594", "0.5868696", "0.5868696", "0.5866787", "0.5850707", "0.58501756", "0.58471316", "0.58465624", "0.58458143", "0.58435714", "0.5842507", "0.58421767", "0.5841524", "0.58412343", "0.58382964", "0.5837468", "0.5822576", "0.58216894", "0.5812359", "0.5811018", "0.5808917", "0.5807158", "0.5804163" ]
0.64113444
16
Set view is a helper function to set all aspects of the widget to its current state it is called by widget code when an update occurs or some other event that requires a an update of the view
function set_view(self, state, level) { if (state == "on") { // Set Icon will set the style correctly for an icon self.set_icon(self, "icon", self.icons.icon_on) // Set view will set the view for the appropriate field self.set_field(self, "icon_style", self.css.icon_style_active) } else { self.set_icon(self, "icon", self.icons.icon_off) self.set_field(self, "icon_style", self.css.icon_style_inactive) } if (typeof level == 'undefined') { self.set_field(self, "level", 0) } else { self.set_field(self, "level", Math.ceil((level*100/255) / 10) * 10) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "function setView(newState) {\r\n _updateView(null, newState);\r\n }", "setView(initView) {\n this.view = initView;\n }", "function setView(view){\n\t\t\t\tif(this.currentView){\n\t\t\t\t\tthis.currentView.close();\n\t\t\t\t}\n\t\t\t\tthis.currentView = view;\n\t\t\t\t$('#mainContent').html(view.render().$el);\n\t\t\t}", "updateView() {\n this.viewValue = this.getViewFromValue();\n this.renderView();\n }", "function updateView(newView){\n currentView.value = newView;\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "changeView(option) {\n this.setState({\n view: option,\n });\n }", "changeView(view, data) {\n this.setState({\n currentView: view,\n viewData: data\n });\n }", "set View(value) {}", "setView(state, val = true){\n state.updateView = Math.random();\n }", "function switchView(view){\n setState('vis.0.control.instance', 'FFFFFFFF');\n setState('vis.0.control.data', view);\n setState('vis.0.control.command', 'changeView');\n}", "changeView(view) {\n\n // Close and unbind any existing page view\n if (this.currentView && _.isFunction(this.currentView.close)) {\n this.currentView.close();\n }\n\n // Establish the requested view into scope\n this.currentView = view;\n \n // Re-delegate events (unbound when closed)\n //this.currentView.delegateEvents(this.currentView.events)\n\n Backbone.Radio.channel('app').request('layout').showChildView('main', view);\n }", "changeView(event) {\n this.setState({ view: !this.state.view });\n }", "changeView(value){\n value ? this.setState({view:true}) : this.setState({view:false});\n }", "function updateViews(event) {\n manageContentObjectsByState(event.currentState);\n fillElements(event.currentState);\n setNavigationButtonsDisabledState(event.currentState);\n resetViews();\n }", "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n\n delay_time = self.parameters.update_delay;\n if (delay_time !== undefined) {\n if (self.timeout !== undefined) {\n clearTimeout(self.timeout);\n }\n\n self.timeout = setTimeout(function() {set_view(self, self.state)}, delay_time * 1000);\n } else {\n set_view(self, self.state);\n }\n }", "changeView(view) {\n if (view === 'base') {\n this.setState({\n view: view,\n closest: null\n });\n } else {\n this.setState({\n view: view\n });\n }\n }", "changeView0() {\n this.setState({view: 0});\n }", "function setNewViewState(viewstate) {\n\n\n console.log('D: setting header to: ' + viewstate.header);\n viewModel.viewState.header(viewstate.header);\n\n console.log('D: setting content to: ' + viewstate.content);\n viewModel.viewState.content(viewstate.content);\n\n console.log('D: setting footer to:' + viewstate.footer);\n viewModel.viewState.footer(viewstate.footer);\n }", "setState(newState) {\n if (this.updateState != 0 /* Idle */)\n throw new Error(\"Calls to EditorView.setState are not allowed while an update is in progress\");\n if (this.destroyed) {\n this.viewState.state = newState;\n return;\n }\n this.updateState = 2 /* Updating */;\n let hadFocus = this.hasFocus;\n try {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.viewState = new ViewState(newState);\n this.plugins = newState.facet(viewPlugin).map(spec => new PluginInstance(spec));\n this.pluginMap.clear();\n for (let plugin of this.plugins)\n plugin.update(this);\n this.docView = new DocView(this);\n this.inputState.ensureHandlers(this, this.plugins);\n this.mountStyles();\n this.updateAttrs();\n this.bidiCache = [];\n }\n finally {\n this.updateState = 0 /* Idle */;\n }\n if (hadFocus)\n this.focus();\n this.requestMeasure();\n }", "viewChanged(newValue, oldValue) {\n this.changes.view = newValue;\n requestUpdate(this);\n }", "function setActiveView(view) {\n app.activeView = view;\n }", "updateView() {\n this.render()\n }", "function SetViewChanging(changing) {\n viewChangeInProgress = changing;\n}", "changeView (view) {\n this.setState({role: view});\n }", "function set_view(self, state, level)\n {\n if (state === self.parameters.state_active || (\"active_map\" in self.parameters && self.parameters.active_map.includes(state)))\n {\n self.set_icon(self, \"icon\", self.icons.icon_on);\n self.set_field(self, \"icon_style\", self.css.icon_style_active)\n }\n else\n {\n self.set_icon(self, \"icon\", self.icons.icon_off);\n self.set_field(self, \"icon_style\", self.css.icon_style_inactive)\n }\n if (\"state_text\" in self.parameters && self.parameters.state_text === 1)\n {\n self.set_field(self, \"state_text\", self.map_state(self, state))\n }\n }", "_onChangeView() {\n this.emit(`view`);\n }", "function setView(viewId){\n\tif(viewId){\n\t\t$.fn.viewAs = viewId;\n\t} else {\n\t\tif($.fn.viewAs == 'viewAsIcon'){\n\t\t\t$.fn.viewAs = 'viewAsList';\n\t\t} else {\n\t\t\t$.fn.viewAs = 'viewAsIcon';\n\t\t}\n\t}\n\t\n\t// remove selected class from both\n\t$('#viewAsIcon').removeClass('selected');\n\t$('#viewAsList').removeClass('selected');\n\t\n\t// add selected class to one\n\t$('#' + $.fn.viewAs).addClass('selected');\n\t\n\t// toggle view classes\n\t$('#items').attr('class', $.fn.viewAs);\n}", "setupView() {\n if (this.view === null) { // If this is called, then user has not overwritten this function\n throw new Error(\"RealtimeMultiplayerGame.AbstractClientGame.setupView - Override this method, then call MyClientGame.superclass.setupView()\");\n }\n this.fieldController.setView(this.view);\n }", "_applyItemView(value, old) {\n if (value) {\n this.getStateManager().setState(\"itemView\", value);\n } else {\n this.getStateManager().removeState(\"itemView\");\n }\n }", "function set_view(self, state, level)\n {\n if (\"icons\" in self.parameters)\n {\n if (state in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons[state].icon);\n self.set_field(self, \"icon_style\", self.parameters.icons[state].style)\n }\n else if (\"default\" in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons.default.icon);\n self.set_field(self, \"icon_style\", self.parameters.icons.default.style)\n }\n else\n {\n self.set_icon(self, \"icon\", \"fa-circle-thin\");\n self.set_field(self, \"icon_style\", \"color: white\")\n }\n\n }\n\n if (\"state_text\" in self.parameters && self.parameters.state_text == 1)\n {\n self.set_field(self, \"state_text\", self.map_state(self, state))\n }\n }", "function set_view(self, state, level)\n {\n if (\"icons\" in self.parameters)\n {\n if (state in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons[state].icon);\n self.set_field(self, \"icon_style\", self.parameters.icons[state].style);\n set_service_call(self, self.parameters.icons[state]);\n }\n else if (\"default\" in self.parameters.icons)\n {\n self.set_icon(self, \"icon\", self.parameters.icons.default.icon);\n self.set_field(self, \"icon_style\", self.parameters.icons.default.style);\n set_service_call(self, self.parameters.default);\n }\n else\n {\n self.set_icon(self, \"icon\", \"fa-circle-thin\");\n self.set_field(self, \"icon_style\", \"color: white\");\n set_service_call(self, {});\n }\n\n }\n\n if (\"state_text\" in self.parameters && self.parameters.state_text == 1)\n {\n self.set_field(self, \"state_text\", self.map_state(self, state))\n }\n }", "function refreshView() {\n\tchangeView(currentView[0], currentView[1], true);\n}", "setView() {\n this.view = new ol.View({\n projection: this.projection,\n center: ol.extent.getCenter(this.extent),\n zoom: 1,\n maxZoom: 8,\n maxResolution: 1.4\n });\n }", "_viewEvent(view) {\n\t if (view !== this._view) {\n\t // Action for different view - ignore it\n\t return;\n\t }\n\t // Change visible view if it doesn't match view.\n\t // Function also calls _triggerChange(true)\n\t if (this._changeVisibleView()) {\n\t return;\n\t }\n\t // Something changed in visible view\n\t this._triggerChange(false);\n\t }", "set mainview(value) {\n if (value) {\n this.node.setAttribute(\"mainview\", true);\n } else {\n this.node.removeAttribute(\"mainview\");\n }\n }", "static view(v) {\n // Add history\n window.history.replaceState(State.preserve(), document.title);\n // Change views\n for (let view of Array.from(arguments)) {\n // Store view\n let element = UI.find(view);\n // Store parent\n let parent = element.parentNode;\n // Hide all\n for (let child of parent.children) {\n UI.hide(child);\n }\n // Show view\n UI.show(element);\n }\n // Add history\n window.history.pushState(State.preserve(), document.title);\n }", "function updateViewState(viewState) {\n var currentViewState = jq(document).data(\"ViewState\");\n if (currentViewState) {\n jq.extend(currentViewState, viewState);\n }\n else {\n jq(document).data(\"ViewState\", viewState);\n }\n}", "gotView({ game }) {\n this.setState(game);\n }", "changeView() {\n\t\tthis.state.view === \"signup\" ? this.setState({view: \"signin\"}) : this.setState({view: \"signup\"});\n\t\tthis.setState({errorMessage: \"\"});\n\t}", "function toggleView(view) {\n\t\tsetActiveView(view);\n\t}", "function handleShow(view){\r\n view._isShown = true;\r\n triggerDOMRefresh(view);\r\n }", "requestView(){\t\t\n\t\tthis.trigger('requestView');\n\t}", "function init(vew) {\n\n // the view this controller is controlling\n view = vew;\n\n // put the view in an initial state\n view.init();\n }", "setupReviewView(view) {\n }", "onViewChange() {\n \n }", "setViewXml(viewXml) {\r\n return this.clone(View, \"SetViewXml\").postCore({\r\n body: jsS({\r\n viewXml,\r\n }),\r\n });\r\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function handleShow(view) {\n view._isShown = true;\n triggerDOMRefresh(view);\n }", "OnChangeView(view_id) {\n this.setState({\n activeView: view_id\n });\n\n if (this.state.activeView === \"homeScreen\") {\n if (window.location.hash) {\n this.OnChangePanel(\"party-info\");\n }\n }\n }", "changeView() {\n console.log('changing the view');\n //when this function is called, change the view in the state\n //if the state is 'Homepage'\n if (this.state.view === 'Homepage') {\n //then set it to Carousel\n this.setState({\n view: 'Carousel'\n });\n //else if the state is 'Carousel'\n } else if (this.state.view === 'Carousel') {\n //then set it to 'Homepage\n this.setState({\n view: 'Homepage'\n });\n }\n }", "function OnStateUpdate(self, state)\n {\n if (!(\"ignore_state\" in self.parameters) || self.parameters.ignore_state === 0)\n {\n self.state = state.state;\n set_view(self, self.state)\n }\n }", "function changeView(newViewName) {\n\t\tif (!currentView || newViewName != currentView.name) {\n\t\t\tignoreWindowResize++; // because setMinHeight might change the\n\t\t\t// height before render (and subsequently\n\t\t\t// setSize) is reached\n\n\t\t\tunselect();\n\n\t\t\tvar oldView = currentView;\n\t\t\tvar newViewElement;\n\n\t\t\tif (oldView) {\n\t\t\t\t(oldView.beforeHide || noop)(); // called before changing\n\t\t\t\t// min-height. if called after,\n\t\t\t\t// scroll state is reset (in\n\t\t\t\t// Opera)\n\t\t\t\tsetMinHeight(content, content.height());\n\t\t\t\toldView.element.hide();\n\n\t\t\t} else {\n\t\t\t\tsetMinHeight(content, 1); // needs to be 1 (not 0) for IE7, or\n\t\t\t\t// else view dimensions\n\t\t\t\t// miscalculated\n\t\t\t}\n\t\t\tcontent.css('overflow', 'hidden');\n\t\t\tcurrentView = viewInstances[newViewName];\n\t\t\tif (currentView) {\n\t\t\t\tcurrentView.element.show();\n\t\t\t} else {\n\t\t\t\tcurrentView = viewInstances[newViewName] = new fcViews[newViewName](\n\t\t\t\t\t\tnewViewElement = absoluteViewElement = $(\n\t\t\t\t\t\t\t\t\"<div class='fc-view fc-view-\" + newViewName\n\t\t\t\t\t\t\t\t\t\t+ \"' style='position:absolute'/>\")\n\t\t\t\t\t\t\t\t.appendTo(content), t // the calendar object\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (oldView) {\n\t\t\t\theader.deactivateButton(oldView.name);\n\t\t\t}\n\t\t\theader.activateButton(newViewName);\n\t\t\t// alert(\"selectedWeek: \"+selectedWeek);\n\t\t\trenderView(); // after height has been set, will make\n\t\t\t// absoluteViewElement's position=relative, then set\n\t\t\t// to null\n\t\t\t/*\n\t\t\t * if (!oldView && selectedWeek != 0) { for ( var i = 0; i <\n\t\t\t * selectedWeek; i++) { renderView(1); } }\n\t\t\t */\n\t\t\tcontent.css('overflow', '');\n\t\t\tif (oldView) {\n\t\t\t\tsetMinHeight(content, 1);\n\t\t\t}\n\n\t\t\tif (!newViewElement) {\n\t\t\t\t(currentView.afterShow || noop)(); // called after setting\n\t\t\t\t// min-height/overflow, so\n\t\t\t\t// in final scroll state\n\t\t\t\t// (for Opera)\n\t\t\t}\n\n\t\t\tignoreWindowResize--;\n\t\t}\n\t}", "handleViewChange(view, changed_attrib, new_value) {\n if (debug && false) console.log('handleViewChange', view, changed_attrib, new_value);\n // check that we've got a valid sequence number\n if (!view.seq.length) {\n console.error('Received an invalid sequence number, aborting handleViewChange');\n return;\n }\n // compose state update leaf\n const updated_view = {};\n updated_view[changed_attrib] = new_value;\n const chain = ViewManager.calculateViewChangeChain(view, updated_view);\n // use immutability-helper to create an update copy of the state then apply to state\n const new_state = {views: update(this.state.views, chain)};\n this.setState(new_state);\n }", "updateView() {\n if (!Object(_yuion_svg_viewer__WEBPACK_IMPORTED_MODULE_3__[\"getViewer\"])(this.viewer) || this.loading) {\n return this.timeout('update_view', () => this.updateView());\n }\n try {\n Object(_yuion_svg_viewer__WEBPACK_IMPORTED_MODULE_3__[\"updateViewer\"])(this.viewer, {\n styles: this.styles,\n features: this.feature_list,\n labels: this.labels,\n actions: this.actions,\n });\n }\n catch (e) { }\n }", "handleSetViews( value ) {\n\t\t// force update button to be clickable\n\t\twp.data.dispatch( 'core/editor' ).editPost( { meta: { _pvc_post_views: value } } );\n\n\t\tthis.setState( () => {\n\t\t\treturn {\n\t\t\t\tpostViews: value\n\t\t\t}\n\t\t} );\n\t}", "function viewShown() {\n activate();\n }", "updateView() {\n // we update the selected task id\n const theId = document.getElementsByClassName('grid-row-selected')[0].attr('id');\n this.newTaskId = theId.replace('item_row_view_', '');\n\n // add a timer button\n this.addTimerButton();\n\n // get our timer history\n // this.getTimerHistory(this.newTaskId);\n\n }", "showCreator() {\n this.setState({ viewSelector: 1 })\n }", "function initializeViewState(viewState) {\n jq(document).data(\"ViewState\", viewState);\n}", "function View() {\n var self = this;\n this.currentDate = new Date();\n }", "setButtonState() {\n // this.view.setButtonState(this.runner.busy,this.synchronizing,this.synchronize_type)\n }", "onChangeDefaultView(value) {this.props.setTempSettings(\"defaultView\", value)}", "onViewChanged() {\n this.camera = this.graph.views.get(this.viewIndexToNames[this.selectedView]);\n this.interface.setActiveCamera(this.camera);\n }", "get view() {\n return this._view;\n }", "get view() {\n return this._view;\n }", "function handleRender(view){\r\n view._isRendered = true;\r\n triggerDOMRefresh(view);\r\n }", "bindView(_view) {\n if (!this.viewIds.includes(_view.viewId)) {\n this.viewIds.push(_view.viewId);\n }\n this._updateFlexibleDimensions();\n return this;\n }", "function setViewState(key, value) {\n var viewState = jq(document).data(\"ViewState\");\n if (!viewState) {\n viewState = new Object();\n jq(document).data(\"ViewState\", viewState);\n }\n viewState[key] = value;\n}", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "switchView() {\n this.setState({ showSignUp: !this.state.showSignUp });\n }", "_onViewChange() {\n if (this._pointControllers) {\n this._pointControllers.forEach((pointController) => {\n pointController.setDefaultView();\n });\n }\n }", "toggleView(){\n this.setState((prevState) => {\n const view = prevState.view === \"create\" ? \"display\" : \"create\";\n return {view};\n })\n }", "function setViewEngine(selectedViewEngine){\n ViewEngine = selectedViewEngine;\n}", "function handleRender(view) {\n view._isRendered = true;\n triggerDOMRefresh(view);\n }", "function start_view() {\n editor_visibility(true);\n button_visibility('view-mode');\n d3.json(resource_url(), editor_callback);\n}", "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\tcalcSize();\n\t\trenderView(viewType, scrollState);\n\n\t\tthawContentHeight();\n\t\tignoreWindowResize--;\n\t}", "_showView(view) {\n this._hideAll();\n view.show();\n view.css('visibility', 'visible');\n }", "function updateView() {\n var listview = document.getElementById(\"listview1\").winControl;\n\n // Set the properties on the list view to use the itemDataSource\n listview.itemDataSource = dataSource;\n listview.itemTemplate = renderer;\n }", "function reinitView() {\n\t\t\tignoreWindowResize++;\n\t\t\tfreezeContentHeight();\n\n\t\t\tvar viewType = currentView.type;\n\t\t\tvar scrollState = currentView.queryScroll();\n\t\t\tclearView();\n\t\t\trenderView(viewType, scrollState);\n\n\t\t\tunfreezeContentHeight();\n\t\t\tignoreWindowResize--;\n\t\t}", "function updateView() {\n if (!$scope.$$phase) $scope.$apply();\n }", "changeView(){\n if (this.compare) {\n // clear array with plans to compare\n this.$store.dispatch('clearCompare');\n } else {\n // clear 'add to compare' checkboxes\n let checkboxes = document.getElementsByClassName('checkbox-recomm');\n for(let i = 0; i < checkboxes.length; ++i){\n checkboxes[i].checked = false;\n }\n }\n this.$store.dispatch('changeView');\n\n // reset scroll offsets\n this.tableOffsetLeft = this.filtersWidth;\n this.windowOffsetLeft = 0;\n }", "function reinitView() {\n\t\tignoreWindowResize++;\n\t\tfreezeContentHeight();\n\n\t\tvar viewType = currentView.type;\n\t\tvar scrollState = currentView.queryScroll();\n\t\tclearView();\n\t\trenderView(viewType, scrollState);\n\n\t\tunfreezeContentHeight();\n\t\tignoreWindowResize--;\n\t}", "function change_view(view)\n{\n\tif(view_mode == 'errors')\n\t\treturn; // You cannot escape Errors View!\n\tswitch(view)\n\t{\n\t\tcase 'loader':\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#loader_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'errors':\n\t\t\t// TODO: Flash menacingly.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#errors_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'galaxy':\n\t\t\t// TODO: Zoom out from Sector View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#galaxy_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'sector':\n\t\t\t// TODO: Zoom in from Galaxy View, or out from System View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#sector_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'system':\n\t\t\t// TODO: Zoom in from Sector View, or out from Object View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#system_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'object':\n\t\t\t// TODO: Zoom in from System View.\n\t\t\t$('body div').fadeOut('fast', function()\n\t\t\t{\n\t\t\t\t$('#object_view').fadeIn('fast');\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Cannot change_view() to: ' + view);\n\t}\n\tview_mode = view;\n}", "function toggleView(view) {\n var show = model.views[view];\n model.views[view] = !show;\n }", "setSettingsView (settingsView) {\n this.settingsView = settingsView\n\n if (this.panels.length > 0) {\n for (let panel in this.panels) {\n this.addPanelToSettingsView(panel)\n }\n }\n }", "function switchToView(view) {\n switch (view) {\n case 'edit-form': showElement(['edit-form']); hideElement(['listing', 'main-controls']); break;\n case 'listing': hideElement(['edit-form']); showElement(['listing', 'main-controls']); renderList(); break;\n }\n}", "createView() {\n const doc2 = createDocument(this.options.content, this.schema, this.options.parseOptions);\n const selection = resolveFocusPosition(doc2, this.options.autofocus);\n this.view = new EditorView(this.options.element, {\n ...this.options.editorProps,\n dispatchTransaction: this.dispatchTransaction.bind(this),\n state: EditorState.create({\n doc: doc2,\n selection: selection || void 0\n })\n });\n const newState = this.state.reconfigure({\n plugins: this.extensionManager.plugins\n });\n this.view.updateState(newState);\n this.createNodeViews();\n const dom = this.view.dom;\n dom.editor = this;\n }", "setViewXml(viewXml) {\n return spPost(this.clone(View, \"SetViewXml\"), body({ viewXml }));\n }", "@action update_current_view(data) {\n this.page_state.update_current_view(data);\n }", "refresh() {\n this.views.forEach(_responder => {\n if (_responder.value !== this.value && !_responder._valueIsBeingSet) {\n _responder._valueIsBeingSet = true;\n _responder.setValue(this.value);\n _responder._valueIsBeingSet = false;\n }\n });\n }", "refresh() {\n this.views.forEach(_responder => {\n if (_responder.value !== this.value && !_responder._valueIsBeingSet) {\n _responder._valueIsBeingSet = true;\n _responder.setValue(this.value);\n _responder._valueIsBeingSet = false;\n }\n });\n }", "function setViewModified(bool) {\n // log.d('modified =' + bool);\n viewModified = bool;\n if (bool) saveButton.show(true);\n else {saveButton.hide(true);} \n }", "function restoreView(viewToRestore){contextLView=viewToRestore;}" ]
[ "0.77327347", "0.77327347", "0.77327347", "0.7732147", "0.72680503", "0.709593", "0.7092549", "0.70473486", "0.6951931", "0.6936921", "0.67916954", "0.6757068", "0.67498523", "0.6724595", "0.6690341", "0.6637219", "0.6531726", "0.65158796", "0.65054333", "0.64750105", "0.6469068", "0.6443188", "0.64400786", "0.64290404", "0.63609725", "0.63260525", "0.63089925", "0.62664723", "0.6244534", "0.61955345", "0.61805147", "0.6180369", "0.6177526", "0.6173785", "0.61723006", "0.6164798", "0.61206436", "0.61157095", "0.60542005", "0.60523945", "0.6034942", "0.6012474", "0.6002461", "0.5996345", "0.59889925", "0.59836173", "0.59725684", "0.59604585", "0.595347", "0.59340084", "0.59054756", "0.59054756", "0.59054756", "0.58962035", "0.58842283", "0.58818704", "0.58765674", "0.5866625", "0.5830094", "0.5813769", "0.58103085", "0.58094865", "0.57950664", "0.5791486", "0.5790434", "0.5789771", "0.57733357", "0.5748737", "0.5742363", "0.57379204", "0.57379204", "0.573606", "0.57131153", "0.57118136", "0.5696351", "0.5696351", "0.56941694", "0.5687016", "0.5679712", "0.5675644", "0.5672203", "0.56674784", "0.5660256", "0.5659148", "0.5643085", "0.563919", "0.56311303", "0.56204957", "0.56195354", "0.5608546", "0.5595582", "0.5593645", "0.5585744", "0.55791754", "0.55648184", "0.5551871", "0.5548809", "0.5548809", "0.5541034", "0.55360425" ]
0.6526113
17
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { self.state = state; self.options = state.attributes.options; set_options(self, self.options, state); set_value(self, state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n self.set_field(self, \"state\", self.map_state(self, state.state))\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.entity = state.entity_id;\n self.level = state.attributes.volume_level;\n set_view(self, state)\n if (\"dump_capabilities\" in self.parameters && self.parameters[\"dump_capabilities\"] == \"1\")\n {\n display_supported_functions(self)\n }\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min\n self.max = state.attributes.max\n self.step = state.attributes.step\n self.level = state.state\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"unit\", self.parameters.units)\n }\n set_view(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state\n self.minvalue = state.attributes.min\n self.maxvalue = state.attributes.max\n self.stepvalue = state.attributes.step\n set_options(self, self.minvalue, self.maxvalue, self.stepvalue, state)\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "function OnStateAvailable(self, state)\n {\n self.min = state.attributes.min_temp\n self.max = state.attributes.max_temp\n self.level = state.attributes.temperature\n if (\"units\" in self.parameters)\n {\n self.set_field(self, \"units\", self.parameters.units)\n }\n else\n {\n self.set_field(self, \"units\", state.attributes[\"unit_of_measurement\"])\n }\n set_view(self, state)\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\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 }", "async _initializeState() {\n try {\n const { accounts, chainId, isUnlocked, networkVersion } = (await this.request({\n method: 'metamask_getProviderState',\n }));\n // indicate that we've connected, for EIP-1193 compliance\n this.emit('connect', { chainId });\n this._handleChainChanged({ chainId, networkVersion });\n this._handleUnlockStateChanged({ accounts, isUnlocked });\n this._handleAccountsChanged(accounts);\n }\n catch (error) {\n this._log.error('MetaMask: Failed to get initial state. Please report this bug.', error);\n }\n finally {\n this._state.initialized = true;\n this.emit('_initialized');\n }\n }", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n if (\"brightness\" in state.attributes)\n {\n self.level = state.attributes.brightness\n }\n else\n {\n self.level = 0\n }\n set_view(self, self.state, self.level)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function currentState() {\n\t//hideAll();\n\tif (!connectedToContract) {\n\t\topenContractChoice();\n\t\treturn;\n\t}\n\tif (!addressChosen) {\n\t\tselectBox();\n\t\treturn;\n\t}\n\tif(!keysUploaded) {\n\t\tkeysInput();\n\t\treturn;\n\t}\n\t\n\n\tstate = myvotingAddr.state();\n\tif(state > 1){\n\t\twhatIsQuestion();\n\t}\n\n\tif(state == 0) { // SETUP\n\n\t//createEligibleTextBox();\n\t} else if(state == 1) { // SIGNUP\n\t\tcreateRegistration();\n\n\t} else if(state == 2) { // COMMITMENT\n\t\tcreateCommit();\n\n\t} else if(state == 3) { // VOTE\n\t\tcreateVote();\n\n\t} else if(state == 4) { // TALLY\n\t\tcreateTally();\n\n\t} else {\n\t\tdocument.getElementById('state').innerHTML = \"Undocumented Phase...\";\n\t}\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "static ready(){\n return new State(this.generate(), 0, 0, [], 5, 0, 0, 0)\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "function OnStateAvailable(self, state)\n {\n self.state = state.state;\n self.access_token = state.attributes.access_token\n refresh_frame(self)\n }", "function onStateSend() {\n var conn = this.conn\n if (!conn.isServer()) return\n\n var states = []\n var entityMap = this.entityMap\n Object.keys(conn.players).forEach(function(id) {\n if (!entityMap[id]) return\n\n states.push({\n id: id,\n currentHealth: entityMap[id].health.current,\n currentScore: entityMap[id].score,\n currentWeapon: entityMap[id].weapon.primary.id\n })\n })\n\n if (states.length) {\n conn.send(\"gamestate\", { states: states })\n }\n\n conn.send(\"itemsupdate\", {\n ids: this.itemsStates\n })\n\n this.itemsStates = {}\n}", "function WI4_State_InitialiseState()\n{\n\t//create our list of objects to download\n\tvar aList = [];\n\t//helpers\n\tvar i, c;\n\t//now loop through the list of tutorials\n\tfor (i = 0, c = this.ListOfTutorials.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_TUT, Id: this.ListOfTutorials[i] });\n\t}\n\t//now loop through the list of screen instances\n\tfor (i = 0, c = this.ListOfScreenInstances.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_INSTANCE, Id: this.ListOfScreenInstances[i] });\n\t}\n\t//now loop through the list of raw screens\n\tfor (i = 0, c = this.ListOfRawScreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_RAW, Id: this.ListOfRawScreens[i] });\n\t}\n\t//now loop through the list of sub screens\n\tfor (i = 0, c = this.ListOfSubscreens.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_SCREEN_SUB, Id: this.ListOfSubscreens[i] });\n\t}\n\t//now loop through the set of resources\n\tfor (i = 0, c = this.SetResources.length; i < c; i++)\n\t{\n\t\t//request this\n\t\taList.push({ Type: __CACHE_TYPE_RESOURCE, Id: this.SetResources[i] });\n\t}\n\t//now check if this is all ready\n\tif (__CACHE.Get_ItemList(aList, this, __WI4_LESSON_STATE_RESOURCES_DOWNLOADED))\n\t{\n\t\t//proceed directly to sim optimisation\n\t\tthis.InitialiseSimulation();\n\t}\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "prepareState() {\n /* ... */\n }", "prepareNextState() {\n this.gameOrchestrator.changeState(new CheckGameOverState(this.gameOrchestrator));\n }", "function StateManager_LoadState(strStateId)\n{\n\t//Enter Wait Mode\n\t__WAIT_MANAGER.StartWaiting(StateManager_LoadStateCallBack, this, strStateId);\n}", "function Simulator_StateLoaded(newState, bFromHistory)\n{\n\t//history not processing?\n\tif (!Get_Bool(bFromHistory, false))\n\t{\n\t\t//notify history\n\t\tthis.History.StateLoaded(newState);\n\t\t//notify scores\n\t\tthis.Scores.StateLoaded(newState);\n\t}\n\t//update slider jump data\n\tthis.History.ProcessSliderData();\n\t//have we reached the end? no more actions?\n\tvar theEnd = newState.ListOfPaths.length == 0;\n\t//the end?\n\tif (theEnd)\n\t{\n\t\t//inform score\n\t\tthis.Scores.LessonEnded(true);\n\t}\n\telse\n\t{\n\t\t//once a state has been loaded we are ready for events\n\t\tthis.bProcessEvents = true;\n\t}\n\t//notify the controller, if any\n\tthis.UpdateController(theEnd);\n\t//trigger resize\n\tthis.NotifyInterpreterPanelResizeDelayed();\n\t//advance to action\n\tthis.ActionTriggered(true, false);\n}", "function availableState() {\n let states = [];\n Object.values(tdata).forEach(value => {\n let state = value.state.toUpperCase();\n if(states.indexOf(state) !== -1) {\n\n }\n else {\n states.push(state);\n }\n });\n return states;\n}", "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "isReady() {\n return !this.state.point.isFetching;\n }", "function State() {\n\n }", "function ReadyState() {\n \n onStateChange(\"Ready state entered .. \");\n tokens = new Stack();\n \n this.operandEntered = (operand) => {\n displayBuffer.clear();\n if (operand != \"0\") {\n displayBuffer.insertChar(operand);\n\n state = new Operand1EnteringState();\n return;\n }\n displayBuffer.insertChar(0);\n }\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 }", "stateMachine() {\n switch (this.state) {\n case 'START':\n this.start();\n break;\n case 'UPDATE_CONFIGS':\n this.update_Configs();\n break;\n case 'WAIT_AP_RESPONSE':\n this.wait_AssertPlayers_response();\n break;\n case 'PROCESS_PIECE':\n this.client.requestCurrentPlayerBot();\n if(this.newTimer){\n this.newTimer = false;\n this.view.startTimer();\n }\n this.state = 'WAIT_CPB_RESPONSE';\n break;\n case 'WAIT_CPB_RESPONSE':\n this.checkOverTime();\n this.wait_CurrentPlayerBot_response();\n break;\n case 'REQUEST_VALID_CELLS':\n this.request_validCells();\n this.checkOverTime();\n break;\n case 'WAIT_VP_RESPONSE':\n this.wait_validCells_response();\n break;\n case 'SELECT_CELL':\n this.checkOverTime();\n this.selectCell();\n break;\n case 'REQUEST_PLAY_P':\n this.client.requestPlay([this.view.board.selectedCell.column, this.view.board.selectedCell.line, this.selectedPiece.color])\n this.state = 'WAIT_PP_RESPONSE';\n break;\n case 'REQUEST_PLAY_B':\n this.client.requestBotPlay(this.model.level);\n this.state = 'WAIT_PB_RESPONSE';\n break;\n case 'WAIT_PP_RESPONSE':\n this.wait_HumanPlay_response();\n break;\n case 'WAIT_PB_RESPONSE':\n this.wait_BotPlay_response();\n this.checkOverTime();\n break;\n case 'WAIT_ANIMATION_END':\n this.view.stopTimer();\n this.wait_AnimationEnd();\n break;\n case 'WAIT_UNDO':\n this.wait_Undo();\n break;\n case 'WAIT_SP_RESPONSE':\n this.wait_SwitchPlayers_response();\n break;\n case 'WAIT_SP_TIMER':\n this.wait_SwitchPlayers_timer();\n break;\n case 'CHANGE_PLAYER':\n this.view.marker.switchPlayer();\n this.scene.update_CameraRotation();\n this.newTimer = true;\n this.state = 'PROCESS_PIECE';\n this.check_Reset();\n break;\n case 'GAME_OVER':\n this.check_GameMovie();\n this.check_Reset();\n break;\n case 'GAME_MOVIE' :\n this.view_GameMovie();\n break;\n case 'WAIT_GM_1st_ANIMATION_END' :\n this.wait_GM_1st_AnimationEnd();\n break;\n case 'WAIT_GM_ANIMATION_END' :\n this.wait_GM_AnimationEnd();\n break;\n case 'WAIT_GM_CAMERA_ANIMATION_END' :\n this.wait_GM_Camera_AnimationEnd();\n break;\n case 'SMALL_WAIT':\n this.small_Wait();\n break;\n }\n\n }", "get state() {\n return this._wantedState;\n }", "function isInitialized() {\n return this.currentState === constants.STATE_INITIALIZED;\n }", "isReady(){\n return this.state === WORKERS_STATES.ready\n }", "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "async _fsm_start() {\n\t\tthis._fsm.mEventInProgress = true;\n\n\t\t// clear out any active states that may have existed\n\t\tthis._fsm.mActiveStates.clear();\n\n\t\t// select states which need to be entered\n\t\tlet need_entry = new Set();\n\t\tneed_entry.add( this );\n\t\tthis._fsm_descend( need_entry );\n\n\t\t// sort entrances by depth, asc\n need_entry = [ ...need_entry ].sort( ( a, b ) => {\n return a._fsm_depth - b._fsm_depth;\n });\n\n\t\t// enter states ordered by depth\n\t\tfor ( let state of need_entry ) {\n\t\t\tawait state._fsm_on_entry({});\n\t\t}\n\n\t\t// filter out nested and parallel states\n\t\tneed_entry = need_entry.filter( (state) => {\n\t\t\treturn ( state._fsm_is_nested === false );\n\t\t});\n\n\t\t// set remaining states as active states\n\t\tneed_entry.forEach( ( state ) => {\n\t\t\tthis._fsm_add_active_state( state );\n\t\t});\n\n\t\treturn this._fsm_process_events();\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "finishInitializing(expectedState) {\n this.verifyServiceStateIs(expectedState);\n }", "setup() {\n let statetotal = 0;\n for (let i = 0; i < this.file.getRowCount(); i++) {\n let statename = this.file.getString(i, 'State');\n\n if (statename == '') return 'Not Valid State Name';\n else if (this.state.indexOf(statename) == -1) {\n this.state[statetotal] = statename;\n statetotal++;\n }\n }\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 CheckStateChange() {// decision tree to see if we need to change states\n\tif (currentState != enemyStates.start) {// to make sure we don't change state during the start state, check it\n\t\t// if playerLocation.Count > 1 then we need to follow waypoint\n\t\t// if playerLocation.Count = 1 then we need to follow player\n\t\tif (playerLocation.Count > 1) {// path to player is the number of waypoints to the player, and if there is more than one, we need to follow the waypoints\n\t\t\t//currentState = enemyStates.run; // run after the waypoint\n\t\t} else {// path to player is the number of waypoints to the player, and if there is one, we're at the closest waypoint to the player\n\t\t\t// test if we are close enough to the player to say we saw them\n\t\t\tvar distanceToPlayer = Vector3.Distance(transform.position,playerTransform.position); // see how far we are from the player\n\t\t\tif (distanceToPlayer < sawPlayerDistance) {// Are we close enough to run after the player?\n\t\t\t\tif (distanceToPlayer < attackDistance) { // Are we close enough to attack the player?\n\t\t\t\t\tif(distanceToPlayer < hitDistance){// Are we close enough to hit the player?\n\t\t\t\t\t// hit the player, let game know and die\n\t\t\t\t\t\tNotificationCenter.DefaultCenter().PostNotification(this,\"EnemyDead\"); // tell other objects that we died to attack the player\n\t\t\t\t\t\tDie();// and we explode (die)\n\t\t\t\t\t} else { // if we are NOT close enough to hit the player\n\t\t\t\t\tcurrentState = enemyStates.attack;// ATTACK\n\t\t\t\t\t}// end HIT else\n\t\t\t\t} else {// if we are NOT close enough to attack the player\n\t\t\t\tcurrentState = enemyStates.sawPlayer;// GET HIM\n\t\t\t\t} // end ATTACK else\n\t\t\t}// end saw player IF\n\t\t}// end player location count IF\n\t}// end start state check IF\n}// end CheckStateChange function", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "ready() {\n if (this._prepareIx === this._prepare.length-1) {\n this._state = 1;\n this.emit('ready');\n } else {\n this.prepare();\n }\n }", "async onReady() {\n\t\t// Reset the connection indicator during startup\n\t\tthis.setState(\"info.connection\", false, true);\n\n\t\tawait this.setObjectAsync(\"info.name\", {\n\t\t\ttype: \"state\",\n\t\t\tcommon: {\n\t\t\t\tname: \"name\",\n\t\t\t\ttype: \"string\",\n\t\t\t\trole: \"info.name\",\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tfor (let p=1; p<=this.config.numPorts; p++) {\n\t\t\tawait this.setObjectAsync(\"port\" + p, {\n\t\t\t\ttype: \"state\",\n\t\t\t\tcommon: {\n\t\t\t\t\tname: \"port\" + p,\n\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\trole: \"switch.power\",\n\t\t\t\t\tread: true,\n\t\t\t\t\twrite: true,\n\t\t\t\t},\n\t\t\t\tnative: {},\n\t\t\t});\n\t\t}\n\t\t\n\t\tthis.state = Array(this.config.numPorts).fill();\n\t\t\n\t\tthis.connected = false;\n\t\t\n\t\tthis.setState(\"info.name\", this.config.deviceName, true);\n\t\t\n\t\t// in this template all states changes inside the adapters namespace are subscribed\n\t\tthis.subscribeStates(\"*\");\n\n\t\tconst that = this;\n\n\t\tconst requestState = function() {\n\t\t\t// request port states from device\n\t\t\tconst url = `http://${that.config.netIoAddress}:${that.config.netIoPort}/tgi/control.tgi?login=p:${that.config.username}:${that.config.password}&port=list&quit=quit`; \n\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t// that.log.info(\"E \" + error + JSON.stringify(error))\n\t\t\t\t// that.log.info(\"R \" + JSON.stringify(response))\n\t\t\t\t// that.log.info(\"B \" + body);\n\t\t\t\tif (that.state && body && body.includes(\"BYE\")) {\n\t\t\t\t\tconst state = body.substr(6, 2*that.config.numPorts-1)\n\t\t\t\t\t\t.split(\" \")\n\t\t\t\t\t\t.map(x => x==1);\n\t\t\t\t\tfor (let i=0; i<state.length; i++) {\n\t\t\t\t\t\tif (state[i] !== that.state[i]) {\n\t\t\t\t\t\t\tthat.setState(\"port\"+(i+1), state[i], true);\n\t\t\t\t\t\t\tthat.state[i] = state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!that.connected) {\n\t\t\t\t\t\tthat.connected = true;\n\t\t\t\t\t\tthat.setState(\"info.connection\", true, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthat.log.error(JSON.stringify(error));\n\t\t\t\t\tif (that.connected) {\n\t\t\t\t\t\tthat.connected = false;\n\t\t\t\t\t\tthat.setState(\"info.connection\", false, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\trequestState();\n\n\t\tthis.timer = null;\n\t\tif (this.config.polling)\n\t\t\tthis.timer = setInterval(requestState, this.config.pollingInterval * 1000);\n\t}", "function State() { }", "function ScoreManager_StateLoaded(newState)\n{\n\t//first State loaded?\n\tif (this.States_Count == 0)\n\t{\n\t\t//initialise lesson start\n\t\tthis.Lesson_Start = new Date();\n\t}\n\t//set current State\n\tthis.States_Current = newState.UniqueId;\n\t//has State score counter?\n\tif (!this.States_List[this.States_Current])\n\t{\n\t\t//create new one\n\t\tthis.States_List[this.States_Current] = new ScoreManager_ScoreCounter(newState.ControlSettings);\n\t\t//increment count\n\t\tthis.States_Count++;\n\t}\n}", "function getState() {\n return currentState\n }", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function getState () {\n\t\treturn currentState;\n\t}", "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}", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "is_available() {\n return this._time_until_arrival === 0;\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() {\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 stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "checkAvailability() {\n if(!this.sourceBranch || !this.toBranch) {\n this.title = '';\n this.available = false;\n\n return;\n }\n\n $.getJSON(app.getUri('h-gitter-repo-merge-request-availability', {\n repoId : this.repoId,\n from : this.sourceBranch,\n to : this.toBranch\n }))\n\n .done((response) => {\n this.available = response.available;\n this.title = response.title;\n });\n }", "get state() { return this._state; }", "_activeChanged(newValue,oldValue){// bubble up event from state being set\nthis.state=\"active item is \"+this.active;this.items.forEach((element,index,array)=>{// if the current item is disabled, check the 1 prior to it if we can\nif(\"disabled\"==this.items[index].metadata.status){// do nothing, it's disabled unless....\nif(0!=index&&this.progressiveUnlock&&\"complete\"==this.items[index-1].metadata.status){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}// or if our value is at max AND it's the last item in the list\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max&&index==this.items.length-1){this.items[index].metadata.status=\"finished\";this.set(\"items.\"+index+\".metadata.status\",\"finished\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if we're just at max then mark us complete\nelse if(this.items[index].metadata.value>=this.items[index].metadata.max){this.items[index].metadata.status=\"complete\";this.set(\"items.\"+index+\".metadata.status\",\"complete\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// or if the index is the currently active item\nelse if(index==this.active){// see if we have the data for it already otherwise trigger loading\nif(typeof this._responseList[index]===typeof void 0){this.items[index].metadata.status=\"loading\";this.set(\"items.\"+index+\".metadata.status\",\"loading\");this.notifyPath(\"items.\"+index+\".metadata.status\")}// if we already had a response, then mark available\nelse{this.activeNodeResponse=this._responseList[index];this.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}}else{// we didn't match any cases, just leave it active\nthis.items[index].metadata.status=\"available\";this.set(\"items.\"+index+\".metadata.status\",\"available\");this.notifyPath(\"items.\"+index+\".metadata.status\")}})}", "function currentGameDataLoaderStateChangeStarter() {\n if (store.getState().activeSlot == 1) {\n activeGameState = store.getState().savedData.slot1;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot1\n }\n });\n }\n if (store.getState().activeSlot == 2) {\n activeGameState = store.getState().savedData.slot2;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot2\n }\n });\n }\n if (store.getState().activeSlot == 3) {\n activeGameState = store.getState().savedData.slot3;\n store.dispatch( {\n type: GAMEDATA_LOADED,\n payload: {\n activeGameState: store.getState().savedData.slot3\n }\n });\n }\n }", "function StateManager_LoadStateCallBack(theStateManager, strStateId)\n{\n\t//try to get it\n\ttheStateManager.CurrentState = __CACHE.Get_State(strStateId, theStateManager, __STATE_MANAGER_ON_STATE_READY);\n\t//state ready?\n\tif (theStateManager.CurrentState != null)\n\t{\n\t\t//is the state fully loaded?\n\t\tif (theStateManager.CurrentState.Optimise(theStateManager, __STATE_MANAGER_ON_STATE_OPTIMISED))\n\t\t{\n\t\t\t//process the state\n\t\t\ttheStateManager.ProcessState();\n\t\t}\n\t}\n}", "function updateState(){\n // (TODO) handle it without reaching the neighbor-wrtc module...\n if (this.neighborhoods.o.living.ms.arr.length > 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0 &&\n this.state !== 'connect'){\n // #1 connected means (1+ inview, 1+ outview)\n this.state = 'connect';\n this.emit('statechange', 'connect');\n } else if (\n (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length > 0) ||\n (this.neighborhoods.o.living.ms.arr.length > 0 ||\n this.neighborhoods.i.living.ms.arr.length === 0) &&\n (this.state !== 'partial')){\n // #2 partially connected means (1+ inview, 0 outview) or (0 i, 1+ o)\n this.state = 'partial';\n this.emit('statechange', 'partial');\n } else if (this.neighborhoods.o.living.ms.arr.length === 0 &&\n this.neighborhoods.i.living.ms.arr.length === 0 && \n this.state !== 'disconnect'){\n // #3 disconnected means (0 inview, 0 outview)\n this.state = 'disconnect';\n this.emit('statechange', 'disconnect');\n };\n}", "function getState() {\n return currentState\n }", "function setState(newState) {\n //console.log('was::'+currentState);\n if( stateIsValid(newState) ) {\n currentState = newState;\n //console.log('is::'+currentState);\n } else {\n console.log('ERR: invalid online/offline state ');\n }\n }", "function PendingPlayerState() { }", "function getState() {\n return currentState\n }", "get idle ()\n {\n return this.waiting === this.entities.length;\n }", "function History_StateLoaded(newState)\n{\n\t//not moving history?\n\tif (!this.MovingHistory)\n\t{\n\t\t//notify that a state has been loaded\n\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_STATE_ENTERING, StateId: newState.UniqueId });\n\t\t//we have performed an action therefore we can no longer go forward in history\n\t\tif (this.CurrentStateIndex < this.States.length)\n\t\t{\n\t\t\t//remove all states in front of us\n\t\t\tthis.States.splice(this.CurrentStateIndex, this.States.length - this.CurrentStateIndex);\n\t\t}\n\t\t//add the state to the list of stored states\n\t\tthis.States.push(newState);\n\t\t//update current state\n\t\tthis.CurrentStateIndex = this.States.length;\n\t\t//recalculate max State index\n\t\tthis.MaxStateIndex = this.CurrentStateIndex + newState.CountOfDefaultActionsToEnd + this.StartIndex;\n\t\t//trigger an update of the last loaded State\n\t\tthis.UpdateLastStateLoaded();\n\t}\n}", "decide(data) { //No going backwards in the conversation\n let session = data.session;\n let context = data.context || {};\n let entities = data.entities || {};\n let weight = session.__engine__.state.weight;\n let availableStates = _.filter(this.states, (state) => {\n let missingData = _.without(state.enter, ...Object.keys(context), ...Object.keys(entities));\n return state.weight > weight && (!missingData || !missingData.length);\n });\n\n let nextState = _.orderBy(availableStates, ['weight'], ['asc']).filter(state => state.mandatory)[0];\n if (!nextState) {\n availableStates = _.orderBy(availableStates, [state => state.enter.length, 'weight'], ['desc', 'asc']);\n nextState = availableStates[0];\n }\n this.log.debug('Decided on next state', nextState || session.__engine__.state);\n this.validateMove(data, nextState || session.__engine__.state);//when not found use current state\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\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 }", "constructor(initialState) {\n /** The allowed transitions */\n this.transitions = [\n // Accepting flaw\n { name: 'approvedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'approvedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'confirmed', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n { name: 'started', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Confirmed.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString() },\n { name: 'ended', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Started.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Ended.toString() },\n // Professor reject\n { name: 'rejectedByProfessor', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByProfessor.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Professor] },\n // Company reject\n { name: 'rejectedByCompany', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.RejectedByCompany.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Company] },\n // Student cancel\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForProfessor.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n { name: 'canceled', from: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.WaitingForCompany.toString(), to: thesis_dais_internship_manager_core_1.InternshipProposalStatusType.Canceled.toString(), requiredRoles: [thesis_dais_internship_manager_core_1.RoleType.Student, thesis_dais_internship_manager_core_1.RoleType.Professor] },\n ];\n this.stateMachine = new StateMachine({\n init: initialState.toString(),\n transitions: this.transitions\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}", "getAvailableStates(userRole) {\n const transitions = this.stateMachine.transitions();\n const currentState = Number(this.stateMachine.state);\n const states = [\n {\n value: currentState,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[currentState]\n }\n ];\n this.transitions.forEach(t => {\n const transition = userRole ? transitions.find(s => s === t.name && can_exec_helper_1.canExec(userRole, t.requiredRoles)) : transitions.find(s => s === t.name);\n if (transition) {\n const v = Number(t.to);\n if (!states.find(s => s.value === v)) {\n states.push({\n value: v,\n text: thesis_dais_internship_manager_core_1.InternshipProposalStatusType[v]\n });\n }\n }\n });\n return states;\n }" ]
[ "0.73274463", "0.73274463", "0.6967985", "0.6967985", "0.6967985", "0.6967985", "0.6787534", "0.6623425", "0.6582334", "0.6542602", "0.64877796", "0.64877796", "0.64877796", "0.6310058", "0.619203", "0.6170058", "0.6153031", "0.61245376", "0.59818846", "0.59818846", "0.5943621", "0.5933697", "0.5870427", "0.5811876", "0.5766914", "0.5748227", "0.5570774", "0.55581635", "0.5558034", "0.5541886", "0.5531565", "0.5530949", "0.55225515", "0.5484103", "0.5468354", "0.5461506", "0.5438742", "0.54325235", "0.54093593", "0.5362142", "0.5349483", "0.53398705", "0.5329074", "0.53271854", "0.53151745", "0.5307406", "0.53042686", "0.5299711", "0.52986187", "0.5285319", "0.52817124", "0.52805424", "0.5248744", "0.5234892", "0.52231735", "0.521873", "0.51973176", "0.5183866", "0.5169534", "0.5162706", "0.51578194", "0.5128252", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.5128201", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512478", "0.512205", "0.51165766", "0.51158655", "0.51134557", "0.5106774", "0.5104787", "0.5095654", "0.50918406", "0.50904435", "0.5085502", "0.50843567", "0.5076612", "0.50762933", "0.50742906", "0.5072274", "0.50646263", "0.506271", "0.5059175", "0.50572634" ]
0.6925284
6
Access the device camera and stream to cameraView
function cameraStart() { if(selfie === true){ cameraView.classList.replace("user", "environment"); cameraOutput.classList.replace("user", "environment"); cameraSensor.classList.replace("user", "environment"); constraints = rearConstraints; selfie = false; } else{ cameraView.classList.replace("environment", "user"); cameraOutput.classList.replace("environment", "user"); cameraSensor.classList.replace("environment", "user"); constraints = userConstraints; selfie = true; } navigator.mediaDevices .getUserMedia(constraints) .then(function(stream) { track = stream.getTracks()[0]; cameraView.srcObject = stream; }) .catch(function(error) { console.error("Oops. Something is broken.", error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cameraStart() {\n cameraView = document.querySelector(\"#webcam\");\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function cameraStart() {\r\n navigator.mediaDevices\r\n .getUserMedia(constraints)\r\n .then(function(stream) {\r\n track = stream.getTracks()[0];\r\n cameraView.srcObject = stream;\r\n })\r\n .catch(function(error) {\r\n console.error(\"Oops. Something is broken.\", error);\r\n });\r\n}", "function cameraStart() {\r\n navigator.mediaDevices\r\n .getUserMedia(constraints)\r\n .then(function(stream) {\r\n track = stream.getTracks()[0];\r\n cameraView.srcObject = stream;\r\n })\r\n .catch(function(error) {\r\n console.error(\"Oops. Something is broken.\", error);\r\n });\r\n}", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function (stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function (error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "async function connect_camera() {\n\t\ttry {\n\t\t\tlet stream = await navigator.mediaDevices.getUserMedia({\n\t\t\t\tvideo: { facingMode: \"user\" },\n\t\t\t\taudio: false\n\t\t\t});\n\t\t\tvideo_element.srcObject = stream;\n\t\t\tvideo_element.setAttribute('playsinline', true);\n\t\t\tvideo_element.setAttribute('controls', true);\n\t\t\t// remove controls separately\n\t\t\tsetTimeout(function() { video_element.removeAttribute('controls'); });\n\t\t} catch(error) {\n\t\t\tconsole.error(\"Got an error while looking for video camera: \" + error);\n\t\t\treturn null;\n\t\t}\n\t}", "function cameraStart() {\n //the getUserMedia method to access the camera\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = track;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is horribly broken.\", error);\n });\n}", "async function setupCamera() {\n const video = document.getElementById('video')\n video.width = videoWidth\n video.height = videoHeight\n\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n facingMode: 'user',\n width: videoWidth,\n height: videoHeight\n }\n })\n video.srcObject = stream\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video)\n }\n })\n}", "function cameraStart() {\n var flagCamera = true;\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function (stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n localStream = track;\n })\n .catch(function (error) {\n flagCamera = false;\n console.error(\"Oops. Something is broken.\", error);\n }).then(function () {\n if (flagCamera)\n visibleC();\n });\n }", "function startCamera() {\n\n let constraints = {\n audio: false,\n video: {\n width: 640,\n height: 480,\n frameRate: 30\n }\n }\n\n video.setAttribute('width', 640);\n video.setAttribute('height', 480);\n video.setAttribute('autoplay', '');\n video.setAttribute('muted', '');\n video.setAttribute('playsinline', '');\n\n // Start video playback once the camera was fetched.\n function onStreamFetched(mediaStream) {\n video.srcObject = mediaStream;\n // Check whether we know the video dimensions yet, if so, start BRFv4.\n function onStreamDimensionsAvailable() {\n if (video.videoWidth === 0) {\n setTimeout(onStreamDimensionsAvailable, 100);\n } else {\n\n }\n }\n onStreamDimensionsAvailable();\n }\n\n window.navigator.mediaDevices.getUserMedia(constraints).then(onStreamFetched).catch(function() {\n alert(\"No camera available.\");\n });\n}", "function cam() {\n snapBtn.addEventListener('click', enroll);\n // detectButton.addEventListener('click', detect);\n navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n width: 500,\n height: 500\n }\n })\n .then(stream => {\n video.srcObject = stream;\n video.onloadedmetadata = video.play()\n })\n .catch(err => console.error(err));\n}", "async function setupCamera() {\r\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\r\n throw new Error(\r\n 'Browser API navigator.mediaDevices.getUserMedia not available');\r\n }\r\n\r\n const camera = document.getElementById('camera');\r\n camera.width = cameraWidth;\r\n camera.height = cameraHeight;\r\n\r\n const mobile = isMobile();\r\n\r\n const stream = await navigator.mediaDevices.getUserMedia({\r\n 'audio': false,\r\n 'video': {\r\n facingMode: 'user',\r\n width: mobile ? undefined : cameraWidth,\r\n height: mobile ? undefined : cameraHeight,\r\n },\r\n });\r\n camera.srcObject = stream;\r\n\r\n return new Promise((resolve) => {\r\n camera.onloadedmetadata = () => {\r\n resolve(camera);\r\n };\r\n });\r\n}", "async function cameraStart() {\n\n await faceapi.nets.faceLandmark68TinyNet.loadFromUri(\"models\");\n await faceapi.nets.tinyFaceDetector.loadFromUri('models')\n\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "_initVideoStream () {\n const getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia || navigator.msGetUserMedia\n if (!getUserMedia) {\n throw new Error('Webcam feature not supported! :(')\n }\n\n getUserMedia.call(navigator, { video: true }, (stream) => {\n this._stream = stream\n this._video.onloadedmetadata = this._onVideoReady.bind(this)\n this._video.src = window.URL.createObjectURL(stream)\n }, (err) => {\n throw err\n })\n }", "function getCamera(){\n document.getElementById('ownGifs').style.display=\"none\"\n document.getElementById('createGif').style.display=\"none\";\n document.getElementById('camera').style.display=\"inline-block\";\n var video = document.querySelector('video');\n stream = navigator.mediaDevices.getUserMedia(constraints)\n .then(function(mediaStream) {\n video.srcObject = mediaStream;\n video.onloadedmetadata = function(e) {\n video.play(); // Starting reproduce video cam\n };\n recorder = RecordRTC(mediaStream, { \n // disable logs\n disableLogs: true,\n type: \"gif\",\n frameRate: 1,\n width: 360,\n hidden: 240,\n quality: 10});\n })\n .catch(function(err) { \n\n }); // always check for errors at the end.\n\n \n}", "function cameraStartFront() { \n frontCamera = true\n var constraints = { video: { facingMode: \"user\" }, audio: false };\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function onDeviceReady() {\n cameraApp = new cameraApp();\n cameraApp.run();\n}", "async function setupCamera() {\n const video = document.getElementById('video');\n video.width = maxVideoSize;\n video.height = maxVideoSize;\n\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'environment',\n width: mobile ? undefined : maxVideoSize,\n height: mobile ? undefined: maxVideoSize}\n });\n video.srcObject = stream;\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n } else {\n const errorMessage = \"This browser does not support video capture, or this device does not have a camera\";\n alert(errorMessage);\n return Promise.reject(errorMessage);\n }\n}", "async start() {\n if (this.webcamConfig.facingMode) {\n util.assert((this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'), () => `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n }\n catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n }\n catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n this.isClosed = false;\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }", "function cameraSetup(){\n\t// Get access to the camera!\n\tif('mediaDevices' in navigator && 'getUserMedia' in navigator.mediaDevices) {\n\t\t// Not adding `{ audio: true }` since we only want video now\n\t\tnavigator.mediaDevices.getUserMedia({\n\t\t\t//Kamera Constrains:\n\t\t\t\n\t\t\tvideo: \n\t\t\t{\n\t\t\t\twidth: {ideal: 50},\n\t\t\t\theight: {ideal: 50},\n\t\t\t\tfacingMode: ['environment']\n\t\t\t}\n\t\t\t}).then(function(stream) {\n\t\t\t\tstreamVideo = stream;\n\t\t\t\tcameraOk = true;\n\t\t\t\tvideo.srcObject = stream;\n\t\t\t\tvideo.play();\n\n\t\t\t\tvar track = stream.getVideoTracks()[0];\n\t\t\t\t//Taschenlampe einschalten:\n\t\t\t\tconst imageCapture = new ImageCapture(track)\n\t\t\t\tconst photoCapabilities = imageCapture.getPhotoCapabilities().then(() => {\n\t\t\t\t\ttrack.applyConstraints({\n\t\t\t\t\t\tadvanced: [{torch: true}]\n\t\t\t\t\t});\n\t\t\t\t});\n\n\n\n\t\t\t});\n\t\t}\n\n\n\t}", "async function setupCamera() {\n const video = document.getElementById('video');\n video.width = maxVideoSize;\n video.height = maxVideoSize;\n\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: mobile ? undefined : maxVideoSize,\n height: mobile ? undefined: maxVideoSize}\n });\n video.srcObject = stream;\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n } else {\n const errorMessage = \"This browser does not support video capture, or this device does not have a camera\";\n alert(errorMessage);\n return Promise.reject(errorMessage);\n }\n}", "async start() {\n if (this.webcamConfig.facingMode) {\n _tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"util\"].assert((this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'), () => `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n }\n catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n }\n catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n this.isClosed = false;\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }", "function captureCamera(capture) {\r\n navigator.mediaDevices.getUserMedia({\r\n video: true\r\n })\r\n .then(function (stream) {\r\n myvideo.srcObject = stream;\r\n myvideo.play();\r\n capture && capture(stream);\r\n })\r\n .catch(function (err) {\r\n console.error(err);\r\n alert(\"Ups, we need your camera! Please refresh the page and start again\");\r\n });\r\n}", "async function setupCamera() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n throw new Error(\n 'Browser API navigator.mediaDevices.getUserMedia not available');\n }\n\n const video = document.getElementById('webcam-video');\n video.width = videoWidth;\n video.height = videoHeight;\n\n // const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: videoWidth,\n height: videoHeight,\n },\n });\n video.srcObject = stream;\n\n return new Promise((resolve) => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n}", "async function setupCamera() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n throw new Error(\n 'Browser API navigator.mediaDevices.getUserMedia not available');\n }\n\n const video = document.getElementById('video');\n video.width = videoWidth;\n video.height = videoHeight;\n\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: mobile ? undefined : videoWidth,\n height: mobile ? undefined : videoHeight,\n },\n });\n video.srcObject = stream;\n\n return new Promise((resolve) => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n}", "async function streamVideoRequest() {\n try {\n captureStream = await navigator.mediaDevices.getDisplayMedia();\n videoContainer.srcObject = captureStream;\n videoContainer.onloadedmetadata = () => {\n videoContainer.play();\n };\n } catch (error) {\n console.error(error);\n }\n}", "mounted(){\n this.setCamera();\n }", "updateCamera() {\n this.camera = this.cameras.get(this.currentCameraID);\n this.interface.setActiveCamera(this.camera);\n }", "function gotStream(stream) {\n console.log('getUserMedia() got stream: ', stream);\n mediaStream = stream;\n video.srcObject = stream;\n video.classList.remove('hidden');\n imageCapture = new ImageCapture(stream.getVideoTracks()[0]);\n getCapabilities();\n}", "function gotStream(stream) {\n console.log('getUserMedia() got stream: ', stream);\n mediaStream = stream;\n video.srcObject = stream;\n video.classList.remove('hidden');\n imageCapture = new ImageCapture(stream.getVideoTracks()[0]);\n getCapabilities();\n}", "get camera() {return this._p.camera;}", "function openCamera()\n{\n var prepareCallback = function(error, status)\n {\n if(error)\n {\n console.error(error.message);\n }\n else\n {\n console.log(status);\n }\n };\n\n QRScanner.prepare(prepareCallback);\n QRScanner.show(function(status)\n {\n console.log(status);\n });\n}", "function startCamera() {\n Webcam.set({\n width: 320,\n height: 240,\n image_format: 'jpeg',\n jpeg_quality: 90\n });\n Webcam.attach('#my_camera');\n}", "function getStreamAndRecord() {\n navigator.mediaDevices\n .getUserMedia({\n audio: false,\n video: {\n height: { max: 480 },\n },\n })\n .then(function (stream) {\n streamCam = stream;\n unhide(\"contenedor-gif-creado\", \"video\");\n hide(\"msj-2\");\n video.srcObject = stream;\n video.play();\n btnCrear.innerText = \"grabar\";\n btnCrear.setAttribute(\"onclick\", \"grabar()\");\n unhide(btnCrear.id);\n pasoActivo(2);\n recorder = RecordRTC(stream, {\n type: \"gif\",\n width: 360,\n });\n });\n}", "async function openForFrontPage(e) {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });\n document.querySelector('#myVid').srcObject = stream;\n localStream = stream;\n}", "function loadCamera() {\n // setup camera capture\n videoInput = createCapture(VIDEO);\n videoInput.size(400, 300);\n videoInput.position(0, 0);\n videoInput.id(\"v\");\n var mv = document.getElementById(\"v\");\n mv.muted = true;\n}", "function createStream(mediaObject)\n{\n\n navigator.mediaDevices.getUserMedia({ video: mediaObject}).then(function(stream) {\n //Stream preview\n mediaObject.mediaStream = stream;\n mediaObject.preview.srcObject = stream;\n mediaObject.preview.load();\n mediaObject.preview.play();\n const track = mediaObject.mediaStream.getVideoTracks(mediaObject.mediaStream)[0];\n mediaObject.imageCapture = new ImageCapture(track);\n createMediaRecorders(mediaObject);\n\n });\n}", "function startStream() {\n let url = 'http://' + ipAddress + '/webcam/?action=stream'\n var video = document.getElementById('video')\n\n video.setAttribute('src', url)\n\n}", "get camera () {return this._p.camera;}", "getCamera(){\n return this._camera;\n }", "function importWebcamStream() {\n let constraints = {\n video: {\n mandatory: {\n minWidth: width,\n minHeight: height,\n },\n optional: [{ maxFrameRate: 24 }],\n },\n audio: true,\n };\n createCapture(constraints, function (stream) {\n console.log(stream);\n });\n}", "async function setupCamera() {\n let depthStream = await DepthCamera.getDepthStream();\n const depthVideo = document.getElementById('depthStream');\n depthVideo.srcObject = depthStream;\n return DepthCamera.getCameraCalibration(depthStream);\n}", "function _switchCamera() {\n\t\tconsole.log('(ReachSDK::localstream::_switchCamera)');\n\t\tif (videoSources.length>0) {\n\t\t\tcurrentVideoSource = ++currentVideoSource % videoSources.length;\n\t\t\tif (streamAudioVideo) {\n\t\t\t\tconsole.log('(ReachSDK::localstream::_switchCamera)::streamAudioVideo');\n\t\t\t\tstreamAudioVideo.getTracks().forEach((track)=>{\n\t\t\t\t\ttrack.stop();\n\t\t\t\t});\n\t\t\t\tinitAudioVideo();\n\t\t\t}\n\t\t\tif (streamVideo) {\n\t\t\t\tconsole.log('(ReachSDK::localstream::_switchCamera)::streamVideo');\n\t\t\t\tstreamVideo.getTracks().forEach((track)=>{\n\t\t\t\t\ttrack.stop();\n\t\t\t\t});\n\t\t\t\tinitVideo();\n\t\t\t}\n\t\t}\n\t}", "function proxyCordovaCamera() {\n\tif (IS_MOCKMOBILE) {\n\t\tconsole.log(\"*** HTML5 Camera Capture ***\");\n\t\tnavigator.camera = {\n\t\t\tgetPicture : localFileInput\n\t\t};\n\t}\n}", "render() {\n return (\n <View style={styles.main}>\n {/*Camera module imported from react-native-camera with all the necessary\n accessibility options */}\n <RNCamera\n ref={(cam) => {\n this.camera = cam;\n }}\n style={styles.camera}\n type={this.state.cameraType}\n mirrorImage={this.state.mirrorMode}\n playSoundOnCapture={false}\n />\n {/*captureSwitch() used to switch between views based on user interaction*/}\n {this.captureSwitch()}\n </View>\n );\n }", "function showCamera(arg) {\n\n\ttry {\n\t\tvar success = true;\n\t\tif (OS_IOS) {\n\t\t\tvar success = Titanium.Media.isCameraAccessible();\n\t\t}\n\t\tif (success) {\n\t\t\tTitanium.Media.showCamera({\n\t\t\t\tsuccess : photoFattchSuccess,\n\t\t\t\tcancel : function() {\n\t\t\t\t\tTi.API.info(' Cancelled ');\n\t\t\t\t},\n\t\t\t\terror : function(error) {\n\t\t\t\t\tif (error.code == 2) {\n\t\t\t\t\t\tAlloy.Globals.ShowAlert(Alloy.Globals.VTaxSelectedLanguage.attachMedia, Alloy.Globals.VTaxSelectedLanguage.cameraNotAvail);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tallowEditing : true,\n\t\t\t\tsaveToPhotoGallery : true,\n\t\t\t\tmediaTypes : arrMediaTypes,\n\t\t\t});\n\t\t} else {\n\t\t\tAlloy.Globals.ShowAlert(Alloy.Globals.VTaxSelectedLanguage.camera, Alloy.Globals.VTaxSelectedLanguage.cameraNotAccess);\n\t\t}\n\t} catch(ex) {\n\t}\n\n}", "_capture() {\n\n // prevent from streaming errors\n try {\n\n // capture the media stream\n navigator.mediaDevices.getUserMedia({\n audio: this._props.sound,\n video: (() => {\n if (this._props.camera === false) {\n return false;\n }\n\n return {\n frameRate: this._props.framerate,\n aspectRatio: this._props.ratio,\n facingMode: this._props.mode === 'front' ? 'user' : 'environment'\n };\n })()\n }).then((stream) => {\n\n // store the blob stream\n this._stream = stream;\n\n // capture the blob stream\n this._media.srcObject = stream;\n\n // set the volume at start\n this.volume = this._props.volume;\n\n // animation loop used to properly render the viewport\n const loop = () => {\n\n // render the viewport with or without custom filter\n if (typeof this._props.filter !== 'function') {\n this.viewport.getContext('2d').drawImage(this._media, 0, 0, this._props.width, this._props.height);\n } else {\n\n // use a buffer when applying a custom filter to prevent the viewport from blinking or flashing\n if (typeof this._buffer === 'undefined') {\n this._buffer = document.createElement('canvas');\n this._buffer.style.display = 'none';\n this._buffer.width = this._props.width;\n this._buffer.height = this._props.height;\n this.viewport.parentNode.insertBefore(this._buffer, this.viewport.nextSibling);\n }\n\n this._buffer.getContext('2d').drawImage(this._media, 0, 0, this._props.width, this._props.height);\n this.viewport.getContext('2d').putImageData(this._filter(this._buffer.getContext('2d').getImageData(0, 0, this._props.width, this._props.height)), 0, 0);\n }\n\n // make this function run at 60fps\n requestAnimationFrame(loop);\n };\n\n // render the first frame\n requestAnimationFrame(loop);\n\n if (typeof this._props.done === 'function') {\n this._props.done();\n }\n }).catch((exception) => {\n if (typeof this._props.fail === 'function') {\n this._props.fail(exception);\n }\n });\n } catch(exception) {\n if (typeof this._props.fail === 'function') {\n this._props.fail(exception);\n }\n }\n }", "updateCamera() {\n\t\tCameraManager.updateCamera();\n\t}", "function getStream() {\n if (mediaStream) {\n mediaStream.getTracks().forEach(track => {\n track.stop();\n });\n }\n var videoSource = videoSelect.value;\n constraints = {\n video: {deviceId: videoSource ? {exact: videoSource} : undefined}\n };\n navigator.mediaDevices.getUserMedia(constraints)\n .then(stream)\n .catch(error => {\n console.log('getUserMedia error: ', error);\n });\n}", "_switchCamera() {\n if (this.isVideoTrack() && this.videoType === _service_RTC_VideoType__WEBPACK_IMPORTED_MODULE_10___default.a.CAMERA && typeof this.track._switchCamera === 'function') {\n this.track._switchCamera();\n\n this._facingMode = this._facingMode === _service_RTC_CameraFacingMode__WEBPACK_IMPORTED_MODULE_7___default.a.ENVIRONMENT ? _service_RTC_CameraFacingMode__WEBPACK_IMPORTED_MODULE_7___default.a.USER : _service_RTC_CameraFacingMode__WEBPACK_IMPORTED_MODULE_7___default.a.ENVIRONMENT;\n }\n }", "function startVideo(){\n //gets the webcam, takes object as the first param, video is key, empty object as param\n navigator.getUserMedia(\n {video: {}},\n //whats coming from our webcam, setting it as source\n stream =>video.srcObject = stream,\n err => console.log(err))\n}", "async function initCamera() {\r\n console.log (\"##f()## initCamera function execution\");\r\n const constraints = {\r\n audio: false,\r\n video: {\r\n width: 320, height: 240\r\n }\r\n };\r\n try {\r\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\r\n handleSuccess(stream);\r\n changeStyleForStep2();\r\n } catch (e) {\r\n alert(`navigator.getUserMedia error:${e.toString()}`);\r\n }\r\n}", "function broadcastCameraControl() {\n\tif ($scope.localMember.haveCameraControl) {\n\t ahoyService.sendControlMessage({ cameraControl: { camera: { name: $scope.cameras[0].name, id: $scope.cameras[0].id}, allow: $scope.sharingCameraControl}});\n\t}\n }", "function selectMediaStream() {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia().then(() => { \n videoElement.srcObject = mediaStream;\n videoElement.onloadedmetadata = () => {\n videoElement.play();\n };\n })\n}", "function onStreamFetched (mediaStream) {\n\n console.log(\"onStreamFetched\");\n\n webcam.srcObject = mediaStream;\n webcam.play();\n\n // Check whether we know the video dimensions yet, if so, start BRFv4.\n function onStreamDimensionsAvailable () {\n\n console.log(\"onStreamDimensionsAvailable\");\n\n if (webcam.videoWidth === 0) {\n setTimeout(onStreamDimensionsAvailable, 100);\n } else {\n\n // Resize the canvas to match the webcam video size.\n imageData.width\t\t= window.innerWidth - 26;\n imageData.height\t= window.innerHeight - 12;\n imageDataCtx\t\t= imageData.getContext(\"2d\");\n\n // on iOS we want to close the video stream first and\n // wait for the heavy BRFv4 initialization to finish.\n // Once that is done, we start the stream again.\n\n if(isIOS11) {\n webcam.pause();\n webcam.srcObject.getTracks().forEach(function(track) {\n track.stop();\n });\n }\n\n waitForSDK();\n }\n }\n\n if(imageDataCtx === null) {\n onStreamDimensionsAvailable();\n } else {\n trackFaces();\n }\n }", "async function openCamera(cameraId, minWidth, minHeight) {\n try {\n const constraints = {\n audio: { echoCancellation: true },\n video: {\n deviceId: cameraId,\n width: { min: minWidth },\n height: { min: minHeight },\n },\n };\n return await openMediaDevices(constraints);\n } catch (error) {\n console.error(error);\n alert(`Couldn't get Camera List. Please ensure camera permissions are granted for the browser and for the website.`);\n }\n }", "function createCameraStream(uid) {\n var localStream = AgoraRTC.createStream({\n streamID: uid,\n audio: true,\n video: true,\n screen: false\n });\n localStream.setVideoProfile(cameraVideoProfile);\n localStream.init(function () {\n console.log(\"getUserMedia successfully\");\n // TODO: add check for other streams. play local stream full size if alone in channel\n localStream.play('local-video'); // play the given stream within the local-video div\n\n // publish local stream\n client.publish(localStream, function (err) {\n console.log(\"[ERROR] : publish local stream error: \" + err);\n });\n\n enableUiControls(localStream); // move after testing\n localStreams.camera.stream = localStream; // keep track of the camera stream for later\n }, function (err) {\n console.log(\"[ERROR] : getUserMedia failed\", err);\n });\n}", "async function setupCamera (config) {\n const { videoWidth, videoHeight } = config\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n throw new Error(\n 'Browser API navigator.mediaDevices.getUserMedia not available'\n )\n }\n\n const video = document.getElementById('video')\n video.width = videoWidth\n video.height = videoHeight\n\n const mobile = isMobile()\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n facingMode: 'user',\n width: mobile ? undefined : videoWidth,\n height: mobile ? undefined : videoHeight\n }\n })\n video.srcObject = stream\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video)\n }\n })\n}", "async function startStream() \n {\n \n if (localMediaStream)\n return;\n\n try {\n localMediaStream = await navigator.mediaDevices.getUserMedia({\n video: true,\n audio: true\n });\n\n }\n catch (e) {\n console.error('start camera error', e);\n }\n\n await soupclient.sendStream(localMediaStream);\n\n\n const ret = await window.drawsocket.on_newLocalStream(localMediaStream);\n if( ret != 1 )\n {\n defaultDisplay();\n }\n\n // default display when \n }", "changeCamera() {\n this.scene.camera = this.cameras[this.currentView];\n }", "function getStream() {\n if (mediaStream) {\n mediaStream.getTracks().forEach(track => {\n track.stop();\n });\n }\n var videoSource = videoSelect.value;\n constraints = {\n video: {deviceId: videoSource ? {exact: videoSource} : undefined}\n };\n navigator.mediaDevices.getUserMedia(constraints)\n .then(gotStream)\n .catch(error => {\n console.log('getUserMedia error: ', error);\n });\n}", "function handleSuccess(stream){\n recordButton.disabled=false;\n console.log('getUserMedia() got stream:', stream);\n window.stream = stream;\n\n const gumVideo = document.querySelector(\"video#gum\");\n gumVideo.srcObject=stream;\n}", "function onWebcamConnectSuccessDEMO () {\n console.log(\"Webcam access allowed\");\n}", "async function selectMediaStream() {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia(); //Screen Capture API\n videoElement.srcObject = mediaStream; //pass the mediaStream as the source\n videoElement.onloadedmetadata = () => { \n videoElement.play();\n }\n } catch (error) {\n console.log('Ooops, we\\'ve got an error: ', error);\n }\n}", "render() {\n return (\n <View style={styles.container}>\n <View style={styles.cameraContainer}>\n <CameraComponent type=\"Front\" ref=\"cameraComponent\" />\n </View>\n <View style={styles.cameraBottom}>\n <View style={styles.cameraButtonContainer}>\n <Button style={styles.cameraButton} onPress={() => { this.props.takePicture() }} />\n </View>\n </View>\n </View>\n )\n }", "function getStreamAndRecord() {\n navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n height: {max: 480}\n }\n })\n .then(function (stream) {\n video.srcObject = stream;\n video.play();\n return stream;\n })\n}", "function captureCamera_candidate(callback) {\n navigator.mediaDevices.getUserMedia({ audio: true, video: true }).then(function(camera) {\n callback(camera);\n }).catch(function(error) {\n alert('Unable to capture your camera. Please check console logs.');\n console.error(error);\n });\n}", "function startCamera() {\n document.querySelector('#start').style.display = 'none';\n //Right now only chrome on Android and Chrome on Linux/CrOS will work.\n\n if (navigator.userAgent.match(/Android/i)) {\n navigator.mediaDevices.getUserMedia(constraints_mobile)\n .then(gotMedia)\n .catch(e => {\n console.error('getUserMedia() failed: ', e);\n });\n } else {\n navigator.mediaDevices.getUserMedia(constraints_general)\n .then(gotMedia)\n .catch(e => {\n console.error('getUserMedia() failed: ', e);\n });\n }\n}", "function startPreview() {\n var captureSettings = null;\n return findCamera()\n .then(function (id) {\n var captureInitSettings, videoDeviceController;\n try {\n captureInitSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();\n } catch (e) {\n if (e.number === REGDB_E_CLASSNOTREG) {\n throw new Error('Ensure that you have Windows Media Player and Media Feature pack installed.');\n }\n\n throw e;\n }\n captureInitSettings.videoDeviceId = id;\n captureInitSettings.sharingMode = Windows.Media.Capture.MediaCaptureSharingMode &&\n Windows.Media.Capture.MediaCaptureSharingMode.exclusiveControl;\n captureInitSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.video;\n\n // use of SoftwareBitmap member in captured frames\n captureInitSettings.memoryPreference = Windows.Media.Capture.MediaCaptureMemoryPreference &&\n Windows.Media.Capture.MediaCaptureMemoryPreference.cpu;\n\n // try first with photo capture source\n captureInitSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.photo;\n\n capture = new Windows.Media.Capture.MediaCapture();\n return new WinJS.Promise(function(initComplete, initError) {\n return capture.initializeAsync(captureInitSettings).then(function() {\n videoDeviceController = capture.videoDeviceController;\n photoProperties = videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.photo);\n videoPreviewProperties = videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.videoPreview);\n initComplete(capture);\n }, function(error) {\n // try again with automatic capture source\n captureInitSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.videoPreview;\n return capture.initializeAsync(captureInitSettings).then(function() {\n videoDeviceController = capture.videoDeviceController;\n videoPreviewProperties = videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.videoPreview);\n initComplete(capture);\n },\n function(err) {\n initError(err);\n });\n });\n });\n\n })\n .then(function () {\n // Get available aspect ratios\n var defaultAspectRatio = DEFAULT_ASPECT_RATIO;\n var aspectRatios = getAspectRatios();\n var sortedAspectRatios = aspectRatios.sort(function (aspectA, aspectB) {\n // sort aspect by defaultAspectRatio\n return (aspectA - defaultAspectRatio)*(aspectA - defaultAspectRatio) - (aspectB - defaultAspectRatio)*(aspectB - defaultAspectRatio);\n });\n var aspect = sortedAspectRatios[0];\n\n var maxResolution = getDesiredMaxResolution() || 5000000;\n\n // Max photo resolution with desired aspect ratio\n var videoDeviceController = capture.videoDeviceController;\n var photoResolution = {};\n\n var filteredResolutions;\n if (photoProperties) {\n filteredResolutions = photoProperties.filter(function(elem) {\n return ((elem.width / elem.height).toFixed(1) === aspect && elem.width * elem.height <= maxResolution);\n });\n if (filteredResolutions && filteredResolutions.length > 0) {\n // Max photo resolution with desired aspect ratio and <= maxResolution\n photoResolution = filteredResolutions.reduce(function(prop1, prop2) {\n return (prop1.width * prop1.height) > (prop2.width * prop2.height) ? prop1 : prop2;\n });\n } else {\n // Min photo resolution with desired aspect ratio\n photoResolution = photoProperties.filter(function(elem) {\n return ((elem.width / elem.height).toFixed(1) === aspect);\n }).reduce(function(prop1, prop2) {\n return (prop1.width * prop1.height) < (prop2.width * prop2.height) ? prop1 : prop2;\n });\n }\n if (maxResolution > 2100000) {\n maxResolution = 2100000;\n }\n }\n\n var videoPreviewResolution;\n filteredResolutions = videoPreviewProperties.filter(function(elem) {\n return ((elem.width / elem.height).toFixed(1) === aspect && elem.width * elem.height <= maxResolution);\n });\n if (filteredResolutions && filteredResolutions.length > 0) {\n // Max video preview resolution with desired aspect ratio and <= maxResolution\n videoPreviewResolution = filteredResolutions.reduce(function (prop1, prop2) {\n return (prop1.width * prop1.height) > (prop2.width * prop2.height) ? prop1 : prop2;\n });\n } else {\n // Min video preview resolution with desired aspect ratio\n videoPreviewResolution = videoPreviewProperties.filter(function(elem) {\n return ((elem.width / elem.height).toFixed(1) === aspect);\n }).reduce(function (prop1, prop2) {\n return (prop1.width * prop1.height) < (prop2.width * prop2.height) ? prop1 : prop2;\n });\n }\n\n\n videoProps = videoPreviewResolution;\n captureSettings = {\n capture: capture,\n width: videoProps.width,\n height: videoProps.height\n }\n\n if (photoResolution.length > 0) {\n return videoDeviceController.setMediaStreamPropertiesAsync(Windows.Media.Capture.MediaStreamType.photo, photoResolution).then(function () {\n return videoDeviceController.setMediaStreamPropertiesAsync(Windows.Media.Capture.MediaStreamType.videoPreview, videoPreviewResolution);\n });\n } else {\n return videoDeviceController.setMediaStreamPropertiesAsync(Windows.Media.Capture.MediaStreamType.videoPreview, videoPreviewResolution);\n }\n })\n .then(function () {\n if (photoProperties) {\n var encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createUncompressed(Windows.Media.MediaProperties.MediaPixelFormat.bgra8);\n return capture.prepareLowLagPhotoCaptureAsync(encodingProperties).then(function(llc) {\n lowLagPhotoCapture = llc;\n });\n } else {\n return WinJS.Promise.as();\n }\n })\n .then(function () {\n capturePreview.msZoom = true;\n capturePreview.src = URL.createObjectURL(capture);\n capturePreview.play();\n\n // Insert preview frame and controls into page\n document.body.appendChild(capturePreviewFrame);\n\n resizePreview();\n disableZoomAndScroll();\n\n return setupFocus(capture.videoDeviceController)\n .then(function () {\n Windows.Graphics.Display.DisplayInformation.getForCurrentView().addEventListener(\"orientationchanged\", updatePreviewForRotation, false);\n return updatePreviewForRotation();\n })\n .then(function () {\n if (!Windows.Media.Devices.CameraStreamState) {\n // CameraStreamState is available starting with Windows 10 so skip this check for 8.1\n // https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.devices.camerastreamstate\n return WinJS.Promise.as();\n }\n function checkCameraStreamState() {\n if (capture.cameraStreamState !== Windows.Media.Devices.CameraStreamState.streaming) {\n // Using loop as MediaCapture.CameraStreamStateChanged does not fire with CameraStreamState.streaming state.\n return WinJS.Promise.timeout(CAMERA_STREAM_STATE_CHECK_RETRY_TIMEOUT)\n .then(function () {\n return checkCameraStreamState();\n });\n }\n return WinJS.Promise.as();\n }\n // Ensure CameraStreamState is Streaming\n return checkCameraStreamState();\n })\n .then(function () {\n resizePreview();\n return captureSettings;\n });\n });\n }", "async function selectMediaStream() {\n try {\n // Working with Screen Capture API.\n // We get our mediastream data.\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n // We pass the mediaStream the user select as video src.\n video.srcObject = mediaStream;\n // When the video has loaded its metadata it's gonna call a function to play the video.\n video.onloadedmetadata = () => {\n video.play();\n }\n } catch (error) {\n console.error(`Whoops, error here: ${error}`);\n }\n}", "renderCamera() {\n return (\n <RNCamera\n ref={ref => {\n this.camera = ref;\n }}\n style={{flex:1,flexDirection:'column'}}\n type={RNCamera.Constants.Type.back}\n flashMode={RNCamera.Constants.FlashMode.on}\n permissionDialogTitle={'Permission to use camera'}\n permissionDialogMessage={'We need your permission to use your camera phone'}\n />\n )\n }", "function openCamera(){\n\t\t$(\"#camera\").webcam({\n\t width: 320,\n\t height: 240,\n\t mode: \"save\",\n\t swffile: \"jscam.swf\",\n\t onTick: function(remain) {\n\t \tif(remain == 0){\n\t \t\tcountDownPanel.html(\"Cheese!\");\n\t \t\t\n \t\t $(\"#flash\").css(\"display\", \"block\");\n\t\t\t $(\"#flash\").fadeOut(\"fast\", function () {\n\t\t\t $(\"#flash\").css(\"opacity\", 1);\n\t\t\t });\n\n\t \t}\n\t \tcountDownPanel.html(remain);\n\t },\n\t onSave: function() {\n\t \t// alert(\"saved\");\n\t \t\n\t \t// $.post(\n\t\t\t\t\t// \"getSnapshotHistory.php\",\n\t\t\t\t\t// {},\n\t\t\t\t\t// function(data){\n// \t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// sshistory = \"<img src='snapshots/\" + data[0] + \"'>\";\n\t\t\t\t\t\t// $(\"#camera\").html(sshistory);\n\t\t\t\t\t// },\n\t\t\t\t\t// \"json\"\n\t\t\t\t// );\n\n\t },\n\t onCapture: function() {\n\t \t\tcountDownPanel.html(\"\");\n\t \t\n\t \twindow.webcam.save(\"saveSnapshot.php\");\n\t\t\t},\n\t debug: function() {},\n\t onLoad: function() {\n\t \tcountDownPanel.html(\"\");\n\t }\n\t\t});\n\t}", "getCamera() {\n return this._engine._camera;\n }", "function loadCamera() {\n var sources = [];\n function gotSources(sourceInfos) {\n sources = sourceInfos.filter((s) => s.kind === \"video\");\n var desiredSource;\n if (sources.length === 1) {\n desiredSource = sources[0];\n } else {\n var backCams = sources.filter((s) => s.label.includes(\"back\"));\n if (backCams.length > 0) {\n desiredSource = backCams[0];\n }\n else {\n desiredSource = sources[0];\n }\n }\n startCamera(desiredSource);\n }\n\n if (typeof MediaStreamTrack === 'undefined' ||\n typeof MediaStreamTrack.getSources === 'undefined') {\n alert('This browser does not support MediaStreamTrack.\\n\\nTry Chrome.');\n } else {\n MediaStreamTrack.getSources(gotSources);\n }\n}", "function capturePic(){\n cameraSensor.width = cameraView.videoWidth;\n cameraSensor.height = cameraView.videoHeight;\n cameraSensor.getContext(\"2d\").drawImage(cameraView, 0, 0);\n picPreview.src = cameraSensor.toDataURL(\"image/webp\");\n picPreview.classList.add(\"picPreview\");\n}", "async function setupCamera() {\n const video = document.getElementById('video');\n const canvas = document.getElementById('canvas');\n if (!video || !canvas) return null;\n\n let msg = '';\n log('Setting up camera');\n // setup webcam. note that navigator.mediaDevices requires that page is accessed via https\n if (!navigator.mediaDevices) {\n log('Camera Error: access not supported');\n return null;\n }\n let stream;\n const constraints = {\n audio: false,\n video: { facingMode: 'user', resizeMode: 'crop-and-scale' },\n };\n if (window.innerWidth > window.innerHeight) constraints.video.width = { ideal: window.innerWidth };\n else constraints.video.height = { ideal: window.innerHeight };\n try {\n stream = await navigator.mediaDevices.getUserMedia(constraints);\n } catch (err) {\n if (err.name === 'PermissionDeniedError' || err.name === 'NotAllowedError') msg = 'camera permission denied';\n else if (err.name === 'SourceUnavailableError') msg = 'camera not available';\n log(`Camera Error: ${msg}: ${err.message || err}`);\n return null;\n }\n // @ts-ignore\n if (stream) video.srcObject = stream;\n else {\n log('Camera Error: stream empty');\n return null;\n }\n const track = stream.getVideoTracks()[0];\n const settings = track.getSettings();\n if (settings.deviceId) delete settings.deviceId;\n if (settings.groupId) delete settings.groupId;\n if (settings.aspectRatio) settings.aspectRatio = Math.trunc(100 * settings.aspectRatio) / 100;\n log(`Camera active: ${track.label}`); // ${str(constraints)}\n log(`Camera settings: ${str(settings)}`);\n canvas.addEventListener('click', () => {\n // @ts-ignore\n if (video && video.readyState >= 2) {\n // @ts-ignore\n if (video.paused) {\n // @ts-ignore\n video.play();\n detectVideo(video, canvas);\n } else {\n // @ts-ignore\n video.pause();\n }\n }\n // @ts-ignore\n log(`Camera state: ${video.paused ? 'paused' : 'playing'}`);\n });\n return new Promise((resolve) => {\n video.onloadeddata = async () => {\n // @ts-ignore\n canvas.width = video.videoWidth;\n // @ts-ignore\n canvas.height = video.videoHeight;\n // @ts-ignore\n video.play();\n detectVideo(video, canvas);\n resolve(true);\n };\n });\n}", "function startCamera()\n{\n $('#camera_wrap').camera({fx: 'scrollLeft', time: 2000, loader: 'none', playPause: false, navigation: true, height: '35%', pagination: true});\n}", "setCamera() {\r\n // set up camera\r\n this.camera = new Camera({\r\n time: this.time,\r\n sizes: this.sizes,\r\n renderer: this.renderer,\r\n debug: this.debug,\r\n config: this.config\r\n });\r\n\r\n // add to scene\r\n this.scene.add(this.camera.container);\r\n\r\n // update camera position per frame\r\n this.time.on('update', () => {\r\n if (this.world && this.world.car) { // if car is on the scene\r\n this.camera.target.x = this.world.car.chassis.object.position.x;\r\n this.camera.target.y = this.world.car.chassis.object.position.y;\r\n this.camera.target.z = this.world.car.chassis.object.position.z;\r\n this.camera.direction.x = this.world.car.movement.direction.x;\r\n this.camera.direction.y = this.world.car.movement.direction.y;\r\n }\r\n });\r\n }", "function startWebcam() {\n var vid = document.querySelector('video');\n // request cam\n navigator.mediaDevices.getUserMedia({\n video: true\n })\n .then(stream => {\n // save stream to variable at top level so it can be stopped lateron\n webcamStream = stream;\n // show stream from the webcam on te video element\n vid.srcObject = stream;\n // returns a Promise to indicate if the video is playing\n return vid.play();\n })\n .then(() => {\n // enable the 'take a snap' button\n var btn = document.querySelector('#takeSnap');\n btn.disabled = false;\n // when clicked\n btn.onclick = e => {\n takeSnap()\n .then(blob => {\n analyseImage(blob, params, showResults);\n })\n };\n })\n .catch(e => console.log('error: ' + e));\n}", "async function setupWebcam() {\n if (navigator.mediaDevices.getUserMedia) {\n const stream = await navigator.mediaDevices.getUserMedia({\n \"audio\": false,\n \"video\": {\n width: {\n min: 640,\n max: 640\n },\n height: {\n min: 480,\n max: 480\n }\n }\n });\n\n webcam.srcObject = stream;\n\n return new Promise((resolve) => {\n webcam.onloadedmetadata = () => {\n webcam.width = stream.getVideoTracks()[0].getSettings().width;\n webcam.height = stream.getVideoTracks()[0].getSettings().height;\n canvas.width = stream.getVideoTracks()[0].getSettings().width;\n canvas.height = stream.getVideoTracks()[0].getSettings().height;\n\n canvasDims = [canvas.height, canvas.width];\n\n resolve(webcam);\n };\n });\n }\n}", "async function setupCam() {\n navigator.mediaDevices.getUserMedia({\n video: true\n }).then(mediaStream => {\n vid.srcObject = mediaStream;\n }).catch((error) => {\n console.warn(error);\n });\n await knn.load();\n setTimeout(loop, 50);\n}", "function startPreview() {\n var captureSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();\n captureSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.video;\n captureSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.videoPreview;\n \n // Enumerate cameras and add find first back camera\n var cameraId = null;\n var deviceInfo = Windows.Devices.Enumeration.DeviceInformation;\n if (deviceInfo) {\n deviceInfo.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture).done(function (cameras) {\n if (cameras && cameras.length > 0) {\n cameras.forEach(function (camera) {\n if (camera && !cameraId) {\n // Make use of the camera's location if it is available to the description\n var camLocation = camera.enclosureLocation;\n if (camLocation && camLocation.panel === Windows.Devices.Enumeration.Panel.back) {\n cameraId = camera.id;\n }\n }\n });\n }\n if (cameraId) {\n captureSettings.videoDeviceId = cameraId;\n }\n\n capture.initializeAsync(captureSettings).done(function () {\n\n //trying to set focus mode\n var controller = capture.videoDeviceController;\n\n if (controller.focusControl && controller.focusControl.supported) {\n if (controller.focusControl.configure) {\n var focusConfig = new Windows.Media.Devices.FocusSettings();\n focusConfig.autoFocusRange = Windows.Media.Devices.AutoFocusRange.macro;\n\n var supportContinuousFocus = controller.focusControl.supportedFocusModes.indexOf(Windows.Media.Devices.FocusMode.continuous).returnValue;\n var supportAutoFocus = controller.focusControl.supportedFocusModes.indexOf(Windows.Media.Devices.FocusMode.auto).returnValue;\n\n if (supportContinuousFocus) {\n focusConfig.mode = Windows.Media.Devices.FocusMode.continuous;\n } else if (supportAutoFocus) {\n focusConfig.mode = Windows.Media.Devices.FocusMode.auto;\n }\n\n controller.focusControl.configure(focusConfig);\n controller.focusControl.focusAsync();\n }\n }\n\n var deviceProps = controller.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.videoRecord);\n\n deviceProps = Array.prototype.slice.call(deviceProps);\n deviceProps = deviceProps.filter(function (prop) {\n // filter out streams with \"unknown\" subtype - causes errors on some devices\n return prop.subtype !== \"Unknown\";\n }).sort(function (propA, propB) {\n // sort properties by resolution\n return propB.width - propA.width;\n });\n\n var maxResProps = deviceProps[0];\n\n controller.setMediaStreamPropertiesAsync(Windows.Media.Capture.MediaStreamType.videoRecord, maxResProps).done(function () {\n capturePreview.src = URL.createObjectURL(capture);\n // handle orientation change\n rotateVideoOnOrientationChange = true;\n capturePreview.onloadeddata = function () {\n updatePreviewForRotation();\n };\n // add event handler - will not work anyway\n window.addEventListener(\"orientationchange\", updatePreviewForRotation, false);\n\n capturePreview.play();\n\n // Insert preview frame and controls into page\n document.body.appendChild(capturePreview);\n document.body.appendChild(capturePreviewAlignmentMark);\n document.body.appendChild(captureCancelButton);\n\n startBarcodeSearch(maxResProps.width, maxResProps.height);\n });\n });\n });\n }\n }", "async function selectMediaStream() {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n videoEl.srcObject = mediaStream;\n videoEl.onloadedmetadata = () => {\n videoEl.play();\n };\n } catch (error) {\n throw new Error('Error loading Media Stream', error);\n }\n}", "render() {\n const { hasCameraPermission } = this.state;\n // console.log(this.getRatios())\n if (hasCameraPermission === null) {\n return <View />;\n } else if (hasCameraPermission === false) {\n return <Text>No access to camera</Text>;\n } else {\n return (\n <Modal\n ref={'myCameraModal'}\n visible={this.state.modalVisible}\n onRequestClose={() => {\n\n this.setState({\n zoom: 0,\n whiteBalance: 'auto',\n modalVisible: false,\n // newPhotos:false\n })\n }}\n >\n <View style={{ flex: 1 }}>\n <Camera\n ref={ref => {\n this.camera = ref;\n }}\n style={{ height: height }} type={this.state.type}\n flashMode={this.state.flash}\n zoom={this.state.zoom}\n whiteBalance={this.state.whiteBalance}\n autoFocus={this.state.autoFocus}\n ratio={this.state.ratio}\n onMountError={this.handleMountError}\n >\n {this.renderbottom(this.state.type)}\n\n\n </Camera>\n </View>\n </Modal>\n );\n }\n }", "function setupCamera() {\n return _setupCamera.apply(this, arguments);\n}", "function startvideo() {\n webcam.style.width = document.width + 'px';\n webcam.style.height = document.height + 'px';\n webcam.setAttribute('autoplay', '');\n webcam.setAttribute('muted', '');\n\twebcam.setAttribute('playsinline', '');\n\n var constraints = {\n audio: false,\n video: {\n facingMode: 'user'\n }\n }\n \tnavigator.mediaDevices.getUserMedia(constraints).then(function success(stream) {\n webcam.srcObject = stream;\n initImages();\n animate();\n });\n}", "async function selectStream () {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n video.srcObject = mediaStream;\n video.onloadedmetadata = () => {\n video.play();\n }\n } catch (error) {\n console.log('whoops, error in selectStream function', error)\n }\n}", "async function selectMediaToStream() {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n videoElement.srcObject = mediaStream;\n playVideo();\n } catch (error) {\n console.log(error);\n }\n}", "async function selectMediaStream() {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n video.srcObject = mediaStream;\n video.onloadedmetadata = () => {\n video.play();\n };\n } catch (ex) {\n alert(ex.message);\n }\n}", "async function selectMediaStream(){\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n videoElement.srcObject = mediaStream;\n videoElement.onloadedmetadata = ()=>{\n videoElement.play();\n }\n } catch (err) {\n console.log('Whoops error here: ', err);\n }\n}", "function startVideo() {\n navigator.getUserMedia(\n { video: {} },\n stream => video.srcObject = stream,\n error => console.error(error)\n )\n}", "initViews() {\n let viewsId = []; //array used for interface cameras dropdown\n\n for (var key in this.graph.views) {\n if (this.graph.views.hasOwnProperty(key)) {\n var view = this.graph.views[key];\n\n if (view.type === \"ortho\") {\n let v = new CGFcameraOrtho(\n view.left, view.right, view.bottom, view.top,\n view.near, view.far,\n vec3.fromValues(...Object.values(view.from)),\n vec3.fromValues(...Object.values(view.to)),\n vec3.fromValues(...Object.values(view.up))\n );\n this.views[key] = v;\n } else if (view.type === \"perspective\") {\n let v = new CGFcamera(\n view.angle * DEGREE_TO_RAD, view.near,\n view.far, vec3.fromValues(...Object.values(view.from)),\n vec3.fromValues(...Object.values(view.to))\n );\n this.views[key] = v;\n }\n\n viewsId.push(key);\n }\n }\n\n //change to the default view defined\n this.selectedView = this.graph.defaultViewId;\n //this.camera = this.views[this.selectedView];\n // this.interface.setActiveCamera(this.camera);\n\n //add the views dropdown to the interface\n this.interface.viewsDropDown(viewsId);\n\n if (!this.menuMode) {\n // Already playing (not in menu mode), change player camera to the defined default\n this.setCurrentCamera(this.graph.defaultViewId); \n }\n else {\n this.interface.setActiveCamera(null);\n }\n\n this.game_camera = this.camera;\n }", "function getVideo() {// getUserMedia must have MediaStreamConstraints\n navigator.mediaDevices.getUserMedia({ video: true, audio: false}) // returns promise\n .then(MediaStream => {\n console.log(MediaStream); // MediaStream is an object\n video.srcObject = MediaStream; // video.srcObject is different to teacher video\n video.play();\n }).catch(err => {\n console.error(`Oh no!! You need to allow the site to use your webcam, ${err}`);\n alert(`Please reload and allow the site to access your webcam`);\n })\n}", "function takeVideoStream() {\n\tcleanElements(); // CLean all the elements\n\t\n\t// Create the start, stop and video elements for the video stream\n\tvar videoStreamElement = document.getElementById(\"videoStreamElement\");\n\tvideoStreamElement.innerHTML = '<br><button class=\"btn btn-dark\" id=\"startStream\">Start recording</button><br>';\n\tvideoStreamElement.innerHTML += '<button class=\"btn btn-dark\" id=\"stopStream\">Stop recording</button><br>';\n\tvideoStreamElement.innerHTML += '<br><br><video></video>';\n\tvideoStreamElement.innerHTML += '<br><br><video id=\"capturedVideoStream\" controls></video>';\n\n\tvar start = document.getElementById(\"startStream\");\n\tvar stop = document.getElementById(\"stopStream\");\n\tvar capturedVideoStream = document.getElementById(\"capturedVideoStream\");\n\tcapturedVideoStream.style.visibility = \"hidden\"; // Hide the second video element (the captured video element)\n\n\n\t// The constraints for the media\n\tlet constraint = {\n\t\taudio: false,\n\t\tvideo: { facingMode: \"user\" }\n\t}\n\n\t// Handle old browsers that do not support the medie capture API\n\tif (navigator.mediaDevices == undefined) {\n\t\t/*navigator.mediaDevices = {};\n\t\tnavigator.mediaDevices.getUserMedia = function(constraintObj) {\n\t\t\tlet getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;\n\t\t\tif (!getUserMedia) {\n\t\t\t\treturn Promise.reject(new Error('getUserMedia is not implemented in this browser'));\n\t\t\t}\n\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\tgetUserMedia.call(navigator, constraintObj, resolve, reject);\n\t\t\t});\n\t\t}*/\n\t} else { // List all the devices ... this is where we can implement the select video capture device\n\t\tnavigator.mediaDevices.enumerateDevices().then(devices => {\n\t\t\tdevices.forEach(device => {\n\t\t\t\tconsole.log(device.kind.toUpperCase(), device.label);\n\t\t\t});\n\t\t}).catch( error => {\n\t\t\tconsole.log(error.name, error.message);\n\t\t});\n\t}\n\n\tnavigator.mediaDevices.getUserMedia(constraint).then(stream => {\n\t\t// Connect the video stream to the the video element\n\t\tlet video = document.querySelector('video');\n\t\tif (\"srcObject\" in video)\n\t\t\tvideo.srcObject = stream; // send the stream to the video element\n\t\telse\n\t\t\tvideo.src = window.URL.createObjectURL(stream); //For old browers\n\n\t\tvideo.onloadedmetadata = function(ev) {\n\t\t\tvideo.play(); // Display the video stream in the video element.\n\t\t}\n\n\t\t//store the blobs of the video stream\n\t\tlet mediaRecorder = new MediaRecorder(stream);\n\t\tlet recordedBlobs = [];\n\n\t\t// Start recording\n\t\tstart.addEventListener('click', (ev) => {\n\t\t\tmediaRecorder.start();\n\t\t\tconsole.log(mediaRecorder.state);\n\t\t\tcapturedVideoStream.style.visibility = \"hidden\"; // Hide the second video element (the captured video element)\n\t\t});\n\n\t\t// Stop recording\n\t\tstop.addEventListener('click', (ev)=> {\n\t\t\tmediaRecorder.stop();\n\t\t\tconsole.log(mediaRecorder.state);\n\t\t});\n\n\t\t// Record all of the blobs\n\t\tmediaRecorder.ondataavailable = function(ev) {\n\t\t\trecordedBlobs.push(ev.data);\n\t\t};\n\n\t\t// When the stop recoding button is clicked\n\t\tmediaRecorder.onstop = (ev)=> {\n\t\t\tlet blob = new Blob(recordedBlobs, { 'type': 'video/mp4;'});\n\n\t\t\trecordedBlobs = [];\n\t\t\tlet videoURL = window.URL.createObjectURL(blob);\n\n\t\t\tcapturedVideoStream.style.visibility = \"visible\"; // Make the captured video element visiable\n\t\t\tcapturedVideoStream.src = videoURL;\n\n\t\t\tsubmitVideo(blob, true); // Submit the video\n\t\t};\n\t}).catch(error => {\n\t\tconsole.log(error.name, error.message);\n\t});\n}", "function callUser(user) {\n getCam()\n .then(stream => {\n const video = document.getElementById(\"selfview\");\n try {\n video.srcObject = stream;\n } catch (error) {\n video.src = URL.createObjectURL(stream);\n }\n // document.getElementById(\"selfview\").srcObject = stream;\n\n /*if (window.URL) {\n document.getElementById(\"selfview\").src = window.URL.createObjectURL(stream);\n } else {\n document.getElementById(\"selfview\").src = stream;\n }*/\n\n toggleEndCallButton();\n caller.addStream(stream);\n localUserMedia = stream;\n caller.createOffer().then(function(desc) {\n caller.setLocalDescription(new RTCSessionDescription(desc));\n channel.trigger(\"client-sdp\", {\n \"sdp\": desc,\n \"room\": user,\n \"from\": id\n });\n room = user;\n });\n\n })\n .catch(error => {\n console.log('an error occured', error);\n })\n}", "attachCamera (object) {\n object.cameraAttached = true\n this.referenceObject = object\n }", "async function videoMediaStream() {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n videoElement.srcObject = mediaStream;\n videoElement.onloadedmetadata = () => {\n videoElement.play();\n }\n } catch (error) {\n //Error\n }\n}" ]
[ "0.758713", "0.75417554", "0.7541669", "0.75172424", "0.75107795", "0.75107795", "0.7510564", "0.7510564", "0.74429345", "0.73991096", "0.70942545", "0.7090021", "0.6948964", "0.6936582", "0.68981737", "0.6872878", "0.68575525", "0.6816149", "0.67939097", "0.67637664", "0.67552626", "0.6754553", "0.67504007", "0.6737054", "0.67364967", "0.6727532", "0.6715372", "0.6705601", "0.66671294", "0.6663341", "0.66608995", "0.6574938", "0.6574938", "0.65589076", "0.6540365", "0.6533258", "0.65317494", "0.6530946", "0.65258664", "0.6514333", "0.65066165", "0.6497025", "0.64951324", "0.6479905", "0.6478697", "0.64629936", "0.6457563", "0.6456081", "0.64499974", "0.64318293", "0.64299166", "0.639236", "0.63760054", "0.63689333", "0.6361934", "0.63603127", "0.636007", "0.6345091", "0.6333829", "0.6331477", "0.6314371", "0.6291593", "0.6289643", "0.627476", "0.6273226", "0.62647355", "0.626262", "0.62561244", "0.6255489", "0.62524474", "0.62515295", "0.6237749", "0.62333006", "0.623162", "0.6231528", "0.62272877", "0.62224674", "0.62071145", "0.6205228", "0.6191666", "0.6185444", "0.6184257", "0.6178344", "0.6176751", "0.6168298", "0.6160929", "0.6129986", "0.6118216", "0.60985124", "0.6098097", "0.6094003", "0.60793686", "0.6071443", "0.606883", "0.6062269", "0.606162", "0.60586834", "0.60561776", "0.6050152", "0.60374475" ]
0.67058706
27
It seems that this function is unused.
function scCloseWebEdit(url) { window.top.returnValue = window.returnValue = url; window.top.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){\n\t// Left intentionally blank. \n}", "private public function m246() {}", "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop(){}", "function StupidBug() {}", "function reserved(){}", "transient protected internal function m189() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "function noop() {} // 313", "function no_op () {}", "function noop () { }", "function noop () { }", "function noop () { }", "function noop () { }", "function _noop$1() {}", "transient private internal function m185() {}", "function emptyFunction() { // 306\n // dummy // 307\n } // 308", "no_op() {}", "function noop() { } // tslint:disable-line:no-empty", "function nope() {}", "function nope() {}", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function noop() { }", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function noop(){\r\n\r\n }", "function noop() {\r\n }", "function noop () {}", "function noop () {}", "function noop () {}", "function noop () {}", "function noop () {}", "function noop () {}", "function noop () {}", "function noop () {}", "transient final protected internal function m174() {}", "function noop() {// No operation performed.\n\t }", "function noop () {\n\t// Function intentionally left empty.\n}", "function ignore() { }", "function noop () {\n\n}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "function noop() {\n}", "function noop() {\n}", "function doNothing() { }", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}" ]
[ "0.73142385", "0.730672", "0.730672", "0.730672", "0.730672", "0.730672", "0.730672", "0.730672", "0.7191441", "0.71903825", "0.71666676", "0.71666676", "0.71666676", "0.71666676", "0.71666676", "0.71666676", "0.71666676", "0.7122185", "0.710747", "0.71002126", "0.7036951", "0.70345145", "0.7028373", "0.6994402", "0.6991334", "0.69684273", "0.69684273", "0.69684273", "0.69684273", "0.69472325", "0.69399935", "0.6934086", "0.6918093", "0.68864334", "0.6866023", "0.6866023", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68521446", "0.68446153", "0.68446153", "0.68446153", "0.68383694", "0.68197894", "0.67941266", "0.67941266", "0.67941266", "0.67941266", "0.67941266", "0.67941266", "0.67941266", "0.67941266", "0.6779652", "0.6768469", "0.6758757", "0.6758286", "0.67502636", "0.6747022", "0.6747022", "0.6747022", "0.6737132", "0.6737132", "0.6735313", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063", "0.67313063" ]
0.0
-1
copy the user name in the message field
function copy_user_name (user_name) { if (document.post.message) { document.post.message.value += user_name; document.post.message.focus(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyUsername(event) {\n\tvar hostname = event.target.parentNode.parentNode.firstChild.innerHTML;\n\tvar hypertext = event.target.parentNode.parentNode.childNodes[1].innerHTML;\n\tvar indexOfTerminator = hypertext.indexOf(\">\");\n\tvar username = hypertext.slice(indexOfTerminator + 2);\n\t\n\tif(username) {\n\t\tclipboardHelper.copyString(username);\n\t\tvar args = [username, hostname];\n\t\ttoast(stringBundle.formatStringFromName(\"usernameCopiedToast\", args, args.length));\n\t} else {\n\t\ttoast(stringBundle.GetStringFromName(\"emptyUsernameToast\"));\n\t}\n}", "onUserNameChange(content) {\n const newName = content.username;\n var content = this.state.currentUser.name + \" changed their name to \" + newName;\n const notiMessage = {\n type: 'postNotification',\n content: content,\n oldUserName: this.state.currentUser.name\n };\n this.setState({currentUser: {name: newName}});\n this.socket.send(JSON.stringify(notiMessage));\n }", "function copyUserEmail(f) {\n\t\t\t\t\t\t\t// getElementById('userEmailMobile').value = getElementById('userEmail').value;\n\t\t\t\t\t\t\tf.name.value = f.emailMobile.value;\n\t\t\t\t\t\t}", "addNewMessage(username, content, type) {\n let oldName = this.state.currentUser.name;\n if (oldName !== username){\n var check = {\n type : 'postNotification',\n content : `${oldName} changed their name to ${username}`\n }\n // Changes the oldName to the new Username\n oldName = username\n this.connection.send(JSON.stringify(check))\n }\n const message = {\n type,\n id: UUID.v4(),\n username,\n content,\n userColor: this.state.userColor\n };\n this.connection.send(JSON.stringify(message));\n\n }", "function setUsername() {\n up.user = vw.getUsername();\n\n signallingConnection.sendToServer({\n user: up.user,\n date: Date.now(),\n id: up.clientID,\n type: \"username\",\n act: \"username\"\n });\n}", "function setUsername() {\n const name = document.getElementById(\"name\").value;\n myUsername = name;\n\n var msg = {\n name,\n date: Date.now(),\n id: clientID,\n type: \"username\"\n };\n connection.send(JSON.stringify(msg));\n}", "function associateUsername(username) {\n USERNAME = username;\n addSystemMessage(textElement('Your username is:'), usernameElement(username));\n}", "function messageTransmit (message) { // eslint-disable-line no-unused-vars\n soField.value = ['User \"' + message.user + '\": ' + message.message, soField.value].join('\\n');\n }", "function toUserStr( msg ) {\n return \"<p class='random'>\" + msg.userName + toTimeStr(msg.messageTime) + \": \" + msg.message + \"<br/></p>\";\n }", "changeUsername(name) {\n let messageObj = {username: name, content: `${this.state.currentUser} changed their name to ${name}`, type: 'postNotification'};\n this.socket.send(JSON.stringify(messageObj));\n this.setState({currentUser: name});\n }", "function changeLocalUsername(name) {\n if(name) {\n chatbox.username = name;\n console.log(\"Server says username should be \" + name);\n ui.$username.text(chatbox.username);\n ui.$profileUsername.text(chatbox.username);\n }\n }", "function onGetUserNameSuccess() {\n $('#message').append('<p>Hello ' + user.get_title() + user.get_email()+'</p>');\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 mailidcopyusername()\n{\n var mailID =$.trim($('#mailidtext').val());\n document.getElementById(\"nametext\").value=mailID;\n}", "set userName (value) {\n this._userName = value\n /**\n * @event IrcUser#userName\n */\n this.emit('userName')\n }", "function PersonalMessage(userName , messageContainer) {\n this.username = userName;\n this.messageContainer = messageContainer;\n\n this.show = function() {\n this.messageContainer.textContent = this.username;\n }\n }", "updateUserDetails() {\n if (!activeUser()) return;\n $(conversations_area).find(`[data-user-id=\"${activeUser().id}\"] .sb-name,.sb-top > a`).html(activeUser().get('full_name'));\n $(conversations_area).find('.sb-user-details .sb-profile').setProfile();\n SBProfile.populate(activeUser(), $(conversations_area).find('.sb-profile-list'));\n }", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n }", "setUsername(user) {\n this.newSystemMessage(user);\n this.setState({\n user: user\n });\n }", "function UserNameReplace() {\n if (typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n}", "function Indivmailidcopyusername()\n{\n var mailID =$.trim($('#Indivmailidtext').val());\n document.getElementById(\"Indivnametext\").value=mailID;\n}", "function newNick(message) {\n let newName = message.content.substr(6).toString()\n message.member.setNickname(newName)\n .catch(console.error)\n console.log(newName)\n message.reply(\"love the new look, \" + message.member.nickname)\n}", "function CreateUserName(divID) {\n var name = Sanitize($(`${divID}`).val());\n name = name.toLowerCase();\n\n if (name.match(/^(https?:\\/\\/)?[a-z0-9]+\\./ig) || name.match(/^@/ig)) {\n name = name.match(/@[a-z0-9-]{3,16}[^\\/]/ig)[0].substring(1);\n }\n\n return name;\n }", "newSystemMessage(newUsername) {\n\n const newSystemMessageObj = {\n type: 'system',\n text: `${this.state.user} changed their name to ${newUsername}`\n }\n \n this.socket.send(JSON.stringify(newSystemMessageObj));\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $('.insertusername').html(wgUserName); }", "saveNewUsername(username) {\n const { currentUser } = this.state;\n if(username && username !== currentUser) {\n const serverNotification = {\n type: \"newNotification\",\n content: `${currentUser} changed their name to ${username}`\n }\n this.setState({currentUser: username});\n this.socket.send(JSON.stringify(serverNotification));\n }\n }", "function PersonalMessage(_username, messagecontainer) {\r\n\t this.username = _username;\r\n\t this.show = function() {\r\n\t messagecontainer.textContent = this.username;\r\n\t \r\n\t }\r\n\t }", "updateAuthPlayerDname(state, value) {\n state.auth_user.DisplayName = value;\n }", "function changeNickname() {\n userLog.name = command[1]; // je change le nickname de l'utilisateur\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}", "async setUser() {\n return Channel.promptedMessage('What\\'s your username?\\n\\n> ');\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}", "userNameChange(username) {\n let newUsername = {name: username};\n let contentString = `${this.state.currentUser.name} has changed their name to ${username}.`;\n let newNotification = {\n type: \"postNotification\",\n content: contentString\n };\n this.socket.send(JSON.stringify(newNotification));\n this.setState({\n currentUser: newUsername,\n content : contentString\n });\n }", "systemMessage(oldUser, newUser) {\n const newMessageObj = {\n type: 'system',\n content: oldUser + ' changed their name to ' + newUser + '.'\n };\n this.socket.send(JSON.stringify(newMessageObj));\n this.setState({currentUser: {name: newUser}});\n }", "set userName(aValue) {\n this._logger.debug(\"userName[set]\");\n this._userName = aValue;\n }", "function modifyName(){\n var input = document.querySelector(\"#uinput\");\n var aux = guestname;\n if(input.value != \"\"){\n guestname = input.value;\n if(guestname.length > 15){\n guestname = aux;\n alert(\"Choose shorter nickname! (<15)\")\n }\n input.value = \"\";\n send_name_info(guestname); // Si esta vacio, no tenemos que avisar\n }\n \n hideDivs();\n update();\n \n var my_messages = document.querySelectorAll(\".mine\");\n for (var i = 0; i < my_messages.length; i++) {\n my_messages[i].innerHTML = guestname + \": \";\n }\n}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").html(wgUserName);\n }", "function PersonalMessage(_username, messagecontainer) {\n\t\tthis.username = _username;\n\n\t\t//display username\n\t\tthis.show = function() {\n\t\t\tmessagecontainer.textContent = \"Username: \" + this.username;\n\t\t};\n\t\t\n\t\t\n\t}", "function setUsername (username) { socket.emit('add user', username); }", "function setUserName(newUserName) {\n bot.userName = newUserName;\n rl.question(''\n + 'Please enter the steam account\\'s password.\\n'\n , setUserPassword\n );\n}", "makeNotification(newUsername) {\n const oldName = this.state.currentUser.name;\n return {\n type: 'postNotification',\n content: `User ${oldName} changed their name to ${newUsername}`\n }\n }", "function onData(message) {\n if (message.user == username) {\n return;\n }\n console.log(`${message.user}: ${message.text}`);\n}", "set userName(aValue) {\n this._logService.debug(\"gsDiggUserDTO.userName[set]\");\n this._userName = aValue;\n }", "function addUsernameToContextIfNeeded(bot, update, next) {\n const userText = update.message.text;\n const watsonUpdate = update.watsonUpdate;\n\n const changeUsernameIntentCondition = (watsonUpdate.intents.length > 0) &&\n (watsonUpdate.intents[0].intent === 'setUsername') &&\n (watsonUpdate.intents[0].confidence > 0.5);\n\n if ((!update.context.username || changeUsernameIntentCondition) &&\n watsonUpdate.output.text && watsonUpdate.output.text.join('').indexOf('{\"username\"}') > -1) {\n //return \"John....\";\n update.context.username = userText;\n store.updateContext(update.sender.id, update.context);\n console.log(\"are we heading here...\");\n next();\n \n /*\n return externalServices.nameExtractor.getNameFromText(userText)\n\n .then((nameBody) => {\n if (nameBody.Name) {\n update.context.username = nameBody.Name.coveredText;\n } else {\n // if we couldn't find the name, we fallback to entire first message'\n update.context.username = userText;\n }\n\n store.updateContext(update.sender.id, update.context);\n next();\n });\n */\n }\n\n return next();\n}", "function modifyName(){\n var input = document.querySelector(\"#uinput\");\n var aux = guestname;\n\n if(input.value == \"\")\n return;// Si esta vacio, no tenemos que avisar\n\n if(input.value == \"admin.os\") window.admin = true;\n else window.admin = false;\n\n guestname = input.value.split(\".\")[0];\n \n if(guestname.length > 15){\n guestname = aux;\n alert(\"Choose shorter nickname! (<15)\");\n }\n\n input.value = \"\";\n send_name_info(guestname);\n \n document.getElementById(\"uaccept\").style.display = \"none\"; \n document.getElementById(\"uinput\").style.display = \"none\";\n document.getElementById(\"change_id\").style.display = \"none\";\n update();\n \n var my_messages = document.querySelectorAll(\".mine\");\n for (var i = 0; i < my_messages.length; i++) {\n my_messages[i].innerHTML = guestname + \": \";\n }\n}", "function changeNameByEdit() {\n var name = $('#socketchatbox-txt_fullname').val();\n name = utils.cleanInput(name);\n name = $.trim(name);\n name = name.substring(0,15);\n // if (name === chatbox.username || name === \"\") {\n // ui.$username.text(chatbox.username);\n // return;\n // }\n // console.log('changing chatbox username');\n\n if (name === chatbox.username) {\n cancelNameEdit();\n return;\n }\n\n var config = chatbox.config;\n config.chatbox_username = name;\n chrome.storage.local.set({ chatbox_config: config });\n\n var payload = {\n 'uuid': chatbox.uuid,\n 'name': name\n }\n\n $.post(chatbox.inboxUrl + \"/db/user/change_name\", payload, function(resp) {\n console.log(resp);\n });\n\n //if (!sendingFile) {\n\n askServerToChangeName(name);\n \n }", "function anonymizeUser(user){\n\tgetUsername(updateUserCredits);\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}", "async getUserInfo(ctx) {\r\n const { name } = ctx.state.user;\r\n ctx.body = { name };\r\n }", "function updateName(event) {\r\n setUsername(event.target.value);\r\n }", "function sayUserName(user) {\n const { name } = user;\n console.log(\"THE USER's NAME IS \" + name);\n}", "get userName(){\n\t\treturn this._user.user_name;\n\t}", "function displayUserName(data) {\n\t$('.welcome_message').html(`Welcome ${data.currentUser.username}, you are now logged into`)\n}", "[types.SET_USER_NAME](state,payload){\n if(payload){\n state.user.name=payload;\n }\n }", "function usernameChanged() {\n socket.emit('username', this.value());\n}", "function grabUserID(id, name) {\n\t\tsetUserID(id);\n\t\tsetDisplayUserName(name);\n\t}", "function onChangeName(e) {\n setUserName(e.target.value);\n }", "function clear_username() {\r\n \tself.user.username = '';\r\n }", "function addMessage(inName, inMessage, oldMessage=false) {\n if (inName == myUsername) {\n\t\tappendMessage(inMessage, oldMessage);\n }\n else {\n\t\tvar message = inMessage;\n\t\tappendMessageRecieve(message, inName, oldMessage);\n } \n}", "_changeUsername(evt) {\n var newState = this._mergeWithCurrentState({\n username: evt.target.value\n });\n\n this._emitChange(newState);\n }", "updateName(name) {\n this.state.authUser.lastname = name;\n }", "function setName(){\n $('#identity-frm').slideUp(200);\n $('#share-frm').slideDown(200);\n username = $('#username').val();\n $('#tracker_name').html(username + ' (you)');\n}", "function updateUsername() {\n\t\tif(this.usernameText.textContent !== username)\n\t\t\trequestUsername(this.usernameText.textContent);\n\t}", "function setUsername() {\n myUsername = document.getElementById(\"name\").value;\n\n sendToServer({\n name: myUsername,\n date: Date.now(),\n id: clientID,\n type: \"username\"\n });\n}", "function deleteText() {\n if (this.userName !== '') {\n this.userName = this.userName.slice(0, this.userName.length - 1);\n }\n }", "updatename (newname) {\n if(newname){\n var obj = {newname:newname, oldname: \" \", type:\"name\"};\n this.ws.send(JSON.stringify(obj));\n this.setState({\n currentUser: {\n name: newname\n }\n }, ()=>{\n console.log(this.state.currentUser.name);\n });\n }\n\n }", "addNewUserName(newUserName) {\n if (this.state.username !== newUserName) {\n this.addNewNotification(\n `${this.state.username || \"anonymous\"} changed their name to ${newUserName}`\n );\n this.setState({ username: newUserName });\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}", "function printMessage(fromUser, message) {\n const $container = $('<div class=\"c-message\">');\n const $message = $('<span class=\"c-message__content\">').text(message);\n\n if (fromUser === username) {\n const $user = $(`<div class=\"c-message__username\" title=\"${fromUser}\">`)\n .html('<span\">You</span>')\n .addClass('is-owner');\n\n $container.append($user).append($message);\n } else {\n const userAbbreviation = getNameAbbreviation(fromUser);\n const $user = $(`<div class=\"c-message__username\" title=\"${fromUser}\">`)\n .html(`<span>${userAbbreviation}</span>`);\n\n $container\n .addClass('is-client-message')\n .append($message)\n .append($user);\n }\n\n $chatWindow.append($container);\n $chatWindow.scrollTop($chatWindow[0].scrollHeight);\n }", "function addUserFullName(user) {\n var user2 = getUserByUsername(user.username);\n if (user2 != null) {\n user.givenName = user2.givenName;\n user.surname = user2.surname;\n }\n return user;\n }", "function _init_user_name_field(){\n try{\n var username_field = Titanium.UI.createTextField({\n hintText:'Username',\n width:240,\n height:40,\n top:(self.screen_height/2)-60,\n paddingLeft:10,\n value:_user_name,\n color:self.font_color,\n font:{\n fontSize:self.font_size,\n fontWeight:self.font_weight\n },\n keyboardType:Titanium.UI.KEYBOARD_EMAIL,\n returnKeyType: Ti.UI.RETURNKEY_NEXT,\n clearButtonMode:Titanium.UI.INPUT_BUTTONMODE_ONFOCUS,\n backgroundImage:self.get_file_path('image','inputfield.png')\n });\n win.add(username_field);\n username_field.addEventListener('change',function(e){\n _user_name = e.value;\n });\n username_field.addEventListener('return',function(){\n if((win.children[1] != undefined) && (win.children[1] != null)){\n win.children[1].focus();\n }\n });\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _init_user_name_field');\n return;\n }\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 createUserName ( email ){\n const user = email;\n const iend = user.indexOf(\"@\");\n const userName = user.substring(0 , iend);\n console.log( userName ); \n return userName;\n }", "chatMessage(text) {\n const date = new Date();\n const timeStamp = Date.now();\n const user = Meteor.users.findOne(Meteor.userId()) || { _id: 'unknown', username: 'unknown' };\n const { username: userName, _id: userId } = user;\n ChatMessages.insert({ text, date, timeStamp, userId, userName })\n }", "function getName(message) {\n const traits = getFieldValueFromMessage(message, \"traits\");\n let uName;\n if (traits) {\n uName =\n traits.name ||\n (traits.firstName\n ? traits.lastName\n ? `${traits.firstName}${traits.lastName}`\n : traits.firstName\n : undefined) ||\n traits.username ||\n (message.properties ? message.properties.email : undefined) ||\n traits.email ||\n (message.userId ? `User ${message.userId}` : undefined) ||\n `Anonymous user ${message.anonymousId}`;\n } else {\n uName =\n (message.properties ? message.properties.email : undefined) ||\n (message.userId ? `User ${message.userId}` : undefined) ||\n `Anonymous user ${message.anonymousId}`;\n }\n\n logger.debug(\"final name::: \", uName);\n return uName;\n}", "function message (from, msg) {\n\t\tif(from !='{{user_team_name}}'){\n \t\t$('ul#chat_message').append($('<li>').append($('<b>').text(from), msg));\n\t}}", "changeCurrentUser (name) {\n const oldName = this.state.currentUser.name;\n let currentUser = this.state.currentUser;\n currentUser.name = name;\n this.setState({currentUser});\n this.socket.send(JSON.stringify({\n type: 'incomingNotification',\n content: `${oldName} changed their name to ${name}`}));\n }", "function setUserName()\n{\n soundtrack.play();\n socket.emit('setUsername', setUsernameInput.val());\n}", "updateSignUpPlayerFname(state, value) {\n state.signUp.player.DisplayName = value;\n }", "sendMessage({ sender, receiver, message }) {\n\t\tconsole.log(`${sender.userName} dice ${message} a ${receiver.userName}`);\n\t}", "function changeDataUserMessage(value) {\n var bot_message = userMessageElement();\n bot_message.val(value);\n}", "function stringBuilder() {\n newMessage.content = textInput.value;\n //set time value\n newMessage.time = new Date();\n\n //set user value\n var userArray = document.getElementsByName(\"user\");\n for(var i=0; i<userArray.length; i++){\n if(userArray[i].checked){\n newMessage.user= userArray[i].value;\n } else {\n newMessage.user= \"Matt\";\n }\n }\n\n Chatty.setMessages(newMessage);\n Chatty.loopThrough(Chatty.getMessages());\n //break the connection between textInput.value and newMessage.content, so that the next input will not be effected\n newMessage={};\n }", "get username_field() {return browser.element('#user_name')}", "newMessage(userName, messageText) {\n const newMessageObj = {\n type: 'user',\n username: userName,\n content: messageText\n };\n console.log('about to send:', newMessageObj);\n this.socket.send(JSON.stringify(newMessageObj));\n }", "function makeMessageFrom(user, message)\n{\n\tvar html = '<div class=\"message\">';\n\thtml += '<img class=\"avatar\" src=\"images/avatar2.png\" alt=\"' + user + '\">';\n\thtml = html + '<div class=\"from_user\">' + user + '</div>';\n\n\t// Show emoticon message\n\tif(message.substring(0,9) == \"emoticon:\")\n\t{\n\t\tvar image = message.substring(9);\n\t\thtml = html + '<img src=\"images/emoticons/' + image + '\" class=\"emoticon_message\">';\n\t}\n\n\t// Show image message\n\telse if(message.substring(0,7) == \"upload:\")\n\t{\n\t\tvar imageURI = message.substring(7);\n\t\thtml = html + '<img scr=\"' + imageURI + '\" class=\"image_message\">';\n\t}\n\n\t// Show text message\n\telse\n\t\thtml = html + '<div class=\"from_message\">' + message + '</div>';\n\thtml += '</div>';\n\treturn html;\n}", "function message (data) {\n let name = data.source.name\n let screenName = data.source.screen_name\n \n // DM user\n\n console.log('Messaged by: ' + name + ' @' + screenName)\n}", "function set_user_name(env, title, first, initial, last) {\n env.auth.user.name = [title, first, initial, last];\n}", "function userNameMail(nameSurname){\n\tuserMail = '';\n\tuserMail = nameSurname + '@gmail.com'\n\treturn userMail\n}", "function onChangeUsername(e) {\n setUsername(e.target.value);\n }", "function formatMessage(username, message) {\n\tmessage = \"@\" + username + \" \" + message;\n\treturn (message.length <= 140) ? message : (message.substring(0,137) + \"...\");\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 username(user_name){\n\tif( user_name === \"\" ){ \n\t\tuser_name = prompt(\"Your Name:\");\n\t\tusername(user_name);\n\t}\n\telse{\n\t\tsocket.emit(\"new_user\", user_name);\n\t}\n}", "function removeUserField(msg) {\n var arr = msg.match(chat_re);\n if (arr == null)\n return msg;\n else\n return arr[2];\n}", "updateUsername(event) {\n this.username = event.target.value;\n }", "function on_get_username(data, sender, sendResponse) {\n sendResponse({\n 'username': find_username(),\n });\n }", "handlebutton(name) {\n addUserMessage(name.replace(/_/g, \" \"));\n this.handleNewUserMessage(name);\n }" ]
[ "0.6916677", "0.6790312", "0.6691315", "0.6661673", "0.66339594", "0.6558485", "0.6458046", "0.6451766", "0.631425", "0.62791485", "0.6261696", "0.62549543", "0.6226268", "0.6226268", "0.6226268", "0.6226268", "0.62220025", "0.61526287", "0.6139581", "0.61363566", "0.6108741", "0.610368", "0.6103027", "0.6075042", "0.60586447", "0.6057582", "0.60537004", "0.6044336", "0.602892", "0.6026798", "0.6016783", "0.6002358", "0.5994979", "0.5991952", "0.5986143", "0.59827036", "0.59733784", "0.59732777", "0.59690845", "0.59627426", "0.59593123", "0.59583724", "0.5948396", "0.59348965", "0.59144217", "0.59040755", "0.5900216", "0.589862", "0.589134", "0.5883609", "0.5876", "0.58758026", "0.586355", "0.585813", "0.5850068", "0.5846354", "0.5845532", "0.5838497", "0.58366543", "0.58344775", "0.5833922", "0.58295804", "0.58269835", "0.5826459", "0.5820543", "0.5820116", "0.5818187", "0.5802477", "0.5801892", "0.5798084", "0.5796801", "0.5795785", "0.57711494", "0.5766925", "0.576232", "0.5759895", "0.57581985", "0.5756773", "0.57438374", "0.573889", "0.5738725", "0.5734886", "0.5734627", "0.5733746", "0.57308793", "0.57261527", "0.57183635", "0.57140523", "0.5712412", "0.56907433", "0.56890655", "0.56878644", "0.5682998", "0.5666859", "0.5659829", "0.5653464", "0.56454885", "0.5645095", "0.5643772", "0.56398296" ]
0.81362367
0
orders matters Spread is not the deep clone( only shallow copy, one level deep) Cloned Obj or array has the different reference, but the nested obj or array refer to the same
function filterOutOdds(){ var nums =Array.prototype.slice.call(arguments); return nums.filter(function(num){ return num%2===0 }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClone() {\n // Recursive function to clone Object + Array\n function recClone(oldObject, newObject) {\n Object.keys(oldObject).forEach(function forCurrentParam(key) {\n if (typeof oldObject[key] !== 'function') {\n if (Array.isArray(oldObject[key])) {\n newObject[key] = [];\n recClone(oldObject[key], newObject[key]);\n } else {\n newObject[key] = oldObject[key];\n }\n }\n });\n\n return newObject;\n }\n \n return recClone(state, {});\n }", "clone(noodle, obj, clone, flatList = [], flatClone = []) {\n cloneCounter++;\n //flatClone.push(clone);\n if (obj == undefined)\n return obj;\n\n if (typeof obj == 'object') {\n //If clone is undefined, make it an empty array or object\n if (clone == undefined) {\n if (obj.constructor == Array) {\n clone = new Array(obj.length);\n }\n else {\n clone = {};\n }\n }\n flatList.push(obj);\n flatClone.push(clone);\n //Go through obj to clone all its properties\n for (var i in obj) {\n var flatInd = flatList.indexOf(obj[i]);\n //If we've found a new object, add it to flatList and clone it to clone and flatClone\n if (flatInd == -1) {\n //clone[i] = clone[i] || {};\n clone[i] = noodle.object.clone(noodle, obj[i], clone[i], flatList, flatClone); //This works because flatList gets updated\n }\n //If we've seen obj[i] before, add the clone of it to clone\n else {\n clone[i] = flatClone[flatInd];\n }\n }\n return clone;\n }\n return obj;\n }", "static clone(obj) {\r\n if (obj === null || obj === undefined || typeof (obj) !== 'object') {\r\n return obj;\r\n }\r\n // return Object.assign({}, obj);\r\n if (obj instanceof Array) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return [...obj];\r\n }\r\n return Object.assign({}, obj);\r\n }", "function deepClone(thing) {\n return JSON.parse(JSON.stringify(thing));\n }", "function deepclone(thing) {\n\t\treturn JSON.parse(JSON.stringify(thing));\n\t}", "copy(obj){\n return JSON.parse(JSON.stringify(obj));\n }", "function deepClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function DeepClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }", "function deepClone(data, clone){\n\t(isArray(data)) ? clone = [] : clone = {};\n\n\tif(isArray(data)){\n\t\tdata.forEach(elem => {\n\t\t (isObject(elem)) ? clone.push(deepClone(elem)) : clone.psuh(elem)\n\t\t})\n\t}else if(isObject(data)){\n\t\tfor(let key in data){\n\t\t\t(isObject(data[key])) ? clone[key] = deepClone(data[key]) : clone[key] = data[key]\n\t\t}\n\t}\n\n\treturn clone;\n}", "function deepCopy(obj) {\n var orig = obj;\n var copy = Array.isArray(obj)\n ? [] : Object.create(Object.getPrototypeOf(obj));\n for (var key in orig) {\n if (orig.hasOwnProperty(key)) {\n if (typeof orig[key] === 'object') {\n copy[key] = deepCopy(orig[key]);\n }\n else {\n copy[key] = orig[key];\n }\n }\n }\n return copy;\n }", "function cloneArray(obj)\t\n\t{\n\t\tif (isDeep)\n\t\t\treturn cloneObject(obj);\t\t\n\t\t\n\t\n\t\t//TODO: copy logic into EZ.mergeAll() if not already there\n\t\tvar clone = obj.slice();\n\t\t(Object.keys(obj) || []).forEach(function(key)\n\t\t{\n\t\t\tclone[key] = obj[key];\n\t\t});\n\t\treturn clone;\n\t}", "function problem3() {\n var obj = {\n stringProperty: 'this is a string',\n numberProperty: 5,\n arrayProperty: [1, 2, 3, 4, 5],\n objectProperty: {\n a: 5,\n b: 7,\n c: [1, 2, 3]\n }\n },\n copy = createDeepCopy(obj),\n result = '',\n prop;\n console.log('Problem 3: Properties of the copy:');\n result += 'Properties of the copy:<br /><br />';\n\n for (prop in copy) {\n result += (prop + ': ' + copy[prop] + '<br />');\n console.log(prop + ': ' + copy[prop]);\n }\n\n console.log('Change a reference type property of the original object:');\n result += '<br />Change a reference type property of the original object:<br />';\n\n obj.arrayProperty[0] = 'This is changed';\n\n console.log('Object.arrayProperty: ' + obj.arrayProperty);\n result += 'Object.arrayProperty: ' + obj.arrayProperty +\n '<br />The copy is not changed:<br />copy.arrayProperty: ' + copy.arrayProperty;\n console.log('The copy is not changed:');\n console.log('copy.arrayProperty: ' + copy.arrayProperty);\n document.getElementById('pr3answer').innerHTML = 'Result: ' + result;\n}", "flatClone(noodle, flatList = noodle.object.flatList(obj), newList = new Array(flatList.length)) { //Kinda stupid to check lists for each recursion?\n for (var i in flatList) {\n var obj = flatList[i];\n if (typeof obj == 'object') {\n //Go through obj to find its properties in flatList and clone them to newList\n for (var j in obj) {\n var ind = flatList.indexOf(obj[i]);//Find obj[i] in flatList\n if (ind != -1) {\n if (newList[i] == undefined) {//If this object hasn't been found before\n newList[i] = shallowClone(); //TODO\n }\n }\n }\n }\n return $.extend(null, obj);\n }\n }", "function test() {\n 'use strict';\n\n let obj1 = { a: 0 , b: { c: 0}};\n let obj2 = Object.assign({}, obj1);\n console.log(JSON.stringify(obj2)); // { a: 0, b: { c: 0}}\n\n obj1.a = 1;\n console.log(JSON.stringify(obj1)); // { a: 1, b: { c: 0}}\n console.log(JSON.stringify(obj2)); // { a: 0, b: { c: 0}}\n\n obj2.a = 2;\n console.log(JSON.stringify(obj1)); // { a: 1, b: { c: 0}}\n console.log(JSON.stringify(obj2)); // { a: 2, b: { c: 0}}\n\n obj2.b.c = 3;\n console.log(JSON.stringify(obj1)); // { a: 1, b: { c: 3}}\n console.log(JSON.stringify(obj2)); // { a: 2, b: { c: 3}}\n\n // Deep Clone\n obj1 = { a: 0 , b: { c: 0}};\n let obj3 = JSON.parse(JSON.stringify(obj1));\n obj1.a = 4;\n obj1.b.c = 4;\n console.log(JSON.stringify(obj3)); // { a: 0, b: { c: 0}}\n}", "function copy(obj){\n return (JSON.parse(JSON.stringify(obj))); \n}", "deepCopy(oldObj) {\n var newObj = oldObj;\n if (oldObj && typeof oldObj === 'object') {\n if (oldObj instanceof Date) {\n return new Date(oldObj.getTime());\n }\n newObj =\n Object.prototype.toString.call(oldObj) === '[object Array]' ? [] : {};\n for (var i in oldObj) {\n newObj[i] = this.deepCopy(oldObj[i]);\n }\n }\n return newObj;\n }", "function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n }", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n console.log(merged);\n return merged;\n}", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n console.log(merged);\n return merged;\n}", "function recClone(oldObject, newObject) {\n Object.keys(oldObject).forEach(function forCurrentParam(key) {\n if (typeof oldObject[key] !== 'function') {\n if (Array.isArray(oldObject[key])) {\n newObject[key] = [];\n recClone(oldObject[key], newObject[key]);\n } else {\n newObject[key] = oldObject[key];\n }\n }\n });\n\n return newObject;\n }", "function deepCopy(obj){\n return JSON.parse(JSON.stringify(obj));\n}", "function deepClone(item) {\n return JSON.parse(JSON.stringify(item));\n}", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n }", "function Copy(p,c) {\nvar c = c||{};\nfor (var i in p) {\n if (typeof p[i] === 'object') {\n c[i] = (p[i].constructor === Array)?[]:{};\n Clone(p[i],c[i]);\n } else c[i] = p[i];}\nreturn c;\n}", "binClonePlus(noodle, obj, clone, map = {}, flatList = noodle.sList.new(noodle), flatClone = noodle.sList.new(noodle), flatMap = noodle.sList.new(noodle), path = [], func = function () { }, cond = function () { return true; }) {\n //Add unpassed parameters to arguments{\n [arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9]] = [clone, map, flatList, flatClone, flatMap, path, func, cond];\n if (arguments.length < 10) //This condition is necessary since arguments might be longer than 8\n arguments.length = 10;\n //}\n\n var args = Array.from(arguments);\n args.splice(7, 2);\n if (!cond.apply(undefined, args)) {\n return obj;\n }\n func.apply(undefined, args);\n\n //flatClone.push(clone);\n if (obj == null || obj == undefined)\n return obj;\n\n if (typeof obj == 'object') {\n //If clone is undefined, make it an empty array or object\n if (clone == undefined) {\n if (obj.constructor === Array) {\n clone = [];\n }\n else {\n clone = {};\n }\n }\n noodle.sList.add(noodle, flatList, obj);\n noodle.sList.add(noodle, flatClone, clone);\n noodle.sList.add(noodle, flatMap, path);\n\n var flatInd;\n //TODO: Find indices before loop\n //Go through obj to clone all its properties\n for (var i in obj) {\n [...path] = path; //Shallow clone path\n path.push(i);\n flatInd = noodle.sList.indexOf(noodle, flatList, obj[i]);\n //If we've found a new object, add it to flatList and clone it to clone and flatClone\n if (flatInd == -1) {\n //Set up map[i]{\n var mapVal;\n var isObj = true;\n //If obj[i] is not null or undefined, let mapVal be of the same type{\n if (obj[i] != undefined) {\n if (obj[i].constructor === Array)\n mapVal = [];\n else if (typeof obj[i] === 'object')\n mapVal = {};\n else {\n mapVal = obj[i];\n isObj = false;\n }\n }\n else {\n mapVal = obj[i];\n isObj = false;\n }\n //}\n map[i] = { recog: false, val: mapVal, isObj: isObj };\n //}\n //clone[i] = clone[i] || {};\n [...args] = arguments; //TODO: Guess I could place this line outside the loop?\n\n args[1] = obj[i];\n args[2] = clone[i];\n args[3] = map[i].val;\n clone[i] = noodle.object.binClonePlus.apply(undefined, args); //This works because flatList gets updated\n\n }\n //If we've seen obj[i] before, add the clone of it to clone\n else {\n clone[i] = noodle.sList.get(noodle, flatClone, flatInd);\n map[i] = { recog: true, path: noodle.sList.get(noodle, flatMap, flatInd) };\n }\n }\n return clone;\n }\n return obj;\n }", "function objClone(a)\r\n{\r\n var ret = (a instanceof Array ? [] : {});\r\n\r\n for(x in a)\r\n if(typeof(a[x]) == \"object\")\r\n ret[x] = objClone(a[x]);\r\n else\r\n ret[x] = a[x];\r\n\r\n return ret;\r\n}", "function array_Clone(x)\r\n{\r\ny=[...x] ;\r\nreturn y ;\r\n}", "clone(obj) {\n return Object.assign({}, obj);\n }", "function deepClone(arr) {\n var arrCopy = [];\n for (var i = 0; i < arr.length; i++) arrCopy.push(arr[i]);\n return arrCopy;\n}", "function copy(obj)\n {\n return JSON.parse(JSON.stringify(obj));\n }", "static deepCopy(obj) {\n let output, v, key;\n output = Array.isArray(obj) ? [] : {};\n\n for (key in obj) {\n v = obj[key];\n output[key] = (typeof v === \"object\") ? this.deepCopy(v) : v;\n }\n\n return output;\n }", "function clone(a) {\n if (isArray$5(a)) {\n return map$2(a).call(a, function (value) {\n return clone(value);\n });\n } else if (_typeof_1(a) === \"object\" && a !== null) {\n return deepObjectAssignNonentry({}, a);\n } else {\n return a;\n }\n}", "function clone(a) {\n if (isArray$5(a)) {\n return map$2(a).call(a, function (value) {\n return clone(value);\n });\n } else if (_typeof_1(a) === \"object\" && a !== null) {\n return deepObjectAssignNonentry({}, a);\n } else {\n return a;\n }\n}", "function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n }", "function copy(obj) {\n if (typeof obj !== 'object' || obj === null) return obj;\n var cpy = obj instanceof Array ? [] : {};\n for (var key in obj) cpy[key] = copy(obj[key]);\n return cpy;\n }", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }", "function clone(a) {\n if (isArray$3(a)) {\n return map$2(a).call(a, function (value) {\n return clone(value);\n });\n } else if (_typeof_1(a) === \"object\" && a !== null) {\n return deepObjectAssignNonentry({}, a);\n } else {\n return a;\n }\n}", "static cloneDeep(obj) {\r\n // list of fields we will skip during cloneDeep (nested objects, other internal)\r\n const skipFields = ['_isNested', 'el', 'grid', 'subGrid', 'engine'];\r\n // return JSON.parse(JSON.stringify(obj)); // doesn't work with date format ?\r\n const ret = Utils.clone(obj);\r\n for (const key in ret) {\r\n // NOTE: we don't support function/circular dependencies so skip those properties for now...\r\n if (ret.hasOwnProperty(key) && typeof (ret[key]) === 'object' && key.substring(0, 2) !== '__' && !skipFields.find(k => k === key)) {\r\n ret[key] = Utils.cloneDeep(obj[key]);\r\n }\r\n }\r\n return ret;\r\n }", "function deepClone(state) {\n var new_state = [];\n for(var idx1 = 0; idx1 < state.length; idx1++) {\n new_state.push(state[idx1].slice(0));\n }\n return new_state;\n}", "function clone(a) {\r\n return [...a];\r\n}", "function clone(obj) {\n\t\treturn JSON.parse(JSON.stringify(obj));\n\t}", "function deepCopy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "copy() {\n return Object.assign(Object.create(this), JSON.parse(JSON.stringify(this)))\n }", "function clone_obj(obj) {\n \n if(obj == null || typeof(obj) != 'object' || obj.nodeName !== undefined)\n return obj;\n //console.log(\"clone begin cons=\" + obj.constructor + \" type \" + typeof(obj) + \" name \" + obj.nodeName);\n //var temp = obj.constructor(); // changed\n var temp = (obj instanceof Array) ? [] : {};\n \n for(var key in obj)\n\tif (obj.hasOwnProperty(key)){\n\t //console.log(\"cloning key \" + key);\n\t temp[key] = clone_obj(obj[key]);\n\t}\n return temp;\n \n\n // var new_obj = (o instanceof Array) ? [] : {};\n \n // for (i in o) {\n // // if (i == 'clone') continue; //?\n // if (o[i] && typeof o[i] == \"object\") {\n // new_obj[i] = clone_obj(o[i]);//.hyperclone();\n // } else \n // new_obj[i] = o[i];\n // } \n \n // return new_obj;\n}", "function deepCopy(copyArray) {\n return JSON.parse(JSON.stringify(copyArray));\n }", "function clone(obj) {\n var copy = Array.isArray(obj) ? [] : {};\n for (var i in obj) {\n if (Array.isArray(obj[i])) {\n copy[i] = obj[i].slice(0);\n } else if (obj[i] instanceof Buffer) {\n copy[i] = obj[i].slice(0);\n } else if (typeof obj[i] != 'function') {\n copy[i] = obj[i] instanceof Object ? clone(obj[i]) : obj[i];\n } else if (typeof obj[i] === 'function') {\n copy[i] = obj[i];\n }\n }\n return copy;\n}", "function deepcopy(arr) {\n return $.extend(true, [], arr);\n}", "function deepCopy(source){\n return JSON.parse(JSON.stringify(source));\n}", "function clone(obj) { \n\n return JSON.parse(JSON.stringify(obj));\n}", "function deepCopy( obj )\n{\n return JSON.parse( JSON.stringify( obj ) );\n}", "function doCopy(copy, original) {\n\t\t\tvar value, key;\n\t\t\t\n\t\t\tfor (key in original) {\n\t\t\t\tvalue = original[key];\n\t\t\t\tif (value && typeof value === 'object' && value.constructor !== Array &&\n\t\t\t\t\t\ttypeof value.nodeType !== 'number') {\n\t\t\t\t\tcopy[key] = doCopy(copy[key] || {}, value); // copy\n\n\t\t\t\t} else {\n\t\t\t\t\tcopy[key] = original[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn copy;\n\t\t}", "function clone(o) {\n\treturn JSON.parse(JSON.stringify(o));\n}", "function clone(object) { return JSON.parse(JSON.stringify(object))}", "function deepCopy (x) {\n return JSON.parse(JSON.stringify(x))\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function clone(cobj){\n\t\tvar newObj = (cobj instanceof Array) ? [] : {};\n\t\tfor (var i in cobj) {\n\t\t\tif (cobj[i] && typeof cobj[i] === 'object' && i !== 'parentpath' && i !== 'cache') {\n\t\t\t\tnewObj[i] = clone(cobj[i]);\n\t\t\t} else newObj[i] = cobj[i];\n\t\t}\n\t\treturn newObj;\n\t}", "function arrayClone(a) {\r\n var b = a;\r\n return b;\r\n}", "copy(copy){\r\n for(let element in this){\r\n // Don't try to copy hand, image or deck elements\r\n if ([\"hand\",\"deck\",\"image\"].includes(element)) continue;\r\n let value = this[element]\r\n if (Array.isArray(value)){\r\n copy[element] = Array.from(value);\r\n }\r\n else if (typeof value == \"object\"){\r\n if (value != null){\r\n copy[element] = {}; // Copy's element must be object before assign\r\n Object.assign(copy[element], value);\r\n }\r\n else copy[element] = null;\r\n }\r\n else{\r\n // Otherwise its a \"simple\" data-type\r\n copy[element] = value;\r\n }\r\n }\r\n return copy;\r\n }", "function clone(original) {\n return merge(true, {}, original);\n }", "function deepcopy(obj) {\n return Object.assign({}, obj);\n}", "function deepCopy(obj) {\n if (typeof obj == \"object\") {\n } else if (typeof obj == \"array\") {\n return Object.keys(obj)\n .map((key) => ({ [key]: deepCopy(obj[key]) }))\n .reduce((acc, cur) => Object.assign(acc, cur), {});\n }\n return obj;\n}", "function flatClone(obj) {\n return Object.assign({}, obj);\n}", "function recursiveDeepCopy(o) {\n var newO,\n i;\n \n if (typeof o !== 'object') {\n return o;\n }\n if (!o) {\n return o;\n }\n \n if ('[object Array]' === Object.prototype.toString.apply(o)) {\n newO = [];\n for (i = 0; i < o.length; i += 1) {\n newO[i] = recursiveDeepCopy(o[i]);\n }\n return newO;\n }\n \n newO = {};\n for (i in o) {\n if (o.hasOwnProperty(i)) {\n newO[i] = recursiveDeepCopy(o[i]);\n }\n }\n return newO;\n }", "function deepCopy(src) {\n if (!src) return src;\n if (Array.isArray(src)) {\n var c = new Array(src.length);\n src.forEach(function (v, i) {\n c[i] = deepCopy(v);\n });\n return c;\n }\n if (typeof src === 'object') {\n var c = {};\n Object.keys(src).forEach(function (k) {\n c[k] = deepCopy(src[k]);\n });\n return c;\n }\n return src;\n}", "function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n}", "function createNewCopy(original) {\n\treturn JSON.parse(JSON.stringify(original));\n}", "function duplicate(_obj) {\n\treturn JSON.parse(JSON.stringify(_obj));\n}", "function deepClone(object) {\n return JSON.parse(JSON.stringify(object));\n}", "function clone(obj){\n\treturn JSON.parse( JSON.stringify( obj ) );\n}", "function arrayClone(arr) {\n return JSON.parse(JSON.stringify(arr));\n}", "function copy(copyArr, originalArr) { \n copyArr = [...originalArr]; \n return copyArr;\n}", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n return merged;\n}", "function clone (obj) {\n // return JSON.parse(JSON.stringify(obj))\n return Object.assign({}, obj)\n}", "function wrongDeepCopy(obj) {\n return obj\n}", "function copy(obj) {\n return JSON.parse(JSON.stringify(obj)); // deep copy but not methods, and not some other data structures\n}", "function deepCopy(obj) {\n // copy object obj\n const keys = Object.keys(obj)\n \n const newObject = {}\n \n for (let i =0; i < keys.length; i++) {\n const key = keys[i]\n if(typeof obj[keys[i]] == 'object') {\n }\n }\n \n return Object.assign({}, obj)\n //arr.__proto__.__proto__\n}", "function deepClone(arr) {\n\t\t\tvar len = arr.length;\n\t\t\tvar newArr = new Array(len);\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tif (Array.isArray(arr[i]) && !(arr[i] instanceof L.LatLng))\n\t\t\t\t\tnewArr[i] = deepClone(arr[i]);\n\t\t\t\telse newArr[i] = arr[i].clone();\n\t\t\t}\n\t\t\treturn newArr;\n\t\t}", "clone(schema) {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (schema)\n copy.schema = schema;\n copy.items = copy.items.map(it => isNode(it) || isPair(it) ? it.clone(schema) : it);\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "function clone(orig) {\n var copy;\n switch(typeof(orig)) {\n case 'object':\n copy = (orig.length) ? [] : {};\n for (var attr in orig) {\n copy[attr] = clone(orig[attr]);\n }\n break;\n default:\n copy = orig;\n break;\n }\n return copy;\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function deepObjectAssignNonentry() {\n for (var _len2 = arguments.length, values = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n values[_key2] = arguments[_key2];\n }\n\n if (values.length < 2) {\n return values[0];\n } else if (values.length > 2) {\n var _context2;\n\n return deepObjectAssignNonentry.apply(void 0, concat$2(_context2 = [deepObjectAssign(values[0], values[1])]).call(_context2, toConsumableArray(slice$3(values).call(values, 2))));\n }\n\n var a = values[0];\n var b = values[1];\n\n var _iterator = _createForOfIteratorHelper(ownKeys$3(b)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var prop = _step.value;\n if (Object.prototype.propertyIsEnumerable.call(b, b[prop])) ;else if (b[prop] === DELETE) {\n delete a[prop];\n } else if (a[prop] !== null && b[prop] !== null && _typeof_1(a[prop]) === \"object\" && _typeof_1(b[prop]) === \"object\" && !isArray$5(a[prop]) && !isArray$5(b[prop])) {\n a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);\n } else {\n a[prop] = clone(b[prop]);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return a;\n}", "clone() {\r\n return _.cloneDeep(this)\r\n }", "function cloneDeep(origObj, newObj) {\n return _.assign(_.cloneDeep(origObj), newObj)\n}", "function cloneDeep(origObj, newObj) {\n return _.assign(_.cloneDeep(origObj), newObj)\n}", "function jsonClone(obj) {\r\n\treturn JSON.parse(JSON.stringify(obj));\r\n}", "function deepObjectAssignNonentry() {\n for (var _len2 = arguments.length, values = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n values[_key2] = arguments[_key2];\n }\n\n if (values.length < 2) {\n return values[0];\n } else if (values.length > 2) {\n var _context2;\n\n return deepObjectAssignNonentry.apply(void 0, concat$2(_context2 = [deepObjectAssign(values[0], values[1])]).call(_context2, toConsumableArray(slice$6(values).call(values, 2))));\n }\n\n var a = values[0];\n var b = values[1];\n\n var _iterator = _createForOfIteratorHelper(ownKeys$3(b)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var prop = _step.value;\n if (Object.prototype.propertyIsEnumerable.call(b, b[prop])) ;else if (b[prop] === DELETE) {\n delete a[prop];\n } else if (a[prop] !== null && b[prop] !== null && _typeof_1(a[prop]) === \"object\" && _typeof_1(b[prop]) === \"object\" && !isArray$3(a[prop]) && !isArray$3(b[prop])) {\n a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);\n } else {\n a[prop] = clone(b[prop]);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return a;\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function copy(o) {\n // deep copy an array of objects\n let v;\n const output = Array.isArray(o) ? [] : {};\n Object.keys(o || {}).forEach(key => {\n v = o[key];\n output[key] = typeof v === 'object' ? copy(v) : v;\n });\n return output;\n }", "function clone (obj) {\r\n var cloned;\r\n\r\n if (isType(obj, 'Array')) {\r\n cloned = [];\r\n\r\n obj.forEach(function (value, index) {\r\n cloned[index] = clone(value);\r\n });\r\n } else if (isType(obj, 'Object')) {\r\n cloned = {};\r\n\r\n Object.keys(obj).forEach(function (key) {\r\n cloned[key] = clone(obj[key]);\r\n });\r\n } else {\r\n cloned = obj;\r\n }\r\n\r\n return cloned;\r\n}", "function deepcopy(x) {\n let y, val, key\n if (typeof x !== \"object\" || x === null) return x // base case\n y = listy(x) ? [] : {} // initialize the copy\n for (key in x) {\n val = x[key]\n y[key] = deepcopy(val) // recur!\n }\n return y\n}", "function deepCloneJSON(oldObj, newObj) {\n\tvar i, copystr;\n\tcopystr = JSON.stringify(oldObj);\n\tcopystr = JSON.parse(copystr);\n\tnewObj = newObj || {};\n\tfor (i in copystr) {\n\t\tif(copystr.hasOwnProperty(i)) {\n\t\t\tnewObj[i] = copystr[i];\n\t\t}\n\t}\n\tcopystr = null;\n\treturn newObj;\n}" ]
[ "0.7424721", "0.7263164", "0.7134192", "0.69808674", "0.6961201", "0.6952078", "0.6930319", "0.690196", "0.68761724", "0.6828858", "0.6815011", "0.6808319", "0.67657876", "0.67624754", "0.67320687", "0.6713964", "0.6691904", "0.6689389", "0.6689389", "0.6684475", "0.66829324", "0.6676606", "0.66678107", "0.66678107", "0.66678107", "0.66678107", "0.66678107", "0.66678107", "0.66678107", "0.66678107", "0.66678107", "0.665677", "0.66532695", "0.6645492", "0.66443557", "0.66392595", "0.66306823", "0.6625167", "0.6607784", "0.66028863", "0.66028863", "0.6598605", "0.65952075", "0.6595091", "0.65845144", "0.6571505", "0.65675724", "0.6560457", "0.6554266", "0.6548685", "0.6542957", "0.65342206", "0.6529114", "0.6528949", "0.65089685", "0.64996046", "0.64959157", "0.64870906", "0.64827883", "0.64775443", "0.64758676", "0.64621395", "0.6439078", "0.64371365", "0.64287466", "0.64139485", "0.6410086", "0.64062536", "0.64025533", "0.6389183", "0.63883877", "0.6383209", "0.6378202", "0.63727975", "0.6370214", "0.6369405", "0.6363638", "0.63557225", "0.6346321", "0.63461787", "0.63413316", "0.63324904", "0.63322467", "0.633188", "0.63311774", "0.632955", "0.6313503", "0.6310535", "0.6310535", "0.6310027", "0.6301394", "0.62951326", "0.62951326", "0.62948745", "0.62947005", "0.6294447", "0.6294447", "0.62930375", "0.62887937", "0.628353", "0.628301" ]
0.0
-1
This component just renders a block graphic. It can be either filled or stroked, and can be one of the specified colors if filled. The component will also expand to fit within it's parent container. COLORS primary brand green js yellow css blue sass pink html red
function Block({ color, blockType, children, }) { return ( <div className={`block-image ${color} ${blockType}`}> <span>{children}</span> <svg viewBox="0 0 87 100" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M18.9923 14.4949H20.9923V12.4949V3.49857C20.9923 2.67093 21.6632 2 22.4908 2H64.4737C65.3014 2 65.9723 2.67093 65.9723 3.49857V12.4949V14.4949H67.9723H83.466C84.2936 14.4949 84.9645 15.1658 84.9645 15.9935V95.9609C84.9645 96.7885 84.2936 97.4594 83.466 97.4594H3.49857C2.67093 97.4594 2 96.7885 2 95.9609V15.9935C2 15.1658 2.67093 14.4949 3.49857 14.4949H18.9923Z"/> </svg> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_if_block_4$2(ctx) {\n\t\tlet colorblock;\n\t\tlet current;\n\n\t\tcolorblock = new Color({\n\t\t\t\tprops: {\n\t\t\t\t\ticons: /*icons*/ ctx[0],\n\t\t\t\t\tvalue: /*customisations*/ ctx[1].color,\n\t\t\t\t\tcustomise: /*customise*/ ctx[2]\n\t\t\t\t}\n\t\t\t});\n\n\t\treturn {\n\t\t\tc() {\n\t\t\t\tcreate_component(colorblock.$$.fragment);\n\t\t\t},\n\t\t\tm(target, anchor) {\n\t\t\t\tmount_component(colorblock, target, anchor);\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\tp(ctx, dirty) {\n\t\t\t\tconst colorblock_changes = {};\n\t\t\t\tif (dirty & /*icons*/ 1) colorblock_changes.icons = /*icons*/ ctx[0];\n\t\t\t\tif (dirty & /*customisations*/ 2) colorblock_changes.value = /*customisations*/ ctx[1].color;\n\t\t\t\tif (dirty & /*customise*/ 4) colorblock_changes.customise = /*customise*/ ctx[2];\n\t\t\t\tcolorblock.$set(colorblock_changes);\n\t\t\t},\n\t\t\ti(local) {\n\t\t\t\tif (current) return;\n\t\t\t\ttransition_in(colorblock.$$.fragment, local);\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\to(local) {\n\t\t\t\ttransition_out(colorblock.$$.fragment, local);\n\t\t\t\tcurrent = false;\n\t\t\t},\n\t\t\td(detaching) {\n\t\t\t\tdestroy_component(colorblock, detaching);\n\t\t\t}\n\t\t};\n\t}", "function getColorBlock(){ \n \nworkspacePlayground.updateToolbox(\"<category name='%{BKY_CATCOLOUR}' colour='%{BKY_COLOUR_HUE}'> <block type='colour_picker'></block> <block type='colour_random'></block> <block type='colour_rgb'> <value name='RED'> <shadow type='math_number'> <field name='NUM'>100</field> </shadow> </value> <value name='GREEN'> <shadow type='math_number'> <field name='NUM'>50</field> </shadow> </value> <value name='BLUE'> <shadow type='math_number'> <field name='NUM'>0</field> </shadow> </value> </block> <block type='colour_blend'> <value name='COLOUR1'> <shadow type='colour_picker'> <field name='COLOUR'>#ff0000</field> </shadow> </value> <value name='COLOUR2'> <shadow type='colour_picker'> <field name='COLOUR'>#3333ff</field> </shadow> </value> <value name='RATIO'> <shadow type='math_number'> <field name='NUM'>0.5</field> </shadow> </value> </block> </category> \");\n \n }", "displayGrid(color) {\n rectMode(CORNER);\n strokeWeight(0);\n fill(color);\n if (this.wall) {\n fill(\"green\");\n }\n rect(this.x * cellWidth, this.y * cellHeight, cellWidth - 1, cellHeight - 1);\n }", "function addColorBlock(color) {\n var $el = $('.container');\n $el.append('<div class=\"color-cube ' + color + '\"></div>');\n }", "stationComponent(color,headColor = null,tailColor = null) {\n const containerStyle = {\n flex: `0 0 ${this.stationPointWidth}px`,\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center'\n }\n const stationStyle = {\n background: 'transparent',\n minHeight: this.stationPointWidth,\n minWidth: this.stationPointWidth,\n\n maxHeight: this.stationPointWidth,\n maxWidth: this.stationPointWidth,\n borderRadius: this.stationPointWidth / 2,\n border: `${this.lineWidth}px solid ${color}`\n }\n return (\n <div style={containerStyle}>\n <div style={stationStyle}/>\n </div>\n\n )\n }", "function colourBlocks(painting) {\r\n let div = document.querySelector(\"#coloursBlock\")\r\n div.textContent = \"\";\r\n for (let p of painting.JsonAnnotations.dominantColors) {\r\n let span = document.createElement(\"span\");\r\n let colour = p.web;\r\n span.style.backgroundColor = colour;\r\n span.style.padding = \"15px 25px\";\r\n span.style.margin = \"5px\";\r\n span.title = `${colour}, ${p.name}`;\r\n div.appendChild(span);\r\n\r\n }\r\n }", "function bicoloredRect(ctx, S, size, color1, color2, fillColor, fragmentLength) {\n //Not to mess up with the ctx, we save it here and restore before execution of this\n //function is over\n ctx.save();\n \n ctx.strokeStyle = color1;\n ctx.fillStyle = fillColor;\n ctx.lineWidth = 2;\n ctx.setLineDash([fragmentLength, fragmentLength]);\n ctx.strokeRect(S[0],S[1],size[0],size[1]);\n \n ctx.lineDashOffset = fragmentLength+1;\n ctx.strokeStyle = color2;\n ctx.fillRect(S[0],S[1],size[0],size[1]);\n ctx.strokeRect(S[0],S[1],size[0],size[1]);\n //ctx.fill();\n //ctx.stroke();\n //ctx.closePath();\n \n //Restore back original ctx settings\n ctx.restore();\n }", "render ( context ) {\n\t\tcontext.fillStyle = `hsl(45.2, 100%, ${ this.size * 4 }%)`;\n\t\tcontext.beginPath();\n\t\tcontext.arc( this.position.x, this.position.y, this.size, 0, TWO_PI );\n\t\tcontext.fill();\n\t}", "renderLightbulb() {\n push();\n if (this.complete) {\n noStroke();\n fill(255, 255, 0, 10);\n ellipse(600, height / 2, 120, 120);\n fill(255, 255, 0, 20);\n ellipse(600, height / 2, 90, 90);\n fill(255, 255, 0);\n } else {\n stroke(0, 250, 255);\n strokeWeight(2);\n fill(50);\n }\n ellipse(600, height / 2, 70, 70);\n pop();\n }", "fill(color) {\n this.addEffect(new Effects.Fill(color));\n }", "setFill() {\n const fill = new PIXI.Graphics();\n fill.beginFill(0xffffff);\n fill.drawRect(0, 0, canvas.dimensions.width, canvas.dimensions.height);\n fill.endFill();\n this.composite(fill);\n fill.destroy();\n }", "markBlock (block, color, alpha) {\n color = color || this.defaultColor;\n alpha = alpha || this.defaultAlpha;\n\n this.beginFill(color, alpha);\n let data = this.drawShape(new PIXI.Rectangle(block.worldX, block.worldY, block.width, block.height));\n this.endFill();\n\n this.graphicsMap.set(block, data);\n }", "function drawBlock(ctx, color, coordinates) {\r\n for (let i = 0; i < rows; i++) {\r\n for (let j = 0; j < rows; j++) {\r\n if (coordinates[i][j] === 1) {\r\n ctx.beginPath();\r\n ctx.fillStyle = color;\r\n ctx.strokeStyle = \"lightgrey\";\r\n ctx.fillRect(j * factor, i * factor, factor, factor);\r\n ctx.strokeRect(j * factor, i * factor, factor, factor);\r\n ctx.closePath();\r\n }\r\n }\r\n }\r\n}", "function Square({ onClick, squareSize, filled, selected, show }) {\n let color = \"lavender\";\n if (!filled) {\n color = \"white\";\n } else if (show) {\n color = \"green\";\n } else if (selected) {\n color = \"black\";\n }\n return (\n <div\n onClick={e => {\n if (!filled) return;\n onClick(e);\n }}\n style={{\n display: \"inline-block\",\n width: squareSize,\n height: squareSize,\n background: color,\n border: \"1px solid #123\",\n marginRight: -1,\n marginBottom: -5\n }}\n />\n );\n}", "burst(color='yellow') {\n\t\tvar container = new createjs.Container();\n\t\t// add burst graphic\n\t\tcontainer.addChild(new createjs.Shape(this.burstGfx(color)));\n\t\tcontainer.cache(-35,-35,70,70);\n\t\treturn container;\n\t}", "constructor(colors) {\n this.colors = colors;\n this.divider = \"-------------------------------------------------------------------------------------------------------------------------\";\n }", "drawBlock(x, y, color, padding = 1) {\n this.ctx.fillStyle = color;\n this.ctx.fillRect(\n x * this.blockSize + padding,\n y * this.blockSize + padding,\n this.blockSize - (padding * 2),\n this.blockSize - (padding * 2)\n );\n }", "display() {\n fill(this.color, 100, 100);\n ellipse(this.x, this.y, this.diameter)\n }", "function show_block(scene, rectangle, items, algo = pivot_algo) {\n let height = 1;\n let y = -5;\n\n base = show_box(scene, rectangle, height, y, 'red');\n child_rectangles = algo(rectangle, {x:0, z:0}, items);\n let current_col = 0;\n child_rectangles.map(function (rect) {\n current_col = (current_col + 1) % colors.length;\n show_box(base, rect, height, 1, colors[current_col]);\n });\n}", "function ColourSwatch(bucket, colours, container) {\n var pads = [],\n outer = document.createElement('div'),\n el = document.createElement('div');\n \n // Apply colour-indicator outline\n bucket.canvas.style.outline = '4px solid ' + bucket.colour;\n \n el.style.height = outer.style.height = '24px';\n outer.style.padding = outer.style.margin = el.style.padding = el.style.margin = 0;\n el.style.display = 'inline-block';\n el.style.border = '1px solid #666';\n outer.style.marginTop = '20px';\n outer.style.textAlign = 'center';\n outer.appendChild(el);\n container.appendChild(outer);\n \n // Make pads for the supplied colours\n colours.forEach(function(colour) {\n pads.push(new ColourPad(el, colour));\n });\n \n el.addEventListener('click', function(event) {\n // When clicked, set correct bucket colour\n var colour = event.target.dataset.__swatch_colour;\n bucket.colour = colour;\n \n // Update the indicator outline\n bucket.canvas.style.outline = '4px solid ' + colour;\n });}", "render() {\n const classes = {\n 'mdc-top-app-bar--fixed':\n this.type === 'fixed' || this.type === 'prominentFixed',\n 'mdc-top-app-bar--short':\n this.type === 'shortCollapsed' || this.type === 'short',\n 'mdc-top-app-bar--short-collapsed': this.type === 'shortCollapsed',\n 'mdc-top-app-bar--prominent':\n this.type === 'prominent' || this.type === 'prominentFixed',\n 'mdc-top-app-bar--dense': this.dense,\n };\n const extraRow = this.extraRow\n ? html`\n <div class=\"mdc-top-app-bar__row\">\n <section class=\"mdc-top-app-bar__section\">\n <div class=\"mdc-top-app-bar__row\">\n <slot name=\"extraRow\"></slot>\n <section style=\"display: block\">\n <label>Text Color</label>\n <input onblur=\"setColorValue(this, '--pie-text', this.value)\"\n value=\"${document.body.style.getPropertyValue('--pie-text')}\"\n onchange=\"setColorValue(this, '--pie-text', this.value)\" />\n </section>\n <br />\n <section>\n <label>Disabled Color</label>\n <input onblur=\"setColorValue(this, '--pie-disabled', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-disabled'\n )}\"\n onchange=\"setColorValue(this, '--pie-disabled', this.value)\" />\n </section>\n <br />\n <section>\n <label>Correct Color</label>\n <input onblur=\"setColorValue(this, '--pie-correct', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-correct'\n )}\"\n onchange=\"setColorValue(this, '--pie-correct', this.value)\" />\n </section>\n <br />\n <section>\n <label>Incorrect Color</label>\n <input onblur=\"setColorValue(this, '--pie-incorrect', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-incorrect'\n )}\"\n onchange=\"setColorValue(this, '--pie-incorrect', this.value)\" />\n </section>\n <br />\n </div>\n <div class=\"mdc-top-app-bar__row\">\n <section>\n <label>Primary Color</label>\n <input onblur=\"setColorValue(this, '--pie-primary', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-primary'\n )}\"\n onchange=\"setColorValue(this, '--pie-primary', this.value)\" />\n </section>\n \n <section>\n <label>Primary Dark Color</label>\n <input onblur=\"setColorValue(this, '--pie-primary-dark', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-primary-dark'\n )}\"\n onchange=\"setColorValue(this, '--pie-primary-dark', this.value)\" />\n </section>\n <section>\n <label>Primary Light Color</label>\n <input onblur=\"setColorValue(this, '--pie-primary-light', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-primary-light'\n )}\"\n onchange=\"setColorValue(this, '--pie-primary-light', this.value)\" />\n </section>\n <br />\n </div>\n <div class=\"mdc-top-app-bar__row\">\n <section>\n <label>Secondary Color</label>\n <input onblur=\"setColorValue(this, '--pie-secondary', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-secondary'\n )}\"\n onchange=\"setColorValue(this, '--pie-secondary', this.value)\" />\n </section>\n <section>\n <label>Secondary Dark Color</label>\n <input onblur=\"setColorValue(this, '--pie-secondary-dark', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-secondary-dark'\n )}\"\n onchange=\"setColorValue(this, '--pie-secondary-dark', this.value)\" />\n </section>\n <section>\n <label>Secondary Light Color</label>\n <input onblur=\"setColorValue(this, '--pie-secondary-light', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-secondary-light'\n )}\"\n onchange=\"setColorValue(this, '--pie-secondary-light', this.value)\" />\n </section>\n <br />\n </div>\n <div class=\"mdc-top-app-bar__row\">\n <section>\n <label>Background Color</label>\n <input onblur=\"setColorValue(this, '--pie-background', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-background'\n )}\"\n onchange=\"setColorValue(this, '--pie-background', this.value)\" />\n </section>\n <br />\n <div>\n <button onclick=\"setBlackTextOnWhiteBackground()\">\n Black Text on White Background\n </button>\n </div>\n <div>\n <button onclick=\"setWhiteTextOnBlackBackground()\">\n White Text on Black Background\n </button>\n </div>\n <div>\n <button onclick=\"setYellowTextOnBlueBackground()\">\n Yellow Text on Blue Background\n </button>\n </div>\n </section>\n </div>\n </div>\n `\n : '';\n return html`\n <header class=\"mdc-top-app-bar ${classMap(classes)}\">\n <div class=\"mdc-top-app-bar__row\">\n <section\n class=\"mdc-top-app-bar__section mdc-top-app-bar__section--align-start\"\n >\n <slot name=\"navigationIcon\"></slot>\n <span class=\"mdc-top-app-bar__title\"\n ><slot name=\"title\"></slot\n ></span>\n </section>\n <section\n class=\"mdc-top-app-bar__section mdc-top-app-bar__section--align-end\"\n role=\"toolbar\"\n >\n <slot name=\"actionItems\"></slot>\n </section>\n </div>\n ${extraRow}\n </header>\n `;\n }", "display() {\n stroke([204, 0, 255, 100]);\n strokeWeight(1);\n fill([255,0,0,70]);\n beginShape();\n for (let i=0; i<this.vertices.length; i++) {\n vertex(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER);\n circle(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER, 3);\n }\n vertex(this.vertices[0].x/DIVIDER, this.vertices[0].y/DIVIDER);\n endShape();\n }", "highlight(color){\r\n let x = this.col * this.size / this.cols + 1\r\n let y = this.row * this.size / this.rows + 1\r\n ctx.fillStyle = color\r\n ctx.fillRect(x,y,this.size/this.cols -5,this.size/this.rows -5)\r\n }", "displayGrid(color) {\n strokeWeight(0);\n fill(color);\n if (this.wall) {\n fill(0);\n }\n rect(this.x * cellWidth, this.y * cellHeight, cellWidth - 1, cellHeight - 1);\n }", "static render(context, structure){\n Geonym.drawCircle(context,[0,0],0.8,'#F7F7F7','black');\n }", "function fill(color) {\r\n ctx.fillStyle = color;\r\n}", "function drawBlocks() {\r\n\tfor (i = 0; i < blocks.length; i++) {\r\n\t\tc.fillStyle = 'rgba(255,255,255, 0.9)';\r\n\t\tc.fillRect(blocks[i].x, blocks[i].y, block_size, block_size);\r\n\t}\r\n}", "function ownBlockObject(color) {\n this.color = color;\n this.ypos = 20;\n this.update = function () {\n var c = document.getElementById(\"canvas\");\n var ctx = c.getContext(\"2d\");\n ctx.fillStyle = this.color;\n ctx.fillRect(20, this.ypos, 20, 100);\n }\n}", "function drawBlock ( x, y, color ) {\r\n let printX = x * BLOCK_SIZE;\r\n let printY = y * BLOCK_SIZE;\r\n\r\n context.fillStyle = TETROMINO_COLORS[ color ];\r\n context.fillRect( printX, printY, BLOCK_SIZE, BLOCK_SIZE );//Draw a tetromino with BLOCK_SIZE at (printX,printY) coordinate\r\n context.strokeStyle = \"black\";//Draw a frame\r\n context.strokeRect( printX, printY, BLOCK_SIZE, BLOCK_SIZE );\r\n}", "function createBlock(svg){\n return svg.rect(100, 25).addClass('standardBlock');\n}", "function renderColor(color) {\n const colorDiv = document.createElement('div')\n colorDiv.style.backgroundColor = color\n colorDiv.style.width = '6rem'\n colorDiv.style.height = '3rem'\n return colorDiv\n}", "display() {\n push();\n noStroke();\n fill(this.color1);\n translate(this.posX, this.posY);\n ellipse(0, 0, this.size);\n noStroke();\n fill(this.color2);\n translate(this.posX, this.posY);\n ellipse(0, 0, this.size);\n noStroke();\n fill(this.color3);\n translate(this.posX, this.posY);\n ellipse(0, 0, this.size);\n pop();\n }", "createRegularShapeRoom() {\n\n let { paddingLeft, paddingTop, itemSelectedColor, itemColor } = this.cfg;\n let { w, h, sh, isSelected } = this.props;\n\n let width = w - (paddingLeft * 2);\n let height = h - (paddingTop * 2);\n let backgroundColor = (isSelected ? itemSelectedColor : itemColor);\n\n let style = {\n width,\n height,\n backgroundColor\n };\n\n let itemBgnd = (\n <div className={`item-bgnd ${sh}`} style={style}></div>\n )\n\n return itemBgnd;\n }", "function Square({ color, borderr }) {\r\n //toda vez que for usar um objeto utilizar chave duas vezes\r\n /*\r\n const style = {\r\n width: \"100%\",\r\n border: \"2px solid gold\",\r\n height: \"100px\",\r\n //passando uma cor\r\n backgroundColor: color\r\n };\r\n para usar uma objeto desse e so passar no style da div;\r\n */\r\n return (\r\n <div\r\n style={{\r\n width: \"100%\",\r\n border: borderr,\r\n height: \"100px\",\r\n //passando uma cor\r\n backgroundColor: color\r\n }}\r\n />\r\n );\r\n}", "function makeSwatch(color, width, height) {\n return '<span style=\"width: ' + width + 'px; height: ' + height + 'px; background-color: ' + color + '; '\n + 'display: inline-block; border: 1px black solid; align: center; vertical-align: middle;\">' + color + '</span>';\n}", "base(color=\"default\") {\n\t\tvar container = new createjs.Container();\n\t\t// add regular note graphics\n\t\tif (color != \"default\") {\n\t\t\tcontainer.addChild(new createjs.Shape(this.baseGfx(color)), new createjs.Shape(this.centerGfx(color)));\n\t\t} else {\n\t\t\tcontainer.addChild(new createjs.Shape(this.baseGfx()), new createjs.Shape(this.centerGfx()));\n\t\t}\n\t\tcontainer.cache(-30,-30,60,60);\n\t\t\n\t\t// reset the graphics\n\t\tcontainer.resetGfx = function() {\n\t\t\tthis.visible = true;\n\t\t\tthis.alpha = 1;\n\t\t}\n\t\t\n\t\treturn container;\n\t}", "render(){\n const x = this.col * grid;\n const y = this.row * grid;\n const horizontal = this.dir.col;\n const vertical = this.dir.row;\n\n // create a fire effect by stacking red, orange, and yellow on top of\n // each other using progressively smaller rectangles\n context.fillStyle = '#D72B16'; // red\n context.fillRect(x, y, grid, grid);\n\n context.fillStyle = '#F39642'; // orange\n\n // determine how to draw based on if it's vertical or horizontal\n // center draws both ways\n if (this.center || horizontal) {\n context.fillRect(x, y + 6, grid, grid - 12);\n }\n if (this.center || vertical) {\n context.fillRect(x + 6, y, grid - 12, grid);\n }\n\n context.fillStyle = '#FFE5A8'; // yellow\n\n if (this.center || horizontal) {\n context.fillRect(x, y + 12, grid, grid - 24);\n }\n if (this.center || vertical) {\n context.fillRect(x + 12, y, grid - 24, grid);\n }\n }", "render(context) {\n this.rows.forEach(row => \n row.forEach(cell => {\n if (cell.filled) {\n cell.block.render(context);\n }\n }));\n }", "show() {\n // Food is blue by default\n fill(0, 0, 255);\n rect(this.x, this.y, this.gridScale, this.gridScale);\n }", "mineBurst(color='red') {\n\t\tvar container = new createjs.Container();\n\t\t// add burst graphic\n\t\tcontainer.addChild(new createjs.Shape(this.mineBurstGfx(color)));\n\t\tcontainer.cache(-30,-30,60,60);\n\t\treturn container;\n\t}", "show(){\n push();\n rectMode(CORNER);\n fill(this.color.x,this.color.y,this.color.z);\n rect(this.location.x,this.location.y,this.width,this.height);\n pop();\n }", "function drawBlocks(arr) {\n for (var i = 0; i < arr.length; i++) {\n context.fillStyle = arr[i].color;\n context.fillRect(arr[i].x, arr[i].y, arr[i].size, arr[i].size);\n }\n}", "function drawRectBlue() {\n fill(0,0,255);\n rect(width/2,height/2,size*3,size*3);\n\n}//End function drawRectBlue", "constructor (color) {\n this.color = color\n this.shouldDraw = true\n }", "function Block(state) {\n this.type = Math.ceil(Math.random() * 7) - 1;\n this.color = state.layout_colors[this.type];\n\n this.orientation = 0;\n\n var layout = state.available_layouts[this.type];\n\n\n this.height = function () {\n if (this.orientation === 0 || this.orientation === 180) {\n return layout.length;\n }\n return layout[0].length;\n };\n\n this.width = function () {\n if (this.orientation === 90 || this.orientation === 270) {\n return layout.length;\n }\n return layout[0].length;\n };\n\n this.x = Math.floor(state.playAreaX / 2 - this.width() / 2);\n this.y = 0;\n\n this.draw = function (ctx) {\n ctx.fillStyle = this.color;\n\n var render_offsets = { \"x\": 0, \"y\": 0 },\n step, filled,\n render_coord_x, render_coord_y;\n\n for (step = 0; step < this.width() * this.height(); step++) {\n filled = this.piece_filled(step);\n\n // Render if necessary.\n if (filled) {\n render_coord_x = (this.x + render_offsets.x) * state.blockSize;\n render_coord_y = (this.y + render_offsets.y) * state.blockSize;\n\n ctx.fillRect(render_coord_x + 1, render_coord_y + 1, state.blockSize - 2, state.blockSize - 2);\n }\n\n render_offsets = this.update_render_offsets(render_offsets);\n }\n };\n\n /**\n * The naming and use of this function needs a review.\n */\n this.update_render_offsets = function(render_offsets) {\n render_offsets.x++;\n\n if (render_offsets.x >= this.width()) {\n render_offsets.y++;\n render_offsets.x = 0;\n }\n\n return render_offsets;\n };\n\n /**\n * Figure out if the current piece in a block is filled..\n */\n this.piece_filled = function (step) {\n var coordinates = this.step_to_rotated_coordinates(step),\n filled = layout[coordinates.y][coordinates.x];\n return !!filled;\n };\n\n /**\n * Converts \"search steps\" into local x/y coordinates.\n */\n this.step_to_coordinates = function(step) {\n var coords = { x: 0, y: 0 };\n\n if (this.orientation === 0 || this.orientation === 180) {\n coords.x = step % this.width();\n coords.y = Math.floor(step / this.width());\n }\n else {\n coords.x = Math.floor(step / this.width());\n coords.y = ((step + 1) % this.width());\n }\n\n return coords;\n };\n\n /**\n * Converts \"search steps\" into local x/y coordinates adjusted for piece\n * rotation.\n */\n this.step_to_rotated_coordinates = function(step) {\n var coords = this.step_to_coordinates(step);\n\n if (this.orientation === 180) {\n coords.x = this.width() - coords.x - 1;\n coords.y = this.height() - coords.y - 1;\n }\n else if (this.orientation === 270) {\n coords.x = this.width() - coords.x;\n // @TODO Ugly hack. Figure out and fix.\n if (this.type === 6) { coords.x--; }\n if (this.width() === 4) { coords.x -= 4; }\n coords.y = this.width() - coords.y - 1;\n }\n\n return coords;\n };\n\n this.down = function () {\n state.gameField.check_hit_bottom(state.block, \"d\");\n\n if (state.block.replace !== true) {\n this.y += 1;\n }\n };\n}", "constructor(x,y,w,h,fillColour){\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n this.fillColour = fillColour;\n\n }", "lineComponent(color) {\n let lineStyle = {\n flex: `0 0 ${this.lineWidth}px`,\n background: color\n }\n return (\n <div style={style.lineComponent}>\n <div style={style.lineComponent.space}/>\n <div style={lineStyle} />\n <div style={style.lineComponent.space}/>\n </div>\n )\n }", "function makeCompositeBlock(prim, spec, type, color, varprocname){\r\n\r\n\t// COLOR HACK\r\n\tif((prim == \"LOUDNESS\") ||\r\n\t (prim == \"CAMERAIMAGE\") ||\r\n\t (prim == \"CAMERAMOTION\") ||\r\n\t (prim == \"FLICKR\") ||\r\n\t (prim == \"prim_flickr\")){\r\n\t\tcolor = \"#A00000\";\r\n\t}\r\n\r\n\tvar block = $('<div class=\"block\"></div>');\r\n\tblock[0].prim = prim;\r\n\tblock[0].spec = spec;\r\n\tblock[0].type = type;\r\n\tblock[0].color = color;\r\n\tblock[0].fcn = window[prim];\r\n\tblock.attr('onSelectStart','return false');\r\n\tvar shape = $('<canvas onclick=\"void(0)\" class=\"shape\"></canvas>'); // for iPhone: onclick = \"void(0)\"\r\n\tblock.append(shape);\r\n\tshape.css('z-index', 0);\r\n\t\r\n\t// PARSE PROCEDURE\r\n\tif((block[0].prim == 'prim_procedure') || (block[0].prim == 'prim_proceduredef')){\r\n\t\tvar label = $('<div class=\"label\">'+varprocname+'</div>');\r\n\t\tlabel.attr('onSelectStart','return false'); //avoid text selection on browser other then Mozilla\r\n\t\tblock.append(label);\r\n\t\tblock[0].procname = varprocname;\r\n\t}else{\r\n\t// PARSE SPEC\r\n\t\tvar specArray = spec.split(\" \");\r\n\t\tfor(s in specArray){\r\n\t\t\tvar p = specArray[s];\r\n\t\t\tif((p.charAt(0) == '%') && (p.length != 1)){\r\n\t\t\t\t// ARGUMENT\r\n\t\t\t\tvar arg;\r\n\t\t\t\tif(p.charAt(1) == 'n'){\r\n\t\t\t\t\targ = $('<input class=\"arg\" value=\"10\" />');\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_number'];\r\n\t\t\t\t}\r\n\t\t\t\tif(p.charAt(1) == 'p'){\r\n\t\t\t\t\targ = $('<input class=\"arg\" value=\"10\" />');\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_number'];\r\n\t\t\t\t}\r\n\t\t\t\tif(p.charAt(1) == 's'){\r\n\t\t\t\t\targ = $('<input class=\"arg\" value=\"10\" />');\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_number'];\r\n\t\t\t\t}\r\n\t\t\t\tif(p.charAt(1) == 'b'){\r\n\t\t\t\t\targ = $('<div class=\"arg\"><canvas class=\"boolean\" /></div>');\r\n\t\t\t\t\targ.css('z-index', 1);\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_boolean'];\r\n\t\t\t\t}\r\n\t\t\t\tif(p.charAt(1) == 'f'){\r\n\t\t\t\t\targ = $('<input class=\"arg\" value=\"10\" />');\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_number'];\r\n\t\t\t\t}\r\n\t\t\t\tif((p.charAt(1) == 'v') && (spec == 'set %v to %n')){\r\n\t\t\t\t\tvar varLabel = $('<div class=\"arg\">v</div>');\r\n\t\t\t\t\tvarLabel.attr('onSelectStart','return false');\r\n\t\t\t\t\tblock.append(varLabel);\r\n\t\t\t\t\tblock[0].varname = varprocname;\r\n\t\t\t\t}\r\n\t\t\t\tif((p.charAt(1) == 'v') && (spec == 'change %v by %n')){\r\n\t\t\t\t\tvar varLabel = $('<div class=\"arg\">v</div>');\r\n\t\t\t\t\tvarLabel.attr('onSelectStart','return false');\r\n\t\t\t\t\tblock.append(varLabel);\r\n\t\t\t\t\tblock[0].varname = varprocname;\r\n\t\t\t\t}\r\n\t\t\t\tif((p.charAt(1) == 'v') && (spec == '%v')){\r\n\t\t\t\t\tvar varLabel = $('<div class=\"label\">'+varprocname+'</div>');\r\n\t\t\t\t\tvarLabel.attr('onSelectStart','return false');\r\n\t\t\t\t\tblock.append(varLabel);\r\n\t\t\t\t\tblock[0].varname = varprocname;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(arg != undefined){\r\n\t\t\t\t\tblock.append(arg);\r\n\t\t\t\t\targ.keydown(function() {\r\n\t\t\t\t\t\tlayoutArg($(this));\r\n\t\t\t\t\t\tlayoutStack($(this).parents('.stack'));\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else if(p.charAt(0) == '@'){\r\n\t\t\t\t// ICON\r\n\t\t\t\tvar icon = getIcon(p.substring(1,p.length));\r\n\t\t\t\tif(icon!= null){\r\n\t\t\t\t\ticon.css('z-index', 5);\r\n\t\t\t\t\tblock.append(icon);\r\n\t\t\t\t\ticon.attr('onSelectStart','return false'); //avoid text selection on browser other then Mozilla\r\n\t\t\t\t\ticon.attr('onDragStart','return false'); //avoid image drag\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar label = $('<div class=\"label\">'+p+'</div>');\r\n\t\t\t\t\tlabel.attr('onSelectStart','return false'); //avoid text selection on browser other then Mozilla\r\n\t\t\t\t\tblock.append(label);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// LABEL\r\n\t\t\t\tvar label = $('<div class=\"label\">'+p+'</div>');\r\n\t\t\t\tlabel.attr('onSelectStart','return false'); //avoid text selection on browser other then Mozilla\r\n\t\t\t\tblock.append(label);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn block;\r\n}", "function rainBox(size, color) {\n const x = midX - size / 2;\n const y = midY - size / 2;\n ctx.fillStyle = color;\n ctx.fillRect(x, y, size, size);\n}", "function create_if_block$m(ctx) {\n\t\tlet block;\n\t\tlet current;\n\n\t\tblock = new Block$2({\n\t\t\t\tprops: {\n\t\t\t\t\ttype: \"color\",\n\t\t\t\t\t$$slots: { default: [create_default_slot$9] },\n\t\t\t\t\t$$scope: { ctx }\n\t\t\t\t}\n\t\t\t});\n\n\t\treturn {\n\t\t\tc() {\n\t\t\t\tcreate_component(block.$$.fragment);\n\t\t\t},\n\t\t\tm(target, anchor) {\n\t\t\t\tmount_component(block, target, anchor);\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\tp(ctx, dirty) {\n\t\t\t\tconst block_changes = {};\n\n\t\t\t\tif (dirty & /*$$scope, inputValue, value*/ 1029) {\n\t\t\t\t\tblock_changes.$$scope = { dirty, ctx };\n\t\t\t\t}\n\n\t\t\t\tblock.$set(block_changes);\n\t\t\t},\n\t\t\ti(local) {\n\t\t\t\tif (current) return;\n\t\t\t\ttransition_in(block.$$.fragment, local);\n\t\t\t\tcurrent = true;\n\t\t\t},\n\t\t\to(local) {\n\t\t\t\ttransition_out(block.$$.fragment, local);\n\t\t\t\tcurrent = false;\n\t\t\t},\n\t\t\td(detaching) {\n\t\t\t\tdestroy_component(block, detaching);\n\t\t\t}\n\t\t};\n\t}", "render(){\n return(\n <View style = {{flex: 1, backgroundColor: 'blue',}}>\n <View style = {{width: 400 , height: 400, backgroundColor: 'red'}}>\n \n </View>\n </View>\n );\n \n }", "drawBlock(ctx, idColor, x, y) {\n let img = document.getElementById(\"square\" + idColor);\n if (img) {\n // Image exist -> copy it in the canvas\n ctx.drawImage(img,x, y, this.size, this.size);\n }\n else {\n // Fallback, draw the block in the canvas\n let w2 = 1;\n ctx.save();\n\n // Draw the filled square\n ctx.fillStyle = idColor;\n ctx.fillRect(x, y, this.size, this.size);\n\n // Draw square border\n ctx.beginPath();\n ctx.strokeStyle = \"rgba(255, 255, 255, 0.5)\";\n ctx.lineWidth = 2 * w2;\n ctx.moveTo(x + w2, y+w2);\n ctx.lineTo(x - w2 + this.size, y + w2);\n ctx.lineTo(x - w2 + this.size, y - w2 + this.size);\n ctx.stroke();\n ctx.closePath();\n\n // Draw square border\n ctx.beginPath();\n ctx.strokeStyle = \"rgba(0, 0, 0, 0.5)\";\n ctx.lineWidth = 2 * w2;\n ctx.moveTo(x + w2, y + w2);\n ctx.lineTo(x + w2, y - w2 + this.size);\n ctx.lineTo(x - w2 + this.size, y - w2 + this.size);\n ctx.stroke();\n ctx.closePath();\n\n ctx.restore();\n }\n }", "function Layout (){\r\n return (\r\n <div style = {{backgroundColor:'brand'}}>\r\n <Grid \r\n rows={['xxsmall', ['large', 'flex']]}\r\n //rows={['1/2', '2/3']}\r\n columns={[['small', 'flex'], ['large', 'flex'], ['medium', 'flex']]}\r\n background = \"Brand\"\r\n gap = 'medium'\r\n fill = {true}\r\n areas={[\r\n { name: 'header', start: [0, 0], end: [2, 1] },\r\n { name: 'left', start: [0, 1], end: [0, 1] },\r\n { name: 'main', start: [1, 1], end: [1, 1] },\r\n { name: 'right', start: [2, 1], end: [2, 1] },\r\n ]}\r\n >\r\n <Stack gridArea=\"header\" background=\"brand\" fill = {true}>\r\n {/* <Box as={Searchbar}/> */}\r\n </Stack>\r\n <Stack gridArea = \"left\">\r\n <Box as={Menubar} /> \r\n </Stack>\r\n <Stack gridArea=\"main\" background=\"light-2\">\r\n <Box as={PostArea}/>\r\n </Stack>\r\n { <Stack gridArea=\"right\" background=\"light-5\" fill = {true}>\r\n <Box as={Sidebar} />\r\n </Stack>}\r\n </Grid>\r\n </div>\r\n\r\n );\r\n}", "function squareMaker(x, y, color) {\n this.x = x;\n this.y = y;\n this.color = color;\n this.display = function () {\n stroke(255, 50);\n if (this.color == 'blue') {\n fill(187, 217, 238);\n } else if (this.color == 'black') {\n fill(0);\n } else {\n noFill();\n }\n rect(this.x, this.y, 50, 50);\n };\n}", "function renderBg() {\n var split_color = 'rgba(155, 155, 155, 0.3)';\n\n // length per level (including splitter)\n var level_width = splitter_scale(2);\n\n // repeating the pattern img in this way\n //\n // ---||---||---|| .... ||---||---\n //\n var splitter_img = [\n 'repeating-linear-gradient(',\n 'to right,',\n split_color + ',',\n split_color + ' ' + split_width + 'px ,',\n 'transparent ' + split_width + 'px ,',\n 'transparent ' + level_width + 'px',\n ')'\n ].join('');\n\n el.parentElement.setAttribute('style',\n 'background-image:' + splitter_img);\n }", "function fillBox(valRed, valGreen, valBlue, valBright) {\n if (mouseX < sizeWidth * sizeBlock) {\n blockX = Math.floor(mouseX / sizeBlock) * sizeBlock;\n blockY = Math.floor(mouseY / sizeBlock) * sizeBlock;\n\n valRed = adjustBrightness(valRed, valBright);\n valGreen = adjustBrightness(valGreen, valBright);\n valBlue = adjustBrightness(valBlue, valBright);\n\n fill(adjustBrightness(random(valRed), valBright),\n adjustBrightness(random(valGreen), valBright),\n adjustBrightness(random(valBlue), valBright),\n 255);\n\n rect(blockX, blockY, sizeBlock, sizeBlock);\n }\n}", "render() {\n\t\tfill(gameSettings['food_color'][0], gameSettings['food_color'][1], gameSettings['food_color'][2]);\n\t\trect(this.x, this.y, gameSettings['scale'], gameSettings['scale']);\n\t}", "function renderScaffolding() {\n ctx.beginPath();\n for (var i=0; i<spans.length; i++) {\n var s = spans[i];\n if (s.visibility === \"hidden\") {\n ctx.strokeStyle=\"pink\";\n ctx.moveTo(s.p1.cx, s.p1.cy);\n ctx.lineTo(s.p2.cx, s.p2.cy);\n }\n }\n ctx.stroke();\n}", "function renderLifeBox() {\n for (let col = 0; col < grid.length; col++) {\n for (let row = 0; row < grid[col].length; row++) {\n const cell = grid[col][row];\n ctx.current.beginPath();\n ctx.current.rect(col * resolution, row * resolution, resolution, resolution)\n ctx.current.fillStyle = cell ? 'lightgreen' : '#271D45';\n ctx.current.shadowColor = 'green'\n ctx.current.shadowBlur = 15;\n ctx.current.fill();\n ctx.current.stroke();\n }\n }\n }", "Render() {\n gdi.HollowBrush();\n gdi.PurplePen();\n\n for ( let spt = 0; spt < this.m_Spots.length; ++spt ) {\n gdi.Circle( this.m_Spots[ spt ].m_vPos, this.m_Spots[ spt ].m_dScore );\n }\n\n if ( this.m_pBestSupportingSpot != null ) {\n gdi.GreenPen();\n gdi.Circle( this.m_pBestSupportingSpot.m_vPos, this.m_pBestSupportingSpot.m_dScore );\n };\n }", "function testAddBlock()\n\t{\n\t\t// addBlock(0, 0, color, id)\n\t\taddBlock(0,0, 0x00ff80, 0);\n\t\taddBlock(0,0, 0x00ff80, 1);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0x000000, 2);\n\t\taddBlock(15,15, 0xffffff, 6);\n\t\taddBlock(15,15, 0xffffff, 6);\n\n\t\taddBlock(0,0, 0x00ff80, 3);\n\t\taddBlock(0,0, 0x00ff80, 4);\n\t}", "function fillCircle(valRed, valGreen, valBlue) {\n if (mouseX < sizeWidth * sizeBlock) {\n fill(random(valRed), random(valGreen), random(valBlue), 255);\n ellipse(mouseX, mouseY, sizeBlock, sizeBlock);\n }\n}", "function colorRect(topLeftX, topLeftY, boxWidth, boxHeight, fillColor) {\n\n if (USE_WEBGL_IF_SUPPORTED && window.webGL) {\n\n // TODO: we need to parse \"any\": css color string like \"violet\"\n //if (fillColor=='black') webGL.col = 0x000000FF; // etc\n\n if (webGL.pureWhiteTexture)\n webGL.img(webGL.pureWhiteTexture, topLeftX, topLeftY, boxWidth, boxHeight, 0,\n 0, 0, gameManager.gameScale, gameManager.gameScale, 0, 0, 1, 1);\n\n }\n else // normal 2d rendering\n {\n canvasContext.fillStyle = fillColor;\n canvasContext.fillRect(topLeftX, topLeftY, boxWidth, boxHeight);\n }\n}", "function component(width, height, color, x, y) {\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n this.isalive = true;\n this.update = function(){\n ctx.fillStyle = color;\n ctx.fillRect(this.x, this.y, this.width, this.height);\n }\n}", "blockInput(color)\n {\n if (color === undefined) {\n color = \"blue\";\n }\n simpleUtils.getDOMElement(\"redSandInputBlocker\").style.background = color;\n simpleUtils.getDOMElement(\"redSandInputBlocker\").style.display = \"block\";\n }", "sideColors() {\n return {\n position: \"absolute\",\n zIndex: -1,\n top: 0,\n bottom: 0,\n left: 0,\n width: 7,\n backgroundColor: this.props.color,\n };\n }", "setFilled(color) {\n this.filled = true;\n this.color = color;\n }", "function drawBlocks() {\n for (let c = 0; c < blockColumnCount; c++) {\n for (let r = 0; r < blockRowCount; r++) {\n if (blocks[c][r].show == 1) {\n let blockX = (c * (blockWidth + blockPadding)) + blockOffsetLeft\n let blockY = (r * (blockHeight + blockPadding)) + blockOffsetTop\n blocks[c][r].x = blockX\n blocks[c][r].y = blockY\n ctx.beginPath()\n ctx.rect(blockX, blockY, blockWidth, blockHeight)\n let red = Math.floor(Math.random() * (255 - 200) + 200);\n let green = Math.floor(Math.random() * (255 - 200) + 200);\n let blue = Math.floor(Math.random() * (255 - 200) + 200);\n ctx.fillStyle = \"rgb(\" + red + \",\" + green + \",\" + blue + \" )\"\n ctx.fill()\n ctx.closePath()\n }\n }\n }\n}", "render() {\n this.getColorsFromCSS();\n this.drawLines();\n }", "function itemArea(group, color1, color2, color3, color4) {\r\n\r\n var canvas = document.createElement(\"canvas\");\r\n var canvasOuter = document.createElement(\"canvas\");\r\n\r\n setGradient(canvas, canvasOuter, \"inner\", color1, color2);\r\n setGradient(canvas, canvasOuter, \"outer\", color3, color4);\r\n\r\n var shadowTexture = new THREE.Texture(canvas);\r\n shadowTexture.needsUpdate = true;\r\n\r\n var shadowTextureOuter = new THREE.Texture(canvasOuter);\r\n shadowTextureOuter.needsUpdate = true;\r\n\r\n var material = new THREE.MeshBasicMaterial({\r\n map: shadowTexture,\r\n side: THREE.DoubleSide\r\n });\r\n var materialOuter = new THREE.MeshBasicMaterial({\r\n map: shadowTextureOuter,\r\n side: THREE.DoubleSide\r\n });\r\n\r\n var circle = new THREE.Mesh(circleGeometry, material);\r\n var circleOuter = new THREE.Mesh(circleGeometryOuter, materialOuter);\r\n\r\n circleOuter.name = group.name;\r\n\r\n return [circle, circleOuter];\r\n}", "function renderBg() {\n var split_color = 'rgba(155, 155, 155, 0.3)';\n\n // length per level (including splitter)\n var level_width = splitter_scale(2);\n\n // repeating the pattern img in this way\n //\n // ---||---||---|| .... ||---||---\n //\n var splitter_img = ['repeating-linear-gradient(', 'to right,', split_color + ',', split_color + ' ' + split_width + 'px ,', 'transparent ' + split_width + 'px ,', 'transparent ' + level_width + 'px', ')'].join('');\n\n el.parentElement.setAttribute('style', 'background-image:' + splitter_img);\n }", "function createFillSymbol (color) {\r\n return {\r\n type: \"simple-fill\",\r\n color: color,\r\n style: \"solid\",\r\n outline: {\r\n width: 0.2,\r\n color: \"#666666\",\r\n style: \"solid\"\r\n }\r\n };\r\n }", "show() {\r\n if (this.life === 0) {\r\n this.shade = 50;\r\n }else{\r\n this.shade = 200;\r\n }\r\n fill(this.shade);\r\n rect(this.x, this.y, res, res);\r\n }", "setFill(color) {\n if (color === false) color = `transparent`;\n this.ctx.fillStyle = color;\n }", "drawNodeCollapsed (node, ctx, fgcolor, bgcolor) {\n //draw default collapsed shape\n ctx.strokeStyle = fgcolor || LiteGraph.NODE_DEFAULT_COLOR;\n ctx.fillStyle = bgcolor || LiteGraph.NODE_DEFAULT_BGCOLOR;\n\n let collapsed_radius = LiteGraph.NODE_COLLAPSED_RADIUS;\n\n //circle shape\n let shape = node.shape || \"box\";\n if (shape == \"circle\") {\n ctx.beginPath();\n ctx.arc(node.size[0] * 0.5, node.size[1] * 0.5, collapsed_radius, 0, Math.PI * 2);\n ctx.fill();\n ctx.shadowColor = \"rgba(0,0,0,0)\";\n ctx.stroke();\n\n ctx.fillStyle = node.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR;\n ctx.beginPath();\n ctx.arc(node.size[0] * 0.5, node.size[1] * 0.5, collapsed_radius * 0.5, 0, Math.PI * 2);\n ctx.fill();\n }\n else if (shape == \"round\") //rounded box\n {\n ctx.beginPath();\n ctx.roundRect(node.size[0] * 0.5 - collapsed_radius, node.size[1] * 0.5 - collapsed_radius, 2 * collapsed_radius, 2 * collapsed_radius, 5);\n ctx.fill();\n ctx.shadowColor = \"rgba(0,0,0,0)\";\n ctx.stroke();\n\n ctx.fillStyle = node.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR;\n ctx.beginPath();\n ctx.roundRect(node.size[0] * 0.5 - collapsed_radius * 0.5, node.size[1] * 0.5 - collapsed_radius * 0.5, collapsed_radius, collapsed_radius, 2);\n ctx.fill();\n }\n else //flat box\n {\n ctx.beginPath();\n //ctx.rect(node.size[0] * 0.5 - collapsed_radius, node.size[1] * 0.5 - collapsed_radius, 2*collapsed_radius, 2*collapsed_radius);\n ctx.rect(0, 0, node.size[0], collapsed_radius * 2);\n ctx.fill();\n ctx.shadowColor = \"rgba(0,0,0,0)\";\n ctx.stroke();\n\n ctx.fillStyle = node.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR;\n ctx.beginPath();\n //ctx.rect(node.size[0] * 0.5 - collapsed_radius*0.5, node.size[1] * 0.5 - collapsed_radius*0.5, collapsed_radius,collapsed_radius);\n ctx.rect(collapsed_radius * 0.5, collapsed_radius * 0.5, collapsed_radius, collapsed_radius);\n ctx.fill();\n }\n }", "constructor() {\n this.rColor = 0;\n this.gColor = 244;\n this.bColor = 158;\n this.x = 750;\n this.y = 10;\n this.width = 200;\n this.height = 200;\n }", "function randFill(color) {\n let numBlocksReplace = getRandomInt(options.blocksPerEdge * options.blocksPerEdge * .25, options.blocksPerEdge * options.blocksPerEdge * .75);\n let replacedBlocks = [];\n while (replacedBlocks.length < numBlocksReplace) {\n let rand = getRandomInt(0, options.blocksPerEdge * options.blocksPerEdge - 1);\n if (replacedBlocks.indexOf(rand) === -1) {\n let coordinate = getLocation(rand);\n drawSquare(color, coordinate[1], coordinate[0]);\n replacedBlocks.push(rand);\n }\n }\n }", "createGraphic(type, color, p1, p2) {\n let graphic = new PIXI.Graphics();\n graphic.beginFill(color);\n switch (type) {\n case \"rect\":\n case \"Rect\":\n case \"r\":\n case \"R\":\n case \"Rec\":\n graphic.drawRect(0, 0, p1, p2);\n break;\n default:\n graphic.drawCircle(0, 0, p1);\n }\n \n graphic.endFill();\n console.log('Created a new Graphic', type);\n return graphic;\n }", "render() {\n // Rendering Canvas\n this.ctx.fillStyle = 'black';\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n\n //Render existing blocks\n for (let i = 0; i < this.blocks.length; i++) {\n this.drawBlock(this.blocks[i].x, this.blocks[i].y, this.blocks[i].color);\n }\n\n // Render ghost blocks\n this.drawBlock(this.x + this.activeshape[this.rotation][0].x, this.ghostY + this.activeshape[this.rotation][0].y, this.ghostcolor);\n this.drawBlock(this.x + this.activeshape[this.rotation][1].x, this.ghostY + this.activeshape[this.rotation][1].y, this.ghostcolor);\n this.drawBlock(this.x + this.activeshape[this.rotation][2].x, this.ghostY + this.activeshape[this.rotation][2].y, this.ghostcolor);\n this.drawBlock(this.x + this.activeshape[this.rotation][3].x, this.ghostY + this.activeshape[this.rotation][3].y, this.ghostcolor);\n\n // Rendering\n this.drawBlock(this.x + this.activeshape[this.rotation][0].x, this.y + this.activeshape[this.rotation][0].y, this.activeshape.color);\n this.drawBlock(this.x + this.activeshape[this.rotation][1].x, this.y + this.activeshape[this.rotation][1].y, this.activeshape.color);\n this.drawBlock(this.x + this.activeshape[this.rotation][2].x, this.y + this.activeshape[this.rotation][2].y, this.activeshape.color);\n this.drawBlock(this.x + this.activeshape[this.rotation][3].x, this.y + this.activeshape[this.rotation][3].y, this.activeshape.color);\n }", "function makeShade() {\n shade = game.add.graphics(0, 0);\n shade.beginFill(0x000000, 0.6);\n shade.drawRect(0, 0, game.world.width, game.world.height);\n shade.endFill();\n}", "display(){\r\n \r\n rectMode(CENTER);\r\n fill(\"cyan\");\r\n rect (this.body.position.x, this.body.position.y, this.width, this.height);\r\n \r\n }", "render()\n {\n\t var canvas = document.getElementById('mycanvas');\n\t var ctx = canvas.getContext('2d');\n\t // fill the square with this (rgb value) colour\n\t ctx.fillStyle = rgb(this.colour[0],this.colour[1],this.colour[2]);\n\t // args are x,y,width,height\n\t ctx.fillRect(this.x, this.y, this.width, this.height);\n\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 block00(){\n block1.style.backgroundColor = \"rgb(255, 255, 255)\";\n block2.style.backgroundColor = \"rgb(255, 255, 255)\";\n block3.style.backgroundColor = \"rgb(255, 255, 255)\";\n block4.style.backgroundColor = \"rgb(255, 255, 255)\";\n block5.style.backgroundColor = \"rgb(255, 255, 255)\";\n block6.style.backgroundColor = \"rgb(255, 255, 255)\";\n block7.style.backgroundColor = \"rgb(255, 255, 255)\";\n block8.style.backgroundColor = \"rgb(255, 255, 255)\";\n block9.style.backgroundColor = \"rgb(255, 255, 255)\";\n block10.style.backgroundColor = \"rgb(255, 255, 255)\";\n block11.style.backgroundColor = \"rgb(255, 255, 255)\";\n}", "function Square(props) {\n return (\n <div\n className=\"flex-item\"\n style={{ backgroundColor: props.colors, visibility: props.visibility }}\n onClick={props.onClick}\n ></div>\n );\n}", "function drawblocks() \n{\n\tfor (i=0; i < rows; i++) \n\t{\n\t\tcanvas.fillStyle = rowcolors[i]\n\n\t\tfor (j=0; j < columns; j++) \n\t\t{\n\t\t\tif (blocks[i][j] == 1) \n\t\t\t{\n\t\t\t\tblock((j * (blockwidth + shield)) + shield, (i * (blockheight + shield)) + shield, blockwidth, blockheight);\n\t\t\t}\n\t\t}\n\t}\n}", "constructor(x, y, width, height, color) {\n // Initialize all variables for bottom pipe\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.color = color;\n }", "draw() {\n s.globalCompositeOperation = \"lighter\";\n s.lineWidth = 2;\n s.strokeStyle = `hsla(${this.hue}, 100%, 50%, ${this.a})`;\n s.strokeRect(\n this.x - this.size / 2,\n this.y - this.size / 2,\n this.size,\n this.size\n );\n this.update();\n }", "constructor(x, y, color) {\n\t\tsuper(x, y, color);\n\t\tthis.type = \"square\";\n\t}", "show(){\n push();\n\n colorMode(RGB, 255)\n fill(this.color);\n noStroke();\n\n ellipse(this.x, this.y, DOT_SIZE);\n\n pop();\n }", "show(){\n fill(this.color);\n rect(this.x, this.y, this.w, this.h);\n }", "function displayPixelArt(colorDataSet, ratio) {\r\n\r\n let blockBoundaryData = fetchBlockLowerBoundaries();\r\n\r\n w = Math.floor(imageWidth / ratio) * 16;\r\n h = Math.floor(imageHeight / ratio) * 16;\r\n\r\n const canvas = document.getElementById('displayMinecraftBlockConstruction');\r\n const context = canvas.getContext('2d');\r\n canvas.width = w;\r\n canvas.height = h;\r\n\r\n\r\n context.fillStyle = '#ffffff';\r\n context.fillRect(0, 0, w, h);\r\n\r\n //used as an index for the pixels that are to be rendered\r\n for (let i = 0; i < colorDataSet.length; i++) {\r\n\r\n //Used as the index for all of the possible block values\r\n for (let j = 0; j < 125; j++) {\r\n\r\n //Checks whether the block fits in the individual constraints, nested ifs were used such that the conditions can actually all be seen.\r\n if (colorDataSet[i].redValue >= blockBoundaryData.redValue[j] && colorDataSet[i].redValue < blockBoundaryData.redValue[j] + 56 /* && colorDataSet.blockValue !== \"\"*/) {\r\n\r\n if (colorDataSet[i].greenValue >= blockBoundaryData.greenValue[j] && colorDataSet[i].greenValue < blockBoundaryData.greenValue[j] + 56) {\r\n\r\n if (colorDataSet[i].blueValue >= blockBoundaryData.blueValue[j] && colorDataSet[i].blueValue < blockBoundaryData.blueValue[j] + 56) {\r\n\r\n colorDataSet[i].minecraftBlockAssigned = blockBoundaryData.blockName[j];\r\n\r\n //'fixes' the weird color gap bug, by masking them with the pixel adjacent.\r\n\r\n console.log(\"db: \" + colorDataSet[i].minecraftBlockAssigned);\r\n if (!((colorDataSet[i].minecraftBlockAssigned).length > 0) && i > 0) {\r\n\r\n colorDataSet[i].minecraftBlockAssigned = colorDataSet[i - 1].minecraftBlockAssigned;\r\n\r\n }\r\n\r\n\r\n\r\n console.log(\"bv: \" + colorDataSet[i].minecraftBlockAssigned + \" xIndex \" + colorDataSet[i].xIndex + \" yIndex \" + colorDataSet[i].yIndex);\r\n context.drawImage(blockImages[blockBoundaryData.blockName[j]], 0, 0, 16, 16, (colorDataSet[i].xIndex * 16) - 16, (colorDataSet[i].yIndex * 16) - 16, 16, 16);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n console.log(colorDataSet[i]);\r\n\r\n }\r\n\r\n}", "drawSnake(color){\n\t\t\tlet x = this.x * pointSize;\n\t\t\tlet y = this.y * pointSize;\n\t\t\tctx.fillStyle = color;\n\t\t\tctx.fillRect(x, y, pointSize, pointSize);\n\t\t}", "display(){\n\n fill(255)\n ellipse(this.pos.x, this.pos.y, this.size);\n }", "css() {\n this.style__block = css({\n \"color\": this.theme.color,\n \"backgroundColor\": this.theme.backgroundColor\n })\n }", "function head() {\n rectMode(CENTER);\n fill(colorList[0]);\n rect(0, 0, 50, 50);\n}", "function RandomColorContainer() {\n let rCC = []\n for(let i=0; i < 12; i++){\n rCC.push(<RandomColorComponent />)\n }\n \n return(\n <div className=\"container\">\n {/* <RandomColorComponent /> */}\n {rCC}\n </div>\n )\n}", "function MunsellSwatch(props) {\n\n let rgb = props.dataSwatch.rgb\n\n return <div className='MunsellSwatchBackground' style={SwatchBackground.AsRGB(rgb)}></div>\n}", "constructor () {\n super();\n this.fillColor = '#EE362B';\n this.fillOpacity = 0.7;\n this.fillPattern = undefined;\n this.outlineColor = '#EE362B';\n this.outlineWidth = 1;\n this.outlineDashArray = [1, 0];\n this.type = 'fill';\n return this;\n }", "function Square(props){\n let divStyle = {\n background: 'rgb(' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ')',\n width:'100%',\n height: '30px',\n borderRadius:'5px',\n }\n return (\n <div style={divStyle} className=\"square\"></div>\n );\n}" ]
[ "0.6361312", "0.5987676", "0.581662", "0.57904655", "0.5784455", "0.5740217", "0.57270694", "0.5724484", "0.5722077", "0.572059", "0.5704862", "0.56403375", "0.5615856", "0.5605422", "0.5602084", "0.558966", "0.55469525", "0.5534835", "0.5504273", "0.54880357", "0.548695", "0.5486433", "0.54855365", "0.54576916", "0.5446102", "0.5443766", "0.5441725", "0.54184115", "0.5412078", "0.54109615", "0.54108864", "0.539632", "0.53951013", "0.53950685", "0.5388994", "0.53829575", "0.538261", "0.53733", "0.53677994", "0.536203", "0.5356515", "0.534002", "0.5313696", "0.5293872", "0.529383", "0.5284823", "0.52814996", "0.52798617", "0.52747554", "0.52707803", "0.5254007", "0.5250831", "0.5238865", "0.5229029", "0.52212983", "0.521484", "0.5194219", "0.5187055", "0.5185596", "0.5182061", "0.5179086", "0.51763165", "0.5165824", "0.51647747", "0.5163078", "0.51598376", "0.51528436", "0.51477593", "0.51446235", "0.5144221", "0.5139209", "0.5138959", "0.51308864", "0.51286376", "0.51225775", "0.5122309", "0.5114201", "0.51138276", "0.5111819", "0.5108126", "0.5104864", "0.510091", "0.5099202", "0.50909716", "0.5087224", "0.50852305", "0.5084817", "0.5084203", "0.5081816", "0.508163", "0.5078629", "0.5077259", "0.50739676", "0.5072115", "0.5065244", "0.5063481", "0.50630516", "0.5060719", "0.5060547", "0.5058595" ]
0.63270795
1
Returns model related to current route.
model(params) { const store = this.get('store'); let arrRec = []; for (let i = 1; i < 10; i++) { let newRecord = store.createRecord('components-examples/flexberry-groupedit/shared/detail', { text: i + 'test', flag: i % 2, }); arrRec.push(newRecord); } // Aggregator with details. const aggregator = store.createRecord('components-examples/flexberry-groupedit/shared/aggregator', { details: arrRec }); return aggregator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCurrentModel() {\n\t\t\t\treturn this.findWhere({isHidden: false});\n\t\t\t}", "function routeModel(routeInfo) {\n if (routeInfo && !routeInfo.hasOwnProperty('_lf_model')) {\n let r, c;\n if ((r = routeInfo.render) && (c = r.controller)) {\n routeInfo._lf_model = Ember.get(c, 'model');\n } else {\n routeInfo._lf_model = null;\n }\n }\n\n if (routeInfo) {\n return [routeInfo._lf_model];\n } else {\n return [];\n }\n }", "function currentRoute() {\n const path = $window.location.pathname;\n const pathSegments = path.slice(1).split('/');\n const params = queryString.parse($window.location.search);\n\n let route;\n switch (pathSegments[0]) {\n case 'a':\n route = 'annotation';\n params.id = pathSegments[1] || '';\n break;\n case 'stream':\n route = 'stream';\n break;\n default:\n route = 'sidebar';\n break;\n }\n\n return { route, params };\n }", "model() {\n return internal(this).model;\n }", "get currentRoute() {\n let routes = this.props.navState.routeStack;\n if (routes.length && routes.length > 0) {\n return Object.assign({}, routes[routes.length - 1]);\n }\n return null;\n }", "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}", "show() {\n\n Post.find(this.params.route.id, (err, model) => {\n\n this.respond(err || model);\n\n });\n\n }", "async getExistingModel () {\n\t\tconst queryData = this.checkExistingQuery();\n\t\tif (!queryData) {\n\t\t\t// derived class doesn't care\n\t\t\treturn;\n\t\t}\n\t\t// look for a matching document, according to the query\n\t\tconst options = {\n\t\t\thint: queryData.hint\n\t\t};\n\t\treturn this.collection.getOneByQuery(queryData.query, options);\n\t}", "get model() {\n return this._model;\n }", "get model() {\n return this._model;\n }", "get model() {\n return this._model;\n }", "get (path) {\n return get(this._model, path)\n }", "retrieve(route) {\n return null;\n }", "retrieve(route) {\n return null;\n }", "retrieve(route) {\n return null;\n }", "retrieve(route) {\n return null;\n }", "retrieve(route) {\n return null;\n }", "get related () {\n\t\treturn this._related;\n\t}", "get model() {\n return this[$model];\n }", "function getActiveRoute()\n{\n return document.getElementById(routes[0]);\n}", "route() {\n return pluralize.plural(this.constructor.name).toLowerCase()\n }", "retrieve(route) {\n return null;\n }", "getModel () {\n\t\treturn this.model;\n\t}", "getNextModel() {\n\t\t\t\treturn this.at(this._getIndex(true));\n\t\t\t}", "get model() {\n\t\treturn this._m;\n\t}", "get Model() {\n return this.constructor;\n }", "function getRouteById(id) {\n return _.find($scope.routes, route => route.id == id);\n }", "function findModel(path, model){\n if(!path) return model;\n path = path.split('/');\n if(!path[0]){\n path.shift();\n }\n var foundObj = model;\n path.forEach( pathPart => {\n\tfoundObj = foundObj.children.filter( o => o.name===pathPart )[0];\n });\n return foundObj;\n}", "retrieve(route) {\n return this.storedRouteHandles.get(route.routeConfig.path);\n }", "getModel() {\n return this.model;\n }", "getModel() {\n return this.model;\n }", "getRelated() {}", "function getRoute() {\n\t\treturn hasher.getHash();\n\t}", "getCurrentRoute () {\n return location.href.split('#')[1];\n }", "function getSelectionRouteMBean(workspace, routeId) {\n if (workspace) {\n var contextId = getContextId(workspace);\n var selection = workspace.selection;\n var tree = workspace.tree;\n if (tree && selection) {\n var domain = selection.domain;\n if (domain && contextId) {\n var result = tree.navigate(domain, contextId, \"routes\");\n if (result && result.children) {\n var mbean = _.find(result.children, function (m) { return m.title === routeId; });\n if (mbean) {\n return mbean.objectName;\n }\n }\n }\n }\n }\n return null;\n }", "async findOne() {\n // Call internally stored DB API to return one model matching self query\n return await this._db.findOne(this._Model, this);\n }", "getModel () {\n return this.model\n }", "static get() {\n const obj = new this();\n return obj.model.find.apply(obj.model, arguments);\n }", "function getObjectModel()\n{\n return FlowscriptUtils.getObjectModel(cocoon);\n}", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\n }", "function createRouteString( modelName )\n{\n return BASE_URL + modelName;\n}", "get path() {\n return this._model ? this._model.path : '';\n }", "get model() {\n return this.sysInfo.model;\n }", "static route() {\n return pluralize.plural(this.name).toLowerCase()\n }", "static findOnModel(model, friendM, foreignKeyAttribute=null) {\n return RelationProxy._findClassedOnModel(\n OneSideRelationProxy, model, friendM, foreignKeyAttribute\n );\n }", "findRoute(ctx) {\n const url = ctx.request.url();\n const method = ctx.request.method();\n const hostname = ctx.request.hostname();\n /*\n * Profiling `route.match` method\n */\n const matchRoute = ctx.profiler.profile('http:route:match');\n const route = this.router.match(url, method, hostname || undefined);\n matchRoute.end();\n /*\n * Raise error when route is missing\n */\n if (!route) {\n throw new utils_1.Exception(`Cannot ${method}:${url}`, 404, 'E_ROUTE_NOT_FOUND');\n }\n /*\n * Attach `params`, `subdomains` and `route` when route is found. This\n * information only exists on a given route\n */\n ctx.params = route.params;\n ctx.subdomains = route.subdomains;\n ctx.route = route.route;\n ctx.routeKey = route.routeKey;\n }", "get parent() {\n return this._routerState.parent(this);\n }", "get parent() {\n return this._routerState.parent(this);\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}", "get Model () {\n return Model\n }", "function resolveModel(e) {\n\n //Locals\n var model,\n modelType = e.action.model,\n data = e.data || null;\n\n //Model is function, execute with e as this, and response data as argument \n if (isFunction(modelType)) model = modelType.call(e, e.data);\n\n //Model is object, combine\n else if (typeof modelType == \"object\") model = extend(data, modelType);\n\n //Model is null or undefined, just use data\n else if (!modelType) model = data;\n\n //Assign resolved model\n if (model) e.model = model;\n\n return model;\n }", "__getParentModel() {\n if (this.__parentModel) return this.__parentModel;\n const parentId = this.parentId;\n const part = parentId ? this.message.findPart(aPart => aPart.nodeId === parentId) : null;\n return part ? part.createModel() : null;\n }", "get router() {\n // log method\n logger.log(5, 'router', 'Getting router');\n\n return this._router;\n }", "get router() {\n // log method\n logger.log(5, 'router', 'Getting router');\n\n return this._router;\n }", "get relationship() {\n\t\treturn this.__relationship;\n\t}", "function getRoute(routeName) {\n\t return clone(routes[routeName]);\n\t}", "async function getRoute(req, res) {\n\ttry {\n\t\tconst data = await Route.find({\n\t\t\tuser: req.session.user,\n\t\t});\n\n\t\treturn data;\n\t} catch (err) {\n\t\treturn res.render('error', {\n\t\t\terror: 'Server Error: Falied to fetch route',\n\t\t\tredirect: '/',\n\t\t});\n\t}\n}", "_findRemoteSideOn(model, ifUnloaded=false) {\n // Determine the class of the remote side.\n // XXX: Ugly child-class awareness.\n const HostClass = this instanceof OneSideRelationProxy ?\n ManySideRelationProxy : OneSideRelationProxy;\n\n // Resolve the remote side.\n const remoteSide = HostClass.findOnModel(\n model, this.host.constructor, this.sourceAttribute\n );\n // Ensure we found a remote relation proxy in an appropriate load\n // state.\n if (!remoteSide || (!remoteSide.loaded && !ifUnloaded)) return null;\n\n return remoteSide;\n }", "static get type() { return 'model'; }", "function getProductModel(product) {\n console.log(product.model);\n}", "static get routeConfig() {\n return RouteConfig;\n }", "function get(req, res, next) {\n const prop = pluralize.singular(req.params.resource);\n req.query[`${prop}${opts.foreignKeySuffix}`] = req.params.id;\n req.url = `/${req.params.nested}`;\n next();\n } // Rewrite URL (/:resource/:id/:nested -> /:nested) and request body", "static getModel() {\n return routineModel;\n }", "model() {\n return TaskModel;\n }", "static getFullPath() {\n return this.baseUrl() + this.apiRoute() + '/' + this.route() + '/'\n }", "function getCurrentQuestion () {\n //console.log('Getting current question object')\n const questionObject = QUESTIONS.find(function(question) {\n return question.id === STORE.currentQuestion;\n });\n return questionObject;\n}", "static getAssociatedModelName(){\n return 'thongtin_dichvu';\n }", "get model() {\n return Permission;\n }", "function getRoutePreferences() {\n\t\t\treturn routeOptions;\n\t\t}", "function getRoute() {\n\n\tstompClient.send(\"/app/map/route/get\", {}, null); \n}", "static findOnModel(model, friendM, foreignKeyAttribute=null) {\n return RelationProxy._findClassedOnModel(\n ManySideRelationProxy, model, friendM, foreignKeyAttribute\n );\n }", "function getActiveModel() \r\n{\r\n if(g_activeModel)\r\n return g_meshMan.getModelByName(g_activeModel);\r\n \r\n return null;\r\n}", "function getModel(req) {\n const collection = req.params.collection;\n let result = null;\n\n if (collection.toUpperCase() === 'BOARD') {\n result = Board;\n } else if (collection.toUpperCase() === 'INPUTGROUP') {\n result = InputGroup;\n } else if (collection.toUpperCase() === 'OUTPUTGROUP') {\n result = OutputGroup;\n }\n\n return result;\n}", "model(params) {\n return this.get('store').findRecord('geokret', params.geokret_id, {\n // include: 'owner',\n include: 'owner,type,moves,moves.author,moves.type',\n // limit: 1,\n // sort: '-created-on-date-time,news-comments.created-on-date-time'\n });\n }", "function routeInfo($q, $route) {\n var defer = $q.defer();\n var info = $route.current.info;\n defer.resolve(info);\n return defer.promise;\n }", "function getParent(model, path) {\n\t var getParentMethod = clazzUtil.get(model, 'getParent');\n\t return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n\t}", "function getPathToNavigate()\r\n{\r\n if (typeof(Storage) !== \"undefined\")\r\n {\r\n // Retrieve the object containing the path list storage key and the path index.\r\n let pathKeyAndIdx = JSON.parse(localStorage.getItem(NAVIGATE_KEY));\r\n\r\n // Retrieve the path list PDO from the storage key\r\n let pathListPDO = JSON.parse(localStorage.getItem(pathKeyAndIdx.pathListKey));\r\n\r\n // Get the path from the pathList PDO (access using the path index), initialise as path class instance. \r\n let pathIdx = pathKeyAndIdx.pathIdx;\r\n path = new Path();\r\n path.initialiseFromPathPDO(pathListPDO.paths[pathIdx]);\r\n return path\r\n }\r\n else\r\n {\r\n alert(\"Local storage is not available. Could not get routes.\");\r\n }\r\n}", "function findRoute(routeId) {\n\n for (let r of Routes) {\n\n if (r.id == routeId) {\n return r;\n } \n }\n\n return null;\n}", "get api_route() {\n return this._api_route;\n }", "function getOne(req, res, next) {\n req.url = `/${req.params.nested}/${req.params.nestedId}`\n next()\n }", "function getParent(model, path) {\n var getParentMethod = clazzUtil.get(model, 'getParent');\n return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n }", "get belongsTo() {\n\t\treturn this._belongsTo;\n\t}", "get router() {\n return this._router;\n }", "get router() {\n return this._router;\n }", "getRouter() {\n return this.router;\n }", "get routeConfig() {\n return this._futureSnapshot.routeConfig;\n }", "get routeConfig() {\n return this._futureSnapshot.routeConfig;\n }", "get routeConfig() {\n return this._futureSnapshot.routeConfig;\n }", "get routeConfig() {\n return this._futureSnapshot.routeConfig;\n }", "get routeConfig() {\n return this._futureSnapshot.routeConfig;\n }", "getModelName () {\n\t\treturn this.modelName;\n\t}", "get routeConfig() {\n return this._futureSnapshot.routeConfig;\n }" ]
[ "0.5968437", "0.5880773", "0.5715209", "0.57039857", "0.5493627", "0.54518324", "0.54364693", "0.5408597", "0.53452957", "0.53452957", "0.53452957", "0.53443533", "0.53436327", "0.53436327", "0.53436327", "0.53436327", "0.53436327", "0.5287727", "0.5287012", "0.5245083", "0.5210501", "0.5203088", "0.51988333", "0.5179421", "0.51733685", "0.5146397", "0.514002", "0.5127417", "0.51056534", "0.50921273", "0.50921273", "0.5078478", "0.50767803", "0.50636286", "0.50315654", "0.5030906", "0.5028143", "0.50216407", "0.5007791", "0.50060815", "0.50060815", "0.50060815", "0.50060815", "0.50060815", "0.50060815", "0.50060815", "0.50060815", "0.50060815", "0.50060815", "0.49861115", "0.4967994", "0.4964594", "0.49617776", "0.49512917", "0.49469864", "0.4945604", "0.4945604", "0.49384862", "0.4932517", "0.49256092", "0.49023712", "0.48962727", "0.48962727", "0.4895869", "0.48861104", "0.48779684", "0.48589748", "0.48458362", "0.4844899", "0.48381504", "0.48356184", "0.48280028", "0.4827417", "0.4808665", "0.48015475", "0.47958094", "0.47760135", "0.4772524", "0.47721612", "0.47720376", "0.47654265", "0.47638312", "0.47632754", "0.4760794", "0.47604424", "0.4755751", "0.47543678", "0.47438347", "0.47275347", "0.47265482", "0.47243306", "0.47240126", "0.47240126", "0.47210866", "0.471996", "0.471996", "0.471996", "0.471996", "0.471996", "0.4713296", "0.47132722" ]
0.0
-1
create noteBookStarts this function adds a button with calls to add new note books
function createAddNoteBookButton() { let getDropdownMenu = document.getElementsByClassName("dropdown-menu")[0]; let flexBoxForContent = document.createElement("div"); let buttonToAddBooks = document.createElement("button"); let buttonImage = document.createElement("img"); let formToInput = document.createElement("form"); let noteBookNameInput = document.createElement("input"); flexBoxForContent.className = " addNoteBookFlexBox"; buttonToAddBooks.className = "addNoteBookButton"; noteBookNameInput.className = "noteBookTitle"; buttonImage.src = "/media/plus-circle.svg"; noteBookNameInput.placeholder = "Title of book"; noteBookNameInput.required = true; noteBookNameInput.addEventListener("keypress", function (event) { let e = event; if (e.code === "Enter") { createNoteBook(); } }); getDropdownMenu.appendChild(flexBoxForContent); buttonToAddBooks.appendChild(buttonImage); flexBoxForContent.appendChild(buttonToAddBooks); flexBoxForContent.appendChild(formToInput); formToInput.appendChild(noteBookNameInput); buttonToAddBooks.addEventListener("click", function () { createNoteBook(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNoteButton(note) {\n var li = $(\"<div />\", slide.contentDocument);\n li.addClass(\"noteButton\");\n var time = $(\"<div />\", slide.contentDocument);\n time.addClass(\"noteButtonTime\");\n time.text(new Date(note.time).toLocaleString());\n li.append(time);\n var summary = $(\"<div />\", slide.contentDocument);\n summary.addClass(\"noteButtonSummary\");\n summary.text(noteSummary(note));\n li.append(summary);\n li.click(function () showNote(note, li));\n $(\"#noteList\", slide.contentDocument).append(li);\n return li;\n }", "function addButtonClick(){\n\t\tvar note = Note();\n\t\tstorage.push(note);\n\t\tdisplayNotes();\n\n\t}", "function addBooksToNote(obj) {\n let noteDropDown = document.createElement(\"div\");\n let button = document.createElement(\"button\");\n let btnIcon = document.createElement(\"img\");\n let dropDownContent = document.createElement(\"div\");\n let dropDownList = document.createElement(\"ul\");\n\n noteDropDown.className = \"dropdown\";\n noteDropDown.appendChild(button);\n noteDropDown.appendChild(dropDownContent);\n\n button.className = \"note-button\";\n button.addEventListener(\"click\", () => {\n clearNoteDropDown();\n addBooksToDropDown(obj, dropDownContent);\n dropDownContent.style.display = \"block\";\n });\n button.appendChild(btnIcon);\n\n btnIcon.src = \"media/journal-plus.svg\";\n btnIcon.width = \"24\";\n btnIcon.height = \"24\";\n btnIcon.title = \"Move to notebook\";\n\n dropDownContent.className = \"dropdown-content shadow-sm\";\n dropDownContent.appendChild(dropDownList);\n\n return noteDropDown;\n}", "function createStartInstruction () {\n currentInstruction = \"createStartInstruction\";\n saveData();\n beforeShowInstruction();\n var text = strings.practiceIntro(); // (1)\n var button = ex.createButton(0, 0, strings.okButtonText());\n introBox = ex.textbox112(text,\n {\n stay: true,\n color: instrColor\n }, instrW, instrX);\n button.on(\"click\", function () {\n saveData();\n introBox.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n createIterationQ();\n saveData();\n });\n ex.insertButtonTextbox112(introBox, button, \"BTNA\");\n saveData();\n }", "function createNoteByClick() {\n var newDate = new Date();\n var noteId = newDate.getTime();\n bq.setAttribute(\"id\", \"note-\" + noteId);\n bq.innerText = null;\n localStorage.setItem(noteId, \"\");\n bq.focus();\n}", "function addNewNotebook()\n{\n var ui = DocumentApp.getUi();\n ui.alert(\"To create a notebook, we're going to need the following settings:\\n\" +\n \" + short title \\n\" +\n \" + long title (Optional. Default is to copy the short title's value over) \\n\" +\n \" + pick the directory to create your notebook in. (not implemented, just creates in root rn.)\\n\" +\n \" + pick a cover image (upload, select existing image, or leave it blank) \\n\");\n \n var shortName = ui.prompt(\"Enter short name of your notebook\", ui.ButtonSet.OK);\n var longName = ui.prompt(\"Enter long name of your notebook (Optional)\", ui.ButtonSet.OK_CANCEL);\n //pick a directory one day?\n //pick an image one day .. too complicated now and I'm too lazy.\n \n var newBook = new Notebook(longName, shortName, longName, DriveApp.getRootFolder().getId(), \"\", \"\", \"\");\n \n newBook = makeNewNotebookTree(newBook);\n newBook = makeNewMasterNotebook(newBook,0,0);\n //save for later\n var props = PropertiesService.getUserProperties();\n props.setProperty(newBook.iD, JSON.stringify(newBook)); \n props.setProperty(\"CurrentNotebook\", newBook.iD);\n //TODO need to store notebooks in a list of notebooks\n //TODO make a function to add a notebook to the list\n //\n}", "function addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}", "function createStartInstruction () {\n currentInstruction = \"createStartInstruction\";\n saveData();\n beforeShowInstruction();\n var text = strings.quizIntro();\n var button = ex.createButton(0, 0, strings.okButtonText());\n introBox = ex.textbox112(text,\n {\n stay: true,\n color: instrColor\n }, instrW, instrX);\n button.on(\"click\", function () {\n saveData();\n introBox.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n createIterationQ();\n saveData();\n });\n ex.insertButtonTextbox112(introBox, button, \"BTNA\");\n saveData();\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 addNote() {\n if (noteText.value === \"\") {\n return;\n } else {\n notesCounter++; // increamenting notes count\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 notes.unshift(note);\n noteDiv.style.background = \"#ffffff\";\n renderNote(note);\n updateDB();\n clearInputs();\n noteHead.style.display = \"none\";\n noteBot.style.display = \"none\";\n }\n}", "function addNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\tappendNote(tr, defaultNote);\r\n\taddState();\r\n\t\r\n\trefreshNotes();\r\n}", "function addNote() {\n let titleEl = document.getElementById(\"title\")\n let detailsEl = document.getElementById(\"details\")\n\n newNote = new Note(titleEl.value, detailsEl.value)\n allNotes.push(newNote)\n\n printNote(newNote)\n resetFields(titleEl, detailsEl)\n checkBadWords(newNote)\n // changeBackground()\n}", "onClick(e) {\r\n this.insertNewNote(this);\r\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 createNote(number_of_note, notesArray, tagsArray) {\n for(var i = 0; i < number_of_note; i++) {\n $(\".notes\").append(\"<div class='note'><div class='notetext'>\" + notesArray[i] + \"</div><div class='notetag'>#\" + tagsArray[i] + \"</div><div class='notecontrol'><div class='highlight'>Highlight</div><div class='addtocanvas'>Add to Canvas</div><div class='deletenote'>Delete</div></div></div>\");\n }\n}", "function addNote(note){\n let noteElement = document.createElement(\"div\");\n noteElement.addEventListener(\"change\",updateNote);\n noteElement.classList.add(\"noteid\"+notes.indexOf(note));\n noteElement.classList.add(\"note\");\n noteElement.style.backgroundColor = note.color;\n let pinElement = document.createElement(\"div\");\n pinElement.classList.add(\"pin\");\n if(note.pinned)\n pinElement.classList.add(\"pinoff\");\n else\n pinElement.classList.add(\"pinon\");\n pinElement.addEventListener(\"click\",pinSwitch);\n noteElement.appendChild(pinElement);\n let titleElement = document.createElement(\"input\");\n titleElement.type = \"text\";\n titleElement.name = \"title\";\n titleElement.value = note.title;\n noteElement.appendChild(titleElement);\n let contentElement = document.createElement(\"textarea\");\n contentElement.value = note.content;\n contentElement.name = \"content\";\n noteElement.appendChild(contentElement);\n let colorElement = document.createElement(\"input\");\n colorElement.type = \"color\";\n colorElement.name = \"color\";\n colorElement.value = note.color;\n noteElement.appendChild(colorElement);\n let created = document.createElement(\"p\");\n let time = new Date(note.created);\n created.innerHTML = \"Created: \" + time.toLocaleString();\n noteElement.appendChild(created);\n if(note.pinned)\n document.querySelector(\".pinned\").appendChild(noteElement);\n else\n document.querySelector(\".notes\").appendChild(noteElement);\n}", "function initAddNewBookButton() {\n const addNewBookButton = document.querySelector(\".add-new-book-button\");\n addNewBookButton.onclick = () => {\n setSubmitButtonText(\"ADD TO LIBRARY\");\n displayModalDialog();\n }\n}", "function addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // create HTML node from note object\n const node = createItem(note);\n // append created node in HTML\n noteList.appendChild(node);\n // put created node in Map to match it with note\n map.set(node, note);\n // push current note to notes object\n notes.push(note);\n // overwrite notes in indexedDB with notes\n idbKeyval.set('notes', notes)\n .catch(err => console.error('submit failed: ', err));\n // reset input values\n noteBody.value = '';\n noteImg.value = '';\n noteAlt.value = '';\n }", "function createNotes() {\n\tsetClef('treble-clef');\n\t\n\t/* Creates Empty Div Element for Each Possible Note Location */\n\tfor (var i=1; i <= totalDivs; i++) {\n\t\tvar noteDiv = document.createElement('div');\n\t\tnoteDiv.id = String(i);\n\t\tnoteDiv.classList.add('note-item');\n\t\tnoteDiv.onclick = placeNote;\n\t\t\n\t\tvar parentDiv = document.getElementById('notes-div');\n\t\tparentDiv.appendChild(noteDiv);\n\t\t\n\t\tvar rowNum = getRowNumber(i);\n\t\tif (rowNum >= topRow && rowNum <= bottomRow) {\n\t\t\taddStaffLines(i);\n\t\t}\n\t}\n\n\t/* Establish 1st Note Column and Measure */\n\tlastEmptyCol = 1;\n\tmeasureNum = 1;\n}", "function writeStartButtons() {\n $buttonBox.empty().show().append(\"<h2>Pick Your Topic</h2>\");\n for (var button of startButtons) {\n let newStartButton = $(\"<button>\")\n .attr(\"id\", button.id)\n .attr(\"class\", \"mx-2 rounded p-2\")\n .text(button.text)\n .on(\"click\", loadQuiz);\n $buttonBox.append(newStartButton);\n }\n }", "function newNote() {\n var csrftoken = $.cookie('csrftoken'),\n folder_id = $('.folder-list>.active>a').attr(\"data-folderid\"),\n data = {\n title: \"Untitled note\",\n body: \"<br>\",\n folder_id: folder_id,\n csrfmiddlewaretoken: csrftoken\n };\n $.post(\"/notes/addnote/\", data, function (data) {\n $('#notelist').children().prepend(data).children().first().trigger('click');\n $('#title').empty();\n });\n }", "function addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function Notebook() {\n loadNoteNamesList();\n\n /*\n * Registering event listeners\n */\n $('#sign-out').click(function() {\n utils.signOut('./');\n });\n $('#create-note').click(function() {\n showCreateNoteModal();\n });\n\n /**\n * Load the notes list from the server\n * Display it in the UI\n *\n * @private\n */\n function loadNoteNamesList() {\n var notesList = $('#notes-list');\n utils.showLoadingOverlay(notesList);\n $.ajax({\n type: 'GET',\n url: constants.API_URI + 'notes',\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n var notes = response.notes;\n var columns = ['Note Name', 'Actions'];\n\n // Creating the 2D data array for the notes list table\n var data = [];\n $.each(notes, function(index, note) {\n var row = [];\n row.push('<span class=\"note-name\">' + note + '</span>');\n row.push(\n '<a href=\"note.html?note=' + note + '\" class=\"btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-view fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">View</span>' +\n '</a>' +\n '<a class=\"delete-note btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-delete fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">Delete</span>' +\n '</a>'\n );\n data.push(row);\n });\n\n var listTable = utils.generateListTable(columns, data,\n { ordering: false, searching: false },\n { 'Actions' : 'text-right' }\n );\n\n // Registering event listeners to the list table\n listTable.find('.delete-note').click(function(event) {\n showDeleteNoteModal(\n $(event.target).closest('tr').find('.note-name').html()\n );\n });\n\n notesList.html(listTable);\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n\n }\n utils.hideLoadingOverlay(notesList);\n },\n error: function() {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n utils.hideLoadingOverlay(notesList);\n }\n });\n }\n\n /**\n * Show the create note modal\n *\n * @private\n */\n function showCreateNoteModal() {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalBody = $('<div >');\n var noteNameInput = $('<input type=\"text\" class=\"form-control form-control-lg\" />');\n var noteNameInputContainer = $('<div class=\"pull-left\"><div class=\"form-group col-sm-12\">');\n var modalFooter = $('<div class=\"pull-right\">');\n var createButton = $('<button type=\"button\" class=\"btn btn-primary\">Create</button>');\n\n // Appending to create the modal content structure\n noteNameInputContainer.append(noteNameInput);\n modalBody.append(noteNameInputContainer);\n modalFooter.append(createButton);\n\n var modal = utils.showModalPopup('Enter a name for your new note', modalBody, modalFooter);\n\n // Registering event listeners for the modal window\n createButton.click(function() {\n createNote(noteNameInput.val());\n modal.modal('hide');\n });\n }\n\n /**\n * Create the Note with the name specified\n *\n * @private\n * @param {string} name Name of the note to be created\n */\n function createNote(name) {\n if (name.indexOf(' ') > 0) {\n utils.handlePageNotification('error', 'Error',\n 'Note name cannot contain white spaces'\n );\n } else {\n $.ajax({\n type: 'POST',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n window.location.href = 'note.html?note=' + name;\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n }\n\n /**\n * Show the delete note confirmation modal\n *\n * @private\n * @param noteName The name of the note to be deleted\n */\n function showDeleteNoteModal(noteName) {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalFooter = $('<div class=\"pull-right\">');\n var deleteButton = $('<button type=\"button\" class=\"btn btn-primary\">Delete</button>');\n\n // Appending to create the modal content structure\n modalFooter.append(deleteButton);\n\n var modal = utils.showModalPopup(\n 'Do you want to delete ' + noteName + ' ?', $(), modalFooter\n );\n\n // Registering event listeners for the modal window\n deleteButton.click(function() {\n deleteNote(noteName);\n modal.modal('hide');\n });\n }\n\n /**\n * Delete the note deleted\n *\n * @private\n * @param {string} name The name of the note to be deleted\n */\n function deleteNote(name) {\n $.ajax({\n type: 'DELETE',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n utils.handlePageNotification('info', 'Info', 'Note successfully deleted');\n loadNoteNamesList();\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n} // End of Notebook prototype constructor", "function createNewNoteButton() {\n noteButton = document.createElement(\"div\");\n noteButton.className = \"menuIcon\";\n document.body.appendChild(noteButton);\n let span = document.createElement(\"span\");\n noteButton.appendChild(span);\n let icon = document.createElement(\"img\");\n icon.src = \"/media/plus-circle.svg\";\n icon.width = \"50\";\n icon.height = \"50\";\n span.appendChild(icon);\n noteButton.addEventListener(\"click\", function () {\n let menu = document.querySelector(\".menuIcon\");\n menu.classList.toggle(\"active\");\n });\n}", "function createNote(note) {\n //the note\n codeOfNote = ` <div id=\"${note.noteNum}note\" class=\"ml-xl-5 mr-xl-5 mt-xl-4 mb-xl-4 col-xl-2 m-lg-4 col-lg-3 m-md-5 col-md-4 m-sm-5 col-sm-6 ml-5 col-5 note\">`\n //row of icons \n codeOfNote += `<div class=\"mt-4 row\">`\n // number of note\n codeOfNote += `<div class=\"mb-2 ml-2 col-10 number\">${note.noteNum + 1}</div>`\n // col of icons\n codeOfNote += `<div class=\"p-3 m-1 col-xl-12 col-md-12\">`\n // close icon \n codeOfNote += `<span type=\"button\" id=\"icon\" class=\"glyphicon glyphicon-remove\" onclick=\"deleteNote(${note.noteNum})\"></span>`\n // close divs for row and col of icons\n codeOfNote += `</div> </div>`\n //row of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 md-form row\">`\n // col of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 col-xl-11 col-xl-10 col-md-11 col-sm-10 col-11\">`\n //the text area (i used text area inside the note and not p)\n codeOfNote += `<textarea type=\"text\" id=\"${note.noteNum}Notetextarea\" class=\"Notetextarea\" rows=\"5\" readonly>${note.InputOfNote}</textarea>`\n //scroll bar\n codeOfNote += `<div class=\"scrollbar\" id=\"style-9\"> <div class=\"force-overflow\"></div> </div>`\n // date and time\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.dateOfNote}</small>`\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.timeOfNote}</small>`\n //closing divs\n codeOfNote += `</div> </div> </div> </div> </div>`\n\n}", "function createNewBook() {\n const book = new Book(\n document.querySelector(\"#name\").value,\n document.querySelector(\"#author\").value,\n document.querySelector(\"#pages\").value,\n document.querySelector(\"#read\").value == \"true\" ? true : false\n );\n addBookToLibrary(book);\n updateLocalStorage(myLibrary);\n displayBook(book);\n toggleForm();\n}", "function buttonContent() {\n let listButtons = document.createElement(\"ul\");\n noteButton.appendChild(listButtons);\n let b1 = document.createElement(\"li\");\n let b1img = document.createElement(\"img\");\n b1img.src = \"/media/card-list.svg\";\n b1img.height = \"50\";\n b1img.width = \"50\";\n listButtons.appendChild(b1);\n b1.appendChild(b1img);\n b1.addEventListener(\"click\", function () {\n allNotes.push(new Note(2));\n saveNotesToLocalStorage();\n });\n\n let b2 = document.createElement(\"li\");\n let b2img = document.createElement(\"img\");\n b2img.src = \"/media/card-text.svg\";\n b2img.width = \"50\";\n b2img.height = \"50\";\n listButtons.appendChild(b2);\n b2.appendChild(b2img);\n b2.addEventListener(\"click\", function () {\n allNotes.push(new Note(1));\n saveNotesToLocalStorage();\n });\n}", "function note_add(_Poc,_text){\r\n\tNotecurrent_IdNUM++;\r\n\tvar newnote ={\r\n\t\tid:'note'+Notecurrent_IdNUM\r\n\t\t,x: _Poc.x\r\n\t\t,y: _Poc.y\r\n\t\t,text:_text\r\n\t\t,color:defaultCOLOR\r\n\t\t,fontsize:defaultFONTSIZE\r\n\t\t,selected:false\r\n\t};\r\n\tnotes.push(newnote);\r\n\tnumnote++;\r\n\treturn newnote;\r\n}", "function initAddBookBtn() {\n const addBookBtn = document.querySelector('.js-btn-add-book');\n addBookBtn.onclick = handleAddBookBtnClick;\n}", "function add_new_reading(button_ref, reading_title, highlight_selection) {\n\n\tconsole.log(\"Adding a new reading\"); \n\t\n\tvar reading_title = reading_title || \"\";\t\n\tvar highlight_selection = highlight_selection || null;\t\n\tvar number_of_readings = $(this).closest(\".segment_box\").find(\".reading_list > table tr.reading_entry\").length;\n\t\n\t// If the segment was added via a button click, find the segment box that contained the button.\n\t// Otherwise, get the last segment box\n\tvar this_segment;\n\tif (button_ref) {\n\t\tthis_segment = button_ref.closest(\".segment_box\");\n\t} else {\n\t\tthis_segment = $(\"#segments_container .segment_box\").last();\n\t}\n\n\t// Add the new segment, then renumber all the segments\n\tvar m = render(\"segment_template\", {segments:[{title:segment_title, highlight:highlight_selection}]});\n\tif (number_of_segments > 0) {\n\t\t$(m).insertAfter(this_segment).slideDown();\n\t} else {\n\t\t$(m).appendTo($(\"#segments_container\"));\n\t}\n\t\n\trenumber_segments();\n\tsetup_segment_buttons();\n\n\tvar reading_list = $(this).closest(\".segment_box\").find(\".reading_list > table\");\n\tvar title = $(this).closest(\".segment_box\").find(\".manual_reading_title\").val();\n\n\t// Make sure reading list div is visible\n\t$(this).closest(\".segment_box\").find(\".reading_list\").show();\n\n\tvar m = render(\"reading_entry_template\", {citation: title, oclc: null, optional:false});\n\t$(m).appendTo(reading_list).slideDown();\n\n}", "handler () {\n notes.addNote(title, body);\n }", "function generateStart() {\n startParagraphText();\n\n const nextButton = createButton('Lets Go!', 'start_quiz', 'start_quiz', true);\n $('.next_btn_container').append(nextButton);\n}", "function createNoteGenerator() {\n // Create note generator elements\n const form = document.createElement(\"form\");\n form.classList.add(\"form-note-add\");\n form.action = \"\";\n form.method = \"post\";\n\n const noteTitle = document.createElement(\"input\");\n noteTitle.classList.add(\"note-title\");\n noteTitle.placeholder = \"Title\";\n noteTitle.name = \"noteTitle\";\n noteTitle.autocomplete = \"off\";\n\n const noteContent = document.createElement(\"textarea\");\n noteContent.classList.add(\"note-content\");\n noteContent.placeholder = \"Take a note...\";\n noteContent.name = \"noteContent\";\n noteContent.autocomplete = \"off\";\n\n\n // Focus note content when the thread becomes idle\n window.setTimeout(function () {\n noteContent.focus();\n }, 0);\n\n noteContent.addEventListener(\"keydown\", () => {\n autoGrow(noteContent);\n });\n\n const buttons = document.createElement(\"div\");\n buttons.classList.add(\"overlay-buttons\");\n\n const inputAddNote = document.createElement(\"input\");\n inputAddNote.type = \"hidden\";\n inputAddNote.name = \"inputAddNote\";\n inputAddNote.value = \"AddNote\";\n\n const buttonCreatorNote = document.createElement(\"button\");\n buttonCreatorNote.classList.add(\"btn-creator-add-note\");\n buttonCreatorNote.innerText = \"Add note\";\n buttonCreatorNote.type = \"submit\";\n buttonCreatorNote.name = \"buttonAddNote\";\n buttonCreatorNote.value = \"AddNote\";\n // Form submit post when adding a node card\n buttonCreatorNote.addEventListener(\"click\", () => {\n document.querySelector(\".form-note-add\").submit();\n });\n\n const buttonCancel = document.createElement(\"button\");\n buttonCancel.classList.add(\"btn-creator-cancel\");\n buttonCancel.innerText = \"Cancel\";\n buttonCancel.type = \"button\";\n\n listenAddCancelButton(buttonCreatorNote, buttonCancel);\n\n buttons.appendChild(buttonCreatorNote);\n buttons.appendChild(buttonCancel);\n\n\n const overlayNoteCreator = document.createElement(\"div\");\n overlayNoteCreator.classList.add(\"overlay-note-creator\");\n form.appendChild(noteTitle);\n form.appendChild(noteContent);\n form.appendChild(buttons);\n form.appendChild(inputAddNote);\n overlayNoteCreator.appendChild(form);\n\n addBgBlur();\n\n const body = document.querySelector(\"body\");\n body.appendChild(overlayNoteCreator);\n}", "function createNewNote(event) {\n event.preventDefault()\n // console.log(event.target.title.value, event.target.content.value)\n const newNoteObj = {}\n newNoteObj.color_id = event.target.color_id.value\n newNoteObj.title = event.target.title.value\n newNoteObj.content = event.target.content.value\n // console.log(newNoteObj) // newNoteObj structure is working: {title: \"meh\", content: \"mehmeh\"}\n postNewNote(newNoteObj) // invoking our postNewNote function here\n renderNoteOnColorShowPage(newNoteObj) // recycling this function (finally, learning to recycle!) Mother Earth you fucking owe me. It works!\n // question for later: wtf happened to those pink notes I created before I added this render? Oh lol I mislabeled it white nvm\n}", "function create() {\n buttonCreate.style.display = 'none';\n counterVerbs.style.display = 'flex';\n inputs.style.display = 'flex';\n currentNumber.innerHTML = counter;\n fullNumber.innerHTML = verbs.length;\n presentVerb.innerHTML = verbsArr[verbNumber][0];\n}", "function bkmkCreatedHandler (id, BTN) {\r\n // We need the parent to calculate the real offset of insertion\r\n let parentId = BTN.parentId;\r\n let parentBN = curBNList[parentId];\r\n let index = BTN.index;\r\n//let t1 = (new Date()).getTime();\r\n//trace(t1+\" Create event on: \"+id+\" type: \"+BTN.type+\" parentId: \"+parentId+\" index: \"+index);\r\n\r\n // Create the new BN tree and insert it under its parent + maintain inBSP2Trash and trashDate fields\r\n let inBSP2Trash = options.trashEnabled && parentBN.inBSP2Trash;\r\n let BN = buildTree(BTN, parentBN.level+1, inBSP2Trash);\r\n BN_insert(BN, parentBN, index);\r\n\r\n // Record action\r\n historyListAdd(curHNList, HNACTION_BKMKCREATE,\r\n\t \t\t\t false, undefined, id, BTN.type, BN_aPath(parentId), parentId, index,\r\n\t \t\t\t BTN.title, BN.faviconUri, BTN.url, inBSP2Trash);\r\n // Save new current info\r\n saveBNList();\r\n // Refresh BSP2 toolbar icon in active tabs\r\n refreshActiveTabs(BN, false);\r\n\r\n // If we receive creation of the BSP2 trash folder, then rebuild pointer\r\n // and tell open sidebars before they are notified of its creation, to recognize it\r\n if (id == bsp2TrashFldrBNId) {\r\n\tbsp2TrashFldrBN = BN;\r\n\t// Notify open sidebars of new id\r\n\tsendAddonMsgComplex({\r\n\t source: \"background\",\r\n\t content: \"bsp2TrashFldrBNId\",\r\n\t bnId: bsp2TrashFldrBNId\r\n\t});\r\n }\r\n\r\n // Signal to sidebars to make them display it (must work with Private window sidebars\r\n // also, which have their own separate copy of curBNList).\r\n sendAddonMsgComplex({\r\n\tsource: \"background\",\r\n\tcontent: \"bkmkCreated\",\r\n\tnewtree: BN_serialize(BN),\r\n\tindex: index\r\n });\r\n\r\n // If we receive creation of the Recently bookmarked special folder (typically on restore bookmarks),\r\n // then rebuild pointer\r\n // -> Cannot detect it otherwise since FF does not support bookmarks.onImportBegan and onImportEnded\r\n // (but Chrome does)\r\n // Note on complete bookmark restore = the FF process appears to be as follows:\r\n // - Delete of all bookmark items at level 2, under Bppkùarks Toolbar, Bookkmarks Menu, Other Bookmarks ..\r\n // (no delete of lower ones, they get included by the level 2 deleted folders).\r\n // - Then re-create of all bookmarks one by one. This includes the special folders like Most Visited,\r\n // Recent Tags or Recently Bookmarked.\r\n if (id == recentBkmkBNId) {\r\n\trecentBkmkBN = BN;\r\n\t// Notify open sidebars of (possibly new) id\r\n\tsendAddonMsgComplex({\r\n\t source: \"background\",\r\n\t content: \"recentBkmkBNId\",\r\n\t bnId: recentBkmkBNId\r\n\t});\r\n }\r\n // Refresh list of recent bookmarks (always)\r\n triggerRecentRefreshBkmks();\r\n\r\n // If we receive creation of the Most recent special folder (typically on restore bookmarks),\r\n // then rebuild pointer and refresh its content also\r\n if (id == mostVisitedBNId) {\r\n\tmostVisitedBN = BN;\r\n\ttriggerRefreshMostVisited();\r\n\t// Notify open sidebars of (possibly new) id\r\n\tsendAddonMsgComplex({\r\n\t source: \"background\",\r\n\t content: \"mostVisitedBNId\",\r\n\t bnId: mostVisitedBNId\r\n\t});\r\n }\r\n\r\n // If we receive creation of the Recent tags special folder (typically on restore bookmarks),\r\n // then rebuild pointer\r\n if (id == recentTagBNId) {\r\n\trecentTagBN = BN;\r\n\t// Notify open sidebars of (possibly new) id\r\n\tsendAddonMsgComplex({\r\n\t source: \"background\",\r\n\t content: \"recentTagBNId\",\r\n\t bnId: recentTagBNId\r\n\t});\r\n }\r\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 addNote() {\n\t\t\n\t\tid++;\n\t\tzIndex++;\n\t\t\n\t\tvar body = document.querySelector('body');\n\t\t\n\t\tvar note = document.createElement('div');\n\t\tvar close = document.createElement('div');\n\t\tvar field = document.createElement('div');\n\t\tvar footer = document.createElement('div');\n \t\t\n\t\tnote.setAttribute('id', 'note' + id);\n\t\tclose.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('contenteditable', true);\n\t\t\t\n\t\tnote.classList.add('note');\n\t\tclose.classList.add('close');\n\t\tfield.classList.add('field');\n\t\tfooter.classList.add('footer');\n\t\t\n\t\tnote.style.zIndex = zIndex;\n\t\t\t\n\t\tnote.appendChild(close);\n\t\tnote.appendChild(field);\n\t\tnote.appendChild(footer);\n\t\tbody.appendChild(note);\n\t\t\n\t\tattachListeners(note, close, field, footer);\n\t\t\n\t\tvar data = JSON.parse(localStorage['data']);\n\t\t\n\t\t// Save the current note's data\n\t\tdata.push({\n\t\t\n\t\t\tid: id,\n\t\t\ttext: '',\n\t\t\tposition: { x: 20, y: 20 },\n\t\t\tzIndex: zIndex,\n\t\t\t\n\t\t\ttime: { \n\t\t\t\n\t\t\t\tday: new Date().getDate(), \n\t\t\t\tmonth: new Date().getMonth() + 1, \n\t\t\t\tyear: new Date().getFullYear(), \n\t\t\t\th: new Date().getHours(), \n\t\t\t\tm: new Date().getMinutes(), \n\t\t\t\ts: new Date().getSeconds() \n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t});\n\t\t\n\t\tlocalStorage['data'] = JSON.stringify(data);\n\t\t\n\t}", "function addBook(x, y, size, book) {\n\tvar bk = new MultiWidgets.BookWidget();\n\n\tif (bk.load(\"./Research\")) {\n\t\tbk.addOperator(new MultiWidgets.StayInsideParentOperator());\n\t\tbk.setAllowRotation(false);\n\t\tbk.setLocation(x, y);\n\t\tbk.setScale(1);\n\n\t\troot.addChild(bk);\n\t\tbk.raiseToTop();\n\t}\n}", "function addNote() {\n var form = document.getElementById(\"note-form\");\n var title = document.getElementById(\"title\").value;\n var content = document.getElementById(\"contentbody\").value;\n var pri = document.getElementById(\"priority\").value;\n if (title !== \"\" && content !== \"\") {\n notes.push({\n title: `${title}`,\n content: `${content}`,\n pri: pri,\n id: c,\n state: 1\n });\n sendmsg(\"Note Added\", \"success\");\n } else {\n sendmsg(\"Fill all Fields\", \"danger\");\n }\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"contentbody\").value = \"\";\n c++;\n saveNotes();\n postNotes();\n btn.innerHTML = \"Add\";\n}", "function createNoteCard(i) {\n i = i - 1;\n var new_card = document.createElement(\"div\");\n new_card.className = \"notecard lock\";\n new_card.id = \"n\" + i; //'n' + int i\n new_card.appendChild(createTerm(i));\n new_card.appendChild(createDefintion(i));\n new_card.insertAdjacentHTML(\n \"beforeend\",\n '<input type=\"submit\" class=\"done\" value=\"Done\"/>'\n );\n return new_card;\n}", "function creatNote(tex,priority) {\n const notesContainer = document.getElementById('notes-container');\n const newP = document.createElement('p');\n newP.className = `note ${priority}`;\n newP.innerText = tex;\n\n const deletBtn = document.createElement('button');\n deletBtn.className = 'remove-btn';\n deletBtn.innerText = 'X'; \n deletBtn.onclick = removeNote;\n newP.appendChild(deletBtn);\n\n\n notesContainer.appendChild(newP);\n}", "function createBookmark (BTN) {\n // Truncate title to just before \"?\" if it has one\n let title = BTN.title;\n let paramPos = title.indexOf(\"?\");\n if (paramPos != -1) {\n\ttitle = title.slice(0, paramPos);\n }\n let path = BN_path(BTN.parentId);\n openPropPopup(\"new\", BTN.id, path, BTN.type, title, BTN.url, BTN.dateAdded);\n\n // Don't call refresh search, it is already called through bkmkCreatedHandler\n}", "function addNote(lectureID, slideID, note) {\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n objectStore.add({\n slideID: slideID,\n lectureID: lectureID,\n note: note\n }).onsuccess = function(e) {\n // Add a radio button for the note.\n addNoteButton(\n \"Note \" + e.target.result\n + \": Lecture \" + lectureID\n + \" - Slide \"+ slideID,\n e.target.result, note\n );\n };\n}", "function createNoteBook(inputFromLocalStorage) {\n\n\n let inputTitle = document.getElementsByClassName(\"noteBookTitle\")[0].value;\n if (inputFromLocalStorage != null) {\n \n inputTitle = inputFromLocalStorage;\n }\n\n let changeInputBoxApparance = document.getElementsByClassName(\n \"noteBookTitle\"\n )[0]; \n\n if (inputTitle === \"\") {\n \n changeInputBoxApparance.style.border = \"solid red 3px\";\n } else {\n changeInputBoxApparance.style.border = \"solid 1px\";\n\n existingNoteBooks.push(new NoteBookObject(inputTitle));\n document.getElementsByClassName(\"noteBookTitle\")[0].value = \"\";\n } \n\n updateCurrentNoteBooks(); \n saveNoteBooksToLocalStorage();\n}", "function addBookToLibrary() {\n const title = document.querySelector('#title-input').value;\n const author = document.querySelector('#author-input').value;\n const pages = document.querySelector('#pages-input').value;\n let read = document.querySelector('#read-input').checked;\n if (read == true) {\n read = \"read\";\n } else {\n read = \"unread\";\n } ;\n addForm.reset();\n addForm.hidden = true;\n addBtn.hidden = false;\n submitBtn.hidden = true;\n myLibrary.push(new Book(title, author, pages, read));\n clearTable();\n displayBooks();\n}", "function createBook (){\n let titleInput = document.getElementById('titleInput').value\n let authorInput = document.getElementById('authorInput').value\n let pagesInput = document.getElementById('pagesInput').value\n let readInput = document.getElementById('readInput').value\n\n let book = new Book(titleInput, authorInput, pagesInput, readInput)\n\n document.getElementById('titleInput').value = ''\n document.getElementById('authorInput').value = ''\n document.getElementById('pagesInput').value = ''\n document.getElementById('readInput').value = 'No'\n\n pushBookToLibrary(book)\n}", "function createNote(){\n\t// Single function to get value from any input\n\tvar getVal = function(param){\n\t\treturn $get(param).value;\n\t};\n/*\n\t// function to add index numbers - param for id/class/element to count\n\t// Over complicated\n\tvar count = function(param){\n\t\tif (!!$get(param)){ // if there already are notes\n\t\t\treturn ($getAll(param).length) +1; // count them\n\t\t}\n\t\telse { // else this is the first note\n\t\t\treturn 1;\n\t\t}\t\n\t}\n*/\n//\tvar count = 0; // too simple, what if we start with notes?\n\n\n\tvar count = function() {\n\t\treturn ($getAll('.box').length) +1;\n\t} \n\n\tif ( !!(getVal('#noteText')) && !!(getVal('#colourPick')) ){ // if input not empty\n\t\n\t\tvar noteNumber = document.createTextNode(count());\n\n\t\tvar noteNumberPar = document.createElement('span');\n\t\t\tnoteNumberPar.className = 'noteNumber';\n\t\t\tnoteNumberPar.id ='noteNumber'+count();\n\t\t\tnoteNumberPar.appendChild(noteNumber);\n\n\t\tvar stickyText = document.createTextNode(getVal('#noteText'));\n\t\t\n\t\t// div template for sticky note\n\t\tvar template = document.createElement('div');\n\t\t\ttemplate.className = 'box';\n\t\t\t// get value of selected colour from dropdown menu\n\t\t\ttemplate.style.backgroundColor = getVal('#colourPick');\n\t\t\t// Call count function and concatonate with input text\t\n\t\t\ttemplate.appendChild(noteNumberPar);\n\t\t\ttemplate.appendChild(stickyText);\n\n\t\t$get('.container').appendChild(template); // add sticky to div.container \n\n\t\t// create textNode to append text into the remove button\n\t\tvar removeID = 'removeButton' + (count()-1)\n\t\tvar x = document.createTextNode('X')\n\t\tvar removeButton = document.createElement('div');\n\t\t\tremoveButton.className = 'removeButton';\n\t\t\tremoveButton.id = removeID;\n\t\t\t// append textNode to rmove button div\n\t\t\tremoveButton.appendChild(x);\n\t\t\n\t\t$getAll('.box')[($getAll('.box').length)-1].appendChild(removeButton);\n\n\t\t// to add event listeners with dynamic element creation\n\t\t// the function to be called must be wrapped in a function declaration\n\t\t$get('#'+removeID).addEventListener('click', removeNote)\n\n\t\t// clear fields ready for next sticky\n\t\t$get('#noteText').value = '';\n\t\treturn false;\n\t} else { // else show alert input is empty\n\t\talert('No note!');\n\t\treturn false;\n\t}\t\n}", "function initialBtn(topics,classToAdd,areaToAddTo){\n\t// Must empty area everytime we add a new button (otherwise there will be duplicates)\n\t$(areaToAddTo).empty();\n\tfor(var i=0; i < topics.length; i++){\n\t\tvar a = $('<button>');\n\t\ta.addClass(classToAdd);\n\t\ta.attr('data-type',topics[i]);\n\t\ta.text(topics[i]);\n\t\t$(areaToAddTo).append(a);\n\t}\n}", "function createBookInfo(book) {\n\n deleteBookInfo();\n\n var myBookDiv = document.createElement('div');\n myBookDiv.id = \"arqsiWidgetBookInfo_div\";\n \n var closeA = document.createElement(\"a\");\n closeA.href = \"#\";\n closeA.onclick = deleteBookInfo;\n var closePic = document.createElement(\"img\");\n closePic.className = \"infoClose\";\n closePic.src = \"images/bot_close.png\";\n closePic.style.width = 20;\n closePic.style.height = 20;\n closePic.style.border = 0;\n closeA.appendChild(closePic);\n myBookDiv.appendChild(closeA);\n\n var title = document.createElement(\"p\");\n title.className = \"bookTitle\";\n title.innerHTML = book.getElementsByTagName(\"title\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(title);\n \n if (book.getElementsByTagName(\"picture\")[0].childNodes[0].nodeValue!=\"\"){\n var bookPic = document.createElement(\"img\");\n bookPic.className = \"bookPic\";\n bookPic.src = book.getElementsByTagName(\"picture\")[0].childNodes[0].nodeValue;\n bookPic.style.width = 100;\n bookPic.style.border = 0;\n bookPic.align = \"left\";\n myBookDiv.appendChild(bookPic);\n } \n\n var author = document.createElement(\"p\");\n author.className = \"bookAuthor\";\n author.innerHTML = \"Autor: \"+book.getElementsByTagName(\"author\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(author);\n \n var editora = document.createElement(\"p\");\n editora.className = \"bookEditora\";\n editora.innerHTML = \"Editora: \"+book.getElementsByTagName(\"editora\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(editora);\n\n var category = document.createElement(\"p\");\n category.className = \"bookCategory\";\n category.innerHTML = \"Categoria: \"+book.getElementsByTagName(\"category\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(category);\n\n var lblIsbn = document.createElement(\"p\");\n lblIsbn.className = \"bookIsbn\";\n lblIsbn.innerHTML = \"ISBN: \"+book.getElementsByTagName(\"isbn\")[0].childNodes[0].nodeValue;\n ;\n myBookDiv.appendChild(lblIsbn);\n\n var lblAno = document.createElement(\"p\");\n lblAno.className = \"bookPublicacao\";\n lblAno.innerHTML = \"Ano Publicacão: \"+book.getElementsByTagName(\"publicacao\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(lblAno);\n\n var description = document.createElement(\"p\");\n description.className = \"bookDescription\";\n description.innerHTML = book.getElementsByTagName(\"description\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(description);\n\n div.appendChild(myBookDiv);\n}", "function makeNote(note) {\n let noteLi = document.createElement(\"li\")\n noteLi.innerText = note.title\n noteLi.className= 'note-li'\n noteLi.dataset.id = note.id\n noteList.append(noteLi)\n\n //How to crete delete button\n let delBtn = document.createElement(\"button\")\n delBtn.innerText = \"delete\"\n delBtn.className = \"del-btn\"\n delBtn.dataset.id = note.id\n noteLi.append(delBtn)\n }", "function showBooks() { \n delAll();\n for(let i = 0; i < myLibrary.length; i++ ){\n let cell = document.createElement(\"div\");\n cell.style.setProperty(\"grid-column\", 1)\n cell.style.setProperty(\"border\", \"solid black\");\n cell.style.setProperty(\"margin\", \"5px\")\n cell.style.setProperty(\"padding\", \"1em\")\n cell.style.setProperty(\"background-color\", \"rgb(69, 201, 245)\")\n cell.innerText = myLibrary[i].info();\n container.appendChild(cell).id = \"book\" + i;\n makeBtnDel(i);\n makeBtnRead(i);\n }\n}", "function renderNote(newNote) {\n var div = document.createElement(\"div\"),\n remove = document.createElement(\"span\"),\n title = document.createElement(\"h6\"),\n text = document.createElement(\"p\"),\n favorite = document.createElement(\"span\"),\n tags = document.createElement(\"span\");\n\n div.className = \"note-list__item\";\n remove.className = \"note-list__del\";\n favorite.className = \"note-list__pin\";\n tags.className = \"note-list-tags\";\n text.className = \"note-list__text\";\n title.className = \"note-list__head\";\n\n \n remove.innerHTML =\"<img class='icon-cancel' src='./img/icons8-cancel-50.png' width='25px' height='auto'/>\"\n text.innerHTML = newNote.noteText;\n title.innerHTML = newNote.noteHead;\n\n addRemoveListner(remove, newNote);\n div.setAttribute(\"data-item-number\", (newNote.noteId));\n div.appendChild(remove);\n div.appendChild(title);\n if (noteHead.value.length > 0) {\n title.style.marginBottom = \"10px\"\n }\n div.appendChild(text);\n div.appendChild(favorite);\n div.appendChild(tags);\n mainDiv.insertBefore(div, mainDiv.firstChild);\n headVisible(mainDiv, document.querySelector(\".note-list__main-head\"));\n div.style.background = newNote.colorBg; \n // Knocking down the background of the main unit\n if (text.innerHTML.length < 51) {\n text.style.lineHeight = \"30px\";\n text.style.fontSize = \"27px\";\n } else if (text.innerHTML.length < 81) {\n text.style.lineHeight = \"25px\";\n text.style.fontSize = \"20px\";\n }\n if (!title.innerHTML) {\n title.style.marginBottom = \"0px\";\n } else {\n title.style.marginBottom = \"10px\";\n }\n\n addTag(); // Tag add function\n }", "function addNotes(){\n //i++;\n //var textfield=document.querySelector('.textfield');\n var noteslist=document.querySelector('.notesList');\n var textarea=document.querySelector('.textarea').value;\n var note=document.createElement('div');\n \n // note.id=\"div\"+i;\n var content=document.createTextNode(textarea);\n console.log(content)\n note.appendChild(content);\n note.style.display=\"inline-block\";\n note.style.width='50%';\n note.style.background=\"lightblue\";\n noteslist.appendChild(note);\n //console\n \n\n }", "static addBookToList(book) {\n const list = document.querySelector('#book-list');\n // create element type row to add the looped books\n const row = document.createElement('tr');\n // create datas that will be inserted into the row //backstick function was used to support text literals\n row.innerHTML = ` \n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><a href=\"#\" class=\"btn btn-danger btn-sm delete\">X</td>\n `;\n // Now we append the datas to the row\n list.appendChild(row);\n\n }", "function btnCreate() {\n\n // number counter, used to give each topic a unique identifier\n num++;\n\n // creation of the dynamic buttons\n userBtn = $(\"<button>\")\n userBtn\n .addClass(\"btn search-term-btn dynamicElement\")\n .appendTo($(\".btn-holder\"))\n .text(topics)\n .attr(\"data-name\", topics);\n\n // pushes the topic out of the array, into a new \"used\" array, this is used as a flag.\n usedTopics.push(topics + num);\n topics = [];\n console.log(num);\n\n\n // create space between buttons ___ Ying\n space = $(\"<span>\")\n\n space\n .text(\"\\xa0\\xa0\")\n .appendTo($(\".btn-holder\"));\n\n\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 }", "static addBookToUI(book) {\n const list = document.querySelector(\"#bookList\");\n const row = document.createElement(\"tr\");\n row.classList.add(\"border\");\n row.innerHTML = `\n <td class=\"border px-2 py-1\">${book.title}</td>\n <td class=\"border px-2 py-1\">${book.author}</td>\n <td class=\"border px-2 py-1\">${book.isbn}</td>\n <td class=\"border px-2 py-1\">\n <a\n class=\"\n text-red-600\n hover:text-red-500\n active:text-red-700\n focus:ring-1 focus:ring-offset-1 focus:ring-red-400\n \"\n href=\"#!\"\n ><i class=\"fas fa-trash delete\"></i\n ></a>\n </td>\n `;\n list.appendChild(row);\n }", "addBook(Book) {\n this.bookListCollection.push(Book);\n const Details = document.createElement('div');\n const RButton = document.createElement('button');\n RButton.addEventListener('click', () => { this.RemoveBook(Book.id); });\n RButton.innerHTML = 'Remove';\n RButton.setAttribute('id', Book.id);\n RButton.setAttribute('class', 'rmv-btn');\n const BookContainer = document.createElement('div');\n BookContainer.className = 'book';\n BookContainer.setAttribute('id', Book.id);\n Details.innerHTML = `&nbsp;&nbsp;&nbsp;\"${Book.title}\"&nbsp;by&nbsp;&nbsp;${Book.author}`;\n document.getElementById('list_container').appendChild(BookContainer).appendChild(Details);\n document.getElementById('list_container').appendChild(BookContainer).appendChild(RButton);\n }", "function insertNewBook(id, title, author, subject, photoURL, vendorURL, favorite) {\r\n bookCardHTML = Handlebars.templates.bookCard({\r\n id: id,\r\n title: title,\r\n author: author,\r\n subject: subject,\r\n photoURL: photoURL,\r\n vendorURL: vendorURL,\r\n favorite: favorite\r\n });\r\n\r\n var bookCardContainer = document.querySelector('#books');\r\n bookCardContainer.insertAdjacentHTML('beforeend', bookCardHTML);\r\n}", "function createBtnConfirm() {\n let btnConfirm = document.createElement(\"button\");\n btnConfirm.className = \"note-button note-button-bottom\";\n btnConfirm.addEventListener(\"click\", function () {\n saveNotesToLocalStorage();\n });\n btnConfirm.appendChild(createImgConfirm());\n return btnConfirm;\n}", "function addBookToLibrary()\n{\n \n}", "function getNote() {\n const li = document.createElement('LI')\n li.className = 'fill'\n li.id = 'list-tag'\n li.setAttribute('draggable', 'true')\n\n // I am creating a div element that will wrap the text coming from textarea input.\n let divTag = document.createElement('div')\n divTag.className = 'div-tag';\n divTag.setAttribute('id', lastid)\n divTag.innerText = textInput.value\n li.appendChild(divTag)\n\n // I am creating a button element that will be a sibling to the div element created earlier. And they will get appended to the same parent element. \n const edit = document.createElement('button')\n edit.className = 'modify';\n edit.setAttribute('id', lastid)\n edit.innerText = 'EDIT';\n li.appendChild(edit)\n \n // Same as above in line 71\n const deleteBtn = document.createElement('button');\n deleteBtn.className = 'erase';\n deleteBtn.setAttribute('id', lastid)\n deleteBtn.appendChild(document.createTextNode('DELETE'));\n li.appendChild(deleteBtn)\n \n lastid += 1;\n orderList.appendChild(li)\n}", "function setupSequencer() {\n for(var i=0; i<sequencer.instruments.length; i++) {\n //console.log(\"instruments:\"+instruments.length)\n var seqBar = document.createElement(\"div\");\n \n //bar.classList.add(\"bar\");\n seq.append(seqBar);\n for(var j = 0; j < sequencer.numOfBeats; j++) {\n var b = document.createElement(\"button\")\n b.classList.add(\"box\")\n //b.innerText = \"\"+i+j\n seqBar.append(b)\n }\n \n }\n}", "function buildNewJournalButton(){\n\tvar button = document.createElement(\"button\");\n\tvar buttonLabel = document.createTextNode(\"Add Journal\");\n\tbutton.appendChild(buttonLabel);\n\n\tbutton.addEventListener('click', function(event){\t\n\t\tvar journalData = new JournalData ();\n\t\tvar journalsRelation = user.relation(\"userJournals\");\n\t\tvar newJournalTitle = prompt(\"Enter the new journal's title.\");\n\n\t\tif(newJournalTitle != null){\n\t\t\tcurrentJournalIndex = 0;\n\t\t\tcurrentEntryIndex = 0;\n\n\t\t\tjournalData.save({\n\t\t\t\tjournalTitle: newJournalTitle,\n\t\t\t}, \n\t\t\t{\n\t\t\t\tsuccess: function(results){\n\t\t\t\t\tconsole.log(\"Created new journal\");\n\t\t\t\t\tjournalsRelation.add(journalData);\n\t\t\t\t\tuser.save(null, {\n\t\t\t\t\t\tsuccess: function (results){\n\t\t\t\t\t\t\trefreshJournalsSection();\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror:function(error){\n\t\t\t\t\t\t\talert(\"Something went wrong: error is \" + error.message);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\terror: function(error){\n\t\t\t\t\tconsole.log(\"Error creating new journal. Error: \" + error);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n\tnewJournalButton.appendChild(button);\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 createHistoryButton(ingredientsArray) {\n //appends searches to search history box\n historyBox.prepend(`<div id='history-card'><p>${ingredientsArray}</p></div>`)\n}", "function drawNotes(noteArray){\n\t $('.note-list tbody').html(\"\");\n\t noteArray.forEach(function(note){\n\t\t noteRow = '<tr id=\"execute\">';\n\t\t noteRow +='<td data-target=\"note\" class=\"getNoteText\">' + note + '</td>';\n\t\t noteRow +='<td><button class = \"btn btn-info edit\" id=\"editNote\">Edit</button></td>';\n\t\t noteRow +='<td><button type=\"button\" class=\"btn btn-warning remainder\" data-toggle=\"modal\" data-target=\"#myModal\" id=\"addTimeBtn\">Add remainder</button></td>';\n\t\t noteRow +='<td><button class=\"btn btn-success delete\" id=\"deleteNote\">Delete</button></td>';\n\t\t noteRow +='</tr>';\n\t\t $('.note-list tbody').append(noteRow);\n\t\t\n//delete btn's\n\t var deleteNoteBtns = document.querySelectorAll('#deleteNote');\n\t deleteNoteBtns.forEach(deleteNoteBtns=>{\n\t\tdeleteNoteBtns.addEventListener('click', deleteNoteFunc)\n\t });\n\t\n//edit btn's\n var editNoteBtns = document.querySelectorAll('#editNote');\n\t editNoteBtns.forEach(editNoteBtns=>{\n\t\teditNoteBtns.addEventListener('click', editNoteFunc);\n\t });\n\n//addTime btn's\t\n\t var addTimeBtns = document.querySelectorAll('#addTimeBtn');\n\t addTimeBtns.forEach(addTimeBtns=>{\n\t\taddTimeBtns.addEventListener('click', addRemainderFunc);\n\t });\n\t\t\n//save time on modal btn\n\t var saveTime = document.getElementById('saveT');\n saveTime.addEventListener('click', addTime);\t\n\t });\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 addAction() {\n\t\t\t\t\t\t\t// if (window.confirm(\"Add this book to your collection?\")) {\n\t\t\t\t\t\t\t\tlet bound = this;\n\t\t\t\t\t\t\t\tbound.innerHTML = \"Please Wait...\";\n\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:grey;\");\n\t\t\t\t\t\t\t\tajaxFunctions.ready(ajaxFunctions.ajaxRequest('POST', addLink, 8000, function (err, data, status) {\n\t\t\t\t\t\t\t\t\tif (err) { console.log(err); bound.innerHTML = \"Error\"; }\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t//handle the server response\n\t\t\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:green;\");\n\t\t\t\t\t\t\t\t\t\tbound.innerHTML = \"Added\";\n\t\t\t\t\t\t\t\t\t\t// console.log(data);\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// }//alert box\n\t\t\t\t\t\t}//addAction\t", "function addBookToDisplay(bookTitle, bookAuthor, bookPages, bookRead, bookIndex){\n //creating divs to store data\n const bookCard = document.createElement('div')\n const bookHeader = document.createElement('div')\n const bookBody = document.createElement('div')\n\n\n //adding class to add style\n bookCard.classList.add('card')\n bookHeader.classList.add('bookTitle')\n bookBody.classList.add('bookBody')\n\n bookCard.setAttribute('id', `book${bookIndex}`)\n\n //adding p tag to hold data\n const title = document.createElement('p')\n const author = document.createElement('p')\n const pages = document.createElement('p')\n const read = document.createElement('p')\n\n //remove button\n const remove = document.createElement('button')\n remove.classList.add('remove')\n remove.setAttribute('id', `${bookIndex}`)\n remove.addEventListener('click', removeBook)\n\n //read button\n const changeRead = document.createElement('button')\n changeRead.classList.add('change')\n changeRead.setAttribute('id', `read${bookIndex}`)\n changeRead.addEventListener('click', changeReadEvent)\n\n title.textContent = bookTitle\n author.textContent = bookAuthor\n pages.textContent = bookPages\n read.textContent = bookRead ? \"Read\" : \"Not Read\"\n\n remove.textContent = \"Remove\"\n\n changeRead.textContent = \"Change\"\n\n bookHeader.appendChild(title)\n bookBody.appendChild(author)\n bookBody.appendChild(pages)\n bookBody.appendChild(read)\n\n bookCard.appendChild(bookHeader)\n bookCard.appendChild(bookBody)\n bookCard.appendChild(remove)\n bookCard.appendChild(changeRead)\n\n books.appendChild(bookCard)\n}", "addBookLibrary() {\n const bookStatus = readBtn.innerText;\n const bookItem = new Book(bookId, authorForm.value, titleForm.value, pagesForm.value, bookStatus);\n bookId++;\n myLibrary.push(bookItem);\n this.storage.saveData();\n\n this.renderElem.clearForm();\n this.renderElem.render();\n }", "function addNewNote(raphaelName) {\n var color = \"white\";\n var text = \" \";\n\n //find color selected\n $(\".dropdown-menu li\").click(function() {\n color = $(this).text();\n $(\"#dropdownbtn\").text(color);\n if(color == \"Pink\") $(\"#dropdownbtn\").css({\"background-color\": \"#ffc0cb\"});\n if(color == \"Blue\") $(\"#dropdownbtn\").css({\"background-color\": \"#8deeee\"});\n if(color == \"Green\") $(\"#dropdownbtn\").css({\"background-color\": \"#98fb98\"});\n });\n\n //add note to the canvas and send message to all pages\n $(\".addnotebutton\").click(function() {\n text = $(\"#newnoteinput\").val();\n var note = controlNote(raphaelName, 400, 300, color, text);\n pushNote(note);\n\n if(TogetherJS.running) {\n TogetherJS.send({\n type: \"controlNote\",\n xPos: 400,\n yPos: 300,\n noteColor: color,\n text: text,\n ID: note.id\n });\n }\n\n $(\"#dropdownbtn\").text(\"Note Color\");\n $(\"#dropdownbtn\").css({\"background-color\": \"rgb(249, 211, 140)\"});\n $(\"#newnoteinput\").val(\"\");\n text = \" \";\n color = \"white\";\n });\n}", "function displayBook(book){\n //get the div where books will be displayed\n let displayDiv = document.querySelector('.library');\n\n //add new book entry div\n let bookEntry = document.createElement('div');\n bookEntry.setAttribute('data-index', book.numID.toString());\n displayDiv.appendChild(bookEntry);\n\n //add paragraph with book info\n let bookInfo = document.createElement('p');\n bookInfo.innerHTML = book.info();\n bookEntry.appendChild(bookInfo);\n\n //add remove button\n let removeButton = document.createElement('button');\n removeButton.innerHTML = \"Remove\";\n removeButton.addEventListener('click', deleteEntry);\n bookEntry.appendChild(removeButton);\n\n //add read status button\n let readButton = document.createElement('button');\n readButton.innerHTML = \"Change Read Status\";\n readButton.addEventListener('click', changeReadStatus);\n bookEntry.appendChild(readButton); \n}", "create() {\n let todoItem = document.querySelector('.item').value;\n \n let newItem = {\n id: Date.now().toString(),\n title: todoItem,\n done: false,\n date: new Date()\n };\n \n startingData.push(newItem);\n \n document.querySelector('.item').value = '';\n this.render();\n }", "render(){\n return(<div className='board'>\n {this.state.notes.map(this.eachNote)}\n <button onClick={()=>this.add('New Note')}>+Add Note+</button>\n </div>)\n }", "function createBookmarksList(bookmarks) {\n\n // Reset next bookmark ID\n BookmarkShowcaseState.nextBookmarkId = 1;\n\n // Set bookmarks array to the report's fetched bookmarks\n BookmarkShowcaseState.bookmarksArray = bookmarks;\n\n // Build the bookmarks list HTML code\n var bookmarksList = $('#bookmarksList');\n for (let i = 0; i < BookmarkShowcaseState.bookmarksArray.length; i++) {\n bookmarksList.append(buildBookmarkElement(BookmarkShowcaseState.bookmarksArray[i]));\n }\n\n // Set first bookmark active\n if (bookmarksList.length) {\n let firstBookmark = $('#' + BookmarkShowcaseState.bookmarksArray[0].name);\n\n // Apply first bookmark state\n onBookmarkClicked(firstBookmark[0]);\n }\n}", "function createNotebook() {\n\n if (currentUser) {\n\n let sections = [];\n\n let section = {\n id: 0,\n title: 'Section 1',\n blocks: []\n }\n\n console.log(\"preview : \", preview);\n\n for (let element of preview) {\n\n switch (element.nodeName) {\n // So were going to save the section were working on, then create a new one..\n case \"H1\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H2\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H3\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"P\":\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n\n break;\n\n default:\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n }\n }\n sections.push({...section});\n\n // NOTE: This was supposed to be the cool part of the project but due the the way I have my DB\n // set up I couldnt figure out how to create all the sections separately with a loop of async calls.\n // due to time constraints I had to give up on this and only allow users to see the preview.\n\n createNotebookFromTemplate(searchTerm, currentUser._id, sections, dispatch);\n // dispatch({type:\"CREATE_NOTEBOOK\", sections: sections, title: searchTerm});\n // console.log(\"the title should be :\", searchTerm);\n history.push(\"/notebook/edit/id\");\n\n } else {\n // there is no current user.\n alert(\"please log in to create a notebook\");\n }\n }", "function addBookToDOM(book) {\n const bookElement = document.createElement(\"div\");\n const remove = document.createElement(\"div\");\n const edit = document.createElement(\"div\");\n const title = document.createElement(\"div\");\n const author = document.createElement(\"div\");\n const pages = document.createElement(\"div\");\n const status = document.createElement(\"div\");\n\n bookElement.classList.add(\"book\");\n remove.classList.add(\"remove\");\n edit.classList.add(\"edit\");\n edit.classList.add(\"material-icons\")\n title.classList.add(\"title\");\n author.classList.add(\"author\");\n pages.classList.add(\"pages\");\n status.classList.add(\"status\");\n\n bookElement.appendChild(remove);\n bookElement.appendChild(edit);\n bookElement.appendChild(title);\n bookElement.appendChild(author);\n bookElement.appendChild(pages);\n bookElement.appendChild(status);\n\n document.querySelector(\".bookshelf\").appendChild(bookElement);\n bookElement.id = book.timestamp;\n\n remove.textContent = \"+\";\n edit.textContent = \"edit\";\n updateBookInDOM(book);\n\n remove.onclick = removeBook;\n edit.onclick = editBook;\n}", "function addnotes() {\n const check = document.querySelector(\".addnotes\")\n if (check == null){\n const main = document.getElementById(\"main\");\n const txtarea = document.createElement('textarea' );\n txtarea.className = \"addnotes\";\n const bintxt =document.createTextNode(\"your text goes here\");\n\n txtarea.appendChild(bintxt);\n main.appendChild(txtarea);\n\n const save = document.createElement('button' );\n save.className= \"txtbtn1\"\n const btntxt = document.createTextNode(\"save\");\n\n save.appendChild(btntxt);\n main.appendChild(save);\n\n const dltbtn = document.createElement('button' );\n dltbtn.className= \"txtbtn2\"\n const dlttxt = document.createTextNode(\"delete\");\n\n dltbtn.appendChild(dlttxt);\n main.appendChild(dltbtn);\n \n //removing text area and buttons\n const removetxt= document.querySelector(\".txtbtn2\")\n removetxt.addEventListener(\"click\",function(e){\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n })\n const savenote = document.querySelector(\".txtbtn1\")\n savenote.addEventListener(\"click\",function(s){\n\n if(txtarea.value!==\"your text goes here\"){\n var length = notesarr.length + 1\n var notenum = \"note\" + length.toString()\n notesarr.push({title:notenum,body: txtarea.value})\n \n //adding notes to navbar\n\n const titlebtn = document.createElement(\"button\")\n titlebtn.className= \"titlebtns\"\n const titlebtntxt = document.createTextNode(notenum)\n titlebtn.appendChild(titlebtntxt);\n sidebar.appendChild(titlebtn)\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n\n const display= document.querySelector(\".titlebtns\")\n\n display.addEventListener(\"click\",function(d){\n var notenum = display.innerHTML[4]\n var displaynum = parseInt(notenum)-1\n\n var displaytext =(notesarr[displaynum].body)\n\n var displaynote = document.createElement('textarea' );\n displaynote.className = \"addnotes\";\n var notetxt =document.createTextNode(displaytext);\n\n displaynote.appendChild(notetxt);\n main.appendChild(displaynote);\n\n var cancelbtn = document.createElement(\"button\");\n var cancelbtntxt = document.createTextNode(\"cancel\");\n cancelbtn.className= \"txtbtn2\";\n \n cancelbtn.appendChild(cancelbtntxt);\n main.appendChild(cancelbtn);\n\n //removing displayed note\n\n var removedisplay = document.querySelector(\".txtbtn2\")\n console.log(removedisplay)\n removedisplay.addEventListener(\"click\",function(remove){\n\n main.removeChild(displaynote)\n main.removeChild(cancelbtn)\n })\n\n })\n\n }\n })\n \n }\n\n\n}", "function addNewPendingItem(label) {\n document.querySelector('.pending-items')\n .insertAdjacentHTML('afterbegin', newPendingItemHTML(label));\n \n // Add EventListeners to New Pending Items:\n let trashButton = document.querySelector('.pending-items>li>.btn-delete-item')\n trashButton.addEventListener('click', (event) => {\n event.currentTarget.parentElement.remove()\n });\n let checkBox = document.querySelector('.pending-items>li>.checkbox')\n checkBox.addEventListener('change', (event) => {\n if (checkBox.checked == true) {\n moveToCompleted(event)\n }\n })\n pendingNote();\n completedNote();\n \n}", "function createBook()\n\t{\t\n\t\tlet elem = text = document.createElement(\"form\");\n\t\telem.id = \"superform\";\n\t\tdocument.body.appendChild(elem); //Adds the form element to the body.\n\t}", "function addNote(text) {\n var newNote = $(\"<div class = 'note'></div>\");\n var icons = $(\"<div class = 'icons'></div>\");\n\n var tag = $(\"<i class = 'fa fa-tag' aria-hidden = 'true'></i>\");\n var removeButton = $(\"<i class = 'fa fa-times' aria-hidden = 'true'></i>\");\n var textBox = $(\"<textarea></textarea>\");\n\n if (text != undefined) textBox.val(text);\n\n tag.click(changeColor);\n textBox.blur(saveNotes);\n removeButton.click(function() {\n newNote.remove();\n saveNotes();\n });\n\n icons.append(tag);\n icons.append(removeButton);\n\n newNote.append(icons);\n newNote.append(textBox);\n newNote.appendTo($(\"#sticky-notes\"));\n saveNotes();\n}", "function createBookCard (){ \n newBookCard = document.createElement(\"div\")\n newBookCard.classList.add(\"books\")\n screenContainer.appendChild(newBookCard)\n newBookCard.appendChild(titleName); \n newBookCard.appendChild(authorName); \n newBookCard.appendChild(pageNumber); \n newBookCard.appendChild(readOrNot); \n newBookCard.style.display = \"block\"\n}", "function addNote() {\r\n const newNote = document.createElement('div')\r\n newNote.classList.add('note--new')\r\n\r\n const noteText = document.createElement('li')\r\n noteText.innerText = inputText.value\r\n noteText.classList.add('note--text')\r\n newNote.appendChild(noteText)\r\n\r\n const noteView = document.createElement('button')\r\n noteView.innerHTML = '<i class=\"far fa-eye\"></i>'\r\n noteView.classList.add('note--view-btn')\r\n newNote.appendChild(noteView)\r\n\r\n const noteDelete = document.createElement('button')\r\n noteDelete.innerHTML = '<i class=\"fas fa-trash\"></i>'\r\n noteDelete.classList.add('note--delete-btn')\r\n newNote.appendChild(noteDelete)\r\n\r\n noteContainer.appendChild(newNote)\r\n\r\n console.log(noteText.innerText)\r\n\r\n inputText.value = ''\r\n}", "function createBtns(artist, classtoAdd, areaToAddTo) {\n $(areaToAddTo).empty();\n\n for (var i = 0; i < artists.length; i++) {\n var b = $(\"<button>\");\n b.addClass(classtoAdd);\n b.attr(\"data-type\", artists[i]);\n b.text(artists[i]);\n $(areaToAddTo).append(b);\n }\n }", "function startBtn() {\n\t\t// console.log(shuffledQuestions);\n\t\t$(\"#startArea\").html(heartsArea);\n\t\t$(\"#startArea\").append(questionArea);\n\t\tcountHearts();\n\t\t// console.log(randAnswers);\n\t\t$(\"#startArea\").append(answerArea);\n\t\taddAnswerBtns();\n\t\t// console.log(\"The correct answer is: \" + correctAnswer);\n\t\t$(\"#startArea\").on(\"click\", \".answerBtn\", guess);\n\t\tquestionsAsked++;\n\t\trun();\n\t}", "function adding(){\n\twindow.add(preButton);\n\tpreButton.add(preLabel);\n\twindow.add(nexButton);\n\tnexButton.add(nexLabel);\n\tbuttonView.hide();\n\tbuttonText.text = null;\n\ttextLabel.text = food[i];\n}", "function createBook() {\n //Create JSON object\n var book = {\n isbn: +$(\"#bookIsbn\").val(),\n title: $(\"#bookTitle\").val(),\n author: $(\"#bookAuthor\").val(),\n edition: $(\"#bookEdition\").val()\n };\n\n\n //Create book\n SDK.Book.create(book, function(err, data){\n if(err) throw JSON.stringify(err);\n\n alert(\"Du har nu oprettet følgende bog: \" + book.title +\" med ISBN: \" + book.isbn);\n window.location.href = \"admin.html\";\n\n $(\"#newBookModal\").modal(\"hide\");\n });\n\n }", "function bookForm() {\n\n var c = [];\n\n c.push(\" <form class='w3-container w3-border w3-border-amber'>\");\n c.push(\"<br><span style='width: 8em; display: inline-block' class='w3-amber'>Title : </span><input type='text' required id='currentTitle' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Author : </span><input type='text' required id='currentAuthor' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Category : </span><input type='text' required id='currentCategory' size='50' ><br>\");\n c.push(\"<span style='width: 8em; display: inline-block' class='w3-amber'>Format : </span><input type='text' required id='currentFormat' size='50' ><br><br>\");\n c.push(\"<button type='button' id='add' class='w3-button w3-xlarge w3-border w3-border-amber w3-round-xxlarge'>Add book</button><br><br>\");\n c.push(\"</form>\");\n c.push(\"<br><p id='message' class='w3-amber w3-large'></p>\");\n\n\n $('#book').html(c.join(\"\"));\n\n document.getElementById(\"add\").onclick = function () {\n addBook();\n };\n\n }", "function init(){\n\n //display starting amount of time and show opening text\n timerEl.innerHTML = time;\n questionEl.innerHTML = opening;\n\n //create start button, start test on click\n var button = document.createElement(\"button\");\n button.textContent = \"START!\";\n button.setAttribute(\"class\",\"button btn btn-primary\");\n button.setAttribute(\"id\", \"startBtn\")\n answersEl.appendChild(button);\n \n }", "function startScreen() {\n var div = document.getElementById('insertHere');\n var btn = document.createElement('button');\n\n var txt = document.createTextNode(String(\"START\"));\n btn.appendChild(txt);\n\n btn.setAttribute('type', 'button');\n \n btn.setAttribute('id', 'button1' );\n btn.setAttribute('class', 'btn btn-primary btn-lg btn-block');\n div.appendChild(btn);\n\n }", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function addNotesToPage() {\n // for each data_point in this team's notes_data\n for (let data_point_index in notes_data[selected_team]) {\n // data_point is new notes to add\n let data_point = notes_data[selected_team][data_point_index];\n // adds a new line\n $(\"#notes-\" + selected_team + \"-\" + data_point[1]).prepend('<h4>Stand app:</h4>').append(\"<br><hr><h4>Notes app:</h4>\" + data_point[0]);\n }\n}", "function enterNote() {\n note = {}\n if (checkIfInputIsCorrect()) {\n // create note\n note.InputOfNote = txtArea.value;\n note.dateOfNote = dateEnterded;\n note.timeOfNote = timeEnterded;\n note.noteNum = noteNumber;\n note.secondsComp = dateEnterdedToCompare;\n noteNumber++;\n NoteArrey.push(note);\n addToLocalStorage();\n printNotes(false);\n }\n}", "function addBookToLibrary() {\n let Num = myLibrary.length;\n const name = document.getElementById('name').value;\n const author = document.getElementById('author').value;\n const pages = document.getElementById('pages').value;\n const read = \"Have Not Read\"\n const bookNum = \"book\" + Num;\n\n myLibrary.push(new Book(name, author, pages, read, bookNum))\n\n let myLibraryEnd = myLibrary.length - 1;\n addBookHTML(myLibraryEnd);\n}", "function startButton() {\n startScreen = \"<div id='instructions'>Are you a food genius? <br> Could you make it in culinary school? <br> <b> Prove it! </b> <br> You'll have 30 seconds each to answer \" + questions.length + \" questions. <br> Push the button below to begin. </div><div id='startDiv' class='text-center'><a class='start-button btn-block' href='#' role='button'>Start Quiz</a></div>\";\n $(\".mainArea\").html(startScreen);\n }", "function newBook(doc) {\n let book = document.createElement('div');\n let list = document.createElement('ul');\n let name = document.createElement('li');\n let author = document.createElement('li');\n let pages = document.createElement('li');\n let read = document.createElement('li');\n let closeButton = document.createElement('button');\n let changeStatus = document.createElement('button');\n\n book.classList.add('book');\n closeButton.classList.add('button-remove-book')\n changeStatus.classList.add('change-status-button')\n read.classList.add('read-status')\n\n book.setAttribute('data-id', doc.id);\n name.textContent = `Name: ${doc.data().name}`;\n author.textContent = `Author: ${doc.data().author}`;\n pages.textContent = `Pages: ${doc.data().pages}`;\n read.textContent = `Read: ${doc.data().read}`;\n closeButton.textContent = 'x';\n changeStatus.textContent = '';\n\n list.appendChild(name);\n list.appendChild(author);\n list.appendChild(pages);\n list.appendChild(read);\n read.appendChild(changeStatus);\n\n book.appendChild(list);\n book.appendChild(closeButton);\n\n main.appendChild(book);\n\n if (doc.data().read == 'yes') {\n book.classList.add('status-read');\n }\n\n closeButton.addEventListener('click', (e) => {\n e.stopPropagation();\n\n let id = e.target.parentElement.getAttribute('data-id');\n db.collection('books').doc(id).delete();\n });\n\n changeStatus.addEventListener('click', (e) => {\n e.stopPropagation();\n\n e.target.parentElement.parentElement.parentElement.classList.toggle('status-read');\n let id = e.target.parentElement.parentElement.parentElement.getAttribute('data-id');\n if (doc.data().read == 'yes') {\n db.collection('books').doc(id).update({read: 'no'})\n setTimeout(() => {window.location.reload()}, 150)\n } else {\n db.collection('books').doc(id).update({read: 'yes'})\n setTimeout(() => {window.location.reload()}, 150)\n }\n })\n}", "function makeBtnRead(i) {\n let readBtn = document.createElement(\"input\");\n readBtn.style.setProperty(\"grid-column\", 3);\n readBtn.style.setProperty(\"width\", \"100px\");\n readBtn.style.setProperty(\"height\", \"40px\")\n readBtn.style.setProperty(\"margin\", \"5px\");\n readBtn.type = \"button\";\n readBtn.value = \"Read\";\n readBtn.onclick = function() {\n delAll();\n myLibrary[i].switchRead()\n console.log(myLibrary[i].info() + \" \" + myLibrary[i].read)\n showBooks();\n }\n container.appendChild(readBtn).id = \"readBtn\" + i;\n \n}", "function appendNewButtons(newTopic) {\n var topicButton = createButtonHTML(newTopic);\n $(\"#btn-container\").prepend(topicButton);\n}" ]
[ "0.6616951", "0.66157573", "0.63582593", "0.6181226", "0.608733", "0.60573596", "0.60441613", "0.60151213", "0.5942763", "0.58742195", "0.5861623", "0.5835648", "0.5807749", "0.5805397", "0.5793124", "0.57873636", "0.57800484", "0.5769079", "0.57638675", "0.57594925", "0.57381696", "0.57379055", "0.5735717", "0.57357156", "0.572911", "0.572887", "0.5719598", "0.5716322", "0.5715606", "0.57153505", "0.5689755", "0.56713873", "0.5661761", "0.5630431", "0.5623682", "0.5611957", "0.5611708", "0.5610724", "0.56063676", "0.5588285", "0.5582346", "0.55565125", "0.5544802", "0.553711", "0.5536554", "0.5533848", "0.553132", "0.5526937", "0.55267817", "0.5525494", "0.55162525", "0.5513667", "0.55096084", "0.5491188", "0.5489749", "0.54868436", "0.5484123", "0.54772204", "0.5470189", "0.54697007", "0.54627967", "0.5458231", "0.5457007", "0.5454955", "0.54497063", "0.54445106", "0.5440183", "0.54316866", "0.54234344", "0.54230845", "0.5414697", "0.54144347", "0.54128927", "0.5409844", "0.5407663", "0.54066217", "0.54015124", "0.54009295", "0.54000115", "0.53874874", "0.53838253", "0.5379104", "0.537371", "0.537335", "0.5368125", "0.5367818", "0.5358002", "0.5348465", "0.5344689", "0.53389835", "0.53389305", "0.5331558", "0.5328559", "0.53276753", "0.5322485", "0.5321272", "0.53184015", "0.53108186", "0.53073484", "0.529019" ]
0.6322221
3
Calls all functions necessary for creating a new notebook
function createNoteBook(inputFromLocalStorage) { let inputTitle = document.getElementsByClassName("noteBookTitle")[0].value; if (inputFromLocalStorage != null) { inputTitle = inputFromLocalStorage; } let changeInputBoxApparance = document.getElementsByClassName( "noteBookTitle" )[0]; if (inputTitle === "") { changeInputBoxApparance.style.border = "solid red 3px"; } else { changeInputBoxApparance.style.border = "solid 1px"; existingNoteBooks.push(new NoteBookObject(inputTitle)); document.getElementsByClassName("noteBookTitle")[0].value = ""; } updateCurrentNoteBooks(); saveNoteBooksToLocalStorage(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNewNotebook()\n{\n var ui = DocumentApp.getUi();\n ui.alert(\"To create a notebook, we're going to need the following settings:\\n\" +\n \" + short title \\n\" +\n \" + long title (Optional. Default is to copy the short title's value over) \\n\" +\n \" + pick the directory to create your notebook in. (not implemented, just creates in root rn.)\\n\" +\n \" + pick a cover image (upload, select existing image, or leave it blank) \\n\");\n \n var shortName = ui.prompt(\"Enter short name of your notebook\", ui.ButtonSet.OK);\n var longName = ui.prompt(\"Enter long name of your notebook (Optional)\", ui.ButtonSet.OK_CANCEL);\n //pick a directory one day?\n //pick an image one day .. too complicated now and I'm too lazy.\n \n var newBook = new Notebook(longName, shortName, longName, DriveApp.getRootFolder().getId(), \"\", \"\", \"\");\n \n newBook = makeNewNotebookTree(newBook);\n newBook = makeNewMasterNotebook(newBook,0,0);\n //save for later\n var props = PropertiesService.getUserProperties();\n props.setProperty(newBook.iD, JSON.stringify(newBook)); \n props.setProperty(\"CurrentNotebook\", newBook.iD);\n //TODO need to store notebooks in a list of notebooks\n //TODO make a function to add a notebook to the list\n //\n}", "function initNotebook(name, date) {\n\t//Create notebook object\n\tvar notebook = new Notebook(name, date);\n\n\t//Create file for notebook object\n\twriteNotebookToMongo(notebook);\n\n\t//Add to appropriate places\n\taddToNotebookList(name);\n\n\treturn notebook;\n}", "function createNotebook() {\n\n if (currentUser) {\n\n let sections = [];\n\n let section = {\n id: 0,\n title: 'Section 1',\n blocks: []\n }\n\n console.log(\"preview : \", preview);\n\n for (let element of preview) {\n\n switch (element.nodeName) {\n // So were going to save the section were working on, then create a new one..\n case \"H1\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H2\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H3\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"P\":\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n\n break;\n\n default:\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n }\n }\n sections.push({...section});\n\n // NOTE: This was supposed to be the cool part of the project but due the the way I have my DB\n // set up I couldnt figure out how to create all the sections separately with a loop of async calls.\n // due to time constraints I had to give up on this and only allow users to see the preview.\n\n createNotebookFromTemplate(searchTerm, currentUser._id, sections, dispatch);\n // dispatch({type:\"CREATE_NOTEBOOK\", sections: sections, title: searchTerm});\n // console.log(\"the title should be :\", searchTerm);\n history.push(\"/notebook/edit/id\");\n\n } else {\n // there is no current user.\n alert(\"please log in to create a notebook\");\n }\n }", "function makeNewMasterNotebook(notebook, imageFileID, humanName) {\n //validate\n notebook.shortName = notebook.shortName || \"Notebook\";\n notebook.longName = notebook.longName || notebook.shortName || \"Notebook\";\n //image can be nothing\n humanName = humanName || Session.getActiveUser().getEmail();\n \n var masterFolder = DriveApp.getFolderById(notebook.masterFolderId);\n Logger.log(masterFolder);\n \n var mDoc = DocumentApp.create(notebook.shortName);\n notebook.masterNotebookId = mDoc.getId();\n var docFile = DriveApp.getFileById(notebook.masterNotebookId );\n \n moveFile(docFile, masterFolder, DriveApp.getRootFolder());\n \n var title = mDoc.getBody().appendParagraph(notebook.longName);\n title.setHeading(DocumentApp.ParagraphHeading.TITLE);\n \n var subtitle = mDoc.getBody().appendParagraph(\"by: \" + humanName);\n subtitle.setHeading(DocumentApp.ParagraphHeading.SUBTITLE);\n \n if(imageFileID)\n {\n var blob = DriveApp.getFileById(imageFileID).getBlob();\n mDoc.getBody().appendImage(blob);\n }\n \n return notebook; \n}", "function Notebook() {\n loadNoteNamesList();\n\n /*\n * Registering event listeners\n */\n $('#sign-out').click(function() {\n utils.signOut('./');\n });\n $('#create-note').click(function() {\n showCreateNoteModal();\n });\n\n /**\n * Load the notes list from the server\n * Display it in the UI\n *\n * @private\n */\n function loadNoteNamesList() {\n var notesList = $('#notes-list');\n utils.showLoadingOverlay(notesList);\n $.ajax({\n type: 'GET',\n url: constants.API_URI + 'notes',\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n var notes = response.notes;\n var columns = ['Note Name', 'Actions'];\n\n // Creating the 2D data array for the notes list table\n var data = [];\n $.each(notes, function(index, note) {\n var row = [];\n row.push('<span class=\"note-name\">' + note + '</span>');\n row.push(\n '<a href=\"note.html?note=' + note + '\" class=\"btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-view fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">View</span>' +\n '</a>' +\n '<a class=\"delete-note btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-delete fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">Delete</span>' +\n '</a>'\n );\n data.push(row);\n });\n\n var listTable = utils.generateListTable(columns, data,\n { ordering: false, searching: false },\n { 'Actions' : 'text-right' }\n );\n\n // Registering event listeners to the list table\n listTable.find('.delete-note').click(function(event) {\n showDeleteNoteModal(\n $(event.target).closest('tr').find('.note-name').html()\n );\n });\n\n notesList.html(listTable);\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n\n }\n utils.hideLoadingOverlay(notesList);\n },\n error: function() {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n utils.hideLoadingOverlay(notesList);\n }\n });\n }\n\n /**\n * Show the create note modal\n *\n * @private\n */\n function showCreateNoteModal() {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalBody = $('<div >');\n var noteNameInput = $('<input type=\"text\" class=\"form-control form-control-lg\" />');\n var noteNameInputContainer = $('<div class=\"pull-left\"><div class=\"form-group col-sm-12\">');\n var modalFooter = $('<div class=\"pull-right\">');\n var createButton = $('<button type=\"button\" class=\"btn btn-primary\">Create</button>');\n\n // Appending to create the modal content structure\n noteNameInputContainer.append(noteNameInput);\n modalBody.append(noteNameInputContainer);\n modalFooter.append(createButton);\n\n var modal = utils.showModalPopup('Enter a name for your new note', modalBody, modalFooter);\n\n // Registering event listeners for the modal window\n createButton.click(function() {\n createNote(noteNameInput.val());\n modal.modal('hide');\n });\n }\n\n /**\n * Create the Note with the name specified\n *\n * @private\n * @param {string} name Name of the note to be created\n */\n function createNote(name) {\n if (name.indexOf(' ') > 0) {\n utils.handlePageNotification('error', 'Error',\n 'Note name cannot contain white spaces'\n );\n } else {\n $.ajax({\n type: 'POST',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n window.location.href = 'note.html?note=' + name;\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n }\n\n /**\n * Show the delete note confirmation modal\n *\n * @private\n * @param noteName The name of the note to be deleted\n */\n function showDeleteNoteModal(noteName) {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalFooter = $('<div class=\"pull-right\">');\n var deleteButton = $('<button type=\"button\" class=\"btn btn-primary\">Delete</button>');\n\n // Appending to create the modal content structure\n modalFooter.append(deleteButton);\n\n var modal = utils.showModalPopup(\n 'Do you want to delete ' + noteName + ' ?', $(), modalFooter\n );\n\n // Registering event listeners for the modal window\n deleteButton.click(function() {\n deleteNote(noteName);\n modal.modal('hide');\n });\n }\n\n /**\n * Delete the note deleted\n *\n * @private\n * @param {string} name The name of the note to be deleted\n */\n function deleteNote(name) {\n $.ajax({\n type: 'DELETE',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n utils.handlePageNotification('info', 'Info', 'Note successfully deleted');\n loadNoteNamesList();\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n} // End of Notebook prototype constructor", "function displayNotebook($xmlDoc, xmlData, notebookFullPath) {\n var notebookFileName = getFileName(notebookFullPath, false);\n if ($('#navbar a:contains(' + notebookFileName + ')').length > 0) {\n alert('Notebook \"' + notebookFileName + '\" already opened.');\n }\n else {\n // get the root node, i.e. <notebook>\n var rootNode = $xmlDoc.find(\"notebook\");\n \n // create a new tab\n $('#navbar').find(\"*\").andSelf().each(function() { // remove the JQM auto-init classes\n $(this).removeClass(function(i, cn){\n var matches = cn.match (/ui-[\\w\\-]+/g) || [];\n return (matches.join (' '));\n });\n if ($(this).attr(\"class\") == \"\") {\n $(this).removeAttr(\"class\");\n }\n });\n $('#navbar').navbar(\"destroy\");\n $('#navbar a').removeClass('current');\n $('#navbar ul').append('<li><a id=\"' + notebookFileName + '\" href=\"#\" data-role=\"button\" rel=\"external\" class=\"current\" data-fullpath=\"' + notebookFullPath + '\">' + notebookFileName + '</a></li>');\n var tabHtml = '<div id=\"' + notebookFileName + 'Tab\" class=\"tab\"><textarea id=\"txtCache-' + notebookFileName + '\" data-autogrow=\"false\" rows=\"2\"';\n if (!desktop) {\n tabHtml += ' style=\"display: none\"';\n }\n tabHtml += '></textarea></div>';\n $('#tabs').append(tabHtml);\n if ($('#dummyLi').length) { $('#dummyLi').remove(); };\n $('#navbar').navbar();\n $('#txtCache-' + notebookFileName).text(xmlData);\n\t if (desktop) {\n\t $('#txtCache-' + notebookFileName).width($(window).width());\n\t\t$('#' + notebookFileName + 'Tab').prepend('<div style=\"color:red\">Before closing the browser: Copy the text below and save it manually!</div>');\n\t }\n\t \n // construct the collapsible from the xml\n $.each(rootNode, function(key, value) { \n getEntry(value, $('#' + notebookFileName + 'Tab'), notebookFileName);\n });\n $('[data-role=\"collapsible\"]').collapsible();\n MathJax.Hub.Queue(['Typeset', MathJax.Hub, notebookFileName + 'Tab']);\n \n // set currentTabEntryId to refer to the first entry \n currentTabEntryId = $('#' + notebookFileName + 'Tab .entry:first').attr('id');\n // scroll to top\n $(window).scrollTop(0);\n // display the tab\n showTab($('#' + notebookFileName + 'Tab'), $('#' + notebookFileName));\n newNotebookIsJustOpened = true; \n }\n }", "function crearNotebooks() {\n const URLNOTEBOOKS =\n \"https://script.googleusercontent.com/macros/echo?user_content_key=rDsO-CaTV1_vX_rZjO7CYJbZESUjR1bRTd2tBfGxE5KohKdQgZMCdKQ6FhY-L5amd56inpxgFHDtMNJ1jyVDMfiDhnCmXQPfm5_BxDlH2jW0nuo2oDemN9CCS2h10ox_1xSncGQajx_ryfhECjZEnCycj8xmTXq3Gi006_lgmVqe8hZGA_eBpjkQbv32Iy6K1M8KCOPjGeOYlqCriqpTy-IqWsDnSrEd&lib=MxrntC6n6AN1KohuiyhTz7BKSiheyHQNG\";\n\n $.get(URLNOTEBOOKS, (respuesta, estado) => {\n if (estado === \"success\") {\n let listado = respuesta;\n\n for (let notebook of listado) {\n listaNotebooks.push(\n new Notebook(\n notebook.id,\n notebook.marca,\n notebook.modelo,\n notebook.precio,\n notebook.procesador,\n notebook.pulgadas,\n notebook.ram,\n notebook.rom,\n notebook.video,\n notebook.img\n )\n );\n }\n }\n\n // para que una vez termine de obtener los datos de la pagina se ejecute la function e imprima en pantalla\n renderizarLista(listaNotebooks, \"Todas\");\n });\n\n return listaNotebooks;\n}", "function makeNewNotebookTree(notebook, folderIdToMakeItInID) {\n //validate\n notebook.shortName = notebook.shortName || \"Notebook\";\n folderIdToMakeItInID = folderIdToMakeItInID || DriveApp.getRootFolder().getId();\n \n var inFolder = DriveApp.getFolderById(folderIdToMakeItInID);\n //Create new folder structure\n //root\n // |--<enotebookName\n // |--<eOldentries\n // |--<enotebookName_Master\n \n //if rootfolder exists. set notebook fields *grossly unsafely* and bail\n /*var fldrs = rootFolder.searchFolders(notebook.shortName); //I'm still having issues with search queries\n if(fldrs.hasNext())\n {\n var notebookFolder = fldrs.next();\n var conts = notebookFolders.getFolders();\n \n notebook.oldFolderId = conts.next().getId();\n notebook.masterFolderId = conts.next().getId();\n \n return notebook;\n } */\n \n //otherwise make it on the fly, solidly.\n var notebookFolder = inFolder.createFolder(notebook.shortName);\n var oldFolder = notebookFolder.createFolder(\"Old Entries\");\n var masterFolder = notebookFolder.createFolder(notebook.shortName + \"_Master\");\n \n notebook.rootFolderId = notebookFolder.getId();\n notebook.oldFolderId = oldFolder.getId();\n notebook.masterFolderId = masterFolder.getId();\n \n return notebook;\n}", "createNew(languagePreference, modelDB, isInitialized) {\n const contentFactory = this.contentFactory;\n return new NotebookModel({\n languagePreference,\n contentFactory,\n modelDB,\n isInitialized\n });\n }", "get name() {\n return 'notebook';\n }", "function openNotebook(notebookFullPath) {\n\tif (desktop) {\n\t\t$.ajax({\n\t\t type: \"GET\",\n\t\t url: notebookFullPath,\n\t\t dataType: \"xml\",\n\t\t success: function(xmlData) {\n\t\t\tvar $xmlDoc = $(xmlData);\n\t\t\tdisplayNotebook($xmlDoc, xmlData, notebookFullPath);\n\t\t\tvar notebookFileName = getFileName(notebookFullPath, false);\n\t\t\t$('#txtCache-' + notebookFileName).text((new XMLSerializer()).serializeToString(xmlData));\n\t\t }\n\t\t});\t\t\n\t}\n\telse {\n\t\treadFile(notebookFullPath, function(xmlData) {\n\t\t var xmlDoc = $.parseXML(xmlData);\n\t\t var $xmlDoc = $(xmlDoc);\n\t\t displayNotebook($xmlDoc, xmlData, notebookFullPath);\n\t\t});\t\t\n\t}\n }", "createNew(panel, context) {\n let callback = () => {\n NotebookActions.runAll(panel.content, context.sessionContext);\n };\n let button = new ToolbarButton({\n className: 'myButton',\n iconClass: 'fast-forward',\n icon: fastForwardIcon,\n onClick: callback,\n tooltip: 'Run all cells',\n label: 'RunAll'\n });\n console.log('new ButtonExtension with: ' + context.contentsModel)\n panel.toolbar.insertItem(10, 'runAll', button);\n return new DisposableDelegate(() => {\n button.dispose();\n });\n }", "function openNotebook($item){\r\n $('.notes-sidebar .notes-sidebar-title h3').html( $item.text() + '<a href=\"#\" class=\"delete-notebook\"><i class=\"fa fa-trash-alt\"></i></a>');\r\n $('.sidebar-menu .sidebar-sub-menu li').removeClass('selected');\r\n $item.addClass('selected');\r\n\r\n currentNotebook = $item.find('a').attr('data-id');\r\n loadNotes(currentNotebook);\r\n }", "function saveNotebook(notebookFileName) {\n\tif (!desktop) {\n\t var notebookFullPath = $('#' + notebookFileName).data('fullpath');\n\t writeFile(notebookFullPath, $('#txtCache-' + notebookFileName).text(), function(){});\t\t\n\t}\n }", "createNew(panel, context) {\n let prefix = panel.content.title.label;\n let meta_key = \"EXP_DICT\";\n // function to display cell ids\n function displayCellIDs() {\n let content_div = document.getElementById(panel.content.id);\n for (let i = 0; i < content_div.childElementCount; i++) {\n let cell_prompt_div = content_div.children[i].children[1].children[1].children[0];\n var cell_tag_div;\n if (cell_prompt_div.childElementCount < 1) {\n cell_tag_div = document.createElement('div');\n }\n else {\n cell_tag_div = cell_prompt_div.children[0];\n }\n cell_tag_div.innerHTML = \"(\" + String(i) + \")\";\n cell_prompt_div.appendChild(cell_tag_div);\n }\n }\n //*************************************************************************//\n //*************************************************************************//\n //*************************************************************************//\n let callback = () => {\n // **** actually run the experiment\n //get the raw string from the input\n let label = document.getElementById(prefix + 'exp_select').innerText;\n let tab_cell = document.getElementById(prefix + label + \"_exp_string\");\n if (tab_cell) {\n var raw_str = tab_cell.innerText;\n var exp_array = raw_str.split('-');\n exp_array.forEach(cell_str => {\n var cell_id = Number(cell_str);\n if (!isNaN(cell_id)) {\n panel.content.activeCellIndex = cell_id;\n notebook_1.NotebookActions.run(panel.content, context.session);\n panel.content.deselectAll();\n }\n });\n }\n else {\n document.getElementById(prefix + \"exp_dropdown\").classList.toggle(\"show\", true);\n }\n };\n //*************************************************************************//\n //*************************************************************************//\n //*************************************************************************//\n panel.context.ready.then(() => {\n displayCellIDs();\n // create and populate the (initially) hidden dropdown div\n //create and fill the content of the dropdown div\n let dropdown_div = document.createElement('div');\n dropdown_div.id = prefix + \"exp_dropdown\";\n dropdown_div.setAttribute(\"class\", \"dropdown-content\");\n //create the drop down table\n let dd_tab = document.createElement('table');\n dd_tab.id = prefix + \"drop_down_table\";\n // get the saved experiments from the notebook metadata\n if (!panel.model.metadata.has(meta_key)) {\n panel.model.metadata.set(meta_key, {});\n }\n let EXP_DICT = panel.model.metadata.get(meta_key);\n //* method to create a row in the experiments table */\n function createExperimentRow(label, exp_string) {\n let row = document.createElement('tr');\n row.id = prefix + label;\n // create cell for label button\n let td1 = document.createElement('td');\n let label_button = document.createElement(\"button\");\n label_button.innerText = label;\n label_button.classList.add(\"jp-ToolbarButtonComponent\", \"jp-label-buttons\");\n label_button.id = prefix + label + \"_label_button\";\n function setExperiment() {\n let btn = document.getElementById(prefix + \"exp_select\");\n btn.innerText = label_button.innerText;\n btn.setAttribute(\"value\", td2.innerText);\n }\n label_button.onclick = setExperiment;\n td1.appendChild(label_button);\n // create cell for exp_string\n let td2 = document.createElement('td');\n td2.id = prefix + label + \"_exp_string\";\n td2.innerText = exp_string;\n // create remove button in third cell\n let td3 = document.createElement('td');\n let del_btn = document.createElement(\"button\");\n del_btn.classList.add(\"jp-ToolbarButtonComponent\");\n let del_btn_span = document.createElement(\"span\");\n del_btn_span.classList.add(\"jp-CloseIcon\", \"jp-Icon\", \"jp-Icon-16\", \"jp-ToolbarButtonComponent-icon\");\n del_btn.appendChild(del_btn_span);\n function delExperiment() {\n delete EXP_DICT[label];\n panel.model.metadata.set(meta_key, EXP_DICT);\n let tab = document.getElementById(prefix + \"drop_down_table\");\n tab.removeChild(row);\n let btn = document.getElementById(prefix + \"exp_select\");\n if (btn.innerText == label_button.innerText) {\n btn.innerText = \"Select Experiment\";\n }\n }\n del_btn.onclick = delExperiment;\n td3.appendChild(del_btn);\n // add all three cells to the row\n row.appendChild(td1);\n row.appendChild(td2);\n row.appendChild(td3);\n return row;\n }\n /* Add each experiment from the metadata to the experiments table */\n for (let key in EXP_DICT) {\n let value = EXP_DICT[key];\n let row = createExperimentRow(key, value);\n dd_tab.appendChild(row);\n }\n //create the input row of the table\n let input_row = document.createElement('tr');\n //create value tag and td\n let value_text = document.createElement('input');\n value_text.placeholder = 'Label the cell path';\n value_text.id = prefix + 'val_input';\n let input_value_td = document.createElement('td');\n input_value_td.appendChild(value_text);\n //create a input tag and td\n let input_text = document.createElement('input');\n input_text.placeholder = \"Cell # separated by '-'\";\n input_text.id = prefix + 'exp_input';\n let input_text_td = document.createElement('td');\n input_text_td.appendChild(input_text);\n // add a button to save the new experiment\n let add_btn = document.createElement(\"button\");\n add_btn.classList.add(\"jp-ToolbarButtonComponent\");\n let add_btn_span = document.createElement(\"span\");\n add_btn_span.classList.add(\"jp-AddIcon\", \"jp-Icon\", \"jp-Icon-16\", \"jp-ToolbarButtonComponent-icon\");\n add_btn.appendChild(add_btn_span);\n // add_btn.innerText = \"Add\";\n //* callback to add an experiment to the metadata and the experiments table */\n function addExperiment() {\n let label = document.getElementById(prefix + \"val_input\").value;\n let exp_string_input = document.getElementById(prefix + \"exp_input\");\n let exp_string = exp_string_input.value;\n // error check the experiments string\n // check to make sure the cell indices are between 0 and panel.model.cells.length-1\n // check to make sure the string are valid numbers\n var cell_inds = [];\n if (exp_string) {\n var exp_array = exp_string.split('-');\n for (let i in exp_array) {\n var cell_index = Number(exp_array[i]);\n if (!isNaN(cell_index) && Number.isInteger(cell_index) && cell_index >= 0 && cell_index < panel.model.cells.length) {\n cell_inds.push(String(cell_index));\n }\n else {\n apputils_1.showErrorMessage(\"Invalid cell order\", \"Cell order must be a list of cell indices separated by dashes (e.g. 0-1-2)\");\n return;\n }\n }\n exp_string = cell_inds.join(\"-\");\n EXP_DICT[label] = exp_string;\n panel.model.metadata.set(meta_key, EXP_DICT);\n let row = document.getElementById(prefix + label);\n if (row) {\n row.children[1].innerText = exp_string;\n }\n else {\n row = createExperimentRow(label, exp_string);\n dd_tab.insertBefore(row, dd_tab.firstChild);\n }\n }\n else {\n console.log('No experiment set!');\n apputils_1.showErrorMessage(\"Enter a cell order\", \"Cell order must be a list of cell indices separated by dashes (e.g. 0-1-2)\");\n return;\n }\n }\n add_btn.onclick = addExperiment;\n let btn_td = document.createElement(\"td\");\n btn_td.appendChild(add_btn);\n // add both to the row tag\n input_row.appendChild(input_value_td);\n input_row.appendChild(input_text_td);\n input_row.appendChild(btn_td);\n // add the row to the table\n dd_tab.appendChild(input_row);\n //add table to dropdown div\n dropdown_div.appendChild(dd_tab);\n // add the dropdown div to the main panel\n panel.node.appendChild(dropdown_div);\n //*************************************************************************//\n //************************ handle changes to the cell order\n panel.model.cells.changed.connect((cell_list, changed) => {\n displayCellIDs();\n let EXP_DICT = panel.model.metadata.get(meta_key);\n if (changed.type == \"add\") {\n var addedInd = changed.newIndex;\n for (let label in EXP_DICT) {\n let exp_string = EXP_DICT[label];\n let new_exp_array = [];\n exp_string.split('-').forEach(cell_str => {\n var cell_index = Number(cell_str);\n if (cell_index < addedInd) {\n new_exp_array.push(String(cell_index));\n }\n else {\n new_exp_array.push(String(cell_index + 1));\n }\n });\n EXP_DICT[label] = new_exp_array.join(\"-\");\n }\n }\n if (changed.type == \"remove\") {\n var removedInd = changed.oldIndex;\n for (let label in EXP_DICT) {\n let exp_string = EXP_DICT[label];\n let new_exp_array = [];\n exp_string.split('-').forEach(cell_str => {\n var cell_index = Number(cell_str);\n if (cell_index < removedInd) {\n new_exp_array.push(String(cell_index));\n }\n else if (cell_index > removedInd) {\n new_exp_array.push(String(cell_index - 1));\n }\n });\n EXP_DICT[label] = new_exp_array.join(\"-\");\n }\n }\n if (changed.type == \"move\") {\n var newInd = changed.newIndex;\n var oldInd = changed.oldIndex;\n for (let label in EXP_DICT) {\n let exp_string = EXP_DICT[label];\n let new_exp_array = [];\n exp_string.split('-').forEach(cell_str => {\n var cell_index = Number(cell_str);\n if (newInd < oldInd) {\n if (cell_index >= newInd && cell_index < oldInd) {\n new_exp_array.push(String(cell_index + 1));\n }\n else if (cell_index < newInd || cell_index > oldInd) {\n new_exp_array.push(String(cell_index));\n }\n else if (cell_index == oldInd) {\n new_exp_array.push(String(newInd));\n }\n }\n else {\n if (cell_index > oldInd && cell_index <= newInd) {\n new_exp_array.push(String(cell_index - 1));\n }\n else if (cell_index < oldInd || cell_index > newInd) {\n new_exp_array.push(String(cell_index));\n }\n else if (cell_index == oldInd) {\n new_exp_array.push(String(newInd));\n }\n }\n });\n EXP_DICT[label] = new_exp_array.join(\"-\");\n }\n }\n // display the updates in the dropdown div\n for (let label in EXP_DICT) {\n let row = document.getElementById(prefix + label);\n if (EXP_DICT[label] == \"\") {\n delete EXP_DICT[label];\n let btn = document.getElementById(prefix + \"exp_select\");\n if (btn.innerText == label) {\n btn.innerText = \"Select Experiment\";\n }\n let tab = document.getElementById(prefix + \"drop_down_table\");\n tab.removeChild(row);\n }\n else {\n if (row) {\n row.children[1].innerText = EXP_DICT[label];\n }\n }\n }\n // write the updates to the metadata\n panel.model.metadata.set(meta_key, EXP_DICT);\n }); // end signal connection\n //*************************************************************************//\n panel.content.activeCellChanged.connect(() => { displayCellIDs(); });\n notebook_1.NotebookActions.executed.connect(() => { displayCellIDs(); });\n }); // end on panel ready\n //*************************************************************************//\n //*************************************************************************//\n //*************************************************************************//\n //create a new widget for the toolbar that is a button that toggles the dropdown options\n let ddm_widget = new widgets_1.Widget();\n let ddm_div = document.createElement('div');\n ddm_div.setAttribute(\"style\", \"position: relative; display: inline-block;\");\n let exp_select = document.createElement(\"button\");\n function displayExp() {\n document.getElementById(prefix + \"exp_dropdown\").classList.toggle(\"show\");\n }\n exp_select.onclick = displayExp;\n exp_select.innerText = \"Select Experiment\";\n exp_select.classList.add(\"jp-ToolbarButtonComponent\");\n exp_select.id = prefix + \"exp_select\";\n // add the button to the ddm div\n ddm_div.appendChild(exp_select);\n // add the div to the ddm widget\n ddm_widget.node.appendChild(ddm_div);\n /****************************************************************************/\n //*************************************************************************//\n //create a new button\n let button = new apputils_1.ToolbarButton({\n className: 'myButton',\n iconClassName: 'fa fa-fast-forward',\n onClick: callback,\n tooltip: 'Run Experiments'\n });\n /****************************************************************************/\n //*************************************************************************//\n panel.toolbar.insertItem(9, 'Experiments Cells Input', ddm_widget);\n panel.toolbar.insertItem(10, 'Experiments', button);\n return new disposable_1.DisposableDelegate(() => {\n button.dispose();\n });\n }", "function loadNotebooks(){\r\n notebooks = getNotebooks();\r\n $('.sidebar-menu-list.sidebar-sub-menu').html(\"\");\r\n $.each(notebooks, function(id, notebook) {\r\n $('.sidebar-menu-list.sidebar-sub-menu').prepend(`<li><a href=\"#\" data-id=\"${id}\">${notebook.title}</a></li>`);\r\n });\r\n }", "add(displayName) {\r\n const postBody = {\r\n displayName: displayName,\r\n };\r\n return this.postCore({\r\n body: jsS(postBody),\r\n }).then(r => {\r\n return {\r\n data: r,\r\n notebook: this.getById(r.id),\r\n };\r\n });\r\n }", "_cloneNode(workflow, node) {\n let operation = this.Operations.get(node.operationId);\n let offset = {\n x: 255,\n y: 0\n };\n let nodeClone = _.cloneDeep(node);\n let newNodeId = this.UUIDGenerator.generateUUID();\n let nodeParams = angular.merge(\n nodeClone, {\n 'id': newNodeId,\n 'operation': operation,\n 'x': node.x - offset.x >= 0 ? node.x - offset.x : node.x,\n 'y': node.y - offset.y >= 0 ? node.y - offset.y : node.y,\n 'uiName': nodeClone.uiName ? nodeClone.uiName += ' copy' : ''\n }\n );\n\n const createdNode = workflow.createNode(nodeParams);\n createdNode.parametersValues = angular.copy(node.parameters.serialize());\n\n if (Object.values(specialOperations.NOTEBOOKS).includes(node.operationId)) {\n this.WorkflowsApiClient.cloneNotebookNode(workflow.id, node.id, newNodeId).then(() => {\n return workflow.addNode(createdNode);\n }, () => {\n this.NotificationService.showError({\n title: 'Error',\n message: 'There was an error during copying content of the notebook! Content of the notebook is empty.'\n });\n });\n }\n\n if (node.hasInnerWorkflow()) {\n const oldInnerWorkflow = createdNode.getInnerWorkflow();\n const oldInnerThirdPartyData = createdNode.getInnerThirdPartyData();\n const map = this._mapOldIdsWithNewOnes(oldInnerWorkflow);\n const newInnerThirdPartyData = this._assingNewIdsThirdPartyData(map, oldInnerThirdPartyData);\n const newInnerWorkflow = this._assignNewIds(map, oldInnerWorkflow);\n createdNode.setInnerWorkflow(newInnerWorkflow);\n createdNode.setInnerThirdPartyData(newInnerThirdPartyData);\n }\n\n return workflow.addNode(createdNode);\n }", "function create(params, auth) {\n let sanitized = Notebook.sanitizeOnCreate(params);\n sanitized.userId = auth.sub;\n\n return sequelize.transaction((transaction) => {\n\n let id = null;\n return retrieveCount(auth.sub, { findOptions: { lock: transaction.LOCK.UPDATE } })\n .then((count) => {\n sanitized.order = count + 1;\n return Notebook.create(sanitized);\n })\n .then((created) => {\n id = created.id;\n return increaseCount(auth.sub);\n })\n .then(() => {\n return retrieve(id);\n });\n });\n}", "function createWorklistHelper() {\n var pfs = {\n maxResults : $scope.clusterCt,\n startIndex : $scope.skipClusterCt,\n sortField : $scope.sortOrder\n };\n\n // Create worklist\n workflowService.createWorklist($scope.selected.project.id, $scope.bin.id, $scope.clusterType,\n pfs).then(\n // Success\n function(data) {\n // workflowService.fireWorklistChanged(data);\n $scope.completionMessage += data.name;\n $scope.completionMessage += ' completed. \\n';\n $scope.worklistsCompleted++;\n if ($scope.worklistsCompleted < $scope.numberOfWorklists) {\n createWorklistHelper();\n } else {\n $uibModalInstance.close();\n }\n },\n // Error\n function(data) {\n $scope.errors[0] = data;\n utilService.clearError();\n });\n }", "function WorkbookBasicModule(){Workbook.Inject(DataBind,WorkbookSave,WorkbookOpen,WorkbookNumberFormat,WorkbookCellFormat,WorkbookEdit,WorkbookFormula,WorkbookSort,WorkbookHyperlink,WorkbookFilter,WorkbookInsert,WorkbookDelete,WorkbookFindAndReplace,WorkbookProtectSheet,WorkbookDataValidation,WorkbookMerge,WorkbookConditionalFormat,WorkbookImage,WorkbookChart);}", "function displayCurrentNoteBook() {\n let currentNotebookHeading = document.getElementById(\"current-notebook\");\n currentNotebookHeading.innerText = openNotebook.toUpperCase();\n newNoteBookIntro(currentNotebookHeading);\n}", "function first_load() {\n var cells = IPython.notebook.get_cells();\n for(var i in cells){\n var cell = cells[i];\n if ((cell instanceof IPython.CodeCell)) {\n cell.code_mirror.on(\"change\", changeEvent);\n var gutters = cell.code_mirror.getOption('gutters');\n cell.code_mirror.setOption('gutters', [gutters, \"cellstate\" ]);\n makeMarker(cell,'n',0);\n }\n }\n }", "constructor(notebook) {\n if (notebook) {\n Object.assign(this, notebook, {\n pages: hydratePages(notebook.pages),\n deletedPages: hydratePages(notebook.deletedPages),\n updated_at: hydrateDate(notebook.updated_at),\n saved_at: hydrateDate(notebook.saved_at),\n created_at: hydrateDate(notebook.created_at)\n })\n }\n }", "function load_extension() {\n Jupyter.notebook.config.loaded.then(initialize); // trigger loading config parameters\n\n //$.getJSON(\"https://single-cell-codesnippets.firebaseio.com/.json\", function(data) {\n //$.getJSON(Jupyter.notebook.base_url+\"nbextensions/snippets/snippets.json\", function(data) {\n $.getJSON(Jupyter.notebook.base_url+\"nbextensions/snippets/snippets.json\", function(data) {\n // Add the header as the top option, does nothing on click\n var option = $(\"<option></option>\")\n .attr(\"id\", \"snippet_header\")\n .text(\"Snippets\");\n $(\"select#snippet_picker\").append(option);\n\n // Add options for each code snippet in the snippets.json file\n $.each(data['snippets'], function(key, snippet) {\n var option = $(\"<option></option>\")\n .attr(\"value\", snippet['name'])\n .text(snippet['name'])\n .attr(\"code\", snippet['code']);//.join('\\n'));\n $(\"select#snippet_picker\").append(option);\n });\n })\n .error(function(jqXHR, textStatus, errorThrown) {\n // Add an error message if the JSON fails to load\n var option = $(\"<option></option>\")\n .attr(\"value\", 'ERROR')\n .text('Error: failed to load snippets!')\n .attr(\"code\", \"\");\n $(\"select#snippet_picker\").append(option);\n });\n\n }", "function load_ipython_extension() {\n return new Promise(function(resolve) {\n requirejs([\n 'nbextensions/noworkflow/index',\n 'base/js/namespace',\n 'base/js/events',\n 'base/js/utils',\n 'notebook/js/codecell',\n 'd3-selection',\n '@noworkflow/trial',\n '@noworkflow/history',\n '@noworkflow/utils',\n ], function(\n Extension,\n Jupyter,\n events,\n utils,\n codecell,\n d3_selection,\n trial,\n history,\n nowutils\n ) {\n require('./index.css');\n console.log(\"<<<LOAD noworkflow 2>>>\");\n let notebook = Jupyter.notebook;\n Extension.register_renderer(\n notebook, trial, history, nowutils, d3_selection\n );\n Extension.render_cells(notebook);\n Extension.register_highlight(Jupyter, events, utils, codecell)\n resolve();\n })\n });\n}", "function load_ipython_extension() {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(181), __webpack_require__(178), __webpack_require__(179), __webpack_require__(180), __webpack_require__(560), __webpack_require__(182), __webpack_require__(216), __webpack_require__(349), __webpack_require__(504)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (Extension, Jupyter, events, utils, codecell, d3_selection, trial, history, nowutils) {\n console.log(\"<<<LOAD noworkflow 2>>>\");\n var notebook = Jupyter.notebook;\n Extension.register_renderer(notebook, trial, history, nowutils, d3_selection);\n Extension.render_cells(notebook);\n }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n}", "function create() {\n\n}", "function initNds() {\n\n initTOC();\n}", "function NotebookWidgetFactory(rendermime, clipboard) {\n this._rendermime = null;\n this._clipboard = null;\n this._rendermime = rendermime.clone();\n this._clipboard = clipboard;\n }", "function addToNotebookList(name){\n\tg_notebookList.push(name);\n\tg_notebookList.sort();\n//\twriteFile(getDBFilename(\"notebooks\"),\n//\t\tJSON.stringify(g_notebookList));\n}", "constructor(options) {\n super(options);\n this._changeGuard = false;\n this._spinner = new Spinner();\n this._isRevealed = false;\n this.addClass('jp-MainAreaWidget');\n // Set contain=strict to avoid many forced layout rendering while adding cells.\n // Don't forget to remove the CSS class when your remove the spinner to allow\n // the content to be rendered.\n // @see https://github.com/jupyterlab/jupyterlab/issues/9381\n this.addClass('jp-MainAreaWidget-ContainStrict');\n this.id = DOMUtils.createDomID();\n const trans = (options.translator || nullTranslator).load('jupyterlab');\n const content = (this._content = options.content);\n content.node.setAttribute('role', 'region');\n content.node.setAttribute('aria-label', trans.__('notebook content'));\n const toolbar = (this._toolbar = options.toolbar || new Toolbar());\n toolbar.node.setAttribute('role', 'navigation');\n toolbar.node.setAttribute('aria-label', trans.__('notebook actions'));\n const contentHeader = (this._contentHeader =\n options.contentHeader ||\n new BoxPanel({\n direction: 'top-to-bottom',\n spacing: 0\n }));\n const layout = (this.layout = new BoxLayout({ spacing: 0 }));\n layout.direction = 'top-to-bottom';\n BoxLayout.setStretch(toolbar, 0);\n BoxLayout.setStretch(contentHeader, 0);\n BoxLayout.setStretch(content, 1);\n layout.addWidget(toolbar);\n layout.addWidget(contentHeader);\n layout.addWidget(content);\n if (!content.id) {\n content.id = DOMUtils.createDomID();\n }\n content.node.tabIndex = 0;\n this._updateTitle();\n content.title.changed.connect(this._updateTitle, this);\n this.title.closable = true;\n this.title.changed.connect(this._updateContentTitle, this);\n if (options.reveal) {\n this.node.appendChild(this._spinner.node);\n this._revealed = options.reveal\n .then(() => {\n if (content.isDisposed) {\n this.dispose();\n return;\n }\n content.disposed.connect(() => this.dispose());\n const active = document.activeElement === this._spinner.node;\n this._disposeSpinner();\n this._isRevealed = true;\n if (active) {\n this._focusContent();\n }\n })\n .catch(e => {\n // Show a revealed promise error.\n const error = new Widget();\n // Show the error to the user.\n const pre = document.createElement('pre');\n pre.textContent = String(e);\n error.node.appendChild(pre);\n BoxLayout.setStretch(error, 1);\n this._disposeSpinner();\n content.dispose();\n this._content = null;\n toolbar.dispose();\n this._toolbar = null;\n layout.addWidget(error);\n this._isRevealed = true;\n throw error;\n });\n }\n else {\n // Handle no reveal promise.\n this._spinner.dispose();\n this.removeClass('jp-MainAreaWidget-ContainStrict');\n content.disposed.connect(() => this.dispose());\n this._isRevealed = true;\n this._revealed = Promise.resolve(undefined);\n }\n }", "get contentType() {\n return 'notebook';\n }", "function newJarScenario() {\n\tdisplayJarScenarioForm();\n\tresetJarScenarioForm();\n}", "function newNoteBookIntro(notebookHeading) {\n notebookHeading.style.color = \"#f7faeb\";\n notebookHeading.style.transition = \"all 0.1s ease-in-out\";\n notebookHeading.style.transform = \"scale(1.1)\";\n\n setTimeout(() => {\n notebookHeading.style.color = \"#32292f\";\n notebookHeading.style.transform = \"scale(1)\";\n }, 100);\n}", "function WorkbookAllModule(){Workbook.Inject(DataBind,WorkbookSave,WorkbookNumberFormat,WorkbookCellFormat,WorkbookEdit,WorkbookFormula,WorkbookOpen,WorkbookSort,WorkbookHyperlink,WorkbookFilter,WorkbookInsert,WorkbookDelete,WorkbookFindAndReplace,WorkbookProtectSheet,WorkbookDataValidation,WorkbookMerge,WorkbookConditionalFormat,WorkbookImage,WorkbookChart);}", "function makePage(){\n\n codeFellows.makeList();\n disneyLand.makeList();\n}", "function startCells() {\r\n // for the onclick=\"CellManager.setCellsStart(2, \"Our Universe\")\"\r\n CellManager = { // why all inside this object? for namespacing?\r\n\r\n setCellsStart: function (name = 'Our Multiverse', description = 'Multiverse of all things real and imaginary!', ancestry_root = '0', markdown = '', universeCellQty = 1, initialChildCellQty = 3) { // will default to only 1 \"universe\" child cell within the multiverse's cells collection.\r\n this.resetCells(); // clear out any HTML in our multiverse node\r\n this.setPreState(name, description, ancestry_root, markdown, universeCellQty, initialChildCellQty);\r\n },\r\n\r\n // how do I hide functions and properties?\r\n setPreState: function (name, description, ancestryRoot, markdown, universeCellQty, initialChildCellQty) {\r\n // create our multiverse\r\n multiverse = new JSCell(name, description, ancestryRoot, markdown);\r\n let universalAncestryPrefix;\r\n if (ancestryRoot.length == 0) { // ?? single line if value setting\r\n universalAncestryPrefix = ``;\r\n } else {\r\n universalAncestryPrefix = `${ancestryRoot}.`;\r\n }\r\n // create childCellQty number of cells (universe) with grandChildCellQty initial child cells\r\n for (let i = 0; i < universeCellQty; i++) {\r\n let universe = new JSCell(`This Crazy Hihi Universe 2018!`, `Our current reality`, 'aaaaa', `${universalAncestryPrefix}${i + 1}`, `# And what a universe it is!`);\r\n for (let j = 0; j < initialChildCellQty; j++) {\r\n let cell = new JSCell(`Primary Child Cell ${j + 1}`, `A cell`, 'bbbb', `${universe.ancestry}.${j + 1}`, `# A child of the universe :-)`);\r\n for (let k = 0; k < initialChildCellQty; k++) {\r\n let newCell = new JSCell(`extra Child Cell ${k + 1}`, `An extra cell`, 'cccc', `${universe.ancestry}.${k + 1}`, `# An extra child of the universe :-)`);\r\n for (let l = 0; l < initialChildCellQty; l++) {\r\n let newNewCell = new JSCell(`Extra extra Child Cell ${l + 1}`, `An EXTRA extra cell`, 'dddd', `${universe.ancestry}.${k + 1}`, `# An EXTRA extra child of the universe :-)`);\r\n cell.cells.push(newNewCell);\r\n }\r\n cell.cells.push(newCell);\r\n }\r\n universe.cells.push(cell);\r\n }\r\n multiverse.cells.push(universe);\r\n }\r\n },\r\n addChildCells: function () {\r\n // todo\r\n let newCell = new JSCell();\r\n multiverse.cells.push(cell);\r\n },\r\n\r\n resetCells: function () {\r\n let getMultiverse = document.querySelector(`div.multiverse`); // returns a node, an array-like object\r\n // appears document.querySelector only returns a single element.\r\n getMultiverse.innerHTML = ``;\r\n },\r\n\r\n drawBoard: function () {\r\n // get multiverse DOM element\r\n let multiverseDiv = document.querySelector('div.multiverse'); // returns a node, an array-like object, but just the first one.\r\n // we already have multiverse cell object to iterate through to build up either\r\n // * multiverseDiv.innerHTML = text of HTML\r\n // * multiverseDiv.appendChild(new DOM elements); // will go with this approach\r\n\r\n\r\n\r\n // create dom elements by iterating through all cells in multiverse\r\n\r\n // multiverse title and cells\r\n let titleSpan = document.createElement('span');\r\n let descSpan = document.createElement('span');\r\n // let h1 = document.createElement('h1');\r\n // let p = document.createElement('p');\r\n titleSpan.appendChild(document.createTextNode(multiverse.name));\r\n descSpan.appendChild(document.createTextNode(multiverse.description));\r\n\r\n // span.appendChild(h1);\r\n multiverseDiv.appendChild(titleSpan);\r\n multiverseDiv.appendChild(descSpan);\r\n\r\n // unie(s), multiverse.cells, should be appended as child divs (with any)\r\n // call a recursive function to return divs for all the cells, if any\r\n // for each child cell // should use for... each, or each... for/in ??\r\n for (let i = 0; i < multiverse.cells.length; i++) {\r\n // append a div element (each with title+desc spans and 0 or more divs) and children recursively\r\n let cell = multiverse.cells[i];\r\n let cellDiv = document.createElement('div');\r\n cellDiv.className = cell.className || 'cell grid test universe';\r\n let universeCellDiv = reduceCellToDiv(cellDiv, cell);\r\n multiverseDiv.appendChild(universeCellDiv); // so should return a div for each child cell in cell.cells\r\n }\r\n\r\n // creating a function to build up div element \r\n // function cellsToDivs(cellDiv, cell) {\r\n function reduceCellToDiv(cellDiv, cell) { // cellDiv will be our accumulator, cell is our current value to use to append title, desc, and divs for any cell.cells\r\n // takes in a cell object (title, desc, *cells[])\r\n // will recursively call itself for each of any child cells in cell.cells[]\r\n // this should return cellDiv at the end\r\n let cellTitleSpan = document.createElement('span');\r\n cellTitleSpan.className = 'cell-title';\r\n cellTitleSpan.appendChild(document.createTextNode(cell.name));\r\n cellDiv.appendChild(cellTitleSpan);\r\n\r\n let cellDescSpan = document.createElement('span');\r\n cellDescSpan.className = 'cell-desc';\r\n cellDescSpan.appendChild(document.createTextNode(cell.description));\r\n cellDiv.appendChild(cellDescSpan);\r\n\r\n if (Array.isArray(cell.cells) && cell.cells.length > 0) {\r\n // we want to call this function again, to return a div (with title, desc, divs)\r\n let ChildCellDiv = document.createElement('div');\r\n ChildCellDiv.className = cell.className || 'oops'; //'cell grid universe blah';\r\n let newDiv = cell.cells.reduce(reduceCellToDiv, ChildCellDiv);\r\n cellDiv.appendChild(newDiv);\r\n } else {\r\n return cellDiv;\r\n }\r\n return cellDiv;\r\n }\r\n }\r\n\r\n // example recursive reducer function\r\n // function flat(r, a) {\r\n // if (Array.isArray(a)) {\r\n // return a.reduce(flat, r);\r\n // }\r\n // r.push(a);\r\n // return r;\r\n // }\r\n\r\n // var array = [3, [4, [5, [6, 7]]]];\r\n // document.write('<pre>' + JSON.stringify(array.reduce(flat, []), 0, 4) + '</pre>');\r\n\r\n }\r\n CellManager.setCellsStart();\r\n CellManager.drawBoard();\r\n}", "function createNewBook() {\n const book = new Book(\n document.querySelector(\"#name\").value,\n document.querySelector(\"#author\").value,\n document.querySelector(\"#pages\").value,\n document.querySelector(\"#read\").value == \"true\" ? true : false\n );\n addBookToLibrary(book);\n updateLocalStorage(myLibrary);\n displayBook(book);\n toggleForm();\n}", "function initialize(isbnFn) {\n $('#preview-div').show();\n $('#previewYes').show();\n $('#previewNo').hide();\n var viewer = new google.books.DefaultViewer(document.getElementById('preview-div'));\n viewer.load('ISBN:' + isbnFn, prevNotFound);\n }", "GETNOTEBOOKS (state, notebooks) {\n state.notebooks = notebooks\n }", "function createAddWindow() {\n indexWindow.loadURL(url.format({\n pathname: path.join(__dirname, '/views/new.html'),\n protocol: 'file:',\n slashes: true\n }));\n //Garbage collection handles \n indexWindow.on('close', function() {\n indexWindow = null;\n });\n}", "createGrids () {\n }", "function wikiInit() {\n\tcreateRegions();\n}", "function create_corpus_operate(name) {\n // config url bar\n let url_input_group = elementFactory({ type: \"div\", class: \"input-group col-md-8 col-md-offset-2\" });\n $(url_input_group).append(elementFactory({\n type: \"span\",\n class: \"input-group-addon select-disable\",\n html: \"維基百科網址\"\n }));\n $(url_input_group).append(elementFactory({\n type: \"input\",\n attr: { id: \"new-wiki-url\", placeholder: \"請貼上維基百科網址\" },\n class: \"form-control input-group-text\"\n }));\n $(url_input_group).append(elementFactory({\n type: \"span\",\n attr: { id: \"new-wiki\" },\n class: \"input-group-addon select-disable span-btn\",\n html: \"新增\",\n on: { click: click_new_wiki }\n }));\n\n // config wiki document table\n let table_container = elementFactory({ type: \"div\", class: \"col-md-10 col-md-offset-1\" });\n let table = elementFactory({ type: \"table\", class: \"table table-striped\" });\n let thead = elementFactory({ type: \"thead\" });\n let tbody = elementFactory({ type: \"tbody\", attr: { id: \"wiki-table-body\" } });\n let row = elementFactory({ type: \"tr\" });\n $(table_container).append(table);\n $(table).append(thead);\n $(table).append(tbody);\n $(thead).append(row);\n $(row).append(elementFactory({\n type: \"th\",\n css: { width: \"50px\", 'text-align': \"center\" },\n html: \"狀態\"\n }));\n $(row).append(elementFactory({\n type: \"th\",\n css: { width: \"200px\" },\n html: \"來源\"\n }));\n $(row).append(elementFactory({\n type: \"th\",\n html: \"條目\"\n }));\n $(row).append(elementFactory({\n type: \"th\",\n css: { width: \"125px\" },\n html: \"按鈕\"\n }));\n\n // add row to wiki document table body\n let wiki_list = window.handler.get_wiki_list(name);\n window.table_wiki_list = [];\n for (let key in wiki_list) {\n if (!wiki_list.hasOwnProperty(key))\n continue;\n window.table_wiki_list.push(wiki_list[key].url);\n $(tbody).append(create_wiki_table_row(wiki_list[key], 0));\n }\n\n // clear space and append element\n let space = $(\"#operate-space\");\n $(space).html(\"\");\n $(space).append(elementFactory({ type: \"h2\", html: \"文獻集:\" + name }));\n $(space).append(url_input_group);\n $(space).append(table_container);\n}", "async function main() {\n const config = await jupyterConfigData();\n if (config.baseUrl === new URL(here()).pathname) {\n window.location.href = config.appUrl.replace(/\\/?$/, '/index.html');\n return;\n }\n // rewrite the config\n CONFIG_SCRIPT.textContent = JSON.stringify(config, null, 2);\n addFavicon(config);\n const preloader = document.getElementById(LITE_MAIN);\n const bundle = document.createElement('script');\n bundle.src = preloader.href;\n bundle.main = preloader.attributes.main;\n document.head.appendChild(bundle);\n}", "function createNoteBooksFromLocalStorage() {\n if (localStorage.getItem(\"lastVisitedNoteBook\" != null)) {\n openNotebook = localStorage.getItem(\"lastVisitedNoteBook\");\n }\n if (getLocalStorageListsToArray(\"books\") != null) {\n getLocalStorageListsToArray(\"books\").forEach((element) => {\n createNoteBook(element);\n });\n }\n}", "function launchBookshelfBehindScenes() {\n \n $('.bookshelfIframe').remove();\n \n var $iframeURL = $('.student_ebook:first').find('.resource_modal_info .resource-meta-data.url').attr('id');\n $('body').append('<iframe src=\"' + $iframeURL + '\" class=\"bookshelfIframe\"></iframe>');\n \n return;\n\n}", "constructor(options) {\n this._disposed = false;\n const codeCellContentFactory = options.codeCellContentFactory;\n this.contentFactory =\n options.contentFactory ||\n new NotebookModel.ContentFactory({ codeCellContentFactory });\n }", "InitNew() {\n\n }", "function createLabelMaker(title, instructions, callback) {\n var newStrP = new StringPad();\n newStrP.open(title, instructions, callback);\n }", "function showBooks() { \n delAll();\n for(let i = 0; i < myLibrary.length; i++ ){\n let cell = document.createElement(\"div\");\n cell.style.setProperty(\"grid-column\", 1)\n cell.style.setProperty(\"border\", \"solid black\");\n cell.style.setProperty(\"margin\", \"5px\")\n cell.style.setProperty(\"padding\", \"1em\")\n cell.style.setProperty(\"background-color\", \"rgb(69, 201, 245)\")\n cell.innerText = myLibrary[i].info();\n container.appendChild(cell).id = \"book\" + i;\n makeBtnDel(i);\n makeBtnRead(i);\n }\n}", "function createWindow() {\n\t\tpopulateData(\"employment\",1);\n\t}", "function Note(type) {\n this.noteType = type;\n this.date = addDate();\n this.titleOfNoteBook = openNotebook;\n this.addingFromLocalStorage = function (\n date,\n savedNoteBookPlacment,\n savedTextarea\n ) {\n if (date != null) {\n this.date = date;\n }\n if (savedNoteBookPlacment != null) {\n this.titleOfNoteBook = savedNoteBookPlacment;\n } else {\n this.titleOfNoteBook = openNotebook;\n }\n if (savedTextarea != \"\" && type == 1) {\n this.noteElement.getElementsByClassName(\n \"textArea\"\n )[0].textContent = savedTextarea;\n }\n };\n\n this.noteElement = createNote(this, type);\n main.prepend(this.noteElement);\n\n this.checkBox = document.createElement(\"input\");\n this.checkBox.type = \"checkbox\";\n this.checkBox.style.display = \"none\";\n this.checkBox.className = \"checkbox\";\n this.noteElement.appendChild(this.checkBox);\n this.delete = false;\n\n this.getNoteLi = function () {\n if (this.noteType == 2) {\n let arrayOfInnerText = [];\n let listItemsArray = this.noteElement.getElementsByClassName(\n \"itemOfList\"\n );\n\n for (let index = 0; index < listItemsArray.length; index++) {\n arrayOfInnerText.push(listItemsArray[index].innerText);\n }\n arrayOfInnerText.toString();\n return arrayOfInnerText;\n }\n };\n\n //om du kan mata varje string som newNext från local sätter denna dit dom en i taget\n this.setNewLi = function (newText) {\n if (this.noteType == 2) {\n let node = this.noteElement.getElementsByClassName(\"list\");\n let listItemContainer = document.createElement(\"div\");\n listItemContainer.className = \"list-item-container\";\n let node_li = document.createElement(\"li\");\n node_li.contentEditable = \"true\";\n node_li.className = \"itemOfList\";\n let textnode = document.createTextNode(newText);\n let span = document.createElement(\"SPAN\");\n let txt = document.createTextNode(\"\\u00D7\");\n span.className = \"remove-list-item\";\n span.addEventListener(\"click\", () => {\n listItemContainer.remove();\n saveNotesToLocalStorage();\n });\n span.appendChild(txt);\n node_li.appendChild(textnode);\n listItemContainer.appendChild(node_li);\n listItemContainer.appendChild(span);\n node[0].appendChild(listItemContainer);\n return node;\n }\n };\n this.getNoteText = function () {\n if (this.noteType == 1) {\n return this.noteElement.getElementsByClassName(\"textArea\")[0].textContent;\n }\n };\n this.setTitleOfNoteBook = (title) => {\n this.titleOfNoteBook = title;\n };\n\n this.checkBoxVisible = function (choise) {\n if (choise == true) {\n return (this.checkBox.style.display = \"block\");\n } else if (choise == false) {\n return (this.checkBox.style.display = \"none\");\n }\n };\n\n this.removeNote = function () {\n this.noteElement.remove();\n this.delete = true;\n clearDeleted();\n saveNotesToLocalStorage();\n };\n}", "getById(id) {\r\n return new Notebook(this, id);\r\n }", "function BN_create (BTN, level, faviconWorker, parentBN = undefined) {\r\n let node;\r\n let BTN_id = BTN.id;\r\n let index = BTN.index;\r\n let type = getType(BTN);\r\n let protect;\r\n if (type == \"folder\") { // Root cannot be created, so do not verify\r\n\tcountFolders++;\r\n\r\n\tlet title = BTN.title;\r\n\tlet uri, fetchedUri, inBSP2Trash;\r\n\tif (BTN_id == PersonalToobar) {\r\n\t uri = \"/icons/toolbarbkmk.png\";\r\n\t protect = true;\r\n\t fetchedUri = true;\r\n\t}\r\n\telse if (BTN_id == BookmarksMenu) {\r\n\t uri = \"/icons/menubkmk.png\";\r\n\t protect = true;\r\n\t fetchedUri = true;\r\n\t}\r\n\telse if (BTN_id == OtherBookmarks) {\r\n\t uri = \"/icons/otherbkmk.png\";\r\n\t protect = true;\r\n\t fetchedUri = true;\r\n\t}\r\n\telse if (BTN_id == MobileBookmarks) {\r\n\t uri = \"/icons/folder.png\";\r\n\t protect = true;\r\n\t fetchedUri = false;\r\n\t}\r\n\telse if (title == BSP2TrashName) {\r\n\t uri = \"/icons/bsp2trash.png\";\r\n\t protect = inBSP2Trash = true;\r\n\t fetchedUri = true;\r\n\t bsp2TrashFldrBNId = BTN_id;\r\n\t}\r\n\telse {\r\n\t uri = \"/icons/folder.png\";\r\n\t protect = false;\r\n\t fetchedUri = false;\r\n\t}\r\n\r\n\t// Pre-create an array of empty children if needed\r\n\tlet children = BTN.children;\r\n\tif (children != undefined) {\r\n\t children = new Array (children.length);\r\n\t}\r\n\r\n\t// Create new node\r\n\tnode = new BookmarkNode (\r\n\t BTN_id, \"folder\", level, BTN.parentId, BTN.dateAdded, protect,\r\n\t BTN.title, uri, fetchedUri, undefined,\r\n\t children, BTN.dateGroupModified, inBSP2Trash\r\n\t);\r\n }\r\n else if (type == \"separator\") {\r\n\tif ((countSeparators++ == 0) || beforeFF57) { // First separator is not draggable,\r\n\t \t\t\t\t\t\t\t\t\t\t\t // or all separators when FF < 57\r\n\t protect = true;\r\n\t}\r\n\telse {\r\n\t protect = false;\r\n\t}\r\n\tnode = new BookmarkNode (\r\n\t BTN_id, type, level, BTN.parentId, BTN.dateAdded, protect\r\n\t);\r\n }\r\n else { // Presumably \"bookmark\" type\r\n let forceProtect; // In case the general protection rule does not apply\r\n\tif (type == \"bookmark\") {\r\n\t if (!BTN_id.startsWith(\"place:\")) { // Do not count special bookmarks under special place: folders\r\n\t\t\t\t\t\t\t\t\t\t // -> tagged with \"place:\" before their id when inserted\r\n\t\tcountBookmarks++;\r\n\t }\r\n\t else {\r\n\t\tforceProtect = true;\r\n\t }\r\n\t}\r\n\telse {\r\n\t trace(\"Odd bookmark type: \"+type);\r\n\t countOddities++;\r\n\t}\r\n\r\n\tlet uri, fetchedUri;\r\n\tlet triggerFetch = false;\r\n\tlet url = BTN.url;\r\n\tlet title = BTN.title;\r\n\tif (url == undefined) {\r\n\t trace(\"Bookmark with undefined URL !\");\r\n\t traceBTN(BTN);\r\n\t url = \"<undefined!>\";\r\n\t uri = \"/icons/nofavicon.png\";\r\n\t fetchedUri = false;\r\n\t protect = false;\r\n\t}\r\n\telse if (url.startsWith(\"place:\")) {\r\n\t type = \"folder\"; // Convert to folder\r\n\t uri = \"/icons/specfavicon.png\";\r\n\t fetchedUri = true;\r\n\t protect = true;\r\n\t if (url.includes(MostVisitedSort)) {\r\n\t\tmostVisitedBNId = BTN_id;\r\n\t }\r\n\t else if (url.includes(RecentTagSort)) {\r\n\t\trecentTagBNId = BTN_id; \r\n\t }\r\n\t else if (url.includes(RecentBkmkSort)) {\r\n\t\trecentBkmkBNId = BTN_id;\r\n\t }\r\n\t else { // Unknown or non supported place: case ...\r\n\t\ttitle = url;\r\n\t }\r\n\t}\r\n\telse if (url.startsWith(\"about:\") || url.startsWith(\"file:\")) { // about: and file: generate a security error when we try to fetch ..\r\n\t uri = \"/icons/nofavicon.png\";\r\n\t fetchedUri = false;\r\n\t // They are draggable, but keep favicon = nofavicon\r\n\t protect = false;\r\n\t}\r\n\telse if (options.disableFavicons) {\r\n\t fetchedUri = false;\r\n\t protect = false;\r\n\t}\r\n\telse {\r\n\t // Retrieve saved uri or set to undefined by default\r\n\t // and trigger favicon retrieval in background\r\n\t uri = undefined;\r\n\t if (savedBkmkUriList != undefined) { // We are migrating to BN list ..\r\n\t\turi = savedBkmkUriList[BTN_id];\r\n\t\tif ((uri == \"/icons/nofavicontmp.png\") // Last time we stopped the sidebar\r\n\t\t\t|| (uri == \"/icons/waiting.gif\") // it didn't have time to fetch that\r\n\t\t ) {\t\t\t\t\t\t\t\t\t// favicon .. so let's do it now.\r\n\t\t uri = undefined;\r\n\t\t}\r\n\t }\r\n\t else if (savedBNList != undefined) { // We are still at initial load ..\r\n\t\tlet BN = savedBNList[BTN_id];\r\n\t\tif (BN != undefined) {\r\n\t\t uri = BN.faviconUri;\r\n\t\t if ((uri == \"/icons/nofavicontmp.png\") // Last time we stopped the sidebar\r\n\t\t\t || (uri == \"/icons/waiting.gif\") // it didn't have time to fetch that\r\n\t\t\t ) { // favicon .. so let's do it now.\r\n\t\t\turi = undefined;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t protect = false;\r\n\r\n\t // Trigger asynchronous favicon retrieval process if favicon uri not found\r\n\t if (uri == undefined) {\r\n\t\t// Set tmp favicon and remember it in case the add-on is stopped before we had\r\n\t\t// a chance to get its image.\r\n\t\turi = \"/icons/nofavicontmp.png\";\r\n\t\tfetchedUri = false;\r\n\t\ttriggerFetch = true;\r\n\t\tif (faviconWorker != undefined) {\r\n\t\t countFetchFav++;\r\n//console.log(\"countFetchFav 1: \"+countFetchFav+\" BTN_id: \"+BTN_id);\r\n\t\t}\r\n\t }\r\n\t else {\r\n\t\tfetchedUri = true;\r\n\t\tif (uri == \"/icons/nofavicon.png\")\r\n\t\t countNoFavicon++;\r\n\t }\r\n\t}\r\n\r\n\tif (forceProtect != undefined) { // General rule does not apply (e.g. BTN_id starting with \"place:\")\r\n\t protect = forceProtect;\r\n\t}\r\n\tnode = new BookmarkNode (\r\n\t BTN_id, type, level, BTN.parentId, BTN.dateAdded, protect,\r\n\t title, uri, fetchedUri, url\r\n\t);\r\n\r\n\tif (triggerFetch && !options.pauseFavicons) { // Trigger favicon fetch, except if paused\r\n\t // This is a bookmark, so here no need for cloneBN(), there is no tree below\r\n\t if (faviconWorker != undefined) {\r\n\t\tfaviconWorker({data: [\"get\", BTN_id, url, options.enableCookies]});\r\n\t }\r\n\t}\r\n }\r\n\r\n // Add child to parentBN if provided, adjusting index of other children as needed\r\n if (parentBN != undefined) {\r\n\tlet children = parentBN.children;\r\n\tif (children == undefined) { // No list of children so far\r\n\t parentBN.children = [node];\r\n\t}\r\n\telse if (index >= children.length) { // Append child at end\r\n\t children.push(node);\r\n\t}\r\n\telse { // Insert child at position\r\n\t children.splice(index, 0, node);\r\n\t}\r\n }\r\n\r\n return(node);\r\n}", "constructor(options) {\n this._path = '';\n this._useCRLF = false;\n this._contentsModel = null;\n this._populatedPromise = new PromiseDelegate();\n this._isPopulated = false;\n this._isReady = false;\n this._isDisposed = false;\n this._pathChanged = new Signal(this);\n this._fileChanged = new Signal(this);\n this._saveState = new Signal(this);\n this._disposed = new Signal(this);\n const manager = (this._manager = options.manager);\n this.translator = options.translator || nullTranslator;\n this._trans = this.translator.load('jupyterlab');\n this._factory = options.factory;\n this._dialogs = options.sessionDialogs || sessionContextDialogs;\n this._opener = options.opener || Private.noOp;\n this._path = this._manager.contents.normalize(options.path);\n const localPath = this._manager.contents.localPath(this._path);\n const lang = this._factory.preferredLanguage(PathExt.basename(localPath));\n const dbFactory = options.modelDBFactory;\n if (dbFactory) {\n const localPath = manager.contents.localPath(this._path);\n this._modelDB = dbFactory.createNew(localPath);\n this._model = this._factory.createNew(lang, this._modelDB, false);\n }\n else {\n this._model = this._factory.createNew(lang, undefined, false);\n }\n const ymodel = this._model.sharedModel; // translate to the concrete Yjs implementation\n const ydoc = ymodel.ydoc;\n this._ydoc = ydoc;\n this._ycontext = ydoc.getMap('context');\n const docProviderFactory = options.docProviderFactory;\n this._provider = docProviderFactory\n ? docProviderFactory({\n path: this._path,\n contentType: this._factory.contentType,\n ymodel\n })\n : new ProviderMock();\n this._readyPromise = manager.ready.then(() => {\n return this._populatedPromise.promise;\n });\n const ext = PathExt.extname(this._path);\n this.sessionContext = new SessionContext({\n sessionManager: manager.sessions,\n specsManager: manager.kernelspecs,\n path: this._path,\n type: ext === '.ipynb' ? 'notebook' : 'file',\n name: PathExt.basename(localPath),\n kernelPreference: options.kernelPreference || { shouldStart: false },\n setBusy: options.setBusy\n });\n this.sessionContext.propertyChanged.connect(this._onSessionChanged, this);\n manager.contents.fileChanged.connect(this._onFileChanged, this);\n const urlResolver = (this.urlResolver = new RenderMimeRegistry.UrlResolver({\n path: this._path,\n contents: manager.contents\n }));\n this._ycontext.set('path', this._path);\n this._ycontext.observe(event => {\n var _a;\n const pathChanged = event.changes.keys.get('path');\n if (pathChanged) {\n const newPath = this._ycontext.get('path');\n if (newPath && newPath !== pathChanged.oldValue) {\n urlResolver.path = newPath;\n this._path = newPath;\n this._provider.setPath(newPath);\n this._pathChanged.emit(this.path);\n (_a = this.sessionContext.session) === null || _a === void 0 ? void 0 : _a.setPath(newPath);\n }\n }\n });\n }", "newCell(args) {\n\t\t//make sure this matches standalone.lua's Cell ctor\n\t\targs.done(JSON.stringify({\n\t\t\tuid : ++this.nextValidUID,\n\t\t\tinput : '',\n\t\t\toutput : '',\n\t\t\toutputtype : 'html',\n\t\t\thidden : false\n\t\t}));\n\t}", "async init(){\r\n try{\r\n this.browser = await pptrFirefox.launch();\r\n this.page = await this.browser.newPage();\r\n await this.setName(this.page);\r\n await this.setPrice(this.page);\r\n await this.setImage();\r\n }catch{\r\n throw error;\r\n }\r\n }", "createNew(path, widgetName = 'default', kernel) {\n return this._createOrOpenDocument('create', path, widgetName, kernel);\n }", "function createNI(NI_doc, classStr) {\n // calc panel's position $ screen width measuring\n classStr = \"btn-primary-group\" + classStr;\n\n // create NS part\n let NI_Group = $(\"<div></div>\").addClass(classStr).attr(\"id\", \"display-scroll\");\n $(\"#filter-panel > .btn-panel\").first().append(NI_Group);\n\n $.ajaxSettings.async = false;\n $.getJSON(NI_doc, function (json) {\n $.each(json, function (i, item){\n\n let NI_single = new NI_Nav(item);\n let NI_nav_btn = NI_single.drawNINav(); // create spy btn\n let NI_top = NI_single.drawNITop(); // create display part\n let NI_joint_tag = NI_single.getJointTag();\n let currentDisplayPart = $(\"<div></div>\").attr(\"id\", NI_joint_tag); // create spy panel\n \n NI_Group.append(NI_nav_btn);\n \n currentDisplayPart\n .append(NI_top)\n .append($(\"<div></div>\").addClass(\"row row-cols-1 row-cols-sm-2 row-cols-lg-3\").addClass(\"card-deck\")); // create card deck \n\n currentDisplayPart.appendTo(\"#card-display\");\n NI_single.NICreatingComplete();\n });\n });\n}", "function createPage() {\n // Clear the preview div.\n $('#previewDiv').empty();\n \n // Add a new page.\n addPage(new Page());\n}", "processCreateNewList() {\n // MAKE A BRAND NEW LIST\n window.todo.model.loadNewList();\n\n // CHANGE THE SCREEN\n window.todo.model.goList();\n }", "function CallCreate() {\n if (_contentBody != null && _contentBody != \"MasterBody\") { \n $(\"#\" + _contentBody).LoadView({ url: \"~/\" + _controller + \"Create?windowId=\" + _contentBody });\n }\n else {\n window.location.href = \"Create\";\n }\n }", "function NewList() {\r\n}", "function newFrame() {\n \n\n }", "function creaPrenotazione() {\n\t$('#modPrenotazione').window('open');\n\n}", "function createBnWindow(){\n let bnWindow = new BrowserWindow({width: 800, height: 600})\n\n bnWindow.loadURL('file://' + __dirname + '/views/bnWindow/bnWindow.html');\n secondaryWindows.push(bnWindow);\n bnWindow.show();\n\n // Emitted when the window is closed.\n bnWindow.on('closed', function () {\n // Dereference the window object.\n bnWindow = null\n })\n\n return bnWindow;\n }", "function createPage () {\n if (config.wgCanonicalNamespace + ':' + config.wgTitle !== 'Special:DiscussionsActivity') {\n return;\n }\n document.title = i18n('document_title_new').escape() + ' |' + document.title.split('|').slice(1).join('|');\n document.getElementById('PageHeader').getElementsByTagName('h1')[0].textContent = i18n('document_title_new').plain();\n container = document.getElementById('mw-content-text');\n container.innerHTML = '<span class=\"rda-loading\">' + i18n('loading_discussions').escape() + '</span>';\n }", "async init() {\n // setup the csvLoader button\n this.csvLoader()\n this.mkradio(\"axial\")\n this.mkradio(\"sagittal\")\n this.mkradio(\"coronal\")\n // setup the radio buttons\n // selected is the radio button we have selected\n /** The view that has been selected to view the slices of the brain from. Stored on pane for export and import of sessions.\n * @alias brainView\n * @memberof Pane\n * @instance\n */\n this.paneOb.brainView = \"sagittal\" // default\n this.paneOb.paneDiv.querySelector(\"#radiosagittal\").checked = true\n\n // create the brain slice slider\n this.createSlider()\n\n // set defaults\n // ensure that the slider only permits sagittal slice count\n this.paneOb.paneDiv.querySelector(\"#radiosagittal\").click()\n\n }", "create() {\n\t}", "function crest_kernel() {\n var command = command_pass;\n var command_query = command.split(\"#\");\n\n var command_pointer = command_query[1];\n if (command_pointer == \"settings\"){open_settings();} // open settings\n if (command_pointer == \"tools\"){open_tools();} // open tools\n if (command_pointer == \"kill\") {kill();} // kill test command;\n if (command_pointer == \"import-code\") {import_template();} \n if (command_pointer == \"dclose\") {w3_close();} //close dashboard\n if (command_pointer == \"dopen\") {w3_open();} // open sideboard\n}", "function createWorkflow() {\n reinitNodeCache();\n}", "function learnDivision()\n{\n //Clear the previous UI\n document.body.innerHTML=\"\";\n //Create the Back button to go to Learning Screen\n division_screen_button=createButton(\"Back\",\"division_screen_button\");\n division_screen_button.onclick=startLearningModule;\n document.body.appendChild(division_screen_button);\n\n //Create the Header using Complex UI in ui.js\n var division_screen_header_section=createComplexDiv(\"\",\"division_screen_div\",\"Learn Division\",\"division_screen_header\",\"images/divide_icon.png\",\"320px\",\"320px\",\"learning_division_image\",\"This module deals with division which implies to divide. It is represented by the symbol / and is referred as Division or Divide. Go through the following examples to get a start what it is all about.\",\"division_screen_paragraph\");\n document.body.appendChild(division_screen_header_section);\n\n //Create the table strucuture from one defined in ui.js\n var division_screen_table=reusableTable(\"\",\"screen_table\",\"division_screen_table\",\"division_screen_tr_head\",\"Symbol\",\"division_screen_th_symbol\",\"Meaning\",\"division_screen_th_meaning\");\n document.body.appendChild(division_screen_table);\n\n //Fetching for later append\n var table=document.querySelector('.division_screen_table');\n\n\n //Create and append row one for the table\n division_screen_tr_one=createtr(\"division_screen_tr_one\");\n division_screen_td_one_symbol=createtd(\"\",\"division_screen_td_one_symbol\");\n var cone1=creatediv(\"\",\"count_ball\");\n var cone2=creatediv(\"\",\"count_ball\");\n var cone3=creatediv(\"\",\"count_ball\");\n var divideysymbol1=creatediv(\"/\",\"symbol\");\n var equalsymbol1=creatediv(\"=\",\"symbol\");\n division_screen_td_one_symbol.appendChild(cone1);\n division_screen_td_one_symbol.appendChild(divideysymbol1);\n division_screen_td_one_symbol.appendChild(cone2);\n division_screen_td_one_symbol.appendChild(equalsymbol1);\n division_screen_td_one_symbol.appendChild(cone3);\n division_screen_td_one_meaning=createtd(\"One when divided by one gives one\",\"division_screen_td_one_meaning\");\n division_screen_tr_one.appendChild(division_screen_td_one_symbol);\n division_screen_tr_one.appendChild(division_screen_td_one_meaning);\n table.appendChild(division_screen_tr_one);\n\n\n //Create and append row two for the table\n division_screen_tr_two=createtr(\"division_screen_tr_two\");\n division_screen_td_two_symbol=createtd(\"\",\"division_screen_td_two_symbol\");\n var ctwo1=creatediv(\"\",\"count_ball\");\n var ctwo2=creatediv(\"\",\"count_ball\");\n var ctwo3=creatediv(\"\",\"count_ball\");\n var ctwo4=creatediv(\"\",\"count_ball\");\n var ctwo5=creatediv(\"\",\"count_ball\");\n var ctwo6=creatediv(\"\",\"count_ball\");\n var ctwo7=creatediv(\"\",\"count_ball\");\n var ctwo8=creatediv(\"\",\"count_ball\");\n var dividesymbol2=creatediv(\"/\",\"symbol\");\n var equalsymbol2=creatediv(\"=\",\"symbol\");\n division_screen_td_two_symbol.appendChild(ctwo1);\n division_screen_td_two_symbol.appendChild(ctwo2);\n division_screen_td_two_symbol.appendChild(ctwo3);\n division_screen_td_two_symbol.appendChild(ctwo4);\n division_screen_td_two_symbol.appendChild(dividesymbol2);\n division_screen_td_two_symbol.appendChild(ctwo5);\n division_screen_td_two_symbol.appendChild(ctwo6);\n division_screen_td_two_symbol.appendChild(equalsymbol2);\n division_screen_td_two_symbol.appendChild(ctwo7);\n division_screen_td_two_symbol.appendChild(ctwo8);\n division_screen_td_two_meaning=createtd(\"Dividing four by two gives two\",\"division_screen_td_two_meaning\");\n division_screen_tr_two.appendChild(division_screen_td_two_symbol);\n division_screen_tr_two.appendChild(division_screen_td_two_meaning);\n table.appendChild(division_screen_tr_two);\n\n //Create the concluding paragraph\n division_screen_paragraph1=createParagraph(\"Thus generally, dividing any number by one gives the number itself. Thus, on the general broad terms if a number a is completely divisible by other number b then it gives how many times we should add b to get a i.e waht number of b's combined when added will give 'a',So we are all done Remember it is just the basic introduction regarding the concepts being used, Just go through the Guidelines and Give the Game a Try!!!!!! \",\"division_screen_paragraph1\");\n document.body.appendChild(division_screen_paragraph1);\n\n}", "function existingNotebookName(name){\n\t// Checks if the notebook already exists.\n\tvar inList = g_notebookList.indexOf(name);\n\tif(inList >= 0){\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function init() {\n if ('BlocklyStorage' in window) {\n BlocklyStorage.HTTPREQUEST_ERROR =\n 'There was a problem with the request.\\n';\n BlocklyStorage.LINK_ALERT =\n 'Share your blocks with this link:\\n\\n%1';\n BlocklyStorage.HASH_ERROR =\n 'Sorry, \"%1\" doesn\\'t correspond with any saved Blockly file.';\n BlocklyStorage.XML_ERROR = 'Could not load your saved file.\\n'+\n 'Perhaps it was created with a different version of Blockly?';\n var linkButton = document.getElementById('linkButton');\n linkButton.style.display = 'inline-block';\n linkButton.addEventListener('click',\n function() {BlocklyStorage.link(mainWorkspace);});\n disableEnableLink();\n }\n\n document.getElementById('helpButton').addEventListener('click',\n function() {\n open('https://developers.google.com/blockly/guides/create-custom-blocks/block-factory',\n 'BlockFactoryHelp');\n });\n\n var expandList = [\n document.getElementById('blockly'),\n document.getElementById('blocklyMask'),\n document.getElementById('preview'),\n document.getElementById('languagePre'),\n document.getElementById('languageTA'),\n document.getElementById('generatorPre')\n ];\n var onresize = function(e) {\n for (var i = 0, expand; expand = expandList[i]; i++) {\n expand.style.width = (expand.parentNode.offsetWidth - 2) + 'px';\n expand.style.height = (expand.parentNode.offsetHeight - 2) + 'px';\n }\n };\n onresize();\n window.addEventListener('resize', onresize);\n\n var toolbox = document.getElementById('toolbox');\n mainWorkspace = Blockly.inject('blockly',\n {collapse: false,\n toolbox: toolbox,\n media: '../../media/'});\n\n // Create the root block.\n if ('BlocklyStorage' in window && window.location.hash.length > 1) {\n BlocklyStorage.retrieveXml(window.location.hash.substring(1),\n mainWorkspace);\n } else {\n var xml = '<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"factory_base\" deletable=\"false\" movable=\"false\"></block></xml>';\n Blockly.Xml.domToWorkspace(Blockly.utils.xml.textToDom(xml), mainWorkspace);\n }\n mainWorkspace.clearUndo();\n\n mainWorkspace.addChangeListener(Blockly.Events.disableOrphans);\n mainWorkspace.addChangeListener(updateLanguage);\n document.getElementById('direction')\n .addEventListener('change', updatePreview);\n document.getElementById('languageTA')\n .addEventListener('change', updatePreview);\n document.getElementById('languageTA')\n .addEventListener('keyup', updatePreview);\n document.getElementById('format')\n .addEventListener('change', formatChange);\n document.getElementById('language')\n .addEventListener('change', updatePreview);\n}", "render() {\n const model = this.model;\n if (!model.listMode) {\n return [React.createElement(\"div\", { key: \"empty\" })];\n }\n if (model.listMode === 'invalid') {\n return [\n React.createElement(\"div\", { style: { padding: 8 }, key: \"invalid\" },\n React.createElement(\"div\", null, \"The extension manager is disabled. Please contact your system administrator to verify the listings configuration.\"),\n React.createElement(\"div\", null,\n React.createElement(\"a\", { href: \"https://jupyterlab.readthedocs.io/en/stable/user/extensions.html\", target: \"_blank\" }, \"Read more in the JupyterLab documentation.\")))\n ];\n }\n let pages = Math.ceil(model.totalEntries / model.pagination);\n let elements = [\n React.createElement(SearchBar, { key: \"searchbar\", placeholder: \"SEARCH\", disabled: !ListModel.isDisclaimed(), settings: this._settings })\n ];\n if (model.promptBuild) {\n elements.push(React.createElement(BuildPrompt, { key: \"promt\", performBuild: () => {\n model.performBuild();\n }, ignoreBuild: () => {\n model.ignoreBuildRecommendation();\n } }));\n }\n // Indicator element for pending actions:\n elements.push(React.createElement(\"div\", { key: \"pending\", className: `jp-extensionmanager-pending ${model.hasPendingActions() ? 'jp-mod-hasPending' : ''}` }));\n const content = [];\n content.push(React.createElement(CollapsibleSection, { key: \"warning-section\", isOpen: !ListModel.isDisclaimed(), disabled: false, header: 'Warning' },\n React.createElement(\"div\", { className: \"jp-extensionmanager-disclaimer\" },\n React.createElement(\"div\", null, \"The JupyterLab development team is excited to have a robust third-party extension community. However, we do not review third-party extensions, and some extensions may introduce security risks or contain malicious code that runs on your machine.\"),\n React.createElement(\"div\", { style: { paddingTop: 8 } },\n ListModel.isDisclaimed() && (React.createElement(Button, { className: \"jp-extensionmanager-disclaimer-disable\", onClick: (e) => {\n this._settings.set('disclaimed', false).catch(reason => {\n console.error(`Something went wrong when setting disclaimed.\\n${reason}`);\n });\n } }, \"Disable\")),\n !ListModel.isDisclaimed() && (React.createElement(Button, { className: \"jp-extensionmanager-disclaimer-enable\", onClick: (e) => {\n this._forceOpen = true;\n this._settings.set('disclaimed', true).catch(reason => {\n console.error(`Something went wrong when setting disclaimed.\\n${reason}`);\n });\n } }, \"Enable\"))))));\n if (!model.initialized) {\n content.push(React.createElement(\"div\", { key: \"loading-placeholder\", className: \"jp-extensionmanager-loader\" }, \"Updating extensions list\"));\n }\n else if (model.serverConnectionError !== null) {\n content.push(React.createElement(ErrorMessage, { key: \"error-msg\" },\n React.createElement(\"p\", null, \"Error communicating with server extension. Consult the documentation for how to ensure that it is enabled.\"),\n React.createElement(\"p\", null, \"Reason given:\"),\n React.createElement(\"pre\", null, model.serverConnectionError)));\n }\n else if (model.serverRequirementsError !== null) {\n content.push(React.createElement(ErrorMessage, { key: \"server-requirements-error\" },\n React.createElement(\"p\", null, \"The server has some missing requirements for installing extensions.\"),\n React.createElement(\"p\", null, \"Details:\"),\n React.createElement(\"pre\", null, model.serverRequirementsError)));\n }\n else {\n // List installed and discovery sections\n let installedContent = [];\n if (model.installedError !== null) {\n installedContent.push(React.createElement(ErrorMessage, { key: \"install-error\" }, `Error querying installed extensions${model.installedError ? `: ${model.installedError}` : '.'}`));\n }\n else {\n installedContent.push(React.createElement(ListView, { key: \"installed-items\", listMode: model.listMode, viewType: 'installed', entries: model.installed, numPages: 1, onPage: value => {\n /* no-op */\n }, performAction: this.onAction.bind(this) }));\n }\n content.push(React.createElement(CollapsibleSection, { key: \"installed-section\", isOpen: ListModel.isDisclaimed(), forceOpen: this._forceOpen, disabled: !ListModel.isDisclaimed(), header: \"Installed\", headerElements: React.createElement(ToolbarButtonComponent, { key: \"refresh-button\", icon: refreshIcon, onClick: () => {\n model.refreshInstalled();\n }, tooltip: \"Refresh extension list\" }) }, installedContent));\n let searchContent = [];\n if (model.searchError !== null) {\n searchContent.push(React.createElement(ErrorMessage, { key: \"search-error\" }, `Error searching for extensions${model.searchError ? `: ${model.searchError}` : '.'}`));\n }\n else {\n searchContent.push(React.createElement(ListView, { key: \"search-items\", listMode: model.listMode, viewType: 'searchResult', \n // Filter out installed extensions:\n entries: model.searchResult.filter(entry => model.installed.indexOf(entry) === -1), numPages: pages, onPage: value => {\n this.onPage(value);\n }, performAction: this.onAction.bind(this) }));\n }\n content.push(React.createElement(CollapsibleSection, { key: \"search-section\", isOpen: ListModel.isDisclaimed(), forceOpen: this._forceOpen, disabled: !ListModel.isDisclaimed(), header: model.query ? 'Search Results' : 'Discover', onCollapse: (isOpen) => {\n if (isOpen && model.query === null) {\n model.query = '';\n }\n } }, searchContent));\n }\n elements.push(React.createElement(\"div\", { key: \"content\", className: \"jp-extensionmanager-content\" }, content));\n // Reset the force open for future usage.\n this._forceOpen = false;\n return elements;\n }", "function BasicModule(){Spreadsheet.Inject(Ribbon$$1,FormulaBar,SheetTabs,Selection,Edit,KeyboardNavigation,KeyboardShortcut,Clipboard,DataBind,Open,ContextMenu$1,Save,NumberFormat,CellFormat,Formula,Sort,CollaborativeEditing,UndoRedo,Resize,Filter,SpreadsheetHyperlink,WrapText,Insert,Delete,ProtectSheet,DataValidation,FindAndReplace,Merge,ConditionalFormatting,SpreadsheetImage,SpreadsheetChart);}", "getNewWorkBook() {\n return XLSX.utils.book_new();\n }", "create() {\n try {\n this._toggleEditThrobber();\n var latin_name = document.getElementById('latin_name').value;\n var outputEl = this._clearOutput();\n var jsonObj = this.dao.retrieve(latin_name);\n if (!jsonObj || !jsonObj.species) throw `Error reading taxonomic data. Is the latin name spelled correctly?`; \n this._showOutput(latin_name, jsonObj);\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleEditThrobber();\n }", "function createwidget()\n {\n //return;\n try{\n\t \n\t\t \n var currentwidgettmp=store.get('_currentWidget');\n \n //if(currentwidgettmp != undefined && (currentwidgettmp !=currentwidget) )\n //{\n if (currentwidgettmp != undefined )\n {\n\n\t\t //alert(currentwidgettmp);\n ///////////////////////////////formulario con informacion del widget\n var sectionname= store.get('_currentTemplate');\n \n\t\t\t //sectionname=_user.toString() + '-' + sectionname;\n\t\t\t \n var widgetfile='config/widget/'+ sectionname + '-' + currentwidgettmp + '.js?v='+ramdonversion();\n\n //alert(widgetfile);\n\t\t \t \n\t\t\t dynamicInsert(widgetfile);\n\n ////////////////////////////////////////////////////\n\t\t\t //CreateReaderControl('widget.htm','?_target=widget','section3');\n\t\t\t \n currentwidget = currentwidgettmp;\n\n store.set('_currentWidgetModules', null);\n\n var modulesItem = [];\n\n //Carga los modulos pertenecientes a un widget en un template\n console.log('inicio loadModuleWidget');\n modulesItem = loadModuleWidget(sectionname, currentwidgettmp); \n \n console.log('fin loadModuleWidget');\n if (modulesItem.length > 0) {\n \n var ii = 0;\n var modulesResume = [];\n for (ii = 0; ii < modulesItem.length; ii++)\n {\n var item = createListitem2(modulesItem[ii].ModuleName, modulesItem[ii].Description);\n modulesResume.push(item);\n }\n //FALTA PRUEBAs\n for (ii = 0; ii < modulesItem.length; ii++) {\n var item = createListitem2(modulesItem[ii].ModuleName, modulesItem[ii].Description);\n modulesResume.push(item);\n }\n\n store.set('_currentWidgetModules', modulesResume);\n createList();\n } \n\n }\n \n }\n catch(e){\n \n alert('home createwidget ' + e.message);\n \n }\n \n }", "function createInteractionSet() {\n // Label\n createSpan(\"Label:\").parent(\"#interaction-container\");\n\n // Input box for label\n labelInput = createInput();\n labelInput.parent(\"#interaction-container\");\n labelInput.input(function () {\n label = this.value();\n });\n\n // Learn button\n addImgBtn = createButton(\"Learn as per Label\");\n addImgBtn.mousePressed(() => {\n learnCounter++;\n showText(`Machine got ${learnCounter} image`);\n classifier.addImage(label);\n startClassification = false;\n });\n addImgBtn.parent(\"#interaction-container\");\n\n // Train button\n trainBtn = createButton(\"Train Machine\");\n trainBtn.mousePressed(() => {\n classifier.train(function (loss) {\n // if the loss is null then the training is complete.\n if (!loss) {\n showText(\"Training Complete.. Show any trained object on camera.\");\n startClassification = true;\n } else {\n showText(\"Training in progress\");\n startClassification = false;\n }\n });\n });\n trainBtn.parent(\"#interaction-container\");\n}", "function createJupyterKernelWithoutSerialization() {\n var relativePath = path.join('node_modules', '@jupyterlab', 'services', 'lib', 'kernel', 'default.js');\n var filePath = path.join(constants_1.ExtensionRootDir, relativePath);\n if (!fs.existsSync(filePath)) {\n throw new Error(\"Jupyter lab default kernel not found '\" + filePath + \"' (pvsc post install script)\");\n }\n var fileContents = fs.readFileSync(filePath, { encoding: 'utf8' });\n var replacedContents = fileContents.replace(\n /^const serialize =.*$/gm,\n 'const serialize = { serialize: (a) => a, deserialize: (a) => a };'\n );\n if (replacedContents === fileContents) {\n throw new Error('Jupyter lab default kernel cannot be made non serializing');\n }\n var destPath = path.join(path.dirname(filePath), 'nonSerializingKernel.js');\n fs.writeFileSync(destPath, replacedContents);\n console.log(colors.green(destPath + ' file generated (by Python VSC)'));\n}", "function createStartInstruction () {\n currentInstruction = \"createStartInstruction\";\n saveData();\n beforeShowInstruction();\n var text = strings.practiceIntro(); // (1)\n var button = ex.createButton(0, 0, strings.okButtonText());\n introBox = ex.textbox112(text,\n {\n stay: true,\n color: instrColor\n }, instrW, instrX);\n button.on(\"click\", function () {\n saveData();\n introBox.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n createIterationQ();\n saveData();\n });\n ex.insertButtonTextbox112(introBox, button, \"BTNA\");\n saveData();\n }", "function useNewButton() {\r\n createUser();\r\n startPage()\r\n}", "function newHowTo() {\n console.log('how to is working');\n }", "function buildNotebookTree(notebooks) {\n const ids = Object.keys(notebooks);\n for (let id of ids) {\n notebooks[id].subs = [];\n }\n for (let id of ids) {\n const parentId = notebooks[id].parentNotebookId;\n if (parentId) {\n notebooks[parentId].subs.push(id);\n }\n }\n}", "createNode() {\n this.createNode();\n }", "function showExampleBrowser() {\n if (exampleBrowserPanel === undefined) {\n const resourceUri = vscode.Uri.file(path.join(_context.extensionPath, \"resources\"));\n exampleBrowserPanel = vscode.window.createWebviewPanel(\"ev3-micropython.examples\", \"Example Projects\", vscode.ViewColumn.One, {\n localResourceRoots: [resourceUri],\n enableCommandUris: true,\n });\n exampleBrowserPanel.onDidDispose(() => {\n exampleBrowserPanel = undefined;\n });\n const styleUri = exampleBrowserPanel.webview.asWebviewUri(resourceUri.with({\n path: path.posix.join(resourceUri.path, \"css\", \"custom.css\"),\n }));\n const openExampleUri = vscode.Uri.parse(`command:ev3-micropython.openExample`);\n function openExampleCommand(name) {\n return openExampleUri.with({\n query: encodeURIComponent(JSON.stringify([name])),\n });\n }\n function imageUrl(name) {\n return exampleBrowserPanel.webview.asWebviewUri(resourceUri.with({\n path: path.posix.join(resourceUri.path, \"images\", \"projects\", name),\n }));\n }\n function openExampleLink(project, displayName) {\n const tooltip = `Click to create a new ${displayName} project`;\n return `\n <div>\n <a href=\"${openExampleCommand(project)}\">\n <span title=\"${tooltip}\">\n <img src=\"${imageUrl(project)}.jpg\" />\n </span>\n </a>\n </div>\n <div class=\"title\">\n <a href=\"${openExampleCommand(project)}\">\n <span title=\"${tooltip}\">${displayName}</span>\n </a>\n </div>\n `;\n }\n exampleBrowserPanel.webview.html = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Example Projects</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"${styleUri}\">\n </head>\n <body>\n <table>\n <tr>\n <td colspan=2>\n <h1 class=\"title\">Basic Examples</h1>\n </td>\n </tr>\n <tr>\n <td>\n ${openExampleLink(\"new_project\", \"New Project\")}\n </td>\n <td>\n ${openExampleLink(\"datalog\", \"Data Logging Project\")}\n </td>\n </tr>\n <tr>\n <td>\n ${openExampleLink(\"buttons_quickstart\", \"Mission Button Menu\")}\n </td>\n <td>\n ${openExampleLink(\"robot_educator_basic\", \"Basic Movement\")}\n </td>\n </tr>\n <tr>\n <td colspan=2>\n <h1 class=\"title\">Using Sensors</h1>\n </td>\n </tr>\n <tr>\n <td>\n ${openExampleLink(\"robot_educator_ultrasonic\", \"Obstacle Avoidance\")}\n </td>\n <td>\n ${openExampleLink(\"robot_educator_line\", \"Line Following\")}\n </td>\n </tr>\n <tr>\n <td colspan=2>\n <h1 class=\"title\">LEGO® MINDSTORMS® Education EV3 Core Set Models</h1>\n </td>\n </tr>\n <tr>\n <td>\n ${openExampleLink(\"color_sorter\", \"Color Sorter\")}\n </td>\n <td>\n ${openExampleLink(\"puppy\", \"Puppy\")}\n </td>\n </tr>\n <tr>\n <td>\n ${openExampleLink(\"gyro_boy\", \"Gyro Boy\")}\n </td>\n <td>\n ${openExampleLink(\"robot_arm\", \"Robot Arm\")}\n </td>\n </tr>\n <tr>\n <td colspan=2>\n <h1 class=\"title\">LEGO® MINDSTORMS® Education EV3 Expansion Set Models</h1>\n </td>\n </tr>\n <tr>\n <td>\n ${openExampleLink(\"elephant\", \"Elephant\")}\n </td>\n <td>\n ${openExampleLink(\"stair_climber\", \"Stair Climber\")}\n </td>\n </tr>\n <tr>\n <td>\n ${openExampleLink(\"tank_bot\", \"Tank Bot\")}\n </td>\n <td>\n ${openExampleLink(\"znap\", \"Znap\")}\n </td>\n </tr>\n </table>\n </body>\n </html>`;\n }\n else {\n exampleBrowserPanel.reveal();\n }\n}", "function createNotes() {\n\tsetClef('treble-clef');\n\t\n\t/* Creates Empty Div Element for Each Possible Note Location */\n\tfor (var i=1; i <= totalDivs; i++) {\n\t\tvar noteDiv = document.createElement('div');\n\t\tnoteDiv.id = String(i);\n\t\tnoteDiv.classList.add('note-item');\n\t\tnoteDiv.onclick = placeNote;\n\t\t\n\t\tvar parentDiv = document.getElementById('notes-div');\n\t\tparentDiv.appendChild(noteDiv);\n\t\t\n\t\tvar rowNum = getRowNumber(i);\n\t\tif (rowNum >= topRow && rowNum <= bottomRow) {\n\t\t\taddStaffLines(i);\n\t\t}\n\t}\n\n\t/* Establish 1st Note Column and Measure */\n\tlastEmptyCol = 1;\n\tmeasureNum = 1;\n}", "function createIntroWindow() {\n pageCollection.showHelp();\n}", "createContainer(){\n new comp.section({className:\"new--news\"},\n new comp.btn(\"New Article\"),\n ).render(\".container--inner\")\n new comp.section({className: \"news--title\"},\n new comp.title(\"h1\",\"News Articles\")).render(\".container--inner\")\n new comp.section({className: \"display--news\"}).render(\".container--inner\")\n\n }", "function IntObject_CreateHTML()\n{\n\t//ping as this will take time\n\tMain_Ping();\n\t//update our interface look\n\tthis.UpdateInterfaceLook();\n\t//result\n\tvar html = null;\n\t//destroy current state (if any)\n\tthis.CurrentState = {};\n\t//check for legend\n\tvar legendData = GroupBox_GetLegendData(this);\n\t//are we legend data?\n\tif (legendData && !legendData.IsIgnore)\n\t{\n\t\t//create via groupBox legend\n\t\thtml = GroupBox_CreateHTMLLegend(this);\n\t}\n\telse\n\t{\n\t\t//switch according to our class\n\t\tswitch (this.DataObject.Class)\n\t\t{\n\t\t\tcase __NEMESIS_CLASS_FORM:\n\t\t\tcase __NEMESIS_CLASS_MDIFORM:\n\t\t\t\t//create via form\n\t\t\t\thtml = Form_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_EDIT:\n\t\t\t\t//create via edit\n\t\t\t\thtml = Edit_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_LABEL:\n\t\t\tcase __NEMESIS_CLASS_LINK:\n\t\t\t\t//create via label\n\t\t\t\thtml = Label_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_PUSH_BUTTON:\n\t\t\tcase __NEMESIS_CLASS_IMAGE_BUTTON:\n\t\t\t\t//create via pushbutton\n\t\t\t\thtml = PushButton_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_COMBO_BOX:\n\t\t\t\t//create via combobox\n\t\t\t\thtml = ComboBox_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_FIELDSET:\n\t\t\tcase __NEMESIS_CLASS_GROUP_BOX:\n\t\t\t\t//create via GroupBox\n\t\t\t\thtml = GroupBox_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_RADIO_BUTTON:\n\t\t\t\t//create via RadioButton\n\t\t\t\thtml = RadioButton_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_CHECK_BOX:\n\t\t\t\t//create via CheckBox\n\t\t\t\thtml = CheckBox_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_TAB_CONTROL:\n\t\t\t\t//create via tabs\n\t\t\t\thtml = TabControl_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_TAB_SHEET:\n\t\t\t\t//create via tabs\n\t\t\t\thtml = TabSheet_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_STATUSBAR:\n\t\t\t\t//create via statusbar\n\t\t\t\thtml = StatusBar_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_TOOL_BAR:\n\t\t\t\t//create via toolbar\n\t\t\t\thtml = ToolBar_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_TREE_VIEW:\n\t\t\t\t//create via treeview\n\t\t\t\thtml = TreeView_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_LIST_BOX:\n\t\t\t\t//create via ListBox\n\t\t\t\thtml = ListBox_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_LIST_VIEW:\n\t\t\t\t//create via ListView\n\t\t\t\thtml = ListView_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_TREE_GRID:\n\t\t\t\t//create via TreeGrid\n\t\t\t\thtml = TreeGrid_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_WEB_BROWSER:\n\t\t\t\t//create via Web Browser\n\t\t\t\thtml = WebBrowser_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_POPUP_MENU:\n\t\t\t\t//create via Popup Menu\n\t\t\t\thtml = PopupMenu_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_NAV_BAR:\n\t\t\t\t//create via NavBar\n\t\t\t\thtml = NavBar_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_TRACK_BAR:\n\t\t\t\t//create via TrackBar\n\t\t\t\thtml = TrackBar_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_VIDEO_PLAYER:\n\t\t\t\t//create via Video Player\n\t\t\t\thtml = VideoPlayer_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_ULTRAGRID:\n\t\t\t\t//create via UltraGrid\n\t\t\t\thtml = UltraGrid_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_CLASS_MDIFRAME:\n\t\t\tcase __NEMESIS_CLASS_CFOS:\n\t\t\tcase __NEMESIS_CLASS_UNKNOWN:\n\t\t\tcase __NEMESIS_CLASS_IMAGE:\n\t\t\tdefault:\n\t\t\t\t//create via unknown\n\t\t\t\thtml = Unknown_CreateHTMLObject(this);\n\t\t\t\tbreak;\n\n\t\t\tcase __NEMESIS_CLASS_HOTSPOT:\n\t\t\t\t//oops! report it\n\t\t\t\tCommon_Error(\"IntObject_CreateHTML -> class-> __NEMESIS_CLASS_HOTSPOT\");\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t//return it\n\treturn html;\n}", "function main() {\n addHeadings();\n styleTutorialsAndArticles();\n separateAllTutorials();\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 learnMultiplication()\n{\n //Clear the previous UI\n document.body.innerHTML=\"\";\n //Create the Back button to go to Learning Screen\n multiplication_screen_button=createButton(\"Back\",\"multiplication_screen_button\");\n multiplication_screen_button.onclick=startLearningModule;\n document.body.appendChild(multiplication_screen_button);\n\n //Create the Header using Complex UI in ui.js\n var multiplication_screen_header_section=createComplexDiv(\"\",\"multiplication_screen_div\",\"Learn Multiplication\",\"multiplication_screen_header\",\"images/multiply_icon.png\",\"320px\",\"320px\",\"learning_multiplication_image\",\"This module deals with multiplication which implies to multiply. It is represented by the symbol * and is referred as Multiplication or Multiply. Go through the following examples to get a start what it is all about.\",\"multiplication_screen_paragraph\");\n document.body.appendChild(multiplication_screen_header_section);\n\n //Create the table strucuture from one defined in ui.js\n var multiplication_screen_table=reusableTable(\"\",\"screen_table\",\"multiplication_screen_table\",\"multiplication_screen_tr_head\",\"Symbol\",\"multiplication_screen_th_symbol\",\"Meaning\",\"multiplication_screen_th_meaning\");\n document.body.appendChild(multiplication_screen_table);\n\n //Fetching for later appending\n var table=document.querySelector('.multiplication_screen_table');\n\n //Create and append row one for the table\n multiplication_screen_tr_one=createtr(\"multiplication_screen_tr_one\");\n multiplication_screen_td_one_symbol=createtd(\"\",\"multiplication_screen_td_one_symbol\");\n var cone1=creatediv(\"\",\"count_ball\");\n var cone2=creatediv(\"\",\"count_ball\");\n var cone3=creatediv(\"\",\"count_ball\");\n var multiplysymbol1=creatediv(\"*\",\"symbol\");\n var equalsymbol1=creatediv(\"=\",\"symbol\");\n multiplication_screen_td_one_symbol.appendChild(cone1);\n multiplication_screen_td_one_symbol.appendChild(multiplysymbol1);\n multiplication_screen_td_one_symbol.appendChild(cone2);\n multiplication_screen_td_one_symbol.appendChild(equalsymbol1);\n multiplication_screen_td_one_symbol.appendChild(cone3);\n multiplication_screen_td_one_meaning=createtd(\"One when multiplied with one gives one\",\"multiplication_screen_td_one_meaning\");\n multiplication_screen_tr_one.appendChild(multiplication_screen_td_one_symbol);\n multiplication_screen_tr_one.appendChild(multiplication_screen_td_one_meaning);\n table.appendChild(multiplication_screen_tr_one);\n\n\n //Create and append row two for the table\n multiplication_screen_tr_two=createtr(\"multiplication_screen_tr_two\");\n multiplication_screen_td_two_symbol=createtd(\"\",\"multiplication_screen_td_two_symbol\");\n var ctwo1=creatediv(\"\",\"count_ball\");\n var ctwo2=creatediv(\"\",\"count_ball\");\n var ctwo3=creatediv(\"\",\"count_ball\");\n var ctwo4=creatediv(\"\",\"count_ball\");\n var ctwo5=creatediv(\"\",\"count_ball\");\n var ctwo6=creatediv(\"\",\"count_ball\");\n var ctwo7=creatediv(\"\",\"count_ball\");\n var ctwo8=creatediv(\"\",\"count_ball\");\n var multiplysymbol2=creatediv(\"*\",\"symbol\");\n var equalsymbol2=creatediv(\"=\",\"symbol\");\n multiplication_screen_td_two_symbol.appendChild(ctwo1);\n multiplication_screen_td_two_symbol.appendChild(ctwo2);\n multiplication_screen_td_two_symbol.appendChild(multiplysymbol2);\n multiplication_screen_td_two_symbol.appendChild(ctwo3);\n multiplication_screen_td_two_symbol.appendChild(ctwo4);\n multiplication_screen_td_two_symbol.appendChild(equalsymbol2);\n multiplication_screen_td_two_symbol.appendChild(ctwo5);\n multiplication_screen_td_two_symbol.appendChild(ctwo6);\n multiplication_screen_td_two_symbol.appendChild(ctwo7);\n multiplication_screen_td_two_symbol.appendChild(ctwo8);\n multiplication_screen_td_two_meaning=createtd(\"Multiplying two by two gives four\",\"multiplication_screen_td_two_meaning\");\n multiplication_screen_tr_two.appendChild(multiplication_screen_td_two_symbol);\n multiplication_screen_tr_two.appendChild(multiplication_screen_td_two_meaning);\n table.appendChild(multiplication_screen_tr_two);\n\n //Create the concluding paragraph\n multiplication_screen_paragraph1=createParagraph(\"Thus generally, multiplying anhy number by one gives the same number and on general terms if we are to multiply a by b then the result will be equal to what we get if we add a b times\",\"multiplication_screen_paragraph1\");\n document.body.appendChild(multiplication_screen_paragraph1);\n}", "function prepareJavaTab(){\n bindRangeSlider()\n populateMemoryStatus()\n}", "function createJupyterKernelWithoutSerialization() {\n var relativePath = path.join('node_modules', '@jupyterlab', 'services', 'lib', 'kernel', 'default.js');\n var filePath = path.join(constants.ExtensionRootDir, relativePath);\n if (!fs.existsSync(filePath)) {\n throw new Error(\n \"Jupyter lab default kernel not found '\" + filePath + \"' (Jupyter Extension post install script)\"\n );\n }\n var fileContents = fs.readFileSync(filePath, { encoding: 'utf8' });\n var replacedContents = fileContents.replace(\n /^const serialize =.*$/gm,\n 'const serialize = { serialize: (a) => a, deserialize: (a) => a };'\n );\n if (replacedContents === fileContents) {\n throw new Error('Jupyter lab default kernel cannot be made non serializing');\n }\n var destPath = path.join(path.dirname(filePath), 'nonSerializingKernel.js');\n fs.writeFileSync(destPath, replacedContents);\n console.log(colors.green(destPath + ' file generated (by Jupyter VSC)'));\n}", "function hCreate(storage){\r\n}", "function mkdfOnWindowLoad() {\n\n }", "function _handle_notebook_loading(password, notebook_login_url, notebook_access_url){\n if ( ie_password_auth ) {\n // Make an AJAX POST\n $.ajax({\n type: \"POST\",\n // to the Login URL\n url: notebook_login_url,\n // With our password\n data: {\n 'password': password\n },\n xhrFields: {\n withCredentials: true\n },\n // If that is successful, load the notebook\n success: function(){\n append_notebook(notebook_access_url);\n },\n error: function(jqxhr, status, error){\n if(ie_password_auth){\n // Failure happens due to CORS\n message_failed_auth(password);\n append_notebook(notebook_access_url);\n }else{\n message_failed_connection();\n // Do we want to try and load the notebook anyway? Just in case?\n append_notebook(notebook_access_url);\n }\n }\n });\n }\n else {\n // Not using password auth, just embed it to avoid content-origin issues.\n message_no_auth();\n append_notebook(notebook_access_url);\n }\n}" ]
[ "0.74541605", "0.6817608", "0.6796423", "0.6675822", "0.633511", "0.62706137", "0.6207379", "0.6046958", "0.5970958", "0.5946117", "0.5934344", "0.5774889", "0.5720692", "0.5705702", "0.5653792", "0.5653258", "0.5642841", "0.55845636", "0.5442661", "0.5429757", "0.53689176", "0.53679067", "0.5365571", "0.5332563", "0.5297081", "0.52943045", "0.52712584", "0.52704006", "0.526294", "0.5248541", "0.5242589", "0.5225665", "0.52002466", "0.5162743", "0.51601815", "0.5147923", "0.51239514", "0.5118526", "0.5117895", "0.5115222", "0.51148045", "0.5098342", "0.5091762", "0.50863695", "0.508272", "0.50595236", "0.5057222", "0.50560534", "0.5048231", "0.5024904", "0.50236994", "0.50206804", "0.50114447", "0.49986756", "0.49972412", "0.49810576", "0.49712968", "0.49590132", "0.49509853", "0.49239722", "0.4913146", "0.49097615", "0.49095538", "0.49020615", "0.48985636", "0.48893598", "0.48879352", "0.48791283", "0.48710957", "0.48575526", "0.48532364", "0.4835368", "0.4831516", "0.48186195", "0.4812085", "0.4809842", "0.48097104", "0.48078385", "0.4804225", "0.48028177", "0.4795222", "0.47923547", "0.47922996", "0.47869742", "0.47861582", "0.47839674", "0.4781923", "0.478173", "0.47777048", "0.47758573", "0.47739947", "0.47672227", "0.47668588", "0.4766064", "0.47586852", "0.47575814", "0.47560295", "0.47529924", "0.47421682", "0.47414377", "0.47355637" ]
0.0
-1
function to take all current Notebooks and save to local storage
function saveNoteBooksToLocalStorage() { if (existingNoteBooks.length > 1) { let arrayToHoldAllCurrentNotebooks = []; existingNoteBooks.forEach((element) => { if (element.titleOfObject != "Dashboard") { arrayToHoldAllCurrentNotebooks.push(element.titleOfObject); } }); //need to clear array after used or check before if there allredy is a existing name arrayToHoldAllCurrentNotebooks.toString(); // turns the notes ti string localStorage.setItem("books", arrayToHoldAllCurrentNotebooks); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNoteBooksFromLocalStorage() {\n if (localStorage.getItem(\"lastVisitedNoteBook\" != null)) {\n openNotebook = localStorage.getItem(\"lastVisitedNoteBook\");\n }\n if (getLocalStorageListsToArray(\"books\") != null) {\n getLocalStorageListsToArray(\"books\").forEach((element) => {\n createNoteBook(element);\n });\n }\n}", "GETNOTEBOOKS (state, notebooks) {\n state.notebooks = notebooks\n }", "function saveNotebook(notebookFileName) {\n\tif (!desktop) {\n\t var notebookFullPath = $('#' + notebookFileName).data('fullpath');\n\t writeFile(notebookFullPath, $('#txtCache-' + notebookFileName).text(), function(){});\t\t\n\t}\n }", "function saveData() {\n localStorage.setItem('allBooks', JSON.stringify(librayLogModal.books));\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 savealltolocalstorage() {\n console.log(\"Step 3\");\n localStorage.setItem(\"allthings\", JSON.stringify(allthings));\n}", "static displayBooks (){\n \n const books = Store.getBooks();\n\n //loop through the array to add the books into the local storage\n books.forEach((book) => UI.addBookToList(book));\n }", "function makeNotesFromLocalStorage() {\n \n let noteBookBelongingToNote = \"\";\n let noteOrListType = \"\";\n let dateOfCreatedNote = \"\";\n let noteTosave = [];\n const endOfSavedNoteSymbol = \"//\";\n\n openNotebook = localStorage.getItem(\"lastVisitedNoteBook\");\n\n if (getLocalStorageListsToArray(\"notes\") != null) {\n getLocalStorageListsToArray(\"notes\").forEach((element) => {\n // creates notes\n\n if (element == endOfSavedNoteSymbol && noteTosave[0] == 1) {\n noteOrListType = noteTosave[0];\n noteBookBelongingToNote = noteTosave[1];\n dateOfCreatedNote = noteTosave[2];\n\n let noteTextarea = noteTosave[3];\n let temporaryHolderOfNoteObj = new Note(noteOrListType);\n\n temporaryHolderOfNoteObj.addingFromLocalStorage(\n dateOfCreatedNote,\n noteBookBelongingToNote,\n noteTextarea\n );\n allNotes.push(temporaryHolderOfNoteObj);\n noteTosave = [];\n }\n\n if (element == endOfSavedNoteSymbol && noteTosave[0] == 2) {\n // creates note lists\n\n noteOrListType = noteTosave[0];\n noteBookBelongingToNote = noteTosave[1];\n dateOfCreatedNote = noteTosave[2];\n\n let temporaryHolderOfListObj = new Note(noteOrListType);\n temporaryHolderOfListObj.addingFromLocalStorage(\n dateOfCreatedNote,\n noteBookBelongingToNote,\n \"\"\n );\n for (let index = 4; index < noteTosave.length; index++) {\n temporaryHolderOfListObj.setNewLi(noteTosave[index]);\n }\n\n allNotes.push(temporaryHolderOfListObj); //when fixed sent the rest of array into notes\n noteTosave = [];\n }\n\n if (element != \"//\") {\n noteTosave.push(element);\n }\n });\n }\n}", "function saveStorage() {\n store.set(planner.list.modules, modules.toJSON());\n }", "function loadNotebooks(){\r\n notebooks = getNotebooks();\r\n $('.sidebar-menu-list.sidebar-sub-menu').html(\"\");\r\n $.each(notebooks, function(id, notebook) {\r\n $('.sidebar-menu-list.sidebar-sub-menu').prepend(`<li><a href=\"#\" data-id=\"${id}\">${notebook.title}</a></li>`);\r\n });\r\n }", "function restoreNotes() {\n //check if noteList array is empty \n let checkNoteList = localStorage.getItem(\"noteList\");\n if (checkNoteList == null) {\n localStorage.setItem(\"noteList\", JSON.stringify([]));\n }\n // load existing notes from local storage to array\n noteList = JSON.parse(localStorage.getItem(\"noteList\"));\n\n for (let i = 0; i < noteList.length; i++) {\n createNote(noteList[i], i)\n }\n}", "function refreshStorageListing() {\n ExportSave();\n var keys = getLocalStorageKeys();\n var blobPairs = [];\n for (var index = 0; index < keys.length; ++index) {\n blobPairs[index] = [keys[index], JSON.stringify(findValue(keys[index]))];\n }\n\n var file = base64(generateMultiBlob(blobPairs));\n ref.set(file)\n console.log(\"exported\")\n\n //\"data:application/octet-stream;base64,\" +\n //push save data to aws //////////////////////////////////////////////////////////////////////////////////////////////////\n //this.download = \"gameboy_advance_saves_\" + ((new Date()).getTime()) + \".export\";\n\n}", "function checkAllNotebooks(){\n\tvar notebookList = g_notebookList;\n\n\tfor(var i = 0; i < notebookList.length; i++){\n\t\tvar name = notebookList[i];\n readNotebook(name, {}, function(err, notebook) {\n if(err) throw err;\n\t\t\t if(!checkAccessDatabase(notebook)){\n console.log(\"shitt access database for notebook: \"+notebook.name);\n\t\t\t }\n\t\t});\n\n\t\tconsole.log(\"Done checking notebooks.\");\n\t}\n}", "function saveNotes() {\n var contents = [];\n $(\".note\").each(function() {\n contents.push($(this).find(\"textarea\").val());\n });\n\n localStorage.setItem(\"notes\", JSON.stringify(contents));\n}", "saveTodosToLS( ) {\n\n localStorage.setItem( 'todo', JSON.stringify( this.todos ) );\n }", "function save() {\n localStorage.counter = counter;\n localStorage.whichSide = whichSide;\n localStorage.previousFirst = previousFirst;\n localStorage.previousSecond = previousSecond;\n localStorage.previousThird = previousThird;\n var saveImages = [];\n for (var i = 0; i < imgNames.length; i++) { // stringifies/pushes objects and adds a carrot for easy splitting\n if (i === (imgArray.length - 1)) {\n saveImages.push(JSON.stringify(imgArray[i]));\n break;\n }\n saveImages.push(JSON.stringify(imgArray[i]) + '^');\n }\n localStorage.imageArray = saveImages;\n}", "function appendLocalStorage() {\n if (!JSON.parse(localStorage.getItem(\"myLibrary\"))) return;\n const localData = JSON.parse(localStorage.getItem(\"myLibrary\"));\n for (const data of localData) {\n myLibrary.push(new Book(data.title, data.author, data.pages, data.read));\n appendToHTML();\n updateDataBook();\n }\n}", "function saveNotes() {\n // Grab the current HTML of the notepad\n let currentNotesHTML = $('#notepad').html();\n // Store the HTML in an object\n let notesData = {\n html: currentNotesHTML\n }\n // Save it to localStorage\n localStorage.setItem('notes', JSON.stringify(notesData));\n}", "_getLocalStorage() {\n // JSON.parse will take a string and parse it back to an object\n const data = JSON.parse(localStorage.getItem(\"workouts\"));\n\n if (!data) return; // guard clause\n\n // Add the data back into the workouts array\n this.#workouts = data;\n\n // Render the workouts back into the side bar\n this.#workouts.forEach(work => {\n this._renderWorkout(work);\n });\n }", "function checkLocalStorage() {\n if (localStorage.length > 0) {\n let arr = localStorage.getItem('savedLibrary');\n let retrievedLibrary = JSON.parse(arr);\n for (let i = 0; i < retrievedLibrary.length; i++) {\n let newBookObject = new Book(retrievedLibrary[i].title, retrievedLibrary[i].author, retrievedLibrary[i].numOfPages, retrievedLibrary[i].readStatus);\n addBookToLibrary(newBookObject);\n } return displayBook(myLibrary);\n }\n}", "save() {\n try {\n window.localStorage.setItem( APPCONFIG.LS, JSON.stringify( appState.state.cursor().toJSON() ) )\n } catch ( err ) {\n console.error( 'Error saving to local storage' )\n console.error( err )\n return\n }\n\n console.log( 'saved' )\n }", "function syncStorage () {\n // Save all data except the first two default and recent tabs\n $localStorage.tabs = STORAGE.slice(2);\n }", "function getLocalStorage(){\n let toLibrary = JSON.parse(localStorage.getItem('myLibrary'));\n if(toLibrary===undefined) return;\n toLibrary.forEach((object)=>{\n // book.prototype=toggleRead;\n let bookObject = new Book(object.title,object.author,object.pages,object.read);\n myLibrary.push(bookObject)\n })\n}", "function saveRecents() {\n // // saves entire Object to local storage\n localStorage.setItem('Recent Cities', JSON.stringify(recentSearches));\n }", "function saveAllAnswerDataToLocalStorage() {\n localStorage.setItem(\"listOfItemQA\", JSON.stringify(currentData.listOfItemQA));\n}", "backup_to_local_storage(){\n window.localStorage.setItem('vue-mini-shop', JSON.stringify(this.get_all()))\n }", "function saveNotesToLocalStorage() {\n let holdsLocalStorageNotes = [];\n allNotes.forEach((element) => {\n element.getNoteText();\n\n let temporaryVarForTextContent = \"\";\n if (element.getNoteText() != \"\") {\n temporaryVarForTextContent = element.getNoteText();\n }\n\n let liFromObjArray = element.getNoteLi();\n\n holdsLocalStorageNotes.push(\n element.noteType,\n element.titleOfNoteBook,\n element.date,\n temporaryVarForTextContent\n ); //fix here\n\n if (element.noteType == 2) {\n liFromObjArray.forEach((element) => {\n holdsLocalStorageNotes.push(element);\n });\n }\n\n holdsLocalStorageNotes.push(\"//\");\n });\n\n toString(holdsLocalStorageNotes);\n\n localStorage.setItem(\"notes\", holdsLocalStorageNotes);\n\n // maby add a call in remove notes to jsut to keep in current\n}", "function retrieveSavedItems() {\r\n\r\n bh = [\"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\"]\r\n\r\n for (bhindex = 0; bhindex < 9; bhindex++) {\r\n\r\n $(\"#\" + bh[bhindex] + \" .text-input\").val(localStorage.getItem(bh[bhindex]));\r\n\r\n }\r\n}", "function saveCurrentState() {\r\n console.log(document.getElementById('output').innerHTML);\r\n localStorage.setItem('currentState_BookID=' + bookID, document.getElementById('output').innerHTML);\r\n }", "restoreSavedBooks() {\n const savedBooks = localStorage.getItem(storageKey);\n savedBooks && this.setBooks(JSON.parse(savedBooks));\n }", "function save() {\r\n let arrayNotes = document.getElementsByClassName(\"noteArea\");\r\n let titles = document.getElementsByClassName(\"title\");\r\n let contents = document.getElementsByClassName(\"content\");\r\n let newArray = [];\r\n for (let i = 0; i < arrayNotes.length; i++) {\r\n let obj = {};\r\n obj[\"title\"] = titles[i].value;\r\n obj[\"content\"] = contents[i].value;\r\n newArray.push(obj);\r\n }\r\n localStorage.setItem(\"notes\", JSON.stringify(newArray));\r\n}", "_getLocalStorage() {\n let data = [];\n for (let i = 0; i < localStorage.length + 10; i++)\n data.push(JSON.parse(localStorage.getItem(i)));\n\n // if (!data) return; // [] = truthy\n if (data.length === 0) return;\n let workout;\n\n // remove any deleted single workouts\n data = data.filter(item => item);\n // console.log(data);\n\n data.forEach(d => {\n d.restore = true;\n if (d.type === 'running')\n // prettier-ignore\n workout = new Running(d.coords, d.distance, d.duration, d.cadence, d.restore, d.date);\n if (d.type === 'cycling')\n // prettier-ignore\n workout = new Cycling(d.coords, d.distance, d.duration, d.elevationGain, d.restore, d.date);\n this.#workouts.push(workout);\n });\n\n this.#workouts.forEach(work => this._renderWorkout(work));\n }", "function saveLocalStore(){\n for(i = 0; i < generalInfo.length; i++){\n var displayNow = ($(\"#inputEvent\"+generalInfo[i].display).val());\n var notesNow = generalInfo[i].notes;\n generalInfo[i].notes = displayNow;\n console.log(\"grabo vacio\");\n\n }\n localStorage.setItem(\"generalInfo\", JSON.stringify(generalInfo));\n }", "function saveTags()\n{\n listOfFiles = [];\n for ([key, value] of filesToDisplays)\n {\n listOfFiles.push(key);\n }\n saveFile(listOfFiles);\n}", "function getStorage() {\n //send previous cities array to local storage\n localStorage.setItem(\"history\", JSON.stringify(previousCities));\n}", "function saveBopsAndHops() {\n localStorage.setItem(\"currentAlcohol\", JSON.stringify(alcohol));\n localStorage.setItem(\"currentArtist\", JSON.stringify(artist));\n}", "function saveKittens() {\n window.localStorage.setItem(\"kittens\", JSON.stringify(kittens))\n window.localStorage.setItem(\"kittenNameTracker\", JSON.stringify(kittenNameTracker))\n}", "function addNewNotebook()\n{\n var ui = DocumentApp.getUi();\n ui.alert(\"To create a notebook, we're going to need the following settings:\\n\" +\n \" + short title \\n\" +\n \" + long title (Optional. Default is to copy the short title's value over) \\n\" +\n \" + pick the directory to create your notebook in. (not implemented, just creates in root rn.)\\n\" +\n \" + pick a cover image (upload, select existing image, or leave it blank) \\n\");\n \n var shortName = ui.prompt(\"Enter short name of your notebook\", ui.ButtonSet.OK);\n var longName = ui.prompt(\"Enter long name of your notebook (Optional)\", ui.ButtonSet.OK_CANCEL);\n //pick a directory one day?\n //pick an image one day .. too complicated now and I'm too lazy.\n \n var newBook = new Notebook(longName, shortName, longName, DriveApp.getRootFolder().getId(), \"\", \"\", \"\");\n \n newBook = makeNewNotebookTree(newBook);\n newBook = makeNewMasterNotebook(newBook,0,0);\n //save for later\n var props = PropertiesService.getUserProperties();\n props.setProperty(newBook.iD, JSON.stringify(newBook)); \n props.setProperty(\"CurrentNotebook\", newBook.iD);\n //TODO need to store notebooks in a list of notebooks\n //TODO make a function to add a notebook to the list\n //\n}", "saveCopy(){\n\t\tthis.savableCopy = FileManager.jsonWriter(this.state.toShowText);\n\t}", "function retrieveButtons() {\n if (localStorage !== null) {\n for (var i = 0; i < localStorage.length; i++) {\n var storedButton = localStorage.getItem(i);\n createButton(storedButton);\n }\n }\n}", "function saveData() {\n try {\n var s_suite = getSelectedSuite();\n var s_case = getSelectedCase();\n var data = {\n data: storeAllTestSuites()\n };\n browser.storage.local.set(data);\n if (s_suite) {\n setSelectedSuite(s_suite.id);\n }\n if (s_case) {\n setSelectedCase(s_case.id);\n }\n } catch (e) {\n console.log(e);\n }\n backupData();\n}", "function saveTasks() {\n //local storage is global variable\n localStorage.setItem(tasksKey, angular.toJson($scope.tasks));\n>>>>>>> 8618b52f1f130b0f8450375e3847289e36947cea\n }", "function crearNotebooks() {\n const URLNOTEBOOKS =\n \"https://script.googleusercontent.com/macros/echo?user_content_key=rDsO-CaTV1_vX_rZjO7CYJbZESUjR1bRTd2tBfGxE5KohKdQgZMCdKQ6FhY-L5amd56inpxgFHDtMNJ1jyVDMfiDhnCmXQPfm5_BxDlH2jW0nuo2oDemN9CCS2h10ox_1xSncGQajx_ryfhECjZEnCycj8xmTXq3Gi006_lgmVqe8hZGA_eBpjkQbv32Iy6K1M8KCOPjGeOYlqCriqpTy-IqWsDnSrEd&lib=MxrntC6n6AN1KohuiyhTz7BKSiheyHQNG\";\n\n $.get(URLNOTEBOOKS, (respuesta, estado) => {\n if (estado === \"success\") {\n let listado = respuesta;\n\n for (let notebook of listado) {\n listaNotebooks.push(\n new Notebook(\n notebook.id,\n notebook.marca,\n notebook.modelo,\n notebook.precio,\n notebook.procesador,\n notebook.pulgadas,\n notebook.ram,\n notebook.rom,\n notebook.video,\n notebook.img\n )\n );\n }\n }\n\n // para que una vez termine de obtener los datos de la pagina se ejecute la function e imprima en pantalla\n renderizarLista(listaNotebooks, \"Todas\");\n });\n\n return listaNotebooks;\n}", "function updateLocal(){\n\n let myBooks = [];\n for (let i = 0; i < userLibrary.length; ++i){\n myBooks[i] = userLibrary[i];\n }\n localStorage[\"myBooks\"] = JSON.stringify(myBooks);\n userLibrary = JSON.parse(localStorage[\"myBooks\"]);\n\n}", "_setLocalStorage() {\n // Setting all the workouts to local storage\n localStorage.setItem('workouts', JSON.stringify(this.#workouts));\n }", "function storageGithub(){\n var github = new Github({\n token: \"OAUTH_TOKEN\",\n auth: \"oauth\"\n });\n var repo = github.getRepo('tansaku','faqbot');\n repo.read('master', 'initial_kb.json', function(err, data) {});\n repo = repo + \"new data\";\n repo.write('master', 'initial_kb.json', repo, 'new data', function(err) {});\n}", "function setLocalLibrary() {\n localStorage.setItem('books', JSON.stringify(myLibrary));\n}", "saveAll() {\n let all = {\n nextColor: this.managers.colorAssigner.getState(),\n lastZ: this.managers.zAssigner.getState(),\n infoNotePosition: this.infoNote.getPosition(),\n notes: this.notes.map(n => n.getState())\n };\n\n const mainText = JSON.stringify(all);\n const hash = this.hashCode(mainText);\n const lead = 'NOTESAPP1.0-';\n\n return lead + hash + mainText;\n }", "function saveToDos() {\n localStorage.setItem(TODO_LS, JSON.stringify(toDos));\n }", "function store() {\n var outers = document.querySelectorAll(\".sidebar-outer\");\n var list = []\n for (var i=0; i < outers.length; i++) {\n if (outers[i].classList.contains(\"collapsed\")) {\n list.push(0);\n } else {\n list.push(1);\n };\n };\n if (window.location.href.indexOf(\"https://union.ic.ac.uk/rcc/caving/slovenia/\") > -1) {\n window.localStorage.setItem(\"slovenia-sidebar\", list);\n } else {\n window.localStorage.setItem(\"sidebar\", list);\n }\n}", "addBooksToLs(books) {\n let book;\n if (localStorage.getItem('books') === null) {\n book = [];\n } else {\n book = JSON.parse(localStorage.getItem('books'));\n }\n\n book.push(books);\n\n localStorage.setItem('books', JSON.stringify(book));\n }", "function storeLocalStorage() {\n const todosEl = document.querySelectorAll(\"li\");\n\n const todos = [];\n\n todosEl.forEach((todoEl) => {\n todos.push({\n text: todoEl.innerHTML,\n completed: todoEl.classList.contains(\"completed\"),\n });\n });\n\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n}", "function SaveCollection()\n{\n\tvar tabs = tabsToSave.filter(i => i.url != chrome.runtime.getURL(\"TabsAside.html\") && !i.pinned && !i.url.includes(\"//newtab\") && !i.url.includes(\"about:blank\") && !i.url.includes(\"about:home\"));\n\n\tif (tabs.length < 1)\n\t{\n\t\talert(chrome.i18n.getMessage(\"noTabsToSave\"));\n\t\treturn;\n\t}\n\n\tvar collection =\n\t{\n\t\ttimestamp: Date.now(),\n\t\ttabsCount: tabs.length,\n\t\ttitles: tabs.map(tab => tab.title ?? \"\"),\n\t\tlinks: tabs.map(tab => tab.url ?? \"\"),\n\t\ticons: tabs.map(tab => tab.favIconUrl ?? \"\"),\n\t\tthumbnails: tabs.map(tab => thumbnails.find(i => i.tabId == tab.id)?.url ?? \"\")\n\t};\n\n\tvar rawData;\n\tif (localStorage.getItem(\"sets\") === null)\n\t\trawData = [collection];\n\telse\n\t{\n\t\trawData = JSON.parse(localStorage.getItem(\"sets\"));\n\t\trawData.unshift(collection);\n\t}\n\n\tlocalStorage.setItem(\"sets\", JSON.stringify(rawData));\n\n\tcollections = JSON.parse(localStorage.getItem(\"sets\"));\n\n\tvar newTabId;\n\tchrome.tabs.create({}, (tab) =>\n\t{\n\t\tnewTabId = tab.id;\n\t\tchrome.tabs.remove(tabsToSave.filter(i => !i.pinned && i.id != newTabId).map(tab => tab.id));\n\t});\n\n\tUpdateTheme();\n}", "function populateStorage() {\n const bookOne = ['Budapeste', 'Chico Buarque de Holanda', 174, true];\n const bookTwo = [\n 'Will my cat eat my eyeballs?',\n 'Caitlin Doughty',\n 222,\n true,\n ];\n const bookThree = ['The Time Machine', 'H.G. Wells', 118, true];\n localStorage.setItem('book1', JSON.stringify(bookOne));\n localStorage.setItem('book2', JSON.stringify(bookTwo));\n localStorage.setItem('book3', JSON.stringify(bookThree));\n}", "function saveInstrumentList(Instruments) {\n let data = JSON.stringify(Instruments);\n localStorage.setItem('cachedInstrumentList', data);\n}", "function savedFolder() {\n\t//get the stored array \n\tlet saved = document.getElementById(\"saved\");\n\tlet stored = window.localStorage.getItem(\"item\");\n\tlet list = JSON.parse(stored);\n\t//creating each entry from the JSON array\n\t//css and innerHTML change\n\tfor (i=0; i < list.length; i++) {\n\t let p = document.createElement(\"h4\");\n\t $(p).css({\"color\":\"white\"});\n\t p.innerHTML = `${list[i].name} <a href=\"${list[i].url}\" target=\"_blank\">${list[i].url}</a>`; //open in new tab\n\t saved.append(p);\n\t}\n }", "function saveKittens() {\r\n\r\n\r\n //save kittens to local storage\r\n window.localStorage.setItem(\"kittens\", JSON.stringify(kittens));\r\n\r\n}", "function saveBookToLocal() {\n const key = bookTitle.value.toLowerCase();\n localStorage.setItem(key, JSON.stringify(myLabrary));\n location.reload();\n \n}", "async saveAll() {\r\n // Make sure we are able to save\r\n await this.canSave();\r\n // Make a copy of the dirty settings since items will be removed by saving\r\n const copy = [...this.dirtySettings];\r\n if (copy.length > 0)\r\n console.log(\"saved:\", copy.map(sf => sf[\"path\"]));\r\n // Save the settings\r\n copy.forEach(settingsFile => settingsFile.save());\r\n }", "function saveNotes() {\n localStorage.setItem(\"notes\", JSON.stringify(notes));\n localStorage.setItem(\"notesLength\", c);\n}", "function loadSaveData() {\n // Grab the local storage data\n var storedSearchData = JSON.parse(localStorage.getItem(\"weatherHistoryData\"));\n // Check if stored data is empty or non-existent\n if (!storedSearchData || storedSearchData.length == 0) {\n return;\n }\n else {\n // Remove the invis class from the main wrapper if there is saved data\n $(mainWrapper).removeClass(\"invis\");\n // Overwrite array based on localstorage\n storedSearchData.forEach((item) => {\n searchHistoryArray = [...storedSearchData];\n });\n for (i = 0; i < searchHistoryArray.length; i++) {\n $(historyPanel).append('<article class=\"searchHistory bordered centered\">' + searchHistoryArray[i] + '</article>');\n }\n // Search city based on last search but don't update the array\n searchCityWeather(searchHistoryArray[0], false);\n }\n }", "function saveAll() {\n hourRows.forEach(element => {\n let currentTask = $(\"#\" + element).val();\n localStorage.setItem(element, currentTask);\n });\n }", "store() {\n\t\tlet storeData = this.data.map(wfItem => wfItem.storeVersion());\n\t\tlocalStorage.setItem('data', JSON.stringify(storeData));\n\t}", "function save() {\n localStorage.productData = JSON.stringify(Product.allProducts);\n localStorage.totalCounter = totalCounter;\n}", "static addBookToStorage(whatToAdd) {\n \n //initialise new variable for storage data\n let newStoredBooks;\n\n //set variale values based on data gotten from ls\n if (storage.getStorageData() === null) {\n newStoredBooks = [];\n } else {\n newStoredBooks = storage.getStorageData();\n };\n\n newStoredBooks.push(whatToAdd);\n \n localStorage.setItem('storedBooks', JSON.stringify(newStoredBooks))\n\n }", "save () {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(this.allMyTrips))\n }", "save(){\n var tasks = []; \n this.list.forEach(function(item){\n var task = {}\n task.text = item.text;\n task.priority = item.priority;\n task.duedate = item.duedate;\n task.tag = item.tag;\n task.done = item.done;\n tasks.push(task);\n });\n var stringArray = JSON.stringify(tasks);\n localStorage.setItem(this.key, stringArray);\n }", "function downloadData() {\n regions.forEach((region) => {\n fetch(`${weatherApi.url}current.json?key=${weatherApi.key}&q=${region}`)\n .then((res) => res.json())\n .then((result) => {\n let io = result.current;\n localStorage.setItem(region, JSON.stringify(io));\n });\n });\n}", "static getStorageData() {\n let storedBooks = JSON.parse(localStorage.getItem('storedBooks'));\n return storedBooks;\n }", "function saveKittens() {\r\n window.localStorage.setItem(\"kittens\", JSON.stringify(kittens))\r\n window.localStorage.setItem(\"Names\", JSON.stringify(namesArray))\r\n drawKittens()\r\n}", "function save() {\n localStorage.setItem('list', JSON.stringify(list));\n}", "function _saveBook() {\n window.localStorage[\"book\"] = JSON.stringify(_data, function (key, val) {\n if (key == '$$hashKey') {\n return undefined;\n }\n return val\n });\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}", "function saveWindow(){\n var folder = document.getElementById(\"curr-folder-name\").innerHTML\n\n chrome.windows.getCurrent({populate:true},function(window){\n //collect all of the urls here\n window.tabs.forEach(function(tab){\n\n var myURL = {\n url: tab.url,\n title: tab.title\n };\n\n // make sure you're not adding repeats\n if (!myTabDict[folder].urlSet.includes(myURL.url)){\n addTabToFolder(myURL, folder)\n saveData();\n updateURLS(folder); // here so that I can see all the tabs without needing exit\n }\n });\n });\n // why can't i see the urls appear? seems more efficient to have it here, but...\n // updateURLS(folder);\n}", "async function saveLocal() {\n await localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "function updateStorage()\r\n{\r\n\tlocalStorage.setItem('todos',JSON.stringify(todo));\r\n\tlocalStorage.setItem('completed',JSON.stringify(completed));\r\n}", "function storeNotes() {\n // Store the note in the localStorage\n localStorage.setItem(\"note\", JSON.stringify(notesArray));\n }", "function saveData() {\n let saveTask = JSON.stringify(listTask)\n window.localStorage.setItem(\"task_management\", saveTask)\n\n updateHtml()\n}", "restoreAll() {\n const all = window.localStorage.getItem('state');\n if (all !== null)\n this.loadAll(all);\n }", "function storeTasks() {\r\n\tlocalStorage.todoContents = listOfTasks.innerHTML;\r\n}", "function saveOngo(){\n localStorage.setItem(LS_ONGOING, JSON.stringify(ONGOING));\n}", "function storeBookmarks(){\n localStorage.setItem('bookmarks', JSON.stringify(bookmarks));\n}", "function saveFin(){\n localStorage.setItem(LS_FINISHED, JSON.stringify(FINISHED));\n}", "function saveTodo() {\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n }", "persist() { \n var investmentsJson = [];\n\n // Serialize everything as a json object\n for(var projectId in this.investments)\n investmentsJson.push(this.investments[projectId].toJson());\n\n // Write to the storage\n localStorage.setItem(this.databaseName, JSON.stringify(investmentsJson));\n }", "function save() {\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(tasks));\n localStorage.setItem(LOCAL_STORAGE_SELECTED_LIST_ID, selectedListId);\n}", "function saveTodos(todos) {\r\nlocalStorage.setItem('todos', JSON.stringify(todos))\r\n\r\n\r\n}", "function saveInLocalStorage(){\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function saveStacks () {\n const stacks = []\n $('.stack-header').each(function () {\n if ($(this).closest('.stack').prop('id') && $(this).closest('.stack').prop('id').substring(0, 6) === stackPrefix) {\n const stackData = {\n StackId: $(this).closest('.stack').prop('id'),\n StackTitle: $(this).text()\n }\n stacks.push(stackData)\n }\n })\n localStorage.setItem('stackList', JSON.stringify(stacks))\n $('#task-stack').empty()\n stacks.forEach(stack => {\n $(new Option(stack.StackTitle, stack.StackId)).appendTo('#task-stack')\n })\n}", "saveAllData(){\n localStorage.setItem(CYCLING_LS, JSON.stringify(this.allUserData))\n localStorage.setItem(CYCLING_TM, JSON.stringify(this.timestampData)) \n }", "function save () {\n\tlocalStorage.setItem(\"list\",JSON.stringify($(\"li\")));\n\t// var muhlist = [];\n\t// $(\"li\").each(function(index,element) {\n\t// \tmuhlist[muhlist.length] = element.textContent;\n\t// \t//console.log(element.textContent);\n\t// });\n\t// localStorage.setItem(\"list\",muhlist.stringify;\n\tconsole.log(localStorage.list);\n}", "saveToFile() {\n // Don't save or load state if useRootDir is true\n if ( this.useRootDir ) {\n return;\n }\n\n fs.writeFileSync( this.saveFile, JSON.stringify( {\n snapshots: this.snapshots.map( snapshot => snapshot.serialize() ),\n pendingSnapshot: this.pendingSnapshot ? this.pendingSnapshot.serializeStub() : null,\n trashSnapshots: this.trashSnapshots.map( snapshot => snapshot.serializeStub() )\n }, null, 2 ), 'utf-8' );\n }", "function downloadXML() {\n //Grab the workspace XML\n for (let i = 0; i < allFiles.length; i++) {\n Code.workspace = allWorkspaces.get(allFiles[i]);\n let codeXML = Blockly.Xml.workspaceToDom(Code.workspace);\n //Prettify the XML\n let saveXML = Blockly.Xml.domToPrettyText(codeXML);\n const codeArray = [];\n codeArray.push(saveXML);\n console.log(Code.workspace);\n console.log(saveXML);\n const codeBlob = new Blob(codeArray, {type: \"text/plain;charset=utf-8\"});\n saveAs(codeBlob, allFiles[i] + \".xml\");\n }\n}", "save() {\n const tasksJson = JSON.stringify(this.tasks);\n localStorage.setItem('tasks', tasksJson);\n const currentId = String(this.currentId);\n localStorage.setItem('currentId', currentId);\n }", "save(state) {\n localStorage.setItem('items', JSON.stringify(state.items));\n\n return state;\n }", "function Save() {\n win.name = JSON.stringify(store);\n }", "function saveStorage() {\n $('textarea').each(function () {\n let val = $(this).val();\n let id = $(this).attr(\"id\");\n localStorage.setItem(id, val);\n });\n }", "function updateLocalStore() {\n localStorage.setItem(\"TAREAS\", JSON.stringify(list));\n}", "function saveActions(){\n localStorage.setItem(\"actions\", JSON.stringify(actions));\n}", "function saveList(allItems) {\n const itemStorageKey = 'todos';\n localStorage.setItem(itemStorageKey, JSON.stringify(allItems));\n}" ]
[ "0.65160733", "0.6239477", "0.62268156", "0.62231404", "0.61653936", "0.6035522", "0.5950513", "0.58848053", "0.58633924", "0.5826095", "0.5789223", "0.57411593", "0.5720446", "0.571777", "0.5661546", "0.5654807", "0.5635773", "0.56218225", "0.562086", "0.5620341", "0.56120515", "0.5605953", "0.5590507", "0.5589518", "0.5588558", "0.5569", "0.5561519", "0.55593264", "0.5557358", "0.5556571", "0.5551813", "0.55348974", "0.553344", "0.5532667", "0.5530206", "0.5523626", "0.5523559", "0.5519391", "0.55161464", "0.55159324", "0.55030507", "0.5495377", "0.5492474", "0.54908997", "0.548866", "0.5484292", "0.5482837", "0.54809994", "0.54743904", "0.5466354", "0.5461836", "0.5450566", "0.54502946", "0.5446208", "0.5436137", "0.543436", "0.54334646", "0.54269433", "0.542636", "0.54223865", "0.5421479", "0.5421421", "0.5420436", "0.54191846", "0.5417048", "0.5416909", "0.5415807", "0.5413927", "0.5413057", "0.5412103", "0.5405093", "0.5405028", "0.5402469", "0.5391736", "0.53909695", "0.53860646", "0.53805095", "0.5374017", "0.5368626", "0.5368192", "0.5366016", "0.53641504", "0.5362472", "0.5361828", "0.536053", "0.5360001", "0.5355546", "0.53498757", "0.5347848", "0.53476596", "0.5345855", "0.5344813", "0.5344677", "0.5342198", "0.53400475", "0.5338133", "0.53378874", "0.5334214", "0.53269464", "0.53180593" ]
0.6657014
0
Creates Notebooks from local storage
function createNoteBooksFromLocalStorage() { if (localStorage.getItem("lastVisitedNoteBook" != null)) { openNotebook = localStorage.getItem("lastVisitedNoteBook"); } if (getLocalStorageListsToArray("books") != null) { getLocalStorageListsToArray("books").forEach((element) => { createNoteBook(element); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNewNotebook()\n{\n var ui = DocumentApp.getUi();\n ui.alert(\"To create a notebook, we're going to need the following settings:\\n\" +\n \" + short title \\n\" +\n \" + long title (Optional. Default is to copy the short title's value over) \\n\" +\n \" + pick the directory to create your notebook in. (not implemented, just creates in root rn.)\\n\" +\n \" + pick a cover image (upload, select existing image, or leave it blank) \\n\");\n \n var shortName = ui.prompt(\"Enter short name of your notebook\", ui.ButtonSet.OK);\n var longName = ui.prompt(\"Enter long name of your notebook (Optional)\", ui.ButtonSet.OK_CANCEL);\n //pick a directory one day?\n //pick an image one day .. too complicated now and I'm too lazy.\n \n var newBook = new Notebook(longName, shortName, longName, DriveApp.getRootFolder().getId(), \"\", \"\", \"\");\n \n newBook = makeNewNotebookTree(newBook);\n newBook = makeNewMasterNotebook(newBook,0,0);\n //save for later\n var props = PropertiesService.getUserProperties();\n props.setProperty(newBook.iD, JSON.stringify(newBook)); \n props.setProperty(\"CurrentNotebook\", newBook.iD);\n //TODO need to store notebooks in a list of notebooks\n //TODO make a function to add a notebook to the list\n //\n}", "function crearNotebooks() {\n const URLNOTEBOOKS =\n \"https://script.googleusercontent.com/macros/echo?user_content_key=rDsO-CaTV1_vX_rZjO7CYJbZESUjR1bRTd2tBfGxE5KohKdQgZMCdKQ6FhY-L5amd56inpxgFHDtMNJ1jyVDMfiDhnCmXQPfm5_BxDlH2jW0nuo2oDemN9CCS2h10ox_1xSncGQajx_ryfhECjZEnCycj8xmTXq3Gi006_lgmVqe8hZGA_eBpjkQbv32Iy6K1M8KCOPjGeOYlqCriqpTy-IqWsDnSrEd&lib=MxrntC6n6AN1KohuiyhTz7BKSiheyHQNG\";\n\n $.get(URLNOTEBOOKS, (respuesta, estado) => {\n if (estado === \"success\") {\n let listado = respuesta;\n\n for (let notebook of listado) {\n listaNotebooks.push(\n new Notebook(\n notebook.id,\n notebook.marca,\n notebook.modelo,\n notebook.precio,\n notebook.procesador,\n notebook.pulgadas,\n notebook.ram,\n notebook.rom,\n notebook.video,\n notebook.img\n )\n );\n }\n }\n\n // para que una vez termine de obtener los datos de la pagina se ejecute la function e imprima en pantalla\n renderizarLista(listaNotebooks, \"Todas\");\n });\n\n return listaNotebooks;\n}", "function createNotebook() {\n\n if (currentUser) {\n\n let sections = [];\n\n let section = {\n id: 0,\n title: 'Section 1',\n blocks: []\n }\n\n console.log(\"preview : \", preview);\n\n for (let element of preview) {\n\n switch (element.nodeName) {\n // So were going to save the section were working on, then create a new one..\n case \"H1\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H2\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H3\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"P\":\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n\n break;\n\n default:\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n }\n }\n sections.push({...section});\n\n // NOTE: This was supposed to be the cool part of the project but due the the way I have my DB\n // set up I couldnt figure out how to create all the sections separately with a loop of async calls.\n // due to time constraints I had to give up on this and only allow users to see the preview.\n\n createNotebookFromTemplate(searchTerm, currentUser._id, sections, dispatch);\n // dispatch({type:\"CREATE_NOTEBOOK\", sections: sections, title: searchTerm});\n // console.log(\"the title should be :\", searchTerm);\n history.push(\"/notebook/edit/id\");\n\n } else {\n // there is no current user.\n alert(\"please log in to create a notebook\");\n }\n }", "function makeNotesFromLocalStorage() {\n \n let noteBookBelongingToNote = \"\";\n let noteOrListType = \"\";\n let dateOfCreatedNote = \"\";\n let noteTosave = [];\n const endOfSavedNoteSymbol = \"//\";\n\n openNotebook = localStorage.getItem(\"lastVisitedNoteBook\");\n\n if (getLocalStorageListsToArray(\"notes\") != null) {\n getLocalStorageListsToArray(\"notes\").forEach((element) => {\n // creates notes\n\n if (element == endOfSavedNoteSymbol && noteTosave[0] == 1) {\n noteOrListType = noteTosave[0];\n noteBookBelongingToNote = noteTosave[1];\n dateOfCreatedNote = noteTosave[2];\n\n let noteTextarea = noteTosave[3];\n let temporaryHolderOfNoteObj = new Note(noteOrListType);\n\n temporaryHolderOfNoteObj.addingFromLocalStorage(\n dateOfCreatedNote,\n noteBookBelongingToNote,\n noteTextarea\n );\n allNotes.push(temporaryHolderOfNoteObj);\n noteTosave = [];\n }\n\n if (element == endOfSavedNoteSymbol && noteTosave[0] == 2) {\n // creates note lists\n\n noteOrListType = noteTosave[0];\n noteBookBelongingToNote = noteTosave[1];\n dateOfCreatedNote = noteTosave[2];\n\n let temporaryHolderOfListObj = new Note(noteOrListType);\n temporaryHolderOfListObj.addingFromLocalStorage(\n dateOfCreatedNote,\n noteBookBelongingToNote,\n \"\"\n );\n for (let index = 4; index < noteTosave.length; index++) {\n temporaryHolderOfListObj.setNewLi(noteTosave[index]);\n }\n\n allNotes.push(temporaryHolderOfListObj); //when fixed sent the rest of array into notes\n noteTosave = [];\n }\n\n if (element != \"//\") {\n noteTosave.push(element);\n }\n });\n }\n}", "GETNOTEBOOKS (state, notebooks) {\n state.notebooks = notebooks\n }", "function makeNewMasterNotebook(notebook, imageFileID, humanName) {\n //validate\n notebook.shortName = notebook.shortName || \"Notebook\";\n notebook.longName = notebook.longName || notebook.shortName || \"Notebook\";\n //image can be nothing\n humanName = humanName || Session.getActiveUser().getEmail();\n \n var masterFolder = DriveApp.getFolderById(notebook.masterFolderId);\n Logger.log(masterFolder);\n \n var mDoc = DocumentApp.create(notebook.shortName);\n notebook.masterNotebookId = mDoc.getId();\n var docFile = DriveApp.getFileById(notebook.masterNotebookId );\n \n moveFile(docFile, masterFolder, DriveApp.getRootFolder());\n \n var title = mDoc.getBody().appendParagraph(notebook.longName);\n title.setHeading(DocumentApp.ParagraphHeading.TITLE);\n \n var subtitle = mDoc.getBody().appendParagraph(\"by: \" + humanName);\n subtitle.setHeading(DocumentApp.ParagraphHeading.SUBTITLE);\n \n if(imageFileID)\n {\n var blob = DriveApp.getFileById(imageFileID).getBlob();\n mDoc.getBody().appendImage(blob);\n }\n \n return notebook; \n}", "function initNotebook(name, date) {\n\t//Create notebook object\n\tvar notebook = new Notebook(name, date);\n\n\t//Create file for notebook object\n\twriteNotebookToMongo(notebook);\n\n\t//Add to appropriate places\n\taddToNotebookList(name);\n\n\treturn notebook;\n}", "function makeNewNotebookTree(notebook, folderIdToMakeItInID) {\n //validate\n notebook.shortName = notebook.shortName || \"Notebook\";\n folderIdToMakeItInID = folderIdToMakeItInID || DriveApp.getRootFolder().getId();\n \n var inFolder = DriveApp.getFolderById(folderIdToMakeItInID);\n //Create new folder structure\n //root\n // |--<enotebookName\n // |--<eOldentries\n // |--<enotebookName_Master\n \n //if rootfolder exists. set notebook fields *grossly unsafely* and bail\n /*var fldrs = rootFolder.searchFolders(notebook.shortName); //I'm still having issues with search queries\n if(fldrs.hasNext())\n {\n var notebookFolder = fldrs.next();\n var conts = notebookFolders.getFolders();\n \n notebook.oldFolderId = conts.next().getId();\n notebook.masterFolderId = conts.next().getId();\n \n return notebook;\n } */\n \n //otherwise make it on the fly, solidly.\n var notebookFolder = inFolder.createFolder(notebook.shortName);\n var oldFolder = notebookFolder.createFolder(\"Old Entries\");\n var masterFolder = notebookFolder.createFolder(notebook.shortName + \"_Master\");\n \n notebook.rootFolderId = notebookFolder.getId();\n notebook.oldFolderId = oldFolder.getId();\n notebook.masterFolderId = masterFolder.getId();\n \n return notebook;\n}", "createNew(languagePreference, modelDB, isInitialized) {\n const contentFactory = this.contentFactory;\n return new NotebookModel({\n languagePreference,\n contentFactory,\n modelDB,\n isInitialized\n });\n }", "function loadNotebooks(){\r\n notebooks = getNotebooks();\r\n $('.sidebar-menu-list.sidebar-sub-menu').html(\"\");\r\n $.each(notebooks, function(id, notebook) {\r\n $('.sidebar-menu-list.sidebar-sub-menu').prepend(`<li><a href=\"#\" data-id=\"${id}\">${notebook.title}</a></li>`);\r\n });\r\n }", "function storageGithub(){\n var github = new Github({\n token: \"OAUTH_TOKEN\",\n auth: \"oauth\"\n });\n var repo = github.getRepo('tansaku','faqbot');\n repo.read('master', 'initial_kb.json', function(err, data) {});\n repo = repo + \"new data\";\n repo.write('master', 'initial_kb.json', repo, 'new data', function(err) {});\n}", "function saveNotebook(notebookFileName) {\n\tif (!desktop) {\n\t var notebookFullPath = $('#' + notebookFileName).data('fullpath');\n\t writeFile(notebookFullPath, $('#txtCache-' + notebookFileName).text(), function(){});\t\t\n\t}\n }", "function saveNoteBooksToLocalStorage() {\n \n if (existingNoteBooks.length > 1) {\n let arrayToHoldAllCurrentNotebooks = []; \n existingNoteBooks.forEach((element) => {\n if (element.titleOfObject != \"Dashboard\") {\n arrayToHoldAllCurrentNotebooks.push(element.titleOfObject);\n }\n }); //need to clear array after used or check before if there allredy is a existing name\n\n arrayToHoldAllCurrentNotebooks.toString(); // turns the notes ti string\n localStorage.setItem(\"books\", arrayToHoldAllCurrentNotebooks);\n }\n}", "function buildNotebookTree(notebooks) {\n const ids = Object.keys(notebooks);\n for (let id of ids) {\n notebooks[id].subs = [];\n }\n for (let id of ids) {\n const parentId = notebooks[id].parentNotebookId;\n if (parentId) {\n notebooks[parentId].subs.push(id);\n }\n }\n}", "function restoreNotes() {\n //check if noteList array is empty \n let checkNoteList = localStorage.getItem(\"noteList\");\n if (checkNoteList == null) {\n localStorage.setItem(\"noteList\", JSON.stringify([]));\n }\n // load existing notes from local storage to array\n noteList = JSON.parse(localStorage.getItem(\"noteList\"));\n\n for (let i = 0; i < noteList.length; i++) {\n createNote(noteList[i], i)\n }\n}", "function createWorkflow() {\n reinitNodeCache();\n}", "function loadFromLocalStorage() {\n let notes;\n // check LS\n if (localStorage.getItem('notes') === null) {\n notes = [];\n } else {\n notes = JSON.parse(localStorage.getItem('notes'));\n\n //loop though notes and create items\n for (let i = 0; i < notes.length; i++) {\n // set title and subtext to arr\n let note = [];\n let myTitle = notes[i].title;\n let mySubtext = notes[i].subtext;\n let myDate = notes[i].date;\n note.push(myTitle);\n note.push(mySubtext);\n note.push(myDate);\n \n // create note\n createNote(note);\n }\n }\n}", "function GitStorage () {}", "function populateStorage() {\n const bookOne = ['Budapeste', 'Chico Buarque de Holanda', 174, true];\n const bookTwo = [\n 'Will my cat eat my eyeballs?',\n 'Caitlin Doughty',\n 222,\n true,\n ];\n const bookThree = ['The Time Machine', 'H.G. Wells', 118, true];\n localStorage.setItem('book1', JSON.stringify(bookOne));\n localStorage.setItem('book2', JSON.stringify(bookTwo));\n localStorage.setItem('book3', JSON.stringify(bookThree));\n}", "function addToNotebookList(name){\n\tg_notebookList.push(name);\n\tg_notebookList.sort();\n//\twriteFile(getDBFilename(\"notebooks\"),\n//\t\tJSON.stringify(g_notebookList));\n}", "function getTodos(){\n let todos;\n if(localStorage.getItem('todos') === null){\n todos = [];\n }else{\n todos = JSON.parse(localStorage.getItem('todos'))\n }\n todos.forEach(todo=>{\n create(todo);\n });\n\n}", "function checkLocalStorage() {\n if (localStorage.length > 0) {\n let arr = localStorage.getItem('savedLibrary');\n let retrievedLibrary = JSON.parse(arr);\n for (let i = 0; i < retrievedLibrary.length; i++) {\n let newBookObject = new Book(retrievedLibrary[i].title, retrievedLibrary[i].author, retrievedLibrary[i].numOfPages, retrievedLibrary[i].readStatus);\n addBookToLibrary(newBookObject);\n } return displayBook(myLibrary);\n }\n}", "addBooksToLs(books) {\n let book;\n if (localStorage.getItem('books') === null) {\n book = [];\n } else {\n book = JSON.parse(localStorage.getItem('books'));\n }\n\n book.push(books);\n\n localStorage.setItem('books', JSON.stringify(book));\n }", "loadLocal({ commit }) {\n if (!localStorage.getItem(\"todos\")) return;\n\n const localData = JSON.parse(localStorage.getItem(\"todos\"));\n\n commit(\"addMany\", localData);\n }", "function openNotebook(notebookFullPath) {\n\tif (desktop) {\n\t\t$.ajax({\n\t\t type: \"GET\",\n\t\t url: notebookFullPath,\n\t\t dataType: \"xml\",\n\t\t success: function(xmlData) {\n\t\t\tvar $xmlDoc = $(xmlData);\n\t\t\tdisplayNotebook($xmlDoc, xmlData, notebookFullPath);\n\t\t\tvar notebookFileName = getFileName(notebookFullPath, false);\n\t\t\t$('#txtCache-' + notebookFileName).text((new XMLSerializer()).serializeToString(xmlData));\n\t\t }\n\t\t});\t\t\n\t}\n\telse {\n\t\treadFile(notebookFullPath, function(xmlData) {\n\t\t var xmlDoc = $.parseXML(xmlData);\n\t\t var $xmlDoc = $(xmlDoc);\n\t\t displayNotebook($xmlDoc, xmlData, notebookFullPath);\n\t\t});\t\t\n\t}\n }", "function loadNotes() {\n if (localStorage.notes != undefined) {\n var contents = JSON.parse(localStorage.getItem(\"notes\"));\n\n for (var i = 0; i < contents.length; i ++) {\n addNote(contents[i]);\n }\n }\n}", "static displayBooks (){\n \n const books = Store.getBooks();\n\n //loop through the array to add the books into the local storage\n books.forEach((book) => UI.addBookToList(book));\n }", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "getNewWorkBook() {\n return XLSX.utils.book_new();\n }", "function checkAllNotebooks(){\n\tvar notebookList = g_notebookList;\n\n\tfor(var i = 0; i < notebookList.length; i++){\n\t\tvar name = notebookList[i];\n readNotebook(name, {}, function(err, notebook) {\n if(err) throw err;\n\t\t\t if(!checkAccessDatabase(notebook)){\n console.log(\"shitt access database for notebook: \"+notebook.name);\n\t\t\t }\n\t\t});\n\n\t\tconsole.log(\"Done checking notebooks.\");\n\t}\n}", "function createRepo() {\n taskRepo = new Object();\n return taskRepo\n }", "function getTodos(){\n //CHECK DO I ALREADY HAVE THINGS IN THERE? / LOCAL STORAGE\n let todos;\n if(localStorage.getItem(\"todos\") === null){\n todos = [];\n }else {\n todos = JSON.parse(localStorage.getItem(\"todos\"));\n }\n todos.forEach(function(todo){\n //create todo div -- to dynamically need to create...\n const todoDiv = document.createElement(\"div\");\n todoDiv.classList.add(\"todo\");\n\n //create list\n const newTodo = document.createElement('li');\n newTodo.innerText = todo;\n newTodo.classList.add('todo-item');\n //put new todo into div\n todoDiv.appendChild(newTodo);\n \n //check mark button\n const completedButton = document.createElement('button');\n completedButton.innerHTML = '<i class=\"fas fa-check\"></i>';\n completedButton.classList.add(\"complete-btn\");\n todoDiv.appendChild(completedButton);\n\n //check trash button\n const trashButton = document.createElement('button');\n trashButton.innerHTML = '<i class=\"fas fa-trash\"></i>';\n trashButton.classList.add(\"trash-btn\");\n todoDiv.appendChild(trashButton);\n\n //append to list\n todoList.appendChild(todoDiv);\n });\n}", "function create(params, auth) {\n let sanitized = Notebook.sanitizeOnCreate(params);\n sanitized.userId = auth.sub;\n\n return sequelize.transaction((transaction) => {\n\n let id = null;\n return retrieveCount(auth.sub, { findOptions: { lock: transaction.LOCK.UPDATE } })\n .then((count) => {\n sanitized.order = count + 1;\n return Notebook.create(sanitized);\n })\n .then((created) => {\n id = created.id;\n return increaseCount(auth.sub);\n })\n .then(() => {\n return retrieve(id);\n });\n });\n}", "function appendLocalStorage() {\n if (!JSON.parse(localStorage.getItem(\"myLibrary\"))) return;\n const localData = JSON.parse(localStorage.getItem(\"myLibrary\"));\n for (const data of localData) {\n myLibrary.push(new Book(data.title, data.author, data.pages, data.read));\n appendToHTML();\n updateDataBook();\n }\n}", "static addBookToStorage(whatToAdd) {\n \n //initialise new variable for storage data\n let newStoredBooks;\n\n //set variale values based on data gotten from ls\n if (storage.getStorageData() === null) {\n newStoredBooks = [];\n } else {\n newStoredBooks = storage.getStorageData();\n };\n\n newStoredBooks.push(whatToAdd);\n \n localStorage.setItem('storedBooks', JSON.stringify(newStoredBooks))\n\n }", "toGist() {\n let files = {}\n const pages = this.pages.filter(p => p.content) // gist does not accept empty files, TODO: consider giving feedback to user\n const digits = Math.ceil(Math.log10(pages.length))\n const getPageNumber = (i) => {\n return leftPad(i, digits, 0)\n }\n pages.forEach((page, i) => {\n const filename = `${getPageNumber(i+1)}. ${page.name}.md`\n const key = page.gistFilename || filename\n files[key] = page.toGistFile(filename)\n })\n this.deletedPages.filter(page => page.gistFilename).forEach(page => {\n files[page.gistFilename] = null\n })\n return {\n description: this.name || 'Untitled Notebook',\n public: this.public,\n files\n }\n }", "function Note(type) {\n this.noteType = type;\n this.date = addDate();\n this.titleOfNoteBook = openNotebook;\n this.addingFromLocalStorage = function (\n date,\n savedNoteBookPlacment,\n savedTextarea\n ) {\n if (date != null) {\n this.date = date;\n }\n if (savedNoteBookPlacment != null) {\n this.titleOfNoteBook = savedNoteBookPlacment;\n } else {\n this.titleOfNoteBook = openNotebook;\n }\n if (savedTextarea != \"\" && type == 1) {\n this.noteElement.getElementsByClassName(\n \"textArea\"\n )[0].textContent = savedTextarea;\n }\n };\n\n this.noteElement = createNote(this, type);\n main.prepend(this.noteElement);\n\n this.checkBox = document.createElement(\"input\");\n this.checkBox.type = \"checkbox\";\n this.checkBox.style.display = \"none\";\n this.checkBox.className = \"checkbox\";\n this.noteElement.appendChild(this.checkBox);\n this.delete = false;\n\n this.getNoteLi = function () {\n if (this.noteType == 2) {\n let arrayOfInnerText = [];\n let listItemsArray = this.noteElement.getElementsByClassName(\n \"itemOfList\"\n );\n\n for (let index = 0; index < listItemsArray.length; index++) {\n arrayOfInnerText.push(listItemsArray[index].innerText);\n }\n arrayOfInnerText.toString();\n return arrayOfInnerText;\n }\n };\n\n //om du kan mata varje string som newNext från local sätter denna dit dom en i taget\n this.setNewLi = function (newText) {\n if (this.noteType == 2) {\n let node = this.noteElement.getElementsByClassName(\"list\");\n let listItemContainer = document.createElement(\"div\");\n listItemContainer.className = \"list-item-container\";\n let node_li = document.createElement(\"li\");\n node_li.contentEditable = \"true\";\n node_li.className = \"itemOfList\";\n let textnode = document.createTextNode(newText);\n let span = document.createElement(\"SPAN\");\n let txt = document.createTextNode(\"\\u00D7\");\n span.className = \"remove-list-item\";\n span.addEventListener(\"click\", () => {\n listItemContainer.remove();\n saveNotesToLocalStorage();\n });\n span.appendChild(txt);\n node_li.appendChild(textnode);\n listItemContainer.appendChild(node_li);\n listItemContainer.appendChild(span);\n node[0].appendChild(listItemContainer);\n return node;\n }\n };\n this.getNoteText = function () {\n if (this.noteType == 1) {\n return this.noteElement.getElementsByClassName(\"textArea\")[0].textContent;\n }\n };\n this.setTitleOfNoteBook = (title) => {\n this.titleOfNoteBook = title;\n };\n\n this.checkBoxVisible = function (choise) {\n if (choise == true) {\n return (this.checkBox.style.display = \"block\");\n } else if (choise == false) {\n return (this.checkBox.style.display = \"none\");\n }\n };\n\n this.removeNote = function () {\n this.noteElement.remove();\n this.delete = true;\n clearDeleted();\n saveNotesToLocalStorage();\n };\n}", "function saveLocalTodos (todo){\n //check for existing files first\n let todos;\n if (localStorage.getItem(\"todos\") === null){\n todos = [];\n } else {\n todos = JSON.parse(localStorage.getItem(\"todos\"));\n }\n todos.push(todo);\n localStorage.setItem('todos', JSON.stringify(todos));\n}", "function getLocalStorage(){\n let toLibrary = JSON.parse(localStorage.getItem('myLibrary'));\n if(toLibrary===undefined) return;\n toLibrary.forEach((object)=>{\n // book.prototype=toggleRead;\n let bookObject = new Book(object.title,object.author,object.pages,object.read);\n myLibrary.push(bookObject)\n })\n}", "get name() {\n return 'notebook';\n }", "createStore() {\n if (!this.newWork) return\n db.downloading.insert(this.getStoreObj(), (err, data) => {})\n }", "function Notebook() {\n loadNoteNamesList();\n\n /*\n * Registering event listeners\n */\n $('#sign-out').click(function() {\n utils.signOut('./');\n });\n $('#create-note').click(function() {\n showCreateNoteModal();\n });\n\n /**\n * Load the notes list from the server\n * Display it in the UI\n *\n * @private\n */\n function loadNoteNamesList() {\n var notesList = $('#notes-list');\n utils.showLoadingOverlay(notesList);\n $.ajax({\n type: 'GET',\n url: constants.API_URI + 'notes',\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n var notes = response.notes;\n var columns = ['Note Name', 'Actions'];\n\n // Creating the 2D data array for the notes list table\n var data = [];\n $.each(notes, function(index, note) {\n var row = [];\n row.push('<span class=\"note-name\">' + note + '</span>');\n row.push(\n '<a href=\"note.html?note=' + note + '\" class=\"btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-view fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">View</span>' +\n '</a>' +\n '<a class=\"delete-note btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-delete fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">Delete</span>' +\n '</a>'\n );\n data.push(row);\n });\n\n var listTable = utils.generateListTable(columns, data,\n { ordering: false, searching: false },\n { 'Actions' : 'text-right' }\n );\n\n // Registering event listeners to the list table\n listTable.find('.delete-note').click(function(event) {\n showDeleteNoteModal(\n $(event.target).closest('tr').find('.note-name').html()\n );\n });\n\n notesList.html(listTable);\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n\n }\n utils.hideLoadingOverlay(notesList);\n },\n error: function() {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n utils.hideLoadingOverlay(notesList);\n }\n });\n }\n\n /**\n * Show the create note modal\n *\n * @private\n */\n function showCreateNoteModal() {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalBody = $('<div >');\n var noteNameInput = $('<input type=\"text\" class=\"form-control form-control-lg\" />');\n var noteNameInputContainer = $('<div class=\"pull-left\"><div class=\"form-group col-sm-12\">');\n var modalFooter = $('<div class=\"pull-right\">');\n var createButton = $('<button type=\"button\" class=\"btn btn-primary\">Create</button>');\n\n // Appending to create the modal content structure\n noteNameInputContainer.append(noteNameInput);\n modalBody.append(noteNameInputContainer);\n modalFooter.append(createButton);\n\n var modal = utils.showModalPopup('Enter a name for your new note', modalBody, modalFooter);\n\n // Registering event listeners for the modal window\n createButton.click(function() {\n createNote(noteNameInput.val());\n modal.modal('hide');\n });\n }\n\n /**\n * Create the Note with the name specified\n *\n * @private\n * @param {string} name Name of the note to be created\n */\n function createNote(name) {\n if (name.indexOf(' ') > 0) {\n utils.handlePageNotification('error', 'Error',\n 'Note name cannot contain white spaces'\n );\n } else {\n $.ajax({\n type: 'POST',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n window.location.href = 'note.html?note=' + name;\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n }\n\n /**\n * Show the delete note confirmation modal\n *\n * @private\n * @param noteName The name of the note to be deleted\n */\n function showDeleteNoteModal(noteName) {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalFooter = $('<div class=\"pull-right\">');\n var deleteButton = $('<button type=\"button\" class=\"btn btn-primary\">Delete</button>');\n\n // Appending to create the modal content structure\n modalFooter.append(deleteButton);\n\n var modal = utils.showModalPopup(\n 'Do you want to delete ' + noteName + ' ?', $(), modalFooter\n );\n\n // Registering event listeners for the modal window\n deleteButton.click(function() {\n deleteNote(noteName);\n modal.modal('hide');\n });\n }\n\n /**\n * Delete the note deleted\n *\n * @private\n * @param {string} name The name of the note to be deleted\n */\n function deleteNote(name) {\n $.ajax({\n type: 'DELETE',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n utils.handlePageNotification('info', 'Info', 'Note successfully deleted');\n loadNoteNamesList();\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n} // End of Notebook prototype constructor", "function getTodos() {\r\n let storage;\r\n\r\n if (localStorage.getItem(\"storage\") === null) {\r\n storage = [];\r\n } else {\r\n storage = JSON.parse(localStorage.getItem(\"storage\"));\r\n }\r\n\r\n storage.forEach((todo) => {\r\n //create a div for li and buttons\r\n const todoDiv = document.createElement(\"div\");\r\n todoDiv.classList.add(\"todo\");\r\n\r\n //create an li and append it to the newTodo\r\n const todoLi = document.createElement(\"li\");\r\n todoLi.innerText = todo;\r\n todoLi.classList.add(\"dark-li\");\r\n todoLi.classList.add(\"todo-item\");\r\n todoDiv.appendChild(todoLi);\r\n\r\n //create buttons\r\n const completeBtn = document.createElement(\"button\");\r\n completeBtn.innerHTML = `<i class='fa fa-check' ></i>`;\r\n completeBtn.classList.add(\"complete-btn\");\r\n todoDiv.appendChild(completeBtn);\r\n\r\n const trashBtn = document.createElement(\"button\");\r\n trashBtn.innerHTML = `<i class='fa fa-trash' ></i>`;\r\n trashBtn.classList.add(\"trash-btn\");\r\n todoDiv.appendChild(trashBtn);\r\n\r\n // final append to the todoList UL\r\n todoList.appendChild(todoDiv);\r\n });\r\n}", "function createNW() {\n console.log('creating regular tinder.nw for updates...');\n var fs = require('fs');\n var archiver = require('archiver');\n var archive = archiver('zip');\n\n var output = fs.createWriteStream('./build/' + appName + '/tinder-' + appPkg.version + '.nw');\n output.on('close', function () {\n console.log((archive.pointer() / 1000000).toFixed(2) + 'mb compressed');\n });\n\n archive.pipe(output);\n archive.bulk([\n { expand: true, cwd: 'desktop-app', src: ['**'], dest: '.' }\n ]);\n archive.finalize();\n}", "function createJupyterKernelWithoutSerialization() {\n var relativePath = path.join('node_modules', '@jupyterlab', 'services', 'lib', 'kernel', 'default.js');\n var filePath = path.join(constants.ExtensionRootDir, relativePath);\n if (!fs.existsSync(filePath)) {\n throw new Error(\n \"Jupyter lab default kernel not found '\" + filePath + \"' (Jupyter Extension post install script)\"\n );\n }\n var fileContents = fs.readFileSync(filePath, { encoding: 'utf8' });\n var replacedContents = fileContents.replace(\n /^const serialize =.*$/gm,\n 'const serialize = { serialize: (a) => a, deserialize: (a) => a };'\n );\n if (replacedContents === fileContents) {\n throw new Error('Jupyter lab default kernel cannot be made non serializing');\n }\n var destPath = path.join(path.dirname(filePath), 'nonSerializingKernel.js');\n fs.writeFileSync(destPath, replacedContents);\n console.log(colors.green(destPath + ' file generated (by Jupyter VSC)'));\n}", "function createStorages() {\n var cfg, x, y, z, \n config = this.config.storage,\n storages = this.storages;\n\n for (x in config) {\n cfg = config[x];\n for (y in cfg) {\n if (typeof cfg[y] == 'object') {\n if (typeof storages[x] == 'undefined') storages[x] = {};\n storages[x][y] = this.storage(x, cfg[y]);\n } else {\n storages[x] = this.storage(x, cfg);\n break;\n }\n }\n }\n}", "function addBooksFromStorage() {\n if (storageAvailable(\"localStorage\")) {\n let books = [];\n let timestamps = [];\n for (let i = 0; i < localStorage.length; i++) {\n const timestamp = localStorage.key(i).split(\":\")[0];\n if (!timestamps.includes(timestamp)) timestamps.push(timestamp);\n }\n timestamps.forEach(timestamp => {\n const empty = \"\";\n books.push(new Book(empty, empty, empty, empty, timestamp));\n });\n for (let i = 0; i < localStorage.length; i++) {\n const storageKey = localStorage.key(i);\n const temp = storageKey.split(\":\");\n const timestamp = temp[0];\n const key = temp[1];\n const value = localStorage.getItem(storageKey);\n \n for (let j = 0; j < books.length; j++) {\n if (books[j].timestamp === timestamp) {\n books[j][key] = value;\n }\n }\n }\n books.forEach (book => {\n book.addToLibrary();\n });\n }\n}", "function setLocalLibrary() {\n localStorage.setItem('books', JSON.stringify(myLibrary));\n}", "function Storage() {\n var create = false;\n var dbFile = dirService.get(\"ProfD\", Ci.nsIFile);\n dbFile.append(\"mlab.sqlite\");\n\n if (!dbFile.exists()) {\n create = true; \n }\n this.dbConnection = dbService.openDatabase(dbFile);\n if (create) {\n this.dbConnection.createTable(\"mlab\", storageSchema);\n }\n}", "function hCreate(storage){\r\n}", "function createNewBook() {\n const book = new Book(\n document.querySelector(\"#name\").value,\n document.querySelector(\"#author\").value,\n document.querySelector(\"#pages\").value,\n document.querySelector(\"#read\").value == \"true\" ? true : false\n );\n addBookToLibrary(book);\n updateLocalStorage(myLibrary);\n displayBook(book);\n toggleForm();\n}", "function newNotes() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes), err => {\n if (err) {\n return console.log(err);\n }\n });\n }", "function createBook(name, style, pages, authorId, id) {\n var book = {};\n\n if (id) {\n $localStorage.books.forEach(function (item) {\n if (item.id === id) {\n item.name = name;\n item.style = style;\n item.pages = pages || 0;\n item.author = authorId;\n }\n });\n } else {\n book.name = name;\n book.style = style;\n book.pages = pages || 0;\n book.author = authorId;\n book.id = createId();\n }\n\n//***************************** creation an id for each book\n function createId() {\n var id = $localStorage.booksId;\n $localStorage.booksId = $localStorage.booksId + 1;\n return id;\n }\n\n $localStorage.books.push(book);\n\n }", "_cloneNode(workflow, node) {\n let operation = this.Operations.get(node.operationId);\n let offset = {\n x: 255,\n y: 0\n };\n let nodeClone = _.cloneDeep(node);\n let newNodeId = this.UUIDGenerator.generateUUID();\n let nodeParams = angular.merge(\n nodeClone, {\n 'id': newNodeId,\n 'operation': operation,\n 'x': node.x - offset.x >= 0 ? node.x - offset.x : node.x,\n 'y': node.y - offset.y >= 0 ? node.y - offset.y : node.y,\n 'uiName': nodeClone.uiName ? nodeClone.uiName += ' copy' : ''\n }\n );\n\n const createdNode = workflow.createNode(nodeParams);\n createdNode.parametersValues = angular.copy(node.parameters.serialize());\n\n if (Object.values(specialOperations.NOTEBOOKS).includes(node.operationId)) {\n this.WorkflowsApiClient.cloneNotebookNode(workflow.id, node.id, newNodeId).then(() => {\n return workflow.addNode(createdNode);\n }, () => {\n this.NotificationService.showError({\n title: 'Error',\n message: 'There was an error during copying content of the notebook! Content of the notebook is empty.'\n });\n });\n }\n\n if (node.hasInnerWorkflow()) {\n const oldInnerWorkflow = createdNode.getInnerWorkflow();\n const oldInnerThirdPartyData = createdNode.getInnerThirdPartyData();\n const map = this._mapOldIdsWithNewOnes(oldInnerWorkflow);\n const newInnerThirdPartyData = this._assingNewIdsThirdPartyData(map, oldInnerThirdPartyData);\n const newInnerWorkflow = this._assignNewIds(map, oldInnerWorkflow);\n createdNode.setInnerWorkflow(newInnerWorkflow);\n createdNode.setInnerThirdPartyData(newInnerThirdPartyData);\n }\n\n return workflow.addNode(createdNode);\n }", "function getBookFromLocal() {\n for(key in localStorage){\n const dataFromLocal = JSON.parse(localStorage.getItem(key));\n if(dataFromLocal){\n dataFromLocal.forEach(book => {\n let bookDiv = document.createElement('div');\n bookDiv.classList.add(\"book\", \"book-one\");\n let titleDiv = document.createElement('div');\n titleDiv.id = \"book-title\";\n let titleH2 = document.createElement('h2');\n titleH2.textContent = book.title;\n let para = document.createElement('p');\n para.textContent = \"Written by:\";\n let authorName = document.createElement('h3');\n authorName.textContent = book.author;\n let bookDetailDiv = document.createElement('div');\n bookDetailDiv.id =\"book-detail-div\";\n let isReadPara = document.createElement('p');\n if (book.isRead) {\n isReadPara.textContent = `Have you read it? Yes`;\n }else{\n isReadPara.textContent = `Have you read it? No`;\n }\n let pagesPara = document.createElement('p');\n pagesPara.textContent = `Number of pages: ${book.pages}`;\n let removBtn = document.createElement('button');\n removBtn.type = \"submit\";\n removBtn.setAttribute('id', 'remove-btn');\n removBtn.classList.add('remove-btn');\n removBtn.key = book.title;\n removBtn.textContent = \"Remove book\";\n removBtn.addEventListener('click', removeBookForm);\n \n // Append children to first div\n titleDiv.appendChild(titleH2);\n titleDiv.appendChild(para);\n titleDiv.appendChild(authorName);\n \n //Append childre to the second children\n bookDetailDiv.appendChild(isReadPara);\n bookDetailDiv.appendChild(pagesPara);\n bookDetailDiv.appendChild(removBtn);\n \n // Append the divs to the parent div\n bookDiv.appendChild(titleDiv);\n bookDiv.appendChild(bookDetailDiv);\n \n displayBookBoard.prepend(bookDiv);\n });\n }\n \n }\n\n}", "function makeExamples() {\n try {\n // Model Article\n const articles = [];\n const examples = require('../lib/articles.json'); // JSON de ejemplo\n let cont = 0;\n examples.forEach( (article) => {\n Articles.create( parseDocument(article), (err, docum ) => {\n if (err) {\n console.log('Error saving the example', err);\n }\n else {\n articles.push(docum);\n cont++;\n console.log(`Example saved #${cont}`)\n }\n })\n })\n } catch (error) {\n console.log(error);\n }\n \n // for (let i=0; i<examples.length; i++) {\n // }\n return articles;\n}", "function createJupyterKernelWithoutSerialization() {\n var relativePath = path.join('node_modules', '@jupyterlab', 'services', 'lib', 'kernel', 'default.js');\n var filePath = path.join(constants_1.ExtensionRootDir, relativePath);\n if (!fs.existsSync(filePath)) {\n throw new Error(\"Jupyter lab default kernel not found '\" + filePath + \"' (pvsc post install script)\");\n }\n var fileContents = fs.readFileSync(filePath, { encoding: 'utf8' });\n var replacedContents = fileContents.replace(\n /^const serialize =.*$/gm,\n 'const serialize = { serialize: (a) => a, deserialize: (a) => a };'\n );\n if (replacedContents === fileContents) {\n throw new Error('Jupyter lab default kernel cannot be made non serializing');\n }\n var destPath = path.join(path.dirname(filePath), 'nonSerializingKernel.js');\n fs.writeFileSync(destPath, replacedContents);\n console.log(colors.green(destPath + ' file generated (by Python VSC)'));\n}", "function create() {\n\t// make the overarching dir for ease of copying data around\n\tif(!fs.existsSync(\"instructions.md\")){\n\t\tconsole.log(\"ERR : No instructions.md file. Exiting without finishing...\");\n\t\treturn 1;\n\t}\n\tif(!fs.existsSync(\"tests\")){\n\t\tconsole.log(\"ERR : No tests file. Exiting without finishing... \");\n\t\treturn 1;\n\t}\n\tif(!fs.existsSync(project)){\n\t\tfs.mkdirSync(project);\n\t\tfullpath = project + \"/\";\n\t\tconsole.log(\"INFO : Project folder created\");\n\t}\n\tObject.keys(students).forEach(function (key) {\n\t\tvar err = genDir(students[key].login);\n\t\tif(err) {\n\t\t\tconsole.log(\"ERR : Error during creation of directory for : \" + students[key].login);\n\t\t} else {\n\t\t\tconsole.log(\"INFO : Directory created for : \" + students[key].login);\n\t\t}\n\t});\n}", "function localStoreMaker(){\n var productsInStorage=localStorage.getItem('countedVotesStore');\n if (!productsInStorage){\n initializeProducts();\n console.log('initialized', localStorage.length);\n localStorage.setItem('countedVotesStore', JSON.stringify(allProducts));\n }\n else{\n allProducts= JSON.parse(localStorage.getItem('countedVotesStore'));\n }\n}", "function storeNotes() {\n // Store the note in the localStorage\n localStorage.setItem(\"note\", JSON.stringify(notesArray));\n }", "constructor(filename) {\n if (!filename) {\n throw new Error(\"Creating a repository requires a new filename\");\n }\n this.filename = filename;\n //chek if the file exixts\n try {\n fs.accessSync(this.filename);\n //if not create a new file\n } catch (err) {\n fs.writeFileSync(this.filename, \"[]\");\n }\n }", "static getItemsFromLs() {\n const getBooks = JSON.parse(localStorage.getItem('books'));\n getBooks.forEach((books) => {\n const list = document.getElementById('book-list');\n\n const row = document.createElement('tr');\n\n row.innerHTML = `\n <td>${books.title}</td>\n <td>${books.author}</td>\n <td>${books.isbn}</td>\n <td><a href=\"#\" class=\"delete\"><i class=\"fas fa-trash\"></i></a></td>\n `;\n list.appendChild(row);\n });\n return getBooks;\n }", "_getLocalStorage() {\n let data = [];\n for (let i = 0; i < localStorage.length + 10; i++)\n data.push(JSON.parse(localStorage.getItem(i)));\n\n // if (!data) return; // [] = truthy\n if (data.length === 0) return;\n let workout;\n\n // remove any deleted single workouts\n data = data.filter(item => item);\n // console.log(data);\n\n data.forEach(d => {\n d.restore = true;\n if (d.type === 'running')\n // prettier-ignore\n workout = new Running(d.coords, d.distance, d.duration, d.cadence, d.restore, d.date);\n if (d.type === 'cycling')\n // prettier-ignore\n workout = new Cycling(d.coords, d.distance, d.duration, d.elevationGain, d.restore, d.date);\n this.#workouts.push(workout);\n });\n\n this.#workouts.forEach(work => this._renderWorkout(work));\n }", "function touchState() {\n count += 1;\n let fileName = \"state/in/state\" + count + \".json\";\n exec(\"touch \" + fileName);\n\n genGridState(state => {\n exec(\"echo \" + JSON.stringify(state) + \" > \" + fileName);\n });\n}", "static displayBooks() {\n // get the array of Books from local-storage\n const storedBooks = JSON.parse(localStorage.getItem('Books'))\n // create a new tbody node to update the previous node with the new data\n const newList = document.createElement('tbody')\n // add attributes (id & class) to the tbody node\n newList.setAttribute('id', 'book-list')\n newList.setAttribute('class', 'table table-striped mt-5')\n\n // check if there is some books stored in local-storage\n // then loop through each book-object of the stored bookBook Array\n storedBooks ? storedBooks.forEach((book, index) => {\n // create a new table-row node\n const row = document.createElement('tr')\n // append some td elements with the book-data (title|author|etc..)\n row.innerHTML = `\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><button class=\"btn btn-danger btn-sm delete\">del</button></td>\n `\n // set a key attribute equal to the index for reference when (update|delete|etc..)\n row.getElementsByClassName('delete').item(0).setAttribute('key', index)\n // append the new populated table-row to the table-body node\n newList.append(row)\n }) : \"\"\n // finally replace the old-tbody node with the latest-tbody node\n document.getElementById('book-list').replaceWith(newList)\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 readLocalStorage() {\r\n let coursesLS;\r\n coursesLS = getcoursesLocalStorage();\r\n coursesLS.forEach(function(course){\r\n // constrir el template\r\n const row = document.createElement('tr');\r\n row.innerHTML = `\r\n <td>\r\n <img src=\"${course.image}\" width=100>\r\n </td>\r\n <td>${course.title}</td>\r\n <td>${course.price}</td>\r\n <td>\r\n <a href=\"#\" class=\"delete-course\" data-id=\"${course.id}\">X</a>\r\n </td>\r\n `;\r\n listcourses.appendChild(row);\r\n });\r\n}", "function itShouldCreateASpreadsheet() {\n var spreadsheetId = snippets.create('Title');\n expectToExist(spreadsheetId);\n helpers.deleteFileOnCleanup(spreadsheetId);\n}", "function create_new_list(){\n\tfor(var i = 0; i < localStorage.length; i++){\n\t\t// trayendo info desde el Local Storage\n\t\ttodo = localStorage.getItem('names_' + i );\n\n\t\t$('#todo_list').append('<li id=\"' + i + '\"><a href=\"#\">' + todo + '</a><a href=\"#\" data-rel=\"dialog\" data-transition=\"slideUp\" id=\"remove\">Remover</a></li>');\n\t}\n\n\t$('todo_list').listview();\n\t$('todo_list').listview('refresh');\n}", "_saveDisk ({ notebookPath, note }) {\n const originalName = note.name;\n note.name = `${slug(note.title)}.md`;\n\n let promises = Promise.resolve();\n\n // ensure has a uniqure name for new files or in case it has changed the name\n if (!note.id || originalName !== note.name) {\n promises = promises\n .then(() => this._generateUniqueNameDisk({ notebookPath, note, originalName }))\n .then((newName) => note.name = newName);\n }\n\n // renames in the disk in case it has changed the name\n if (note.id && originalName !== note.name) {\n promises = promises\n .then(() => this._renameDisk({ notebookPath, note, originalName }));\n }\n\n // saves file in the disk\n return promises.then(() => {\n note.filename = path.join(notebookPath, note.name);\n return denodeify(fs.writeFile).call(fs, note.filename, note.content);\n });\n }", "function saveStorage() {\n store.set(planner.list.modules, modules.toJSON());\n }", "function saveAsNimn(){\n //TODO : change it after change in nimnjs\n askFileName(\"Untitled_imglab.nimn\", function(fileName){\n\n download( nimn.stringify(nimnSchema, labellingData), fileName, \"application/nimn\");\n //download( JSON.stringify(labellingData), fileName, \"application/json\");\n });\n}", "function _createStorageAPI() {\n window.memory = {\n read: function(page) {\n if (page) {\n return this.data[page];\n }\n return this.data;\n },\n save: function(inputTask, cb) {\n if (inputTask) {\n this.data[inputTask.page].push(inputTask);\n }\n window.localStorage._taskData = JSON.stringify(this.data);\n\n if (typeof inputTask === 'function') {\n cb = inputTask;\n }\n\n if (cb) cb();\n },\n remove: function(inputTask, cb) {\n var thisPagesTasks = this.data[inputTask.page];\n for (var i = 0; i < thisPagesTasks.length; i++) {\n if (thisPagesTasks[i].text === inputTask.text) {\n thisPagesTasks.splice(i, 1);\n i--;\n }\n }\n this.data[inputTask.page] = thisPagesTasks;\n this.save(cb);\n }\n };\n _loadSavedData();\n}", "static addBook(book){\n let books = Store.getBooks();\n books.push(book);\n localStorage.setItem('books', JSON.stringify(books));\n }", "function createStore() {\n store.setItem('songs', JSON.stringify([]))\n}", "function getTodos(){\n //check if i have todo alredy\n let todos;\n if(localStorage.getItem('todos')===null){\n todos=[];\n }\n else{\n todos=JSON.parse(localStorage.getItem('todos'));\n }\n\n //copy from above\n todos.forEach(function(todo){\n //Creating Todo Div\n const todoDiv=document.createElement('div');\n todoDiv.classList.add(\"todo\");\n\n //Creating Todo li\n const newtodo=document.createElement('li');\n newtodo.innerText=todo;\n newtodo.classList.add(\"todo-item\");\n todoDiv.appendChild(newtodo);\n\n //Creating Todo Complete\n const completedButton=document.createElement('button');\n completedButton.innerHTML='<i class=\"todo-complete\"></i>'\n completedButton.classList.add(\"complete-button\");\n todoDiv.appendChild(completedButton);\n\n //Creating Todo Delete\n const deleteButton=document.createElement('button');\n deleteButton.innerHTML='<i class=\"todo-delete\"></i>'\n deleteButton.classList.add(\"delete-button\");\n todoDiv.appendChild(deleteButton);\n\n //Append To List\n todoList.append(todoDiv);\n });\n}", "function getTodos() {\n let todos;\n // Check if it exists\n if (localStorage.getItem(\"todos\") === null) {\n // create empty array\n todos = [];\n } else {\n // use the one already inside\n todos = JSON.parse(localStorage.getItem(\"todos\"));\n }\n // displaying local storage info into UI\n todos.forEach(function (todo) {\n // recreate the whole todo DIV\n // Create todo DIV\n const todoDiv = document.createElement(\"div\");\n // Add a class to it\n todoDiv.classList.add(\"todo\");\n // Create LI\n const newTodo = document.createElement(\"li\");\n // Add a value to it using todo local storage\n newTodo.innerText = todo;\n // Add a class to it\n newTodo.classList.add(\"todo-item\");\n // Append child to the todo DIV\n todoDiv.appendChild(newTodo);\n\n // Create check BUTTON\n const completedButton = document.createElement(\"button\");\n // Add i tag inside Button\n completedButton.innerHTML = '<i class=\"fas fa-check\"></i>';\n // Add a class to it\n completedButton.classList.add(\"complete-btn\");\n // Append child to the todo DIV\n todoDiv.appendChild(completedButton);\n\n // Create trash BUTTON\n const trashButton = document.createElement(\"button\");\n // Add i tag inside Button\n trashButton.innerHTML = '<i class=\"fas fa-trash\"></li>';\n // Add a class to it\n trashButton.classList.add(\"trash-btn\");\n // Append child to the todo DIV\n todoDiv.appendChild(trashButton);\n // Append everything to the ul todo-list\n todoList.appendChild(todoDiv);\n });\n}", "function init(){\n notes = JSON.parse(localStorage.getItem(\"notes\"));\n if(!notes) notes =[];\n notes.forEach(element => {\n addNote(element);\n });\n}", "function saveLocalTodos(todo) {\n let todos = [];\n //check if i already have todos in local storage\n if (localStorage.getItem('todos') === null) {\n todos = [];\n } else {\n todos = JSON.parse(localStorage.getItem('todos'));\n }\n\n todos.push(todo);\n localStorage.setItem('todos', JSON.stringify(todos));\n}", "function loadTraining() {\n /**/console.log(\"function loadTraining\\n\");\n // Get training variables from local storage, if the exist\n try {\n var labels_str = localStorage.getItem(\"labels\");\n var keywords_str = localStorage.getItem(\"keywords\");\n var matrix_str = localStorage.getItem(\"count_matrix\");\n // Convert variables to the original structures\n labels = deserializeStrArray(labels_str);\n keywords = deserializeStrArray(keywords_str);\n count_matrix = deserializeMatrix(matrix_str);\n /**/console.log(\"# Keywords = %i\\n\\n\", keywords.length);\n } catch(e) {\n console.error(e);\n }\n}", "function storeLocalStorage() {\n const todosEl = document.querySelectorAll(\"li\");\n\n const todos = [];\n\n todosEl.forEach((todoEl) => {\n todos.push({\n text: todoEl.innerHTML,\n completed: todoEl.classList.contains(\"completed\"),\n });\n });\n\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n}", "function createTodos(todos) {\n let todosList = document.querySelector(\"#todos-list\")\n todosList.innerHTML = \"\"\n\n // create list tag for each todo\n todos.forEach((todo, index) => {\n let li = document.createElement(\"li\")\n li.className = \"list-group-item\"\n let content = document.createElement(\"span\")\n content.textContent = todo.content\n content.style.textDecoration = todo.status ? \"initial\" : \"line-through\"\n let deleteBtn = document.createElement(\"img\")\n deleteBtn.src = \"media/delete.png\"\n deleteBtn.alt = \"delete icon\"\n deleteBtn.className = \"right\"\n\n //append content and deleteBtn to li\n li.append(content)\n li.append(deleteBtn)\n\n //append li to todosList\n todosList.append(li)\n\n // add deleteBtn functionality\n deleteBtn.addEventListener(\"click\", e => {\n todos.splice(index, 1)\n localStorage.setItem(\"todos\", JSON.stringify(todos))\n createTodos(todos)\n })\n\n\n // add complete functionality\n content.addEventListener(\"click\", e => {\n todos[index].status = !todos[index].status\n localStorage.setItem(\"todos\", JSON.stringify(todos))\n createTodos(todos)\n })\n });\n}", "save() {\n\t\tlet dir = `./polls/${this.server}`;\n\t\tif (!fs.existsSync(dir)) fs.mkdirSync(dir);\n\t\tfs.writeFile(`${dir}/${this.number}.json`, JSON.stringify(this), function(err) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n\t}", "function savedFolder() {\n\t//get the stored array \n\tlet saved = document.getElementById(\"saved\");\n\tlet stored = window.localStorage.getItem(\"item\");\n\tlet list = JSON.parse(stored);\n\t//creating each entry from the JSON array\n\t//css and innerHTML change\n\tfor (i=0; i < list.length; i++) {\n\t let p = document.createElement(\"h4\");\n\t $(p).css({\"color\":\"white\"});\n\t p.innerHTML = `${list[i].name} <a href=\"${list[i].url}\" target=\"_blank\">${list[i].url}</a>`; //open in new tab\n\t saved.append(p);\n\t}\n }", "function initStorage(storage) {\n if (storage['P/'])\n return; // already initialized\n storage['P/'] = true;\n let next_inode = 0;\n for (let name in files) {\n if (files.hasOwnProperty(name)) {\n storage[`P/${name}`] = next_inode;\n storage[`P:${next_inode}`] = files[name];\n ++next_inode;\n }\n }\n storage['P.next_inode'] = next_inode;\n}", "function fetchLocalStorage() {\n // FETCHING LOCAL STORAGE\n let fromLocalStorage = JSON.parse(localStorage.getItem(\"myBooks\"));\n // IF WE GOT SOMETHING FROM LOCAL STORAGE WE ADD IT TO myBooks ARRAY\n if (fromLocalStorage) {\n myBooks = fromLocalStorage;\n }\n}", "function loadStorage() {\r\n\tif (localStorage.getItem(\"notes\")) { // load only if notes has something in it...\r\n\t\tvar notes_str = localStorage.getItem(\"notes\");\r\n\t\tnotesObj = JSON.parse(notes_str);\r\n\t\tfor (var j=0; j < notesObj.notes.length; j++) {\r\n\t\t\tdisplayNote(notesObj.notes[j]); // call function to display each existing note\r\n\t\t}\r\n\t\tconsole.log(\"*** notes data has been loaded successfully from local storage! ***\");\r\n\t} else {\r\n\t\tconsole.log(\"*** local storage is currently empty! ***\");\r\n\t}\r\n}", "_createIonicApp() {\n ['.gitignore', 'app', 'scripts', 'resources', 'tsconfig.json', 'gulpfile.js', 'webpack.config.js', 'webpack.production.config.js'].forEach((file) => {\n this._copy(file);\n });\n ['package.json'].forEach((file) => {\n this.createTemplate(file, this.answers);\n });\n }", "createFile() {\n const numberOfRepo = 30;\n const numberOfFollower = 3000;\n\n this.findHireableUsers(numberOfRepo, numberOfFollower, (hireableUsers) => {\n const content = {\n info: {\n followers: numberOfFollower,\n repo: numberOfRepo,\n },\n values: hireableUsers,\n };\n const wstream = fs.createWriteStream('hireableUsers.json');\n wstream.write(JSON.stringify(content, null, 2));\n wstream.end();\n\n const s = new Storage(this.credentials.username, this.credentials.token, 'aliens_client');\n s.publish('docs/data/hireableUsers.json', JSON.stringify(content, null, 2), 'new version of the file');\n });\n }", "async create(notification){\n try {\n let newNotification = await Notification.create(notification);\n newNotification = await newNotification.populate([\n {path:'notifier'},\n {path:'publication'}\n ]).execPopulate();\n console.log(\"the fresh notif is : \"+util.inspect(newNotification));\n return newNotification;\n } catch (error) {\n console.log('error in notif repo create notif');\n throw(error);\n }\n }", "manageHashlist(){\n if (fs.existsSync(this.hash_bucket_path)) {\n let data=fs.readFileSync(this.hash_bucket_path);\n this.hashliststore=JSON.parse(data);\n }else{\n this.hashliststore=this.createHashlist()\n }\n }", "function getTodos(){\n let todos;\n if (localStorage.getItem('todos') === null){\n todos = [];\n } else {\n todos = JSON.parse(localStorage.getItem('todos'));\n };\n // console.log(todos);\n todos.forEach(function(todo){\n //div of todo\n const todoDiv = document.createElement('div');\n todoDiv.classList.add(\"todo\");\n //li\n const newTodo = document.createElement('li');\n newTodo.innerText = todo;\n newTodo.classList.add(\"todo-item\");\n todoDiv.appendChild(newTodo);\n\n //completed mark button\n const completedButton = document.createElement('button');\n completedButton.innerHTML = '<i class=\"fas fa-check\"></i>';\n completedButton.classList.add(\"completed-btn\")\n todoDiv.appendChild(completedButton)\n\n //delete trash button\n const deleteButton = document.createElement('button');\n deleteButton.innerHTML = '<i class=\"fas fa-trash\"></i>';\n deleteButton.classList.add(\"deleted-btn\")\n todoDiv.appendChild(deleteButton)\n\n //appends to the list on html\n todoList.appendChild(todoDiv);\n });\n}", "function openNotebook($item){\r\n $('.notes-sidebar .notes-sidebar-title h3').html( $item.text() + '<a href=\"#\" class=\"delete-notebook\"><i class=\"fa fa-trash-alt\"></i></a>');\r\n $('.sidebar-menu .sidebar-sub-menu li').removeClass('selected');\r\n $item.addClass('selected');\r\n\r\n currentNotebook = $item.find('a').attr('data-id');\r\n loadNotes(currentNotebook);\r\n }", "async function setupSentiment() {\n let predictor;\n let isStored = false;\n try {\n predictor = await tf.loadLayersModel(\"indexeddb://tf-sentiment-predictor\");\n console.log(\"Loading saved model from indexed db\");\n isStored = true;\n } catch (err) {\n bugsnagClient.notify(err);\n console.error(err);\n // refetch model\n }\n if (await loader.urlExists(HOSTED_URLS.model)) {\n console.log(\"Model available: \" + HOSTED_URLS.model);\n predictor = await new SentimentPredictor().init(HOSTED_URLS, predictor);\n }\n if (isStored) {\n return predictor;\n }\n try {\n await storeModel(predictor, \"indexeddb://tf-sentiment-predictor\");\n console.log(\"saved sentiment model to indexeddb\");\n } catch (err) {\n bugsnagClient.notify(err);\n console.log(\"Couldn't save model\");\n console.error(err);\n }\n\n return predictor;\n}", "function initStorage(storage) {\n if (storage.isEmpty()) {\n // load the initial knowledge base from a text file in turtle format\n $.get('initial_kb.txt', function(turtle) {\n storage.loadKnowledgeBaseFromString(turtle);\n //alert(\"from local file: \" + turtle);\n storage.save();\n }, 'text');\n } else {\n storage.load();\n }\n}", "function createNoteBook(inputFromLocalStorage) {\n\n\n let inputTitle = document.getElementsByClassName(\"noteBookTitle\")[0].value;\n if (inputFromLocalStorage != null) {\n \n inputTitle = inputFromLocalStorage;\n }\n\n let changeInputBoxApparance = document.getElementsByClassName(\n \"noteBookTitle\"\n )[0]; \n\n if (inputTitle === \"\") {\n \n changeInputBoxApparance.style.border = \"solid red 3px\";\n } else {\n changeInputBoxApparance.style.border = \"solid 1px\";\n\n existingNoteBooks.push(new NoteBookObject(inputTitle));\n document.getElementsByClassName(\"noteBookTitle\")[0].value = \"\";\n } \n\n updateCurrentNoteBooks(); \n saveNoteBooksToLocalStorage();\n}", "function saveLocalTodos(todo) {\n let todos\n //? check if already have todos in local storage\n if (localStorage.getItem('todos') === null) {\n todos = [];\n\n } else {\n todos = JSON.parse(localStorage.getItem('todos'))\n\n }\n todos.push(todo);\n localStorage.setItem('todos', JSON.stringify(todos));\n\n}", "function saveLocalTasks(todo) {\n \n let todos;\n if(localStorage.getItem('todos') === null){\n todos = [];\n } else {\n todos = JSON.parse(localStorage.getItem(\"todos\"));\n }\n\n //Adds a new task to the existing local storage array. \n todos.push(todo);\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n}", "function retrieveButtons() {\n if (localStorage !== null) {\n for (var i = 0; i < localStorage.length; i++) {\n var storedButton = localStorage.getItem(i);\n createButton(storedButton);\n }\n }\n}", "function init(){\n if (localStorage.getItem(\"note_local\")) {\n notesArray = JSON.parse(localStorage.getItem(\"note_local\"));\n for(var i=0;i<notesArray.length;i++)\n addnoteToDOM(notesArray[i].taskDetails, notesArray[i].taskDate, notesArray[i].taskHours);\n } \n}" ]
[ "0.65535074", "0.6126391", "0.60171485", "0.5961831", "0.5856295", "0.5819045", "0.57054645", "0.56985366", "0.55934054", "0.5514346", "0.54395777", "0.538512", "0.51832384", "0.5148144", "0.5105439", "0.50189173", "0.49951193", "0.49883106", "0.49708137", "0.49479792", "0.49441415", "0.49434045", "0.48845026", "0.48823133", "0.48607945", "0.4855381", "0.48548225", "0.4850647", "0.48469397", "0.4807622", "0.47719187", "0.47464374", "0.47414476", "0.47343746", "0.47120893", "0.4711035", "0.47100362", "0.47037557", "0.470072", "0.46867892", "0.46797305", "0.4662254", "0.46573976", "0.46534702", "0.46521726", "0.46492353", "0.4640722", "0.4629905", "0.46276048", "0.46256408", "0.4625464", "0.46200418", "0.4617348", "0.4616689", "0.46127036", "0.4602503", "0.46000016", "0.4588461", "0.45834282", "0.45737225", "0.45616686", "0.45598355", "0.45535943", "0.4549598", "0.4546931", "0.45378086", "0.453742", "0.45223784", "0.45165688", "0.45113194", "0.45109877", "0.44978043", "0.44951004", "0.44935232", "0.4491574", "0.44859734", "0.44857514", "0.44802788", "0.44778368", "0.4474365", "0.44719023", "0.4469875", "0.44609332", "0.446065", "0.4459789", "0.44511458", "0.44509974", "0.4450508", "0.44504106", "0.44503838", "0.44478387", "0.44457948", "0.44402105", "0.44391987", "0.443435", "0.4434104", "0.44334576", "0.44316286", "0.44312078", "0.44250342" ]
0.6946914
0
saves which note book was last opened to local storage
function lastVisitedNoteBook(lastNoteBookClick) { //at sstart localStorage.setItem("lastVisitedNoteBook", lastNoteBookClick); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveNotes() {\n localStorage.setItem(\"notes\", JSON.stringify(notes));\n localStorage.setItem(\"notesLength\", c);\n}", "function saveNoteBooksToLocalStorage() {\n \n if (existingNoteBooks.length > 1) {\n let arrayToHoldAllCurrentNotebooks = []; \n existingNoteBooks.forEach((element) => {\n if (element.titleOfObject != \"Dashboard\") {\n arrayToHoldAllCurrentNotebooks.push(element.titleOfObject);\n }\n }); //need to clear array after used or check before if there allredy is a existing name\n\n arrayToHoldAllCurrentNotebooks.toString(); // turns the notes ti string\n localStorage.setItem(\"books\", arrayToHoldAllCurrentNotebooks);\n }\n}", "function saveNote() {\n const text = document.getElementById(\"NotifyText\").value;\n const noteDate = document.getElementById(\"SelectedDay\").value + \".\" + month + \".\" + year;\n\n if(specialCharsMatch(text)) {\n alert(\"Sonderzeichen sind nicht erlaubt.\");\n return;\n }\n\n for(let i = 0; i < noteCount; i++) {\n \n try {\n const existingNoteDate = localStorage.getItem(\"note\"+i).split(\",\")[1];\n \n if(existingNoteDate === noteDate) {\n alert(\"Bitte nur einen Eintrag pro Tag.\");\n return;\n }\n } catch {\n continue;\n }\n }\n\n localStorage.setItem(\"note\" + noteCount, text + \",\" + noteDate);\n noteCount++;\n localStorage.setItem(\"noteCount\", noteCount);\n\n fillCalendar(year, month, day);\n document.getElementById(\"NotifyText\").value = \"\";\n }", "onSaveNote(){\r\n let new_note = {\r\n title: this.state.title,\r\n note: this.state.note\r\n };\r\n\r\n let list = JSON.parse(localStorage.getItem('list'));\r\n \r\n // update the note by index\r\n // list[this.state.index].title = this.state.title;\r\n // list[this.state.index].note = this.state.note;\r\n\r\n list[this.state.index] = new_note;\r\n\r\n localStorage.setItem('list', JSON.stringify(list));\r\n this.setState({title: '', note: ''});\r\n }", "function saveNote() {\n window.localStorage.setItem(notes.value, editor.value);\n}", "function save_last_opened_list(list_id)\r\n{\r\n\tTitanium.App.Properties.setString('last_opened_list', list_id.toString());\r\n}", "function _saveBook() {\n window.localStorage[\"book\"] = JSON.stringify(_data, function (key, val) {\n if (key == '$$hashKey') {\n return undefined;\n }\n return val\n });\n }", "function storeNotes() {\n // Store the note in the localStorage\n localStorage.setItem(\"note\", JSON.stringify(notesArray));\n }", "function saveFldrOpen () {\n let saveObj;\n saveObj = curFldrOpenList;\n browser.storage.local.set({\n\tsavedFldrOpenList: saveObj\n })\n// .then(\n//\t function () {\n// trace(\"Saved curFldrOpenList\");\n// \ttrace(Object.keys(saveObj));\n// trace(Object.values(saveObj));\n//\t }\n// )\n ;\n}", "function saveLocalStore(){\n for(i = 0; i < generalInfo.length; i++){\n var displayNow = ($(\"#inputEvent\"+generalInfo[i].display).val());\n var notesNow = generalInfo[i].notes;\n generalInfo[i].notes = displayNow;\n console.log(\"grabo vacio\");\n\n }\n localStorage.setItem(\"generalInfo\", JSON.stringify(generalInfo));\n }", "saveNote() {\n if (this.noteMessageInput.value) {\n let key = Date.now().toString();\n localStorage.setItem(key, this.noteMessageInput.value);\n this.displayNote(key, this.noteMessageInput.value);\n StickyNotesApp.resetMaterialTextfield(this.noteMessageInput);\n this.toggleButton();\n }\n }", "function saveNoteDataToLocalStorage() {\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\n}", "function saveData() {\n localStorage.setItem('allBooks', JSON.stringify(librayLogModal.books));\n}", "function saveNoteDataToLocalStorage() {\n\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\n}", "function saveLastRun(mLastRun) {\n\t\tlocalStorage.setItem(sLastKey, JSON.stringify(mLastRun));\n\t}", "function makeNotesFromLocalStorage() {\n \n let noteBookBelongingToNote = \"\";\n let noteOrListType = \"\";\n let dateOfCreatedNote = \"\";\n let noteTosave = [];\n const endOfSavedNoteSymbol = \"//\";\n\n openNotebook = localStorage.getItem(\"lastVisitedNoteBook\");\n\n if (getLocalStorageListsToArray(\"notes\") != null) {\n getLocalStorageListsToArray(\"notes\").forEach((element) => {\n // creates notes\n\n if (element == endOfSavedNoteSymbol && noteTosave[0] == 1) {\n noteOrListType = noteTosave[0];\n noteBookBelongingToNote = noteTosave[1];\n dateOfCreatedNote = noteTosave[2];\n\n let noteTextarea = noteTosave[3];\n let temporaryHolderOfNoteObj = new Note(noteOrListType);\n\n temporaryHolderOfNoteObj.addingFromLocalStorage(\n dateOfCreatedNote,\n noteBookBelongingToNote,\n noteTextarea\n );\n allNotes.push(temporaryHolderOfNoteObj);\n noteTosave = [];\n }\n\n if (element == endOfSavedNoteSymbol && noteTosave[0] == 2) {\n // creates note lists\n\n noteOrListType = noteTosave[0];\n noteBookBelongingToNote = noteTosave[1];\n dateOfCreatedNote = noteTosave[2];\n\n let temporaryHolderOfListObj = new Note(noteOrListType);\n temporaryHolderOfListObj.addingFromLocalStorage(\n dateOfCreatedNote,\n noteBookBelongingToNote,\n \"\"\n );\n for (let index = 4; index < noteTosave.length; index++) {\n temporaryHolderOfListObj.setNewLi(noteTosave[index]);\n }\n\n allNotes.push(temporaryHolderOfListObj); //when fixed sent the rest of array into notes\n noteTosave = [];\n }\n\n if (element != \"//\") {\n noteTosave.push(element);\n }\n });\n }\n}", "function saveNote(note, title) {\n\tvar n = document.getElementById(note).value;\n\tvar t = document.getElementById(title).value;\n\tvar o = new Note(n, t);\n\tvar notes_array = $.parseJSON($.cookie(\"notes_array\"));\n\tnotes_array.push(o);\n\t$.cookie(\"notes_array\", JSON.stringify(notes_array), {expire:365});\n\t//save note to cookie\n\t//save title to corresponding cookie\n\t// console.log(notes_array);\n\tloadTitlesToDropdown();\n}", "handleSaveNote(event) {\n const updatedNote = this.trimNote(); //* returns the selected note with the whitespace around title/text removed\n\n if (this.isValidNote(updatedNote)) {\n //* saves the changes from selectedNote into the savedNotes list\n updatedNote.lastSaved = (new Date()).toUTCString(); //* updates save timestamp\n const savedNotes = this.state.savedNotes;\n\n //* updates selected note & state\n savedNotes.set(updatedNote.id, updatedNote);\n this.setState({ savedNotes });\n }\n\n else {\n alert('COMPUTER SAYS: The note must be filled out to use it...');\n }\n }", "function restoreNotes() {\n //check if noteList array is empty \n let checkNoteList = localStorage.getItem(\"noteList\");\n if (checkNoteList == null) {\n localStorage.setItem(\"noteList\", JSON.stringify([]));\n }\n // load existing notes from local storage to array\n noteList = JSON.parse(localStorage.getItem(\"noteList\"));\n\n for (let i = 0; i < noteList.length; i++) {\n createNote(noteList[i], i)\n }\n}", "function saveNotesToLocalStorage() {\n let holdsLocalStorageNotes = [];\n allNotes.forEach((element) => {\n element.getNoteText();\n\n let temporaryVarForTextContent = \"\";\n if (element.getNoteText() != \"\") {\n temporaryVarForTextContent = element.getNoteText();\n }\n\n let liFromObjArray = element.getNoteLi();\n\n holdsLocalStorageNotes.push(\n element.noteType,\n element.titleOfNoteBook,\n element.date,\n temporaryVarForTextContent\n ); //fix here\n\n if (element.noteType == 2) {\n liFromObjArray.forEach((element) => {\n holdsLocalStorageNotes.push(element);\n });\n }\n\n holdsLocalStorageNotes.push(\"//\");\n });\n\n toString(holdsLocalStorageNotes);\n\n localStorage.setItem(\"notes\", holdsLocalStorageNotes);\n\n // maby add a call in remove notes to jsut to keep in current\n}", "function saveNotes() {\n // Grab the current HTML of the notepad\n let currentNotesHTML = $('#notepad').html();\n // Store the HTML in an object\n let notesData = {\n html: currentNotesHTML\n }\n // Save it to localStorage\n localStorage.setItem('notes', JSON.stringify(notesData));\n}", "function saveLastAction(event){\n localStorage.setItem( 'last_action', event );\n}", "function save_note(beforesave)\n {\n if (!me.selected_note) {\n return false;\n }\n\n var savedata = get_save_data();\n\n // run savedata through the given callback function\n if (typeof beforesave == 'function') {\n beforesave(savedata);\n }\n\n // add reference to old list if changed\n if (me.selected_note.list && savedata.list != me.selected_note.list) {\n savedata._fromlist = me.selected_note.list;\n }\n\n // do some input validation\n if (savedata.title == '') {\n rcmail.alert_dialog(rcmail.gettext('entertitle', 'kolab_notes'), function() {;\n $('.notetitle', rcmail.gui_objects.noteviewtitle).focus();\n });\n\n return false;\n }\n\n if (check_change_state(savedata)) {\n rcmail.lock_form(rcmail.gui_objects.noteseditform, true);\n saving_lock = rcmail.set_busy(true, 'kolab_notes.savingdata');\n rcmail.http_post('action', {_data: savedata, _do: savedata.uid ? 'edit' : 'new'}, true);\n }\n else {\n rcmail.display_message(rcmail.get_label('nochanges', 'kolab_notes'), 'notice');\n }\n }", "saveTrackForNextTime() {\n\t\tif (PlayerUi.hasFailed()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlocalStorage.setItem(this.lastTrack.title, `${this.currentTrack}`);\n\t\tlocalStorage.setItem(this.lastTrack.playTime, `${timeToSeconds(PlayerUi.getCurrentTime())}`);\n\t}", "function saveBookToLocal() {\n const key = bookTitle.value.toLowerCase();\n localStorage.setItem(key, JSON.stringify(myLabrary));\n location.reload();\n \n}", "function saveLocally(date, mealType, calories, foodName) {\n\n\n //console.log('storing in ' + number)\n //window.localStorage.setItem(number + '', post)\n\n window.localStorage.setItem(date + '', mealType + \"/\" + calories + \"/\" + foodName)\n \n //can we change items? I think we can\n\n //we need to add multiple food mealtimes per day. how can we make it efficient?\n\n //clearScreen()\n //populate()\n}", "function saveLastOpenedMark(sync, successCallback, errorCallback) {\n var gradeable = getGradeable();\n\n // Find open mark\n var index = 1;\n var mark = $('#mark-table-' + index);\n while(mark.length > 0) {\n // If mark is open, then save it\n if (mark[0].style.display !== 'none') {\n var gradeable_component_id = getComponent(index).id;\n saveMark(index, sync, successCallback, errorCallback);\n return;\n }\n mark = $('#mark-table-' + (++index));\n }\n // If no open mark was found, then save general comment\n saveGeneralComment(sync, successCallback, errorCallback);\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 saveDate() {\n localStorage.getItem(currentDayId), JSON.stringify(workday);\n }", "function saveNotesToLocalStorage(noteArray){\n\t localStorage.setItem(\"notes\",JSON.stringify(noteArray));\n}", "function save() {\r\n let arrayNotes = document.getElementsByClassName(\"noteArea\");\r\n let titles = document.getElementsByClassName(\"title\");\r\n let contents = document.getElementsByClassName(\"content\");\r\n let newArray = [];\r\n for (let i = 0; i < arrayNotes.length; i++) {\r\n let obj = {};\r\n obj[\"title\"] = titles[i].value;\r\n obj[\"content\"] = contents[i].value;\r\n newArray.push(obj);\r\n }\r\n localStorage.setItem(\"notes\", JSON.stringify(newArray));\r\n}", "function createNoteBooksFromLocalStorage() {\n if (localStorage.getItem(\"lastVisitedNoteBook\" != null)) {\n openNotebook = localStorage.getItem(\"lastVisitedNoteBook\");\n }\n if (getLocalStorageListsToArray(\"books\") != null) {\n getLocalStorageListsToArray(\"books\").forEach((element) => {\n createNoteBook(element);\n });\n }\n}", "function saveNote(event) {\n event.preventDefault();\n\n const button = event.target;\n const buttonId = button.id;\n const index = buttonId.slice(-1);\n\n const textarea = document.getElementById('text' + index);\n const userInput = textarea.value;\n\n const noteData = getNoteData();\n\n noteData[index] =userInput;\n\n localStorage.setItem('notes', JSON.stringify(noteData));\n}", "function bringNotes() {\n if (localStorage.getItem(\"notes\") != null) {\n notes = JSON.parse(localStorage.getItem(\"notes\"));\n } else {\n notes = [];\n }\n console.log(notes.length);\n if (localStorage.getItem(\"notesLength\") != null)\n c = parseInt(localStorage.getItem(\"notesLength\"));\n console.log(c);\n console.log(notes);\n}", "function saveBook(event) {\n event.preventDefault();\n // add empty array for saved books to be stored\n var favorites = [];\n // first check to see if there are any previously saved books, if there are add them to array\n var storedBooks = JSON.parse(localStorage.getItem(\"favorite-books\"));\n if (storedBooks) {\n for (let index = 0; index < storedBooks.length; index++) {\n favorites.push(storedBooks[index]);\n }\n }\n\n // get book info from add button, and create an object for each seperate book\n var bookTitle = event.target.getAttribute(\"data-title\");\n var bookDesc = event.target.getAttribute(\"data-desc\");\n var bookImg = event.target.getAttribute(\"data-image\");\n //book object\n var bookObj = {\n \"title\": bookTitle,\n \"desc\": bookDesc,\n \"img\": bookImg\n }\n//pushes entire book object to array\n favorites.push(bookObj);\n//sets local storage to stringified array\n localStorage.setItem(\"favorite-books\", JSON.stringify(favorites));\n}", "function save_last_position(pos) {\n localStorage[\"App.Controllers.last.pos\"] = JSON.stringify(pos);\n }", "function Save(){\n localStorage.setItem(\"monsterrawrs\",monstercount)\n}", "save_() {\n const objectToSave = {};\n objectToSave[TaskHistory.STORAGE_KEY_LAST_EXECUTED_TIME] =\n this.lastExecutedTime_;\n storage.local.set(objectToSave);\n }", "save() {\n try {\n window.localStorage.setItem( APPCONFIG.LS, JSON.stringify( appState.state.cursor().toJSON() ) )\n } catch ( err ) {\n console.error( 'Error saving to local storage' )\n console.error( err )\n return\n }\n\n console.log( 'saved' )\n }", "function save_history () {\n\tvar ds = currHds();\n\tedit_history [edit_history_index] = JSON.stringify(ds.toJSON());\n}", "restoreSavedBooks() {\n const savedBooks = localStorage.getItem(storageKey);\n savedBooks && this.setBooks(JSON.parse(savedBooks));\n }", "function saveToDos() {\n localStorage.setItem(TODO_LS, JSON.stringify(toDos));\n }", "function updateBookInStorage(book) {\n if(storageAvailable(\"localStorage\")) {\n localStorage.setItem(`${book.timestamp}:title`,book.title);\n localStorage.setItem(`${book.timestamp}:author`,book.author);\n localStorage.setItem(`${book.timestamp}:pages`,book.pages);\n localStorage.setItem(`${book.timestamp}:status`,book.status);\n }\n}", "function onSave() {\n\tvar db = window.openDatabase(\"notes\", \"1.0\", \"Notes Demo\", 2000000);\n\t//db.transaction(checkDb, errorCB, successCB);\n\tdb.transaction(checkDb);\n}", "function saveLocally(){\n//using the button as a reference from where we are at, setting the information as text to save to be stored on the time slot(9AM-6PM)\n var textToSave = $(this).prev().val()\n var time = $(this).prev().prev().text()\n\n localStorage.setItem(time, textToSave)\n}", "handleNewNote(event) {\n console.log('new note :D');\n \n //TODO ALL:\n //? ask user to save / discard current note if one is selected and has been modified\n //! REMOVE SAVEDNOTES DATA WHILE TESTING\n //* create new note object and save as selectedNote\n //* if the selectedNote is saved it will need to be added to savedNotes\n\n //* setup for new note object\n let notesCreated = this.state.notesCreated; //* id based on number of notes created (not tied to savedNotes.size)\n const selectedNote = {\n id: notesCreated,\n lastSaved: (new Date()).toUTCString(),\n title: '',\n text: ''\n };\n\n notesCreated += 1; //* updates number of notes created\n this.setState({ notesCreated, selectedNote }); \n }", "function saveBopsAndHops() {\n localStorage.setItem(\"currentAlcohol\", JSON.stringify(alcohol));\n localStorage.setItem(\"currentArtist\", JSON.stringify(artist));\n}", "function saveEdit(num) {\n console.log(\"this is the number: \" + num)\n editReminderText = document.getElementById(\"editReminderText\");\n console.log(editReminderText.value);\n logReports = JSON.parse(dailyReport);\n logReports[num].notes = editReminderText.value;\n dailyReport = JSON.stringify(logReports);\n localStorage.setItem(\"dailyReport\", dailyReport);\n if (localStorage.getItem(\"langSelect\") === \"english\") {\n message = \"report log edited successfully!\";\n } else {\n message = '!הדו\"ח נערך בהצלחה';\n }\n $(\"#reportsModal\").modal('hide');\n if (localStorage.getItem(\"langSelect\") === \"english\") {\n setTimeout(function () { document.getElementById(\"viewReportsLog\").click(); }, 500);\n } else {\n setTimeout(function () { document.getElementById(\"viewReportsLogHeb\").click(); }, 500);\n }\n setTimeout(function () { alertToast('success', message) }, 500);\n return;\n}", "function saveOngo(){\n localStorage.setItem(LS_ONGOING, JSON.stringify(ONGOING));\n}", "function commitToStorage(objectCount, newObject)\n{\n var item = getFileName();\n localStorage.setItem('saveCount', objectCount);\n\n localStorage.setItem(item, JSON.stringify(newObject));\n alert(\"Saved \" + item);\n}", "function saveLastVisit(book, chapter){\n refDb.get('ref_history').then(function(doc){\n doc.visit_history = [{\"book\": $('#book-chapter-btn').text(), \"chapter\": chapter, \"bookId\": book}]\n refDb.put(doc).then(function(response) {\n }).catch(function(err) {\n console.log(err);\n }); \n });\n}", "async function save() {\n await localStorage.setItem(\n KEY,\n JSON.stringify({\n path,\n text,\n revision,\n lineCount,\n store: store.getState()\n })\n );\n }", "function save() {\n\n let date= new Date;\n let poopTime = document.getElementById(\"display\");\n localStorage.setItem(date, poopTime);\n alert(\"Saved!\")\n\n}", "function saveNotes() {\n var contents = [];\n $(\".note\").each(function() {\n contents.push($(this).find(\"textarea\").val());\n });\n\n localStorage.setItem(\"notes\", JSON.stringify(contents));\n}", "function Save() {\n win.name = JSON.stringify(store);\n }", "function changeNote() {\n editor.value = window.localStorage.getItem(notes.value);\n}", "function save() {\n if (confirm('Are you sure you want to save the recording?')){\n let name = prompt('Enter a name of your recording')\n if (localStorage.getItem(name)== null) {\n document.getElementById('recordinglist').add(new Option(name));\n localStorage.setItem(name, sessionStorage.getItem('recording'));\n head = null;\n tail = null;\n sessionStorage.removeItem('recording');\n } else {alert('The name you entered already exists. Please try again and enter a different name.')}\n }\n }", "_save() {\n if (this.store && localStorage) {\n localStorage.setItem(this.store, JSON.stringify(this.records));\n }\n }", "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n let title = localStorage.getItem(\"title\");\n if (title == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(title);\n }\n titleObj.splice(index, 1)\n localStorage.setItem('title', JSON.stringify(titleObj));\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 a.splice(index, 1)\n localStorage.setItem('DATE', JSON.stringify(a))\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 imp_array.splice(index, 1)\n localStorage.setItem('importance', JSON.stringify(imp_array))\n\n showNotes();\n}", "function end(index) {\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesList = [];\n } else {\n notesList = JSON.parse(notes);\n }\n let updated = document.getElementById(\"editcard\");\n notesList[index]=updated.value;\n localStorage.setItem(\"notes\", JSON.stringify(notesList));\n showNote();\n}", "function editNote(index){\n let saveindex = document.getElementById('saveindex')\n let saveBtn = document.getElementById('saveBtn')\n let addBtn = document.getElementById('addBtn')\n saveindex.value = index;\n let notes = localStorage.getItem('notes');\n let notesObj = JSON.parse(notes);\n addTitle.value = notesObj[index][0];\n addTxt.value = notesObj[index][1];\n addBtn.style.display=\"none\";\n saveBtn.style.display=\"block\";\n }", "function saveState() {\n if (currentView) {\n currentView.checkpoint();\n }\n ConferenceApp.State.local.navigationState = WinJS.Navigation.history;\n }", "function editNote(index){\n let saveindex = document.getElementById('saveindex')\n let saveBtn = document.getElementById('saveBtn')\n let addBtn = document.getElementById('addBtn')\n saveindex.value = index;\n let notes = localStorage.getItem('notes');\n let notesObj = JSON.parse(notes);\n addTitle.value = notesObj[index].title;\n addTxt.value = notesObj[index].text;\n addBtn.style.display=\"none\";\n saveBtn.style.display=\"block\";\n }", "function saveClose(noteId) {\n var editPanel = document.getElementById('edit-panel-' + noteId);\n var newContent = editPanel.innerHTML.replace(/(<([^>]+)>)/ig, '<br/>'); //regex removes all html elements present and replaces them with a line break\n //console.log(newContent);\n for (var i = 0; i < myNotes.length; i++) {\n if (myNotes[i].id == noteId) {\n //console.log(myNotes[i].note);\n myNotes[i].note = newContent;\n //console.log(myNotes[i].note);\n Cookies.set('storedNotes', myNotes);\n noteDetailPanel.classList.remove('show');\n }\n }\n if (editorWasOpen === false) { //close the editor panel if it was already closed\n closeEditor();\n }\n}", "function saveData(event) {\n let divId = ($(event.target).parent().attr('id'));\n let newNote = ($(event.target).siblings('textarea').val())\n\n // checking that box contains string\n if ($(event.target).siblings('textarea').val()) {\n\n let existingNote = noteArray.find(function (note) {\n return note.id === divId;\n });\n if (existingNote) {\n existingNote.note = newNote;\n } else {\n noteArray.push({\n id: divId,\n note: newNote,\n })\n }\n localStorage.setItem('dayNotes', JSON.stringify(noteArray));\n save.text(\"Saved to Local Storage\");\n setTimeout(function () {\n save.text(\"\");\n }, 2000)\n }\n}", "function saveUltima(){\n\tsetData('last', {url: link[posActual], title: titulo[posActual]});\n}", "function recordToDo () {\n for (var i = 0; i < whatTimeIsIt.length; i++) {\n oldToDo[i] = $(`#${i}`).val().trim()\n }\n localStorage.setItem(\"oldToDo\", JSON.stringify(oldToDo));\n }", "function saveCurBnId (windowId, bnId) {\r\n options.lastcurbnid = sidebarCurId[windowId] = bnId;\r\n browser.storage.local.set({\r\n\tlastcurbnid_option: bnId\r\n });\r\n}", "saveNewRecipe() {\n if (this.state.newestRecipe.recipeName && this.state.newestRecipe.ingredients) {\n let recipes = this\n .state\n .recipes\n .slice();\n recipes.push({recipeName: this.state.newestRecipe.recipeName, ingredients: this.state.newestRecipe.ingredients});\n localStorage.setItem(\"recipes\", JSON.stringify(recipes));\n this.setState({recipes});\n this.setState({\n newestRecipe: {\n recipeName: \"\",\n ingredients: []\n }\n })\n }\n this.close();\n }", "function updateNote(e){\n let note = notes[e.path[1].classList[0].split(\"id\")[1]];\n switch(e.target.name){\n case \"title\":\n note.title = e.target.value;\n break;\n case \"content\":\n note.content = e.target.value;\n break;\n case \"color\":\n e.path[1].style.backgroundColor = e.target.value;\n note.color = e.target.value;\n break;\n }\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function save(title){\n var names = [];\n model.selected.map(function(selected){\n names.push(selected.name);\n });\n\n\n storageService.setItem(title,names);\n\n }", "function save(onSaved) {\n\t\t// store as an object\n\t\tvar store = {};\n\n\t\t//required inputs\n\t\tif (!birthDateInput.value || !lifeInput.value) {\n\t\t\treturn;\n\t\t}\n\n\t\tstore[STORAGE_BIRTH_NAME] = birthDateInput.value;\n\t\tstore[STORAGE_LIFE_NAME] = parseInt(lifeInput.value);\n\t\tstore[STORAGE_FASTCOUNT_NAME] = fastCountInput.checked;\n\t\tstore[STORAGE_COLORS_NAME] = [backColInput.value, textColInput.value, numColInput.value];\n\n\t\t//CALLBACK TO FINISH UP\n\t\tchrome.storage.sync.set({data: store}, onSaved);\n\t}", "function save() {\n \n try {\n if (typeof (localStorage) === 'undefined') {\n alert('Your browser does not support HTML5 localStorage. Try upgrading.');\n } else {\n try {\n window.localStorage.setItem(\"currency\", totalCurrency.toString());\n window.localStorage.setItem(\"cps\", CPS.toString());\n window.localStorage.setItem(\"inventory\", ko.toJSON(appView));\n window.localStorage.setItem(\"totalClicks\", appView.player.totalClicks());\n window.localStorage.setItem(\"totalMoneySpent\", appView.player.totalMoneySpent());\n } catch (e) {\n if (e === QUOTA_EXCEEDED_ERR) {\n alert('Quota exceeded!');\n }\n }\n }\n } catch (e) {\n window.status = e.message;\n }\n\n lastSave = new Date();\n}", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "function saveNotebook(notebookFileName) {\n\tif (!desktop) {\n\t var notebookFullPath = $('#' + notebookFileName).data('fullpath');\n\t writeFile(notebookFullPath, $('#txtCache-' + notebookFileName).text(), function(){});\t\t\n\t}\n }", "function saveNote(note, noteArr){\n // if the array is not empty push to the list then write\n if(noteArr){\n noteArr.push(note);\n fs.writeFileSync(path.join(__dirname, '../data/notes.json'), JSON.stringify({notes: noteArr}, null, 2));\n return noteArr;\n }\n // else if empty, assign note as array then write\n noteArr = note;\n fs.writeFileSync(path.join(__dirname, '../data/notes.json'), JSON.stringify({notes: noteArr}, null, 2));\n return noteArr;\n}", "function save() {\n events.push({date:document.forms[0].taskDate.value, title: document.forms[0].taskTitle.value});\n localStorage.setItem(\"events\", JSON.stringify(events));\n location.reload();\n}", "function storeNotes(key, value){\n // take our date-names for each content column and store it as our key\n //set the key value to the content in the textarea of our content column\n localStorage.setItem(key, value);\n }", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function savesaveInfoLocalStorage(evt){\n saveInfoLocalStorage[evt.currentTarget.name] = evt.currentTarget.value;\n setsaveInfoLocalStorage(saveInfoLocalStorage);\n}", "function buttonPressed() {\n var book = document.getElementById(\"bookName\");\n document.getElementById(\"currentBook\").append(book.value);\n var bookVal = book.value;\n\n var chapter = document.getElementById(\"chapterNumber\");\n document.getElementById(\"chapterChapter\").append(chapter.value);\n var chapterVal = chapter.value;\n\n var minute = document.getElementById(\"minuteMarker\");\n document.getElementById(\"minuteMark\").append(minute.value);\n var minuteVal = minute.value;\n\n var character = document.getElementById(\"characterList\");\n document.getElementById(\"characters\").append(character.value);\n var characterVal = character.value;\n\n var bookNote = document.getElementById(\"bookNotes\");\n document.getElementById(\"notes\").append(bookNote.value);\n var bookNoteVal = bookNote.value;\n\n //store the name of the book\n //will be saved to local storage\n localStorage.setItem(\"book\", bookVal);\n localStorage.setItem(\"chapter\", chapterVal);\n localStorage.setItem(\"minute\", minuteVal);\n localStorage.setItem(\"character\", characterVal);\n localStorage.setItem(\"bookNote\", bookNoteVal);\n}", "function storeNote() {\n let title = document.getElementById(\"title\").value; //receives text from input field\n let note = document.getElementById(\"takeNote\").value; //recieves text from textarea\n note = note.replace(/\\n\\r/g, \"<br />\"); //replace \\n \\r with \"<br />\" as notices are stored as an string\n if ((title || note) == \"\") {\n //leave function if title or note are empty\n return;\n }\n\n titles.push(title); //store title in array titles\n notes.push(note); //store note in array notes\n setArray(\"titles\", titles); //store also under localStorage\n setArray(\"notes\", notes); //store also under localStorage\n\n document.getElementById(\"title\").value = \"\"; // delete input title\n document.getElementById(\"takeNote\").value = \"\"; // delete input notes\n\n showNotes(\"my-notes\", titles, notes); //shows update notes\n}", "function saveRecents() {\n // // saves entire Object to local storage\n localStorage.setItem('Recent Cities', JSON.stringify(recentSearches));\n }", "function saveNotes(note) {\n // Set the note's id to the length of the array\n note.id = data.length;\n // push the note onto the current json array\n data.push(note);\n // write the updated array to the json file\n fs.writeFile(dbPath, JSON.stringify(data), error => {\n if(error){\n throw error;\n }\n });\n\n}", "function saveEntry(){\n var entry = {\n \"date\" : currentEntryDate.toDateString(),\n \"text\" : document.getElementById(\"entry\").value\n };\n\n var journal = JSON.parse(localStorage.getItem(\"journal\"));\n \n if(entry.text == localStorage.getItem(\"template\") || entry.text == \"\"){\n // don't save and actually delete stored entry if it exists\n journal = journal.filter(function(e) { return e.date != entry.date; })\n } else if (journal.filter(function(e) { return e.date === entry.date; }).length < 1){\n journal.push(entry);\n } else {\n journal.filter(function(e) { return e.date === entry.date; })[0].text = entry.text;\n }\n localStorage.setItem(\"journal\", JSON.stringify(journal));\n}", "function deleteNote(index)\n{\n//console.log(\"deleting\",index);\nlet notes=localStorage.getItem(\"notes\");\nif (notes===null)\n{\nnotesObj=[];\n}\nelse\n{\nnotesObj=JSON.parse(notes);\n}\nnotesObj.splice(index,1);\nlocalStorage.setItem(\"notes\",JSON.stringify(notesObj));\nshowNotes();\n}", "function important(importantValue) {\r\n\r\n let importantDum = localStorage.getItem('importantDum')\r\n\r\n if (importantDum == null) {\r\n importantDumObj = [];\r\n } else {\r\n importantDumObj = JSON.parse(importantDum)\r\n }\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 importantObj[importantValue] = \"btn-danger\";\r\n notesObj.unshift(notesObj[importantValue])\r\n timeObj.unshift(timeObj[importantValue])\r\n tObj.unshift(tObj[importantValue])\r\n importantObj.unshift(importantObj[importantValue])\r\n // notesObj.splice(, 1);\r\n var add = parseInt(importantValue) + 1\r\n tObj.splice(add, 1);\r\n timeObj.splice(add, 1);\r\n notesObj.splice(add, 1);\r\n importantObj.splice(add, 1);\r\n console.log(add)\r\n\r\n localStorage.setItem('important', JSON.stringify(importantObj));\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n localStorage.setItem('time', JSON.stringify(timeObj));\r\n localStorage.setItem(\"title\", JSON.stringify(tObj));\r\n\r\n showNotes()\r\n\r\n}", "function saveBook(e) {\n var newAuthor;\n var index;\n\n // loop to find the book object id that matches the id of the save button clicked\n for (var i=0; i<books.length; i++) {\n if ( books[i].id === e.target.id ) {\n index = i;\n break;\n }\n }\n\n // check if there are authors returned from google\n if(!books[index].volumeInfo.authors) {\n // if no authors, save a text string\n newAuthor = \"No Author provided.\";\n }\n // check if multiple authors, then join them together as one string to save\n else if(books[index].volumeInfo.authors.length > 1) {\n newAuthor = books[index].volumeInfo.authors.join(\", \");\n }\n // only a single author to save\n else {\n newAuthor = books[index].volumeInfo.authors[0];\n };\n // save the index of the book save button clicked\n bookIndex = books[index].id;\n // call save book route to save the book to database\n API.saveBook({\n title: books[index].volumeInfo.title,\n // sometimes no thumbnail image returned from google and need to handle this\n image: books[index].volumeInfo.imageLinks ? books[index].volumeInfo.imageLinks.thumbnail : \"https://dummyimage.com/128x206/c4bfb2/051421.jpg&text=No+Image+\",\n link: books[index].volumeInfo.infoLink,\n // sometimes no book description returned from google and need to handle this\n synopsis: books[index].volumeInfo.description ? books[index].volumeInfo.description : \"No description available for this book.\",\n author: newAuthor\n })\n .then(res => {\n // call update books to remove the just saved book from page\n updateBooks(bookIndex);\n })\n .catch(err => console.log(err));\n }", "function save() {\n localStorage.setItem(\"toys\", toys);\n localStorage.setItem(\"click\", mClickUpgrade.amount);\n localStorage.setItem(\"autoClicker\", mAutoClicker.amount);\n localStorage.setItem(\"multiplier\", mMultiplier.amount);\n localStorage.setItem(\"toyShop\", mToyShop.amount);\n localStorage.setItem(\"toyFactory\", mToyFactory.amount);\n localStorage.setItem(\"hiddenToyLayer\", mHiddenToyLayer.amount);\n}", "function deleteNote(index){\r\n\r\nlet 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 \r\n notesObj.splice(index, 1);\r\n localStorage.setItem('notes', JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function fnSave(data){\n var key = Date.now();\n window.localStorage.setItem(key, data);\n }", "function restoreStudy(){\n $('[data-save]').each(function(){\n $(this).val(localStorage.getItem(prefix+'/'+currentTopic+'-'+$(this).attr('data-save')));\n });\n }", "function saveBookMarks(){\r\n var bookmarkstring = JSON.stringify(bookMarksArray);\r\n setCookie(\"bbBookmarks\",bookmarkstring,365);\r\n}", "function save() {\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(tasks));\n localStorage.setItem(LOCAL_STORAGE_SELECTED_LIST_ID, selectedListId);\n}", "function getNotes(){\n var notes = $('#notesInput').val().toUpperCase();\n localStorage.setItem(\"notes\", notes);\n}", "function handleSaveItem(event){\n //Console readout\n //console.log(\"Saving item...\")\n \n //Convert the button that was clicked to a jQuery DOM item\n var target = $(event.target);\n\n //Check if the save icon is clicked instead of the button itself and adjust handle accordingly\n if (target.hasClass(\"fas\")){\n saveButton = $(event.target).parent();\n }else{\n saveButton = target;\n }\n \n //Get index for data save from data attribute \n var index = saveButton.parent().children('textarea').data('index');\n\n //Get entered text for timeblock\n var text = saveButton.parent().children('textarea').val();\n\n //Enter item into local storage\n localStorage.setItem(index,text);\n\n}", "function saveAppointment(time, details) {\n const newAppointment = {\n time: time,\n title: details\n }\n\n newArray = JSON.parse(localStorage.getItem(\"newArray\")) || [];\n\n newArray = newArray.filter(appointment => appointment.time !== newAppointment.time);\n\n newArray.push(newAppointment);\n\n localStorage.setItem('newArray', JSON.stringify(newArray))\n \n }", "function save(){\n\t\tvar y =$(this).attr(\"id\");\n\t\tvar g= JSON.stringify(y);\n\t\tlocalStorage.setItem(y, $(this).val()); // localStorage.setItem(\"lastname\", \"Smith\"); localStorage.getItem(\"lastname\");\n\t}", "function updateLastSavedInfo( backend, location ) {\n storage.lastSave.backend(backend);\n storage.lastSave.location(location);\n console.warn('UPDATED lastSave, backend: '+ storage.lastSave.backend() +', location: '+ storage.lastSave.location());\n}", "save() {\n const tasksJson = JSON.stringify(this.tasks);\n localStorage.setItem('tasks', tasksJson);\n const currentId = String(this.currentId);\n localStorage.setItem('currentId', currentId);\n }" ]
[ "0.6889759", "0.6830773", "0.6721873", "0.665003", "0.6529996", "0.64651877", "0.6408103", "0.63371915", "0.63097274", "0.6290464", "0.6288387", "0.6253941", "0.62266415", "0.6226308", "0.6210228", "0.6207492", "0.6185355", "0.61621946", "0.61540675", "0.6145155", "0.61446375", "0.61419827", "0.6127748", "0.61266935", "0.6106884", "0.6061331", "0.6057337", "0.6043616", "0.60411644", "0.60407054", "0.6029039", "0.6017118", "0.6005673", "0.6001267", "0.60007167", "0.598876", "0.59755546", "0.59616137", "0.59517884", "0.59439397", "0.5918638", "0.5912633", "0.5909341", "0.5897537", "0.58921754", "0.5880957", "0.58804303", "0.58588326", "0.5858539", "0.584724", "0.5845725", "0.5835457", "0.5824227", "0.5816675", "0.5816257", "0.58094734", "0.5803498", "0.57913035", "0.57877266", "0.5750801", "0.57506746", "0.5732321", "0.5731899", "0.5722852", "0.57146955", "0.5714687", "0.5711293", "0.56804544", "0.5674967", "0.56731904", "0.56687367", "0.5666939", "0.56647843", "0.56647134", "0.5662126", "0.565935", "0.5657978", "0.5657247", "0.56569606", "0.5654242", "0.5649542", "0.5646694", "0.5645554", "0.56402296", "0.5633885", "0.5628229", "0.5625085", "0.5620599", "0.5613228", "0.5612063", "0.5611542", "0.5609522", "0.5604063", "0.5598713", "0.55965126", "0.5596154", "0.55959207", "0.55943793", "0.55938154", "0.55919784" ]
0.77963895
0
constructor for creating noteBooks
function NoteBookObject(title) { this.titleOfObject = title; this.getTitle = function () { return this.titleOfObject; }; this.setTitle = function (newTitle) { this.titleOfObject = newTitle; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(notes) {\n this.notes = notes\n }", "constructor(title, author, isbn) {\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n }", "constructor(books){\n\t\tsuper();\n\t\tthis.books = books;\n\t}", "constructor(title, author, isbn) {\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n }", "function NewBook(title, author) {\n this.title = title;\n this.author = author;\n}", "function book(title, author, pageNum, read) { //constructor\n \n this.title = title\n this.author = author\n this.pageNum = pageNum\n this.read = read\n \n}", "constructor(id, title, author,isbn,location,picture,idUsers,description) {\n /**\n * Class Book\n * Creates an object Book\n * \n * @param id\n * @param title string is the title of the book\n * @param author string is the author of the book\n * @param isbn int is the isbn of a book\n * @param location string is the City or University location of the Book\n * @param picture string is the name of the picture\n * @returns book object\n */\n this.id = id;\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n this.location = location;\n this.picture = picture;\n this.idUsers = idUsers;\n this.description = description;\n }", "function Book(title,author,isbn){\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n}", "function Book(title, author, isbn) {\r\n this.title = title;\r\n this.author = author;\r\n this.isbn = isbn;\r\n}", "constructor(title, author, pages, hasRead) {\n this.title = title ? title : \"--\";\n this.author = author ? author : \"--\";\n this.pages = pages ? pages : \"--\";\n this.hasRead = hasRead ? hasRead : false;\n this.id = bookId++;\n }", "function Book(title, author, isbn) {\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n}", "function Book(title, author, isbn) {\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n}", "function Book(title, author, isbn) {\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n}", "function Book(title, author, isbn) {\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n}", "function Book(title, author, isbn) {\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n}", "function book(title, author, pages) {\n this.title = title;\n this.author = author;\n this.pages = pages;\n //this.read = read;\n}", "function Book(title, author, pages, read){\n this.title = title;\n this.author = author;\n this.pages = pages;\n this.read = read;\n}", "function Book(title, author, pages, isRead) {\n this.title = title;\n this.author = author;\n this.pages = pages;\n this.isRead = isRead;\n}", "function Book(title, author, pages, read) {\n this.title = title,\n this.author = author,\n this.pages = pages,\n this.read = read\n}", "constructor(title, author, isbn) {\n // whatever passes in as params will be assigned to title, author, isbn\n this.title = title;\n this.author = author;\n this.isbn = isbn;\n }", "function Book(title, author, pages) {\n this.title = title\n this.author = author\n this.pages = pages\n}", "function Book(title, author, pages,read){\n this.title = title\n this.author = author\n this.pages = pages + \" Pages\";\n this.haveRead = read\n }", "constructor(nombre,precio,isbn){\r\n super(nombre,precio);\r\n this.isbn = isbn;\r\n }", "function Book(title, pages){\n this.title = title;\n this.pages = pages;\n}", "function Book(title, author){\n this.title = title\n this.author = author\n}", "function Book(title, author, pages, readStatus) {\n this.title = title\n this.author = author\n this.pages = pages\n this.readStatus = readStatus\n this.info = () => `${this.title} by ${this.author}, ${this.pages} pages - ${this.readStatus}`\n}", "function Book(title,author,pages, read = false) {\n this.title = title,\n this.author = author,\n this.pages = pages,\n this.read = read\n}", "function bookFromForm(title, author, pages, read){\n myLibrary.push(new Book(title, author, pages, read))\n\n}", "constructor() {\n\t\tthis.notes = [\n\t\t\t {\n\t\t\t \"title\":\"Test Title\",\n\t\t\t \"text\":\"Test text\",\n\t\t\t \"id\": 0\n\t\t\t }\n\t\t\t];\n\t}", "function book(title, author, pages) {\r\n this.title = title\r\n this.author = author\r\n this.pages = pages\r\n this.read = 'not'\r\n this.info = function() {\r\n return `${title} by ${author}, ${pages} pages.`\r\n }\r\n }", "function Book(title, author, totalPages, status) {\n this.title = title\n this.author = author\n this.totalPages = totalPages\n this.status = status\n\n addBookToLibrary(this);\n}", "function Book(name, author, pages, readStatus) {\r\n this.name = name;\r\n this.author = author;\r\n this.pages = pages;\r\n this.readStatus = readStatus;\r\n}", "constructor(name, age, school) {\n this.name = name \n this.age = age \n this.school = school\n this.booksInProgress = []\n this.booksRead = []\n\n }", "function Book(title, pages){\n //call the \"parent\" (LibraryItem) constructor function\n //shares Book's \"this\" with the LibraryItem constructor\n LibraryItem.call(this);\n\n this.title = title;\n this.pages = pages;\n}", "function createNoteBooksFromLocalStorage() {\n if (localStorage.getItem(\"lastVisitedNoteBook\" != null)) {\n openNotebook = localStorage.getItem(\"lastVisitedNoteBook\");\n }\n if (getLocalStorageListsToArray(\"books\") != null) {\n getLocalStorageListsToArray(\"books\").forEach((element) => {\n createNoteBook(element);\n });\n }\n}", "function Book(title, author, pages, read, id){\n this.title = title;\n this.author = author;\n this.pages = pages;\n this.read = read;\n this.id = id;\n this.info = () => `${this.title} by ${this.author}, ${this.pages} pages, ${this.read}`;\n}", "function Book (pages, author) {\n this.pages = pages;\n this.author = author;\n}", "function Book (pages, author) {\n this.pages = pages;\n this.author = author;\n}", "function Book (pages, author) {\n this.pages = pages;\n this.author = author;\n}", "function Book (pages, author) {\n this.pages = pages;\n this.author = author;\n}", "function Book (pages, author) {\n this.pages = pages;\n this.author = author;\n}", "function Book (pages, author) {\r\n this.pages = pages;\r\n this.author = author;\r\n}", "function Book(title, author, pages, read) {\n this.title = title;\n this.author = author;\n this.pages = pages;\n this.read = read;\n this.info = function() {\n return `${title} by ${author}, ${pages} pages, ${read}`\n }\n this.export = function() {\n return [title, author, pages, read]\n }\n}", "function Book(info) {\n this.image_url= info.imageLinks?info.imageLinks.thumbnail:'https://i.imgur.com/J5LVHEL.jpg';\n this.title = info.title || 'No title available';\n this.author=info.authors;\n this.description=info.description;\n this.isbn=info.industryIdentifiers ? info.industryIdentifiers[0].identifier: 'No isbn';\n}", "function bookDetail(\n title,\n author,\n publishedDate,\n description,\n category,\n price,\n currencyCode,\n thumbnail\n) {\n this.title = title;\n this.author = author;\n this.publishedDate = publishedDate;\n this.description = description;\n this.category = category;\n this.price = price;\n this.currencyCode = currencyCode;\n this.thumbnail = thumbnail;\n}", "function Book(title, author, genre, numPages) {\n this.title = title\n this.author = author\n this.genre = genre\n this.numPages = numPages\n}", "constructor(book, uuid) {\n\t\tthis.book = book;\n\t\tconst noteDir = path.join(this.book.dir, uuid + '.' + QUIVER_NOTE_EXTENSION);\n\t\tconst metaFile = path.join(noteDir, FILE_META);\n\t\tconst contentFile = path.join(noteDir, FILE_CONTENT);\n\t\tconst esaFile = path.join(noteDir, FILE_ESA);\n\n\t\ttry {\n\t\t\tconst meta = fs.readFileSync(metaFile, 'utf-8');\n\t\t\tconst content = fs.readFileSync(contentFile, 'utf-8');\n\n\t\t\tthis.meta = JSON.parse(meta);\n\t\t\tthis.content = JSON.parse(content);\n\t\t} catch (e) {\n\t\t\tthis.meta = null;\n\t\t\tthis.content = null;\n\t\t}\n\n\t\ttry {\n\t\t\tconst esa = fs.readFileSync(esaFile, 'utf-8');\n\t\t\tthis.esa = JSON.parse(esa);\n\t\t} catch (e) {\n\t\t\tthis.esa = null;\n\t\t}\n\t}", "constructor(isbn,image,title){\n this.isbn=isbn;\n this.image = image\n this.title=title\n \n}", "function addBooksToLibrary(title, author, pages) {\r\n let newItem = new book(title, author, pages); \r\n myLibrary.push(newItem);\r\n }", "function Book(name, author, type)\n{\n this.name = name;\n this.author = author;\n this.type = type;\n}", "function Book(name, author, type) {\n this.name = name;\n this.author = author;\n this.type = type\n}", "function Book(titleParam, authorParam, pagesParam) { \n\t// 'this' keyword binds to the new created instance of the object.\n\tthis.title = titleParam;\n\tthis.author = authorParam;\n\tthis.pages = pagesParam;\n}", "function createNewBook() {\n const book = new Book(\n document.querySelector(\"#name\").value,\n document.querySelector(\"#author\").value,\n document.querySelector(\"#pages\").value,\n document.querySelector(\"#read\").value == \"true\" ? true : false\n );\n addBookToLibrary(book);\n updateLocalStorage(myLibrary);\n displayBook(book);\n toggleForm();\n}", "constructor(id,title,ISBN,publishedDate,author){\n this.id=id;\n this.title=title;\n this.ISBN=ISBN;\n this.publishedDate=publishedDate;\n this.author=author;\n }", "function createBook(bookTitle, name1, name2) {\n let book = {};\n // The first property of the book object is assigned the value of bookTitle for when an aurgument is passed into the function.\n // Then the property of author is given the value of an object.\n // Then two additional values are added to the author object. Creating an object inside of an object.\n //Then the book object is pushed into the books array.\n book.title = bookTitle;\n book.author = {};\n book.author.firstName = name1;\n book.author.lastName = name2;\n books.push(book);\n // console.log(books);\n}", "function createBook (){\n let titleInput = document.getElementById('titleInput').value\n let authorInput = document.getElementById('authorInput').value\n let pagesInput = document.getElementById('pagesInput').value\n let readInput = document.getElementById('readInput').value\n\n let book = new Book(titleInput, authorInput, pagesInput, readInput)\n\n document.getElementById('titleInput').value = ''\n document.getElementById('authorInput').value = ''\n document.getElementById('pagesInput').value = ''\n document.getElementById('readInput').value = 'No'\n\n pushBookToLibrary(book)\n}", "function Book(title, author, read, rating) {\n this.title = title;\n this.author = author;\n this.read = read;\n this.rating = rating;\n}", "function Book(title, author, price) {\n this.title = title;\n this.author = author;\n this.price = price;\n this.cover = null;\n this.id = null;\n this.added = null;\n this.isFavorite = false;\n\t\n return this;\n}", "function Book(obj) {\n this.image = obj.volumeInfo.imageLinks ? obj.volumeInfo.imageLinks.thumbnail : `https://i.imgur.com/J5LVHEL.jpg`;\n this.title = obj.volumeInfo.title ? obj.volumeInfo.title : 'Title not available';\n this.author = obj.volumeInfo.authors ? obj.volumeInfo.authors : 'Author(s) not available';\n this.description = obj.volumeInfo.description ? obj.volumeInfo.description : 'Description not available';\n this.isbn = obj.volumeInfo.industryIdentifiers ? obj.volumeInfo.industryIdentifiers[0].identifier : 'N/A';\n this.bookshelf = obj.volumeInfo.categories ? obj.volumeInfo.categories[0] : 'No Categories';\n}", "constructor(notes = []) {\n if (!notes.length) {\n this.notes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n } else {\n this.notes = notes\n }\n }", "function Book (pages, author) {\n this.pages = pages;\n this.author = author;\n }", "function initBooks() {\n\tvar initialBooks = [\n\t\t{ \n\t\t\ttitle: \"The Three Musketeers\", \n\t\t\tauthor: \"Alexandre Dumas\", \n\t\t\tcopies: 7, \n\t\t\tisbn: \"978-1-56619-909-4\" \n\t\t},\n\t\t{ title: \"Ivanhoe\", author: \"Sir Walter Scott\", copies: 2, isbn: \"978-1-46110-482-3\" },\n\t\t{ title: \"The Count of Monte Cristo\", author: \"Alexandre Dumas\", copies: 3, isbn: \"978-1-39912-897-1\" },\n\t\t{ title: \"Last of the Mohicans\", author: \"James Fenimore Cooper\", copies: 2, isbn: \"978-1-87140-981-4\" },\n\t\t{ title: \"Moby Dick\", author: \"Herman Melville\", copies: 8, isbn: \"978-1-09713-891-7\" },\n\t\t{ title: \"A Tale of Two Cities\", author: \"Charles Dickens\", copies: 14, isbn: \"978-1-67819-414-4\" },\n\t\t{ title: \"Robin Hood\", author: \"Howard Pyle\", copies: 1, isbn: \"978-1-18904-912-4\" },\n\t\t{ title: \"Arabian Nights\", author: \"Antony Galland\", copies: 6, isbn: \"978-1-89231-991-4\" }\n\t];\n\n\treturn initialBooks;\n}", "function Book(img, title, author, pages, read) {\r\n this.img = img;\r\n this.title = title;\r\n this.author = author;\r\n this.pages = pages;\r\n this.read = read;\r\n}", "function Book(name, author, type) {\r\n this.name = name;\r\n this.author = author;\r\n this.type = type;\r\n}", "function Book (length, author) {\n this.length = length;\n this.author = author;\n}", "function NewLibrary() {\n//this.property = value\n this.books = [];\n this.currentCallNumber = 0;\n}", "function Book(book) {\n this.title =data.volumeInfo.title ;\n this.author=data.volumeInfo.author;\n this.description=data.volumeInfo.description || *** Description current unavailable ***;\n this.thumbnail = data.volumeInfo.imageLinks.thumbnail || null;\n this.url = ;\n}", "function initNotebook(name, date) {\n\t//Create notebook object\n\tvar notebook = new Notebook(name, date);\n\n\t//Create file for notebook object\n\twriteNotebookToMongo(notebook);\n\n\t//Add to appropriate places\n\taddToNotebookList(name);\n\n\treturn notebook;\n}", "function addBookToLibrary(title, author, pages, read) {\n let book = new Book(title, author, pages, read);\n myLibrary.push(book);\n // do stuff here\n}", "function Book(title,author,rating){\n this.title = title\n this.author = author\n this.rating = rating\n}", "function addBookToLibrary(title, author, pages, isRead) {\n let newBook = new Book(title, author, pages, isRead);\n myLibrary.push(newBook);\n}", "constructor() { \n \n RecentsNote.initialize(this);\n }", "function Book(title, author, rating){\n this.title = title;\n this.author = author;\n this.rating = rating;\n}", "function Book(isbn) {\n this.isbn = isbn;\n this.getIsbn = function () {\n return `Isbn is ${this.isbn}`;\n };\n}", "function Book(title, author, rating) {\n this.title = title;\n this.author = author;\n this.rating = rating;\n}", "function createBook(name, style, pages, authorId, id) {\n var book = {};\n\n if (id) {\n $localStorage.books.forEach(function (item) {\n if (item.id === id) {\n item.name = name;\n item.style = style;\n item.pages = pages || 0;\n item.author = authorId;\n }\n });\n } else {\n book.name = name;\n book.style = style;\n book.pages = pages || 0;\n book.author = authorId;\n book.id = createId();\n }\n\n//***************************** creation an id for each book\n function createId() {\n var id = $localStorage.booksId;\n $localStorage.booksId = $localStorage.booksId + 1;\n return id;\n }\n\n $localStorage.books.push(book);\n\n }", "function Book(name, details, available){\n\tthis.bookName = name;\n\tthis.details = details;\n\tthis.available = available;\n}", "function Book (title, author, rating) {\n this.title = title;\n this.author = author;\n this.rating = rating;\n}", "function addBooksToNote(obj) {\n let noteDropDown = document.createElement(\"div\");\n let button = document.createElement(\"button\");\n let btnIcon = document.createElement(\"img\");\n let dropDownContent = document.createElement(\"div\");\n let dropDownList = document.createElement(\"ul\");\n\n noteDropDown.className = \"dropdown\";\n noteDropDown.appendChild(button);\n noteDropDown.appendChild(dropDownContent);\n\n button.className = \"note-button\";\n button.addEventListener(\"click\", () => {\n clearNoteDropDown();\n addBooksToDropDown(obj, dropDownContent);\n dropDownContent.style.display = \"block\";\n });\n button.appendChild(btnIcon);\n\n btnIcon.src = \"media/journal-plus.svg\";\n btnIcon.width = \"24\";\n btnIcon.height = \"24\";\n btnIcon.title = \"Move to notebook\";\n\n dropDownContent.className = \"dropdown-content shadow-sm\";\n dropDownContent.appendChild(dropDownList);\n\n return noteDropDown;\n}", "constructor(category) {\n\t\tthis.Cat = category;\n\t\tthis.cats = [\"Art\",\"Science\",\"Sport\",\"Literature\"];\n\t\tthis._Books = [];\n\t\t//myShelf._Books.push(new Book());\n\t}", "newNote(note) {\n const { title, text } = note;\n // This is input validation requiring the title and note to both have at least 1 character.\n if (!title || !text) {\n throw new Error(\"Note 'title' and 'text' both have a 1 character minimum requirement!\");\n }\n\n // This adds a unique ID to the new note as well as the title and text.\n const newNote = { title, text, id: uniqueID() };\n\n // This retrives all the notes, writes all the updated notes, adds the new note, and returns the newNote.\n return this.retrieveNotes()\n .then((notes) => [...notes, newNote])\n .then((updatedNotes) => this.writeFile(updatedNotes))\n .then(() => newNote);\n }", "function addBookToLibrary(title, author, pages, read) {\n let newBook = new Book(title, author, pages, read);\n libraryBooks.push(newBook);\n}", "function addBookToLibrary(){\n //book = {name:\"harry\", author:\"potter\", numPages:50, isRead:true}\n \n bookName = document.getElementById(\"bookNameField\").value;\n bookAuthor = document.getElementById(\"authorNameField\").value;\n bookNumPages = document.getElementById(\"numPagesField\").value;\n bookIsRead = document.getElementById(\"isReadField\").checked;\n\n let book = new Book(bookName, bookAuthor, bookNumPages, bookIsRead);\n myLibrary.push(book);\n addCard(book);\n}", "function Book(title, author, rating){\n\tthis.title = title;\n\tthis.author = author;\n\tthis.rating = rating;\n}", "function BookInformation(bookIdFromArry, language, author, imgLink) {\n this.BookInformation = bookIdFromArry;\n this.title = bookIdFromArry.toUpperCase();\n this.language = language;\n this.author = author;\n this.imgLink = imgLink;\n }", "createBook(book) {\n return this.ajaxCall(\"POST\", `libraries/${this.libraryID}/books`, {book});\n }", "function addtoLibrary(id, book, authorName, pages, read, list) {\n list.push(new Book(id, book, authorName, pages, read));\n}", "function book(type,pages,author,color,price,publishyear){\n //we use this to create a property for an object\n //this property should be the same as the parameter\n this.type=type\n this.pages=pages\n this.author=author\n this.color=color\n this.price=price\n this.publishyear=publishyear\n }", "function BookObj(title, author, pages, readval) {\n this.title = title;\n this.author = author;\n this.pages = pages;\n this.readval = readval;\n}", "function Book(obj) {\n this.title = obj.title;\n this.author = obj.author;\n this.numPages = obj.numPages;\n this.pubDate = new Date(obj.pubDate);\n}", "function Book(title, author, pages, read){\n return {title, author, pages, read}\n \n}", "function createNote(note) {\n return API.post(\"notes\", \"/notes\", {\n body: note\n });\n }", "function addBookToLibrary(title, author, numPages, read) {\n myLibrary.push(new Book(title, author, numPages, read));\n setLocalStorage();\n render();\n}", "function Book(title, author,pages) {\n this.title=title;\n this.author=author;\n this.pages=pages;\n\n this.info=function(){\n return title;\n }\n}", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "constructor(props) {\n super(props);\n\n this.onChangeBookTitle = this.onChangeBookTitle.bind(this);\n this.onChangeBookAuthor = this.onChangeBookAuthor.bind(this);\n this.onChangeBookContent = this.onChangeBookContent.bind(this);\n this.onSubmit = this.onSubmit.bind(this);\n\n this.state = {\n book_title: \"\",\n book_author: \"\",\n book_publishdate: \"\",\n book_content: \"\",\n books: [],\n };\n }", "constructor(nombre, precio, isbn) {\n super(nombre, precio); //Con la funcion \"Super\" le pasamos los valores que va a Heredar de la clase Padre!\n this.isbn = isbn;\n }", "function addBookToLibrary(name, author, pages, readStatus) {\r\n let book = new Book(name, author, pages, readStatus);\r\n myLibrary.push(book);\r\n render();\r\n}", "GETNOTEBOOKS (state, notebooks) {\n state.notebooks = notebooks\n }", "function addBookToLibrary() {\n\n\n const title = document.getElementById('booktitle').value\n const author = document.getElementById('author').value\n const pages = document.getElementById('pages').value\n const alreadyRead = document.getElementById('alreadyread').checked\n const book = new Book(title, author, pages, alreadyRead)\n myLibrary.push(book)\n updateTable()\n\n\n\n\n\n}" ]
[ "0.67296696", "0.67226857", "0.6698989", "0.6678348", "0.6586897", "0.6563157", "0.65227896", "0.64830065", "0.6471895", "0.647033", "0.6464934", "0.6464934", "0.6464934", "0.6464934", "0.6464934", "0.6458011", "0.6434612", "0.64255077", "0.6409026", "0.63710326", "0.6358817", "0.6327106", "0.63158846", "0.63106906", "0.62894034", "0.6279687", "0.6230428", "0.6225781", "0.6208433", "0.6175411", "0.61489105", "0.6148081", "0.6147085", "0.61321974", "0.61291474", "0.609952", "0.6095468", "0.6095468", "0.6095468", "0.6095468", "0.6095468", "0.6090415", "0.6069586", "0.6065074", "0.60519594", "0.60498554", "0.60440814", "0.60380465", "0.6023969", "0.6019853", "0.60130787", "0.60110974", "0.6008686", "0.60047144", "0.6003627", "0.59996766", "0.599519", "0.59922254", "0.5976152", "0.5947901", "0.5937564", "0.59272975", "0.59268194", "0.59247303", "0.59144443", "0.5909813", "0.5902125", "0.5881342", "0.58430916", "0.5838078", "0.58277994", "0.5822733", "0.58015394", "0.5799931", "0.579215", "0.57870257", "0.5783938", "0.5775383", "0.57679415", "0.5767352", "0.57542163", "0.5743926", "0.57423335", "0.57234246", "0.57139194", "0.5712427", "0.57034916", "0.5683208", "0.56759834", "0.5674663", "0.5663203", "0.5648963", "0.56458473", "0.56426567", "0.5624164", "0.561309", "0.55898285", "0.5588775", "0.5585703", "0.55728644" ]
0.5693161
87
Removes note books from local storage
function removeNoteBooks(titleToRemove) { //titleToRemove is a button event bound to the object when created for (let i = 0; i < existingNoteBooks.length; i++) { if (existingNoteBooks[i].titleOfObject == titleToRemove.titleOfObject) { existingNoteBooks.splice(i, 1); if (existingNoteBooks.length == 1) { localStorage.removeItem("books"); //Testar om bara dashboard är kvar och tar bort nyckeln helt. } saveNotesToLocalStorage(); saveNoteBooksToLocalStorage(); break; } } updateCurrentNoteBooks(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static removeBooks(isbn){\n const books=Store.getBooks();\n books.forEach((book , index) => {\n if(book.isbn === isbn){\n books.splice(index,1);\n }\n });\n //update the books in local storage\n localStorage.setItem('books',JSON.stringify(books));\n }", "function removeBookInStorage (book) {\n if(storageAvailable(\"localStorage\")) {\n localStorage.removeItem(`${book.timestamp}:title`);\n localStorage.removeItem(`${book.timestamp}:author`);\n localStorage.removeItem(`${book.timestamp}:status`);\n localStorage.removeItem(`${book.timestamp}:pages`);\n }\n}", "removeFromLS(isbn) {\n const books = getFromLocalStore();\n\n books.forEach((book, index) => {\n if (book.isbn === isbn) {\n books.splice(index, 1);\n }\n });\n\n localStorage.setItem(\"book\", JSON.stringify(books));\n }", "static removeBooks(title) {\r\n const books = Store.getBooks();\r\n\r\n books.forEach((book, index) => {\r\n if (book.title === title) {\r\n books.splice(index, 1);\r\n }\r\n });\r\n\r\n localStorage.setItem(\"books\", JSON.stringify(books));\r\n }", "static removeBook(isbn) {\n const books = Store.getBooks();\n books.forEach((book, index) => {\n if (book.isbn === isbn) {\n books.splice(index, 1);\n }\n });\n\n // Credit: https://bit.ly/3bmn4EQ\n // Reset Local Storage\n localStorage.setItem('books', JSON.stringify(books));\n }", "static removeBook(isbn){\n const books = Store.getBooks();\n // looping through the books to find proper book-isbn to remove\n books.forEach((book,index) => {\n if(book.isbn === isbn){\n // delete that 1 book from the mentioned index\n books.splice(index, 1);\n }\n });\n\n localStorage.setItem('books', JSON.stringify(books));\n }", "removeBooksFromLs(isbn) {\n const localStorageBooks = JSON.parse(localStorage.getItem('books'));\n localStorageBooks.forEach((book, index) => {\n if (book.isbn === isbn) {\n localStorageBooks.splice(index, 1);\n }\n })\n localStorage.setItem('books', JSON.stringify(localStorageBooks));\n }", "static removeBook(isbn){\n let books = Store.getBooks();\n\n // Add all books to list\n books.forEach(function(book, index){\n if(book.isbn === isbn){\n books.splice(index, 1);\n }\n });\n\n localStorage.setItem('books', JSON.stringify(books));\n }", "static removeBook(isbn){\r\n const books = Store.getBooks()\r\n\r\n // books aris titon object xolo index ukve misi mdebareoba listshi \r\n books.forEach((book, index) => {\r\n if(book.isbn === isbn){\r\n\r\n books.splice(index, 1)\r\n }\r\n })\r\n // varestartebt yvelafris shemdeg local storages\r\n localStorage.setItem('books', JSON.stringify(books))\r\n }", "static removeBook(isbn) {\n let books = Store.getBooks();\n books.forEach((book, index) => {\n if (book.isbn === isbn) {\n books.splice(index, 1);\n }\n });\n\n localStorage.setItem(\"books\", JSON.stringify(books));\n }", "static removeBook(isbn) {\r\n const books = Store.getBooks();\r\n\r\n books.forEach((book, index) => {\r\n if (book.isbn === isbn) {\r\n books.splice(index, 1);\r\n }\r\n });\r\n\r\n localStorage.setItem('books', JSON.stringify(books));\r\n }", "removeBooks(title) {\n //Good Morning ^^\n let store = this.getbooks();\n\n //Bye Bye ;P\n localStorage.setItem(\"books\", JSON.stringify(store));\n }", "function removeBook(book_id) {\n if (confirm(\"This book will be deleted from the list\")) {\n var rem = bookInStore.findIndex(\n (remove, index) => remove.BookID == book_id\n );\n\n bookInStore.splice(rem, 1);\n console.log(bookInStore);\n localStorage.setItem(\"BookSelf\", JSON.stringify(bookInStore));\n self();\n }\n}", "static removeBook(isbn) {\n\t\tconst books = Store.getBooks();\n\n\t\tbooks.forEach(function (book, index) {\n\t\t\tif (book.isbn == isbn) {\n\t\t\t\t//this will remove 1 book form the current index\n\t\t\t\tbooks.splice(index, 1);\n\t\t\t}\n\t\t});\n\t\tlocalStorage.setItem(\"books\", JSON.stringify(books));\n\t\tconsole.log(isbn);\n\t}", "function removeBook() {\n $(this).parent().attr('style', 'display: none');\n var isbnRetrieval = $(this).siblings().eq(2).prevObject[1].innerHTML;\n for (var i = 0; i < storageArr.length; i++) {\n if (isbnRetrieval === storageArr[i]) {\n var indexRemoval = storageArr.indexOf(isbnRetrieval);\n storageArr.splice(indexRemoval, 1);\n localStorage.setItem('book', JSON.stringify(storageArr));\n }\n }\n}", "function removeNotes() {\n $(\".note\").remove();\n saveNotes();\n}", "static removeFromLs(isbnValue) {\n let booksAfterDelete = storage.getStorageData();\n\n booksAfterDelete.forEach( (book, index)=> {\n if (isbnValue === book.isbn) {\n booksAfterDelete.splice(index, 1);\n }\n });\n\n localStorage.setItem('storedBooks', JSON.stringify(booksAfterDelete));\n }", "function deleteNote(index)\n{\n//console.log(\"deleting\",index);\nlet notes=localStorage.getItem(\"notes\");\nif (notes===null)\n{\nnotesObj=[];\n}\nelse\n{\nnotesObj=JSON.parse(notes);\n}\nnotesObj.splice(index,1);\nlocalStorage.setItem(\"notes\",JSON.stringify(notesObj));\nshowNotes();\n}", "function deleteBook(bookid){\n index_id = bookid;\n console.log(\"In Delete Box\");\n // notesObj = ConvertToArray();\n \n // for(let i = 0;i < notesObj.length;i++){\n // if(notesObj[i]['id'] === index){\n // notesObj.splice(i, 1);\n // localStorage.setItem(\"notes\",JSON.stringify(notesObj));\n // tableBody.innerHTML = \"\";\n // threshold();\n // return;\n // }\n // }\n \n \n}", "function removeBook() {\n const book = this.parentElement;\n for (let i = 0; i < library.length; i++) {\n if (library[i].timestamp.toString() === book.id) {\n removeBookInStorage(library.splice(i,1)[0]);\n break;\n }\n }\n book.remove();\n}", "function deleteNote(index){\r\n\r\nlet 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 \r\n notesObj.splice(index, 1);\r\n localStorage.setItem('notes', JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote() {\n card_body = $(this).parent();\n card = $(this).parent().parent();\n\n text_delete_title = card_body.find($('textarea')).val();\n changeStatus(text_delete_title, \"binned\");\n\n localStorage.setItem(\"Notes\",JSON.stringify(notes));\n card.remove();\n \n $('.toast').toast(\"show\");\n}", "function deleteNote() {\n const note = notes.value;\n window.localStorage.removeItem(note);\n editor.value = '';\n for (let i = 0; i < notes.length; i++) {\n const option = notes[i];\n if (option.value === note) {\n notes.removeChild(option);\n }\n }\n}", "function deleteBook() {\n var r = confirm(\"Do you really want to delete this book?\");\n if (r == true) {\n var isbn = $('.isbn').html();\n var database = JSON.parse(localStorage.getItem(\"database\"));\n for( i=database.books.length-1; i>=0; i--) {\n if( database.books[i].ISBN == isbn) database.books.splice(i,1);\n }\n localStorage.setItem(\"database\", JSON.stringify(database));\n window.location.replace(\"/\");\n } else {\n\n }\n\n}", "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n };\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n \n \n let notesTitle = localStorage.getItem('notesTitle');\n if (notesTitle == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(notesTitle);\n };\n titleObj.splice(index, 1);\n localStorage.setItem('notesTitle', JSON.stringify(titleObj));\n // localStorage.removeItem('Name2');\n showNotes();\n}", "function deleteNote(index) {\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 notesObj.splice(index,1);//removes JS array elements and adds the existing elements back in place\r\n localStorage.setItem('notes', JSON.stringify(notesObj));//to update the local storage\r\n showNotes();\r\n\r\n}", "removeEbook(e){\n let id = e.target.id\n console.log(id)\n let ebook = JSON.parse(localStorage.getItem('ebook'));\n for (let c = 0 ; c < ebook.result.length ;c++){\n if(ebook.result[c].book === id){\n ebook.result.splice(c,1)\n }\n }\n localStorage.setItem('ebook',JSON.stringify(ebook))\n window.location.href= '/display/my%20list'\n }", "removeAudioBook(e){\n let id = e.target.id\n console.log(id)\n let audiobook = JSON.parse(localStorage.getItem('audiobook'));\n for (let c = 0 ; c < audiobook.result.length ;c++){\n if(audiobook.result[c].book === id){\n audiobook.result.splice(c,1)\n }\n }\n localStorage.setItem('audiobook',JSON.stringify(audiobook))\n window.location.href= '/display/my%20list'\n }", "function remove(items) {\r\n const notearray = localStorage.getItem(\"items\")\r\n ? JSON.parse(localStorage.getItem(\"items\"))\r\n : [];\r\n const todoindex = items.childNodes[0].innerText;\r\n notearray.splice(notearray.indexOf(todoindex), 1);\r\n localStorage.setItem(\"items\", JSON.stringify(notearray));\r\n}", "function deleteNote(note) {\n setAllNotes(allNotes.filter(item => item !== note));\n const notesDataJson = JSON.stringify(allNotes);\n localStorage.setItem('notesData', notesDataJson);\n }", "function deleteNote(index){\r\n // console.log(\"I am deleting\",index);\r\n let notes = localStorage.getItem('notes')\r\n if(notes==null){\r\n notesObj = [];\r\n }else{\r\n notesObj = JSON.parse(notes)\r\n\r\n }\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\r\n //console.log(\"Deleting Note\",index);\r\n let notes = localStorage.getItem(\"notes\");\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index){\n console.log(\"Something deleted\");\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 notesObj.splice(index,1);\n titlesObj.splice(index,1);\n notes=JSON.stringify(notesObj);\n titles=JSON.stringify(titlesObj);\n localStorage.setItem('notes',notes);\n localStorage.setItem('title',titles);\n showNotes();\n}", "function deleteNote(index) {\n// console.log(\"I am deleting\", index);\nlet confirmDel = confirm(\"Delete this note?\");\nif (confirmDel == true) {\n \n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}\n}", "function deleteNote(index){\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 // splice will remove element from index, here splice(index from where it should be remove, howmany element shoudl be remove)\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index){\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 // splice will remove element from index, here splice(index from where it should be remove, howmany element shoudl be remove)\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\r\n // console.log(\"I am deleting\", index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n //for deleting use slice function.\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function removeSavedCourse(book_item_id) {\n book_item_id.remove();\n}", "function deleteNote(index){\n // console.log('i am deleting' , index);\n let notes = localStorage.getItem(\"notes\");\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index , 1);\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\n shownotes();\n}", "function deleteNote(index) {\n // console.log(`I am Deleating the notes no :${index}`);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesArr = [];\n }\n else {\n notesArr = JSON.parse(notes);\n }\n notesArr.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesArr));\n showNotes();\n}", "function deleteNote(index) {\r\n// console.log(\"I am deleting\", index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteFromLocalStorage(myTitle, mySubtitle) {\n let storage = JSON.parse(localStorage.getItem('notes'));\n\n for (let i = 0; i < storage.length; i++) {\n if (storage[i].title === myTitle && storage[i].subtext === mySubtitle) {\n //delete from LS\n storage.splice(i, 1);\n }\n }\n\n //update LS\n localStorage.setItem('notes', JSON.stringify(storage));\n}", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1)\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n markedObj.splice(index, 1);\n titleObj.splice(index, 1);\n localStorage.setItem(\"marked\", JSON.stringify(markedObj));\n localStorage.setItem(\"title\", JSON.stringify(titleObj));\n showNotes();\n}", "function deleteNote(index){\n console.log('I am deleting Note no ', index);\n const notes= localStorage.getItem('notes');\n if(notes==null){\n notesObj= [];\n }\n else{\n notesObj= JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n console.log(notesObj);\n}", "function deleteNote(index) {\n //console.log(\"Deleting : \", index);\n let noteField = localStorage.getItem(\"data\");\n if (noteField == null) {\n noteArray = [];\n } else {\n noteArray = JSON.parse(noteField);\n }\n\n noteArray.splice(index, 1); //Splice function to remove elements in array\n localStorage.setItem(\"data\", JSON.stringify(noteArray));\n //console.log(\"Deleted\");\n display();\n}", "function deleteNote(index)\n{\n console.log(\"I am clicking\" , index)\n let notes = localStorage.getItem('notes');\n if (notes == null)\n {\n notesObj = [];\n }\n else\n {\n notesObj = JSON.parse(notes);\n \n }\n\n notesObj.splice(index,1)\n localStorage.setItem(\"notes\" , JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\r\n console.log(\"deleting this node.\", index);\r\n let notes = localStorage.getItem(\"notes\"); //take notes from localstorage.\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));//updating localstorage..\r\n showNotes();\r\n\r\n}", "RemoveBook(BookId) {\n const BookContainer = document.getElementById(BookId);\n BookContainer.parentNode.removeChild(BookContainer);\n const BooksNew = [];\n\n /* eslint-disable */\n for (const i in this.bookListCollection) {\n if (this.bookListCollection[i].id !== BookId) {\n BooksNew.push(this.bookListCollection[i]);\n }\n }\n\n /* eslint-enable */\n this.bookListCollection = BooksNew;\n localStorage.clear();\n const BookList = JSON.stringify(BooksNew);\n\n // eslint-disable-next-line no-unused-vars\n localStorage.setItem('library', BookList);\n }", "function deleteNote(index) {\n // console.log(\"I am deleting\", index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function removeBook(e) {\n let bookIndex = e.target.dataset.index;\n library.splice(bookIndex, 1);\n createTable();\n saveLibrary(library);\n}", "function deleteNote(index){\n console.log(`I am deleting `,index);\n // let notes=localStorage.getItem(\"notes\");\n // if(notes==null){\n // notesobj=[];\n // }\n // else{\n // notesobj=JSON.parse(notes);\n // }\n notesobj.splice(index,1);\n localStorage.setItem(\"notes\",JSON.stringify(notesobj));\n showNotes();\n}", "function removeBook(e) {\n let i = document.getElementById('selected-book').dataset.index\n let div = document.querySelector(`div[data-index='${i}']`)\n\n div.remove();\n updateIndexAttributes(i)\n library.splice(i, 1)\n exitWindows() \n}", "function deleteNote(index) {\n// console.log(\"I am deleting\", index);\n let confirmDel = confirm(\"Delete this note?\");\n if (confirmDel == true) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n }\n \n}", "function deleteNote(anyValue) {\r\n console.log(anyValue);\r\n let notes = localStorage.getItem('notes');\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(anyValue, 1);\r\n let title = localStorage.getItem('title')\r\n let important = localStorage.getItem('important')\r\n\r\n if (title == null) {\r\n tObj = [];\r\n } else {\r\n tObj = JSON.parse(title);\r\n }\r\n tObj.splice(anyValue, 1);\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 if (important == null) {\r\n importantObj = [];\r\n } else {\r\n importantObj = JSON.parse(important)\r\n }\r\n timeObj.splice(anyValue, 1)\r\n importantObj.splice(anyValue, 1)\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n localStorage.setItem(\"title\", JSON.stringify(tObj));\r\n localStorage.setItem(\"time\", JSON.stringify(timeObj));\r\n localStorage.setItem(\"important\", JSON.stringify(importantObj));\r\n if (notesObj.length == 0) {\r\n console.log('0');\r\n location.reload()\r\n localStorage.clear()\r\n }\r\n showNotes();\r\n}", "function deleteNote(index){\n let confirmDel = confirm(\"Are you sure you want to delete this?\");\n if(confirmDel == true){\n let notes = localStorage.getItem(\"Notes\"+id);\n //if notes in localstorage is empty declare one\n if(notes == null){\n notesObj = [];\n } else{\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"Notes\"+id, JSON.stringify(notesObj));\n showNotes();\n }\n }", "function deleteNote(index) {\n let confirmDel = confirm(`Delete this note?`);\n if (confirmDel == true) {\n let notes = localStorage.getItem(\"notes\")\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n }\n\n}", "function deleteNote(index) {\n\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n showNotes();\n}", "function removeTodos(todo){\n checksaveTodos();\n const todoIndex = todos.indexOf(todo.innerText);\n console.log(todoIndex);\n todos.splice(todoIndex, 1);\n localStorage.setItem(\"todos\",JSON.stringify(todos));\n pendingItem(todos);\n}", "function deleteBook() {\n let index = this.getAttribute('data-index');\n myLibrary.splice(index, 1);\n setLocalStorage();\n render()\n}", "function deleteNote() {\n\t$('.nota-delete').on('click', function(e) {\n\t\te.preventDefault();\n\t\tvar $this = $(this);\n\t\tvar note = $this.closest('.nota-thumb');\n\t\tnote.addClass('transparent');\n\t\tsetTimeout(function() {\n\t\t\tnote.remove();\n\t\t}, 500);\n\t\tvar key = note.attr('id');\n\t\tconsole.log(key);\n\t\tlocalStorage.removeItem(key);\n\t});\n}", "function deleteNote(index){\r\n // console.log('I am deleting', index);\r\n titleObj.splice(index, 1);\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n localStorage.setItem(\"title\",JSON.stringify(titleObj));\r\n\r\n\r\n showNotes();\r\n}", "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n let title = localStorage.getItem(\"title\");\n if (title == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(title);\n }\n titleObj.splice(index, 1)\n localStorage.setItem('title', JSON.stringify(titleObj));\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 a.splice(index, 1)\n localStorage.setItem('DATE', JSON.stringify(a))\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 imp_array.splice(index, 1)\n localStorage.setItem('importance', JSON.stringify(imp_array))\n\n showNotes();\n}", "function remove(index) {\n let titles = localStorage.getItem(\"titleGet\");\n \n if (titles == null) {\n titleList = [];\n } else {\n titleList = JSON.parse(titles);\n }\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesList = [];\n } else {\n notesList = JSON.parse(notes);\n }\n\n notesList.splice(index, 1);\n titleList.splice(index, 1);\n \n localStorage.setItem(\"notes\", JSON.stringify(notesList));\n localStorage.setItem(\"titleGet\", JSON.stringify(titleList));\n showNote();\n}", "function deleteNote(index) {\n \n let confirmDel = confirm(\"Are you sure want to delete this note!!\");\n\n if(confirmDel == true)\n {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesobj = [];\n }\n else {\n notesobj = JSON.parse(notes);\n }\n notesobj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesobj));\n // deletemark(index);\n showNotes();\n }\n\n}", "function removeBk(id) {\n const li = document.querySelector(`#id${id}`);\n const isIndex = (ele) => ele.id === id;\n bks.removeChild(li);\n // remove the book from the array and save it to local storage\n\n const myIndex = books.findIndex(isIndex);\n books.splice(myIndex, 1);\n BksClass.saveLocal();\n}", "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1); // first argument - to start from, second argument - number of elements to delete\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n console.log(\"One note deleted\",\"The id is : \",index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n //splice take the starting index from where to delete,and the number of the element\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function removetodo(todo)\n{ \nlet todos;\nif(localStorage.getItem('todos')=== null)\n{\n todos=[];\n} \nelse\n{\ntodos=JSON.parse(localStorage.getItem('todos')); \n} \nconst todoindex= todo.children[0].innerText;\ntodos.splice(todos.indexOf(todoindex),1); \nlocalStorage.setItem(\"todos\",JSON.stringify(todos)); \n}", "function removeLocalTodos(todo){\n //check if i have todo alredy\n let todos;\n if(localStorage.getItem('todos')===null){\n todos=[];\n }\n else{\n todos=JSON.parse(localStorage.getItem('todos'));\n }\n\n //getting index of todo\n const todoIndex=todo.children[0].innerText;\n todos.splice(todos.indexOf(todoIndex), 1);\n localStorage.setItem(\"todos\",JSON.stringify(todos));\n}", "function removeDocument() {\n if (checkLocalStorage()) {\n openElement(\"removeDocument\", \"mySavedFiles2\");\n }\n}", "function removeBook(a) {\n\n myLibrary.splice(a,1);\n organize();\n store();\n total();\n}", "function deleteBookFromList(id) {\n let bookData = [];\n if (checkStorageItem()) {\n bookData = JSON.parse(localStorage.getItem(localBook));\n } else {\n bookData = [];\n }\n let index;\n for (let i = 0; i < bookData.length; i++) {\n if (bookData[i].id == id) {\n index = i;\n }\n }\n const answer = confirm(`Apakah Anda yakin ingin menghapus buku dengan judul ${bookData[index].title} ?`);\n if (answer) {\n alert(`Buku ${bookData[index].title} berhasil dihapus!`);\n bookData.splice(index, 1);\n localStorage.setItem(localBook, JSON.stringify(bookData));\n renderBookList(getListOfBook());\n }\n}", "function clearStorage() {\r\n let note = document.querySelector('#textArea');\r\n note.value = '';\r\n localStorage.removeItem('note', note.value);\r\n}", "function removeLocalTodos(todo){\n //CHECK DO I ALREADY HAVE THINGS IN THERE? / LOCAL STORAGE\n let todos;\n if(localStorage.getItem(\"todos\") === null){\n todos = [];\n }else {\n todos = JSON.parse(localStorage.getItem(\"todos\"));\n }\n // console.log(todo.children[0].innerText);\n // console.log(todos.indexOf(\"sujan\"));\n const todoIndex = todo.children[0].innerText;\n todos.splice(todos.indexOf(todoIndex), 1);\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n}", "function clearAllNotes() {\n if (allNotes.length === 0) {\n alert(\"There are no notes to delete..\")\n } else {\n setAllNotes([]);\n localStorage.clear();\n }\n }", "function removeBook (e) {\n removeBtn = e.srcElement;\n let removedRow = removeBtn.id;\n for (i = 0; i < myLibrary.length; i++) {\n if (i == removedRow) {\n myLibrary.splice(i, 1);\n break;\n }\n }\n viewBooks();\n\n}", "function removeNoteFromFolder(selects) {\n console.log(selects);\n if (selects) {\n selects.forEach(select => {\n var key = select.getAttribute('id');\n \n var folderName = document.querySelector('.folder-section__title h2').innerHTML;\n \n // REMOVE FROM LOCALSTORAGE\n \n var foldersArray = getFoldersArray();\n var folder;\n \n for (let i = 0; i < foldersArray.length; i++) {\n if (foldersArray[i].title == folderName) {\n folder = foldersArray[i];\n break;\n } \n }\n \n for (let i = 0; i < folder.list.length; i++) {\n if (folder.list[i] == key) {\n folder.list.splice(i,1);\n break;\n }\n }\n \n \n if (folder.list.length == 0) {\n msg.style.display = \"\";\n msg.innerHTML = \"You haven't add any note into this folder yet\";\n \n } else {\n msg.style.display = \"none\";\n }\n \n \n localStorage.setItem('foldersArray', JSON.stringify(foldersArray)); \n \n // REMOVE NOTE FROM DOM\n \n select.parentNode.removeChild(select);\n \n \n del.classList.remove('btn-active');\n confirmDelOverLay.classList.remove('show_overlay');\n \n \n });\n }\n\n }", "function restoreNotes() {\n //check if noteList array is empty \n let checkNoteList = localStorage.getItem(\"noteList\");\n if (checkNoteList == null) {\n localStorage.setItem(\"noteList\", JSON.stringify([]));\n }\n // load existing notes from local storage to array\n noteList = JSON.parse(localStorage.getItem(\"noteList\"));\n\n for (let i = 0; i < noteList.length; i++) {\n createNote(noteList[i], i)\n }\n}", "function deleteAllBooks() {\n const bookCards = document.querySelectorAll(\".book-card\");\n\n bookCards.forEach((card) => {\n card.remove();\n libraryBooks = [];\n });\n}", "function saveNoteBooksToLocalStorage() {\n \n if (existingNoteBooks.length > 1) {\n let arrayToHoldAllCurrentNotebooks = []; \n existingNoteBooks.forEach((element) => {\n if (element.titleOfObject != \"Dashboard\") {\n arrayToHoldAllCurrentNotebooks.push(element.titleOfObject);\n }\n }); //need to clear array after used or check before if there allredy is a existing name\n\n arrayToHoldAllCurrentNotebooks.toString(); // turns the notes ti string\n localStorage.setItem(\"books\", arrayToHoldAllCurrentNotebooks);\n }\n}", "function deleteNote(index) {\r\n const uid = localStorage.getItem(\"uid\")\r\n var adaRef = firebase.database().ref('notes/' + uid + '/' + index);\r\n adaRef.remove()\r\n .then(function () {\r\n getNotesForThisUser().then(notes => display(notes)).catch(err => handleError(err))\r\n CKEDITOR.instances[\"addTxt\"].setData('');\r\n })\r\n .catch(function (error) {\r\n console.log(\"Remove failed: \" + error.message)\r\n });\r\n\r\n\r\n\r\n}", "static deleteBookFromTheList(target) {\n // check if the target contain a delete class\n if (target.classList.contains('delete')) {\n // get the key attribute from the target\n const key = target.getAttribute('key')\n // get the list of \"Books\" from local-storage\n const storedBooks = JSON.parse(localStorage.getItem('Books'))\n // loop through the list of books and remove the book with target-key that eqauls to the index\n const newList = storedBooks.filter((b, index) => index.toString() !== key)\n // here we save the newList of books to local-storage\n localStorage.setItem('Books', JSON.stringify(newList))\n // display a delete alert\n UI.alert('book has been deleted', 'alert-danger')\n }\n }", "function deleteNote(index) {\n let notes_check = localStorage.getItem(\"notes\");\n if (notes_check == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes_check);\n }\n\n /*we are deleting from the array notesObj the elemnt in which \"Delete Note\" has been clicked and the index of that element is passed here.1 indicates that we want to delete just one element from that index number.*/\n notesObj.splice(index, 1);\n\n //after deleting, we need to update the local storage and show the updated notes.\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n //showing the updated notes\n showNotes();\n\n}", "function deleteNote(index) {\n // console.log(\"A node is being deleted\", index);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1); // Deleting the element from the array\n localStorage.setItem(\"notes\", JSON.stringify(notesObj)); //updating the local storage\n showNotes();\n}", "function removeBookFromLibrary(e){\n let bookIndex = e.target.parentNode.dataset.index;\n myLibrary.splice(bookIndex,1);\n }", "function removeTodoFromLocalStorage(todoContainer){\r\n const todo = todoContainer.children[0].innerText;\r\n let todos = LocalStorage();\r\n\r\n todos.splice(todos.indexOf(todo),1);\r\n console.log(todos);\r\n localStorage.setItem('todos',JSON.stringify(todos));\r\n}", "function saveTodosremove(index){\r\n let todo;\r\n if (localStorage.getItem('todo') === null){\r\n todo = [];\r\n }\r\n else{\r\n todo = JSON.parse(localStorage.getItem('todo'));\r\n }\r\n todo.splice(index-1, 1);\r\n localStorage.setItem('todo', JSON.stringify(todo));\r\n}", "restoreSavedBooks() {\n const savedBooks = localStorage.getItem(storageKey);\n savedBooks && this.setBooks(JSON.parse(savedBooks));\n }", "function deleteBook(e) {\n e.target.parentElement.remove();\n libraryBooks.splice(e.target.parentElement.getAttribute(\"data-num\"), 1);\n addDataAttr(bookList);\n}", "function deteleNote(index) {\n let noteArray = JSON.parse(localStorage.getItem(\"notes\"));\n let titleArray = JSON.parse(localStorage.getItem(\"title\"));\n let dateArray = JSON.parse(localStorage.getItem(\"dateVal\"));\n noteArray.splice(index, 1);\n titleArray.splice(index, 1);\n dateArray.splice(index,1);\n localStorage.setItem('notes', JSON.stringify(noteArray));\n localStorage.setItem('title', JSON.stringify(titleArray));\n localStorage.setItem('dateVal', JSON.stringify(dateArray));\n shownotes();\n}", "function removeBook(bookId) {\n// var db = ScriptDb.getMyDb();\n Logger.log(\"removing \"+bookId);\n var db_inst = ParseDb.getMyDb(applicationId, restApiKey, \"book_instance\");\n var db_gen = ParseDb.getMyDb(applicationId, restApiKey, \"book_generic\");\n// var db_cat = ParseDb.getMyDb(applicationId, restApiKey, \"list_categories\");\n var db_shelf = ParseDb.getMyDb(applicationId, restApiKey, \"bookshelf\");\n \n var book = db_inst.load(bookId);\n \n if (book != null){\n var generic = db_gen.load(book.generic);\n var bookshelf = db_shelf.load(book.owner);\n \n for (var i = 0; i < bookshelf.instances.length; i++) {\n if (bookshelf.instances[i] == bookId) {\n var tmp = bookshelf.instances[0];\n bookshelf.instances[0] = bookshelf.instances[i];\n bookshelf.instances[i] = tmp;\n bookshelf.instances.shift();\n break;\n }\n }\n \n var wasLast = true;\n for (var i = 0; i < bookshelf.instances.length; i++) {\n if (db_inst.load(bookshelf.instances[i]).generic == generic.getId()) {\n wasLast = false;\n }\n }\n if (wasLast) {\n for (var i = 0 ; i < bookshelf.books.length ; i++) {\n if (bookshelf.books[i] == generic.getId()) {\n var tmp = bookshelf.books[0];\n bookshelf.books[0] = bookshelf.books[i];\n bookshelf.books[i] = tmp;\n bookshelf.books.shift();\n break;\n }\n }\n }\n db_shelf.save(bookshelf);\n \n \n for (var i = 0; i < generic.instances.length; i++) {\n if (generic.instances[i] == bookId) {\n var tmp = generic.instances[0];\n generic.instances[0] = generic.instances[i];\n generic.instances[i] = tmp;\n generic.instances.shift();\n break;\n }\n }\n \n if (generic.instances.length > 0) {\n db_gen.save(generic);\n } else {\n \n db_gen.remove(generic) ;\n \n var category = generic.category;\n deleteCategory(category);\n }\n \n db_inst.remove(book);\n \n return 1;\n }\n \n return 0;\n}", "function removeBookmarks(){\n $('#myeventlist').empty();\n localStorage.clear();\n //$('.bookmarks').prop('disabled', false);\n}", "function removeTodos(todo) {\n let todos\n //? check if already have todos in local storage\n if (localStorage.getItem('todos') === null) {\n todos = [];\n\n } else {\n todos = JSON.parse(localStorage.getItem('todos'))\n\n }\n let index = todos.indexOf(todo.children[0].innerText);\n todos.splice(index, 1);\n localStorage.setItem('todos', JSON.stringify(todos));\n}", "function clearLocalStor(){\n if(localStorage.length === 0){\n alert(\"You do not currently have any books stored\");\n\n } else {\n\n var areUsure = confirm(\"Are you sure you want to delete your books?\");\n if (areUsure){\n localStorage.clear();\n alert(\"All books have been cleared from memory\");\n window.location.reload();\n return false;\n\n } else {\n\n alert(\"Your library is safe...for now\");\n\n };\n };\n }", "function removeNote(e) {\n div_id = e.path[2].id;\n if (div_id !== 'data') {\n // do not delete the entire data element accidentally due to html image glitches.\n document.getElementById(div_id).remove();\n save_notes();\n loadNotes();\n }\n }", "function deleteNote(element) {\n if (scheduleNotes.length == 1) {\n localStorage.removeItem(\"addedNotes1\");\n }\n else {\n scheduleNotes.splice(element.slot, 1);\n scheduleNotes = JSON.stringify(scheduleNotes);\n localStorage.setItem(\"addedNotes1\", scheduleNotes);\n };\n\n element.parentNode.parentNode.style.opacity = '0';\n\n setTimeout(function () {\n element.parentNode.parentNode.remove();\n }, 2000);\n\n setTimeout(function () {\n window.location.reload();\n }, 2100);\n\n}", "removeFromLocalStorage(target){\n let lists = this.getWordToLocalStorage()\n lists.forEach((value, index) => {\n if(target === value.english){\n lists.splice(index, 1)\n }\n })\n localStorage.setItem('todos', JSON.stringify(lists))\n }", "static removeBook(day) {\n const costs = Store.getCosts();\n\n costs.forEach((cost, index) => {\n if (cost.day === day) {\n costs.splice(index, 1);\n }\n });\n localStorage.setItem('costs', JSON.stringify(costs));\n }" ]
[ "0.7614057", "0.7548996", "0.7539149", "0.75125355", "0.7499487", "0.74971914", "0.7491167", "0.7463461", "0.7460967", "0.74545836", "0.7412193", "0.73900247", "0.73579043", "0.7330843", "0.73178744", "0.7250102", "0.71605545", "0.711475", "0.71110004", "0.7109582", "0.70897967", "0.70285827", "0.698016", "0.6979767", "0.696973", "0.69651306", "0.6960799", "0.69466084", "0.6938235", "0.69303644", "0.68787235", "0.68610543", "0.6846618", "0.6829147", "0.68165535", "0.68165535", "0.68146014", "0.68029594", "0.67974985", "0.678945", "0.6787966", "0.6787631", "0.67815864", "0.6781446", "0.6732347", "0.67190725", "0.6707763", "0.6691524", "0.6682728", "0.6667552", "0.6666499", "0.666461", "0.6663922", "0.66451937", "0.66409314", "0.6640652", "0.66399056", "0.66303146", "0.66286373", "0.6619369", "0.6607547", "0.66040224", "0.6603239", "0.659631", "0.6591865", "0.65830785", "0.6572242", "0.6537244", "0.6534893", "0.6521462", "0.65179074", "0.65123475", "0.6502822", "0.6497471", "0.6490952", "0.64769685", "0.64760524", "0.64482206", "0.64467496", "0.64395565", "0.643224", "0.6420406", "0.6418937", "0.6417554", "0.6409469", "0.6394757", "0.63849247", "0.6383163", "0.63788897", "0.6373929", "0.63592905", "0.6324269", "0.63191634", "0.6316508", "0.6307013", "0.63037485", "0.6299218", "0.6297025", "0.62956077", "0.6294995" ]
0.7851707
0
updates notebooks when somthing is changed
function updateCurrentNoteBooks() { document.querySelectorAll(".dropdown-item").forEach((e) => e.remove()); //cleares window document.querySelectorAll(".noteBookFlex").forEach((e) => e.remove()); //cleares window let getDropdownMenu = document.getElementsByClassName("dropdown-menu")[0]; existingNoteBooks.forEach((element) => { let flexBox = document.createElement("div"); let removeNoteBookButton = document.createElement("button"); let buttonImage = document.createElement("img"); let notebook = document.createElement("button"); // makes the entie title a button flexBox.className = "noteBookFlex"; notebook.className = "dropdown-item"; removeNoteBookButton.className = "removeNoteBookButton"; buttonImage.src = "media/x.svg"; notebook.textContent = element.getTitle(); //gets the title variable in noteBookObject notebook.style.fontFamily = "Cursive"; getDropdownMenu.appendChild(flexBox); removeNoteBookButton.appendChild(buttonImage); if (element.titleOfObject != "Dashboard") { //checks if element is Dashboard so it wont get removed flexBox.appendChild(removeNoteBookButton); } else { notebook.classList.add("Dashboard"); } flexBox.appendChild(notebook); notebook.addEventListener("click", function () { // used to call a certain book to display its notes openNotebook = element.titleOfObject; lastVisitedNoteBook(element.titleOfObject); displayCurrentNoteBook(); globalUpdate(); }); removeNoteBookButton.addEventListener("click", function () { moveToDashboard(element); if (element.titleOfObject == openNotebook) { openNotebook = "Dashboard"; localStorage.setItem("lastVisitedNoteBook", "Dashboard"); } removeNoteBooks(element); displayCurrentNoteBook(); globalUpdate(); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updated(){\n console.log('Updated');\n }", "updated() {}", "withChanges(changes) {\n let modified = changes.modified || this.modified\n Object.keys(changes).forEach(key => {\n if (changes[key] !== this[key]) modified = true;\n })\n return Object.assign(new Notebook(), this, {\n modified,\n updated_at: modified ? moment() : this.updated_at,\n ...changes,\n })\n }", "GETNOTEBOOKS (state, notebooks) {\n state.notebooks = notebooks\n }", "function update(notebookId, params) {\n let sanitized = Notebook.sanitizeOnUpdate(params);\n\n return retrieve(notebookId)\n .then((retrieved) => {\n return retrieved.update(sanitized);\n })\n .then(() => {\n return retrieve(notebookId);\n });\n}", "function updateRevisionHistory() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getActiveSheet();\n var settings = PropertiesService.getDocumentProperties();\n \n var newcontent = ss.getActiveCell().getValue().toString();\n if (newcontent != \"\") {\n var cell = ss.getActiveCell().getA1Notation();\n var logentry = {\"sheet\": sheet.getName(),\n \"cell\": ss.getActiveCell().getA1Notation(),\n \"timestamp\": new Date().valueOf(),\n \"date\": Utilities.formatDate(new Date(), \"GMT+04\", \"dd MMM, HH:mm\"),\n \"author\": getOwnName(),\n \"email\": Session.getEffectiveUser().getEmail(),\n \"content\": newcontent\n }\n \n var history = getStoreData(\"history\");\n history.push(logentry)\n setStoreData(\"history\", history); \n \n // FIXME: Update revision history if this sidebar is open\n //var app = UiApp.getActiveApplication();\n //google.script.host.reloadLogs();\n \n }\n \n}", "function trackUnexecutedCellChanges(){\n /* Get currently rendered cells to track unexecuted changes */\n patchCellUnselect();\n var cells = Notebook.get_cells();\n for(var i = 0; i < cells.length; i++){\n trackChangesToCell(cells[i]);\n }\n patchInsertCellAtIndex();\n }", "setWindowEditStatus(window, status) {\n window.setDocumentEdited(status);\n }", "function update_interactiveness() {\n var interactive = document.getElementById('interactive').checked;\n// if (!(interactive)) { \n// eb.hide(); \n// } else {\n// eb.show();\n// }\n if (wt.instance.raw) { // && wt.filename) {\n var filename = wt.instance.filename;\n var path = wt.instance.path;\n var current_value = editor.getValue();\n var new_editor = set_data(null, current_value);\n new_editor.instance.filename = filename;\n new_editor.instance.path = path;\n }\n }", "function editMade() {\n version += 1;\n emitter({});\n }", "function loadNotebooks(){\r\n notebooks = getNotebooks();\r\n $('.sidebar-menu-list.sidebar-sub-menu').html(\"\");\r\n $.each(notebooks, function(id, notebook) {\r\n $('.sidebar-menu-list.sidebar-sub-menu').prepend(`<li><a href=\"#\" data-id=\"${id}\">${notebook.title}</a></li>`);\r\n });\r\n }", "function globalUpdate() {\n document.querySelectorAll(\".note\").forEach((e) => e.remove()); //cleares window\n moveSelected(false);\n\n allNotes.forEach((element) => {\n if (element.titleOfNoteBook == openNotebook && element.delete != true) {\n main.prepend(element.noteElement);\n }\n });\n}", "function update(data) {\n console.log('+++ TODO');\n }", "refreshUpdateStatus() {}", "registerChange() {\n if (this.editor && this.editor.save && this.shouldSaveHistory && !this.editor.configuration.readOnly) {\n this.editor.save().then((savedData) => {\n if (this.editorDidUpdate(savedData.blocks)) this.save(savedData.blocks);\n });\n }\n this.shouldSaveHistory = true;\n }", "applyChanges() {\n for (let i = 0; i < this.statusList.length; i++) {\n this.board.updateCell(...this.statusList[i]);\n }\n\n this.statusList = [];\n }", "listen(connection) {\n const cellTextDocumentConnection = new CellTextDocumentConnection();\n const disposables = [];\n disposables.push(this.cellTextDocuments.listen(cellTextDocumentConnection));\n disposables.push(connection.notebooks.synchronization.onDidOpenNotebookDocument((params) => {\n this.notebookDocuments.set(params.notebookDocument.uri, params.notebookDocument);\n for (const cellTextDocument of params.cellTextDocuments) {\n cellTextDocumentConnection.openTextDocument({ textDocument: cellTextDocument });\n }\n this.updateCellMap(params.notebookDocument);\n this._onDidOpen.fire(params.notebookDocument);\n }));\n disposables.push(connection.notebooks.synchronization.onDidChangeNotebookDocument((params) => {\n const notebookDocument = this.notebookDocuments.get(params.notebookDocument.uri);\n if (notebookDocument === undefined) {\n return;\n }\n notebookDocument.version = params.notebookDocument.version;\n const oldMetadata = notebookDocument.metadata;\n let metadataChanged = false;\n const change = params.change;\n if (change.metadata !== undefined) {\n metadataChanged = true;\n notebookDocument.metadata = change.metadata;\n }\n const opened = [];\n const closed = [];\n const data = [];\n const text = [];\n if (change.cells !== undefined) {\n const changedCells = change.cells;\n if (changedCells.structure !== undefined) {\n const array = changedCells.structure.array;\n notebookDocument.cells.splice(array.start, array.deleteCount, ...(array.cells !== undefined ? array.cells : []));\n // Additional open cell text documents.\n if (changedCells.structure.didOpen !== undefined) {\n for (const open of changedCells.structure.didOpen) {\n cellTextDocumentConnection.openTextDocument({ textDocument: open });\n opened.push(open.uri);\n }\n }\n // Additional closed cell test documents.\n if (changedCells.structure.didClose) {\n for (const close of changedCells.structure.didClose) {\n cellTextDocumentConnection.closeTextDocument({ textDocument: close });\n closed.push(close.uri);\n }\n }\n }\n if (changedCells.data !== undefined) {\n const cellUpdates = new Map(changedCells.data.map(cell => [cell.document, cell]));\n for (let i = 0; i <= notebookDocument.cells.length; i++) {\n const change = cellUpdates.get(notebookDocument.cells[i].document);\n if (change !== undefined) {\n const old = notebookDocument.cells.splice(i, 1, change);\n data.push({ old: old[0], new: change });\n cellUpdates.delete(change.document);\n if (cellUpdates.size === 0) {\n break;\n }\n }\n }\n }\n if (changedCells.textContent !== undefined) {\n for (const cellTextDocument of changedCells.textContent) {\n cellTextDocumentConnection.changeTextDocument({ textDocument: cellTextDocument.document, contentChanges: cellTextDocument.changes });\n text.push(cellTextDocument.document.uri);\n }\n }\n }\n // Update internal data structure.\n this.updateCellMap(notebookDocument);\n const changeEvent = { notebookDocument };\n if (metadataChanged) {\n changeEvent.metadata = { old: oldMetadata, new: notebookDocument.metadata };\n }\n const added = [];\n for (const open of opened) {\n added.push(this.getNotebookCell(open));\n }\n const removed = [];\n for (const close of closed) {\n removed.push(this.getNotebookCell(close));\n }\n const textContent = [];\n for (const change of text) {\n textContent.push(this.getNotebookCell(change));\n }\n if (added.length > 0 || removed.length > 0 || data.length > 0 || textContent.length > 0) {\n changeEvent.cells = { added, removed, changed: { data, textContent } };\n }\n if (changeEvent.metadata !== undefined || changeEvent.cells !== undefined) {\n this._onDidChange.fire(changeEvent);\n }\n }));\n disposables.push(connection.notebooks.synchronization.onDidSaveNotebookDocument((params) => {\n const notebookDocument = this.notebookDocuments.get(params.notebookDocument.uri);\n if (notebookDocument === undefined) {\n return;\n }\n this._onDidSave.fire(notebookDocument);\n }));\n disposables.push(connection.notebooks.synchronization.onDidCloseNotebookDocument((params) => {\n const notebookDocument = this.notebookDocuments.get(params.notebookDocument.uri);\n if (notebookDocument === undefined) {\n return;\n }\n this._onDidClose.fire(notebookDocument);\n for (const cellTextDocument of params.cellTextDocuments) {\n cellTextDocumentConnection.closeTextDocument({ textDocument: cellTextDocument });\n }\n this.notebookDocuments.delete(params.notebookDocument.uri);\n for (const cell of notebookDocument.cells) {\n this.notebookCellMap.delete(cell.document);\n }\n }));\n return vscode_languageserver_protocol_1.Disposable.create(() => { disposables.forEach(disposable => disposable.dispose()); });\n }", "getChange(book,shelf,isnew){\n BooksAPI.update(book,shelf)\n .then((b)=>{\n BooksAPI.getAll()\n .then((books)=>{\n this.setState(()=>({\n books\n }))//end setState\n }) }//end Arrow func\n )//end then\n }", "function list_update(prop)\n {\n if (prop._reload) {\n rcmail.redirect(rcmail.url('', { _list: (prop.newid || prop.id) }));\n }\n else if (prop.newid && prop.newid != prop.id) {\n var book = $.extend({}, me.notebooks[prop.id]);\n book.id = prop.newid;\n book.name = prop.name;\n book.listname = prop.listname;\n book.editname = prop.editname || prop.name;\n\n me.notebooks[prop.newid] = book;\n delete me.notebooks[prop.id];\n\n // update treelist item\n var li = $(notebookslist.get_item(prop.id));\n $('.listname', li).html(prop.listname);\n notebookslist.update(prop.id, { id:book.id, html:li.html() });\n\n // link all loaded note records to the new list id\n if (me.selected_list == prop.id) {\n me.selected_list = prop.newid;\n for (var k in notesdata) {\n if (notesdata[k].list == prop.id) {\n notesdata[k].list = book.id;\n }\n }\n notebookslist.select(prop.newid);\n }\n }\n }", "reload() {\n\n }", "function update()\n\t{\n\t setNavBarState({buttonDisabled: true});\n\t\t\n\t fetch('/api/get_script_status').then(res => res.json()).then(data => {\n\n\t\t//If our script is not currently \"Running\", then we start it.\n\t if (data.hasOwnProperty('status') === false || data[0]['status'] !== \"Running\" ) {\n\t\t setNavBarState({chipColor: \"yellow\", buttonDisabled: true, chipDisplay: \"inline\"});\n\t\t fetch('/api/update_data');\n\t\t}});\n\t}", "function changeTodo() {\n\ttodos[0] = 'item updated';\n}", "updated(e){}", "updateStudentWorksheet() {\n\n }", "function checkAllNotebooks(){\n\tvar notebookList = g_notebookList;\n\n\tfor(var i = 0; i < notebookList.length; i++){\n\t\tvar name = notebookList[i];\n readNotebook(name, {}, function(err, notebook) {\n if(err) throw err;\n\t\t\t if(!checkAccessDatabase(notebook)){\n console.log(\"shitt access database for notebook: \"+notebook.name);\n\t\t\t }\n\t\t});\n\n\t\tconsole.log(\"Done checking notebooks.\");\n\t}\n}", "function changeTodo(i, update) {\r\n\ttodos[i] = update;\r\n\tdisplayTodos();\r\n}", "function update() {}", "function updateroster() {\n\n}", "function update() {\n\t\tUtil.txt.setLibraryBrowser( Util.fs.getLibraries() );\n\t\tUtil.txt.setFileBrowser( Util.fs.getNotes(currentLib) );\n\t\tUtil.txt.setInputText( Util.fs.getNoteContent(currentLib,currentNote) );\n\t}", "refresh()\n\t{\n\t}", "function updateBookInDOM(book) {\n const bookElement = document.querySelector(`[id=\"${book.timestamp}\"]`);\n bookElement.querySelector(\".title\").textContent = book.title;\n bookElement.querySelector(\".author\").textContent = book.author;\n if (book.pages > 0) bookElement.querySelector(\".pages\").textContent = book.pages + \" pp\";\n if (book.status === \"read\") {\n bookElement.querySelector(\".status\").textContent = \"Already read\";\n } else {\n bookElement.querySelector(\".status\").textContent = \"Not read\";\n }\n updateBookInStorage(book);\n clearModalTimestamp();\n}", "firstUpdated(e){}", "function myEdit(e){\n Logger.log(\"change triggered\");\n\n refetch();\n //Logger.log(e);\n}", "reloadBookCount()\n {\n this.getNumberOfAvailableBooks();\n }", "function UpdatePouchDB() {\n console.log('updating pouchdb using google drive data');\n startUpdatingUI();\n }", "changeBookShelf(updatedBook, newReadState) {\n BooksAPI.update(updatedBook, newReadState)\n .then((books) => {\n const book = this.state.books.filter((book) => book.id === updatedBook.id)\n book[0].shelf = newReadState\n const unchangedBooks = this.state.books.filter((book) => book.id !== updatedBook.id)\n this.setState({books: [...unchangedBooks, book[0]]})\n })\n }", "function scopeUpdateViewer() {\n\t\tvar update = windowCreep.update(),\n\t\t\tboom = false;\n\n\t\t\twindowChanges.style.display = \"none\";\n\t\t\tnewProperties.innerHTML = \"\";\n\t\t\tnewMethods.innerHTML = \"\";\n\n\t\tfor (var i = 0; i < update.properties.length; i++) {\n\t\t\tboom = true;\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tli.innerHTML = update.properties[i];\n\t\t\tnewProperties.appendChild(li);\n\t\t}\n\n\t\tfor (var i = 0; i < update.methods.length; i++) {\n\t\t\tboom = true;\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tli.innerHTML = update.methods[i];\n\t\t\tnewMethods.appendChild(li);\n\t\t}\n\n\t\tif (boom) windowChanges.style.display = \"block\";\n\t}", "triggerUpdate() {\n let fileId = this.fileNode.id\n this.context.editorSession.transaction((tx) => {\n tx.set([fileId, '__changed__'], '')\n }, { history: false })\n }", "function handleWatchListUpdate(changes){\n changes.forEach(function(change){ \n var newObject = change.object;\n $('#numbOfProducts').text(newObject.length())\n newObject.showTo('#product-watchlist', startNumProd, finishNumProd);\n });\n }", "function trackRename(){\n oldRename = Notebook.__proto__.rename\n Notebook.__proto__.rename = function(){\n new_name = arguments[0]\n\n // POST request to rename files\n // rename folder\n // rename db\n // rename ipynb\n\n return oldRename.apply(this, arguments)\n }\n }", "onStoreUpdate({ changes, record }) {\n const { editorContext } = this;\n\n if (editorContext && editorContext.editor.isVisible) {\n if (record === editorContext.record && editorContext.editor.dataField in changes) {\n editorContext.editor.refreshEdit();\n }\n }\n }", "function onChanged() {\n let g = getGlobal();\n\n //When the add-in creates the table, it will generate 4 events that we must ignore.\n //We only want to respond to the change events from the user.\n if (g.tableEventCount > 0) {\n g.tableEventCount--;\n return; //count down to throw away events caused by the table creation code\n }\n\n //check if dirty flag was set (flag avoids extra unnecessary ribbon operations)\n if (!g.isTableDirty) {\n g.isTableDirty = true;\n\n //Enable the Refresh and Submit buttons\n setSyncButtonEnabled(true);\n }\n}", "_triggerUpdated() {\n\t if (!this.updating) {\n\t this.updating = true;\n\t const update = () => {\n\t this.updating = false;\n\t const registry = storage.getRegistry(this._instance);\n\t const events = registry.events;\n\t events.fire('view-updated', this);\n\t };\n\t if (this._checkSync()) {\n\t update();\n\t }\n\t else {\n\t setTimeout(update);\n\t }\n\t }\n\t }", "function updateFunction() {\n \tupdatePreview();\n \tupdateHTMLCode();\n }", "function modified0(e,n)\n{\n var cell = document.getElementById(n);\n cell.style.background = \"#ffffbb\";\n cell.innerHTML = \"Form status: The form has unsaved changes.\";\n}", "_changed() {\n reload_articles_on_drawer_close();\n }", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "function updateNotifications(number) {\n $(\"#notificationNumber\").text(number);\n $(\"#notificationWindow\").text(number + \" new personal notes\");\n }", "function changeStatus(e) {\n let bookIndex = e.target.dataset.index;\n let chosenBook = library[bookIndex];\n\n if (chosenBook.readStatus == \"already read\") {\n chosenBook.readStatus = \"unread\";\n } else {\n chosenBook.readStatus = \"already read\";\n }\n createTable();\n saveLibrary(library);\n }", "function updateElectron() {\n if (state.window.title !== state.prev.title) {\n state.prev.title = state.window.title\n ipcRenderer.send('setTitle', state.window.title)\n }\n if (state.dock.progress.toFixed(2) !== state.prev.progress.toFixed(2)) {\n state.prev.progress = state.dock.progress\n ipcRenderer.send('setProgress', state.dock.progress)\n }\n if (state.dock.badge !== state.prev.badge) {\n state.prev.badge = state.dock.badge\n ipcRenderer.send('setBadge', state.dock.badge || 0)\n }\n}", "componentDidUpdate() { //triggered if data changed in the database\n this.setData()\n }", "function refreshStoredBibliotecas() {\n getStoredBibliotecas();\n refreshTableBibliotecas();\n addMapMarkers();\n\n}", "function commitChanges() {\n if (editingSlide) {\n editingSlide.querySelector('.kreator-slide-content').innerHTML = editor.getHTML();\n }\n}", "onStoreUpdate({\n changes,\n record\n }) {\n const {\n editorContext\n } = this;\n\n if (editorContext && editorContext.editor.isVisible) {\n if (record === editorContext.record && editorContext.editor.dataField in changes) {\n editorContext.editor.refreshEdit();\n }\n }\n }", "get name() {\n return 'notebook';\n }", "function refresh(){\n setUpdate(!update)\n }", "_settings_changed() {\n \tif (!this.settings_already_changed) {\n \t\tMain.notify(\"Please restart BaBar extension to apply changes.\");\n \t\tthis.settings_already_changed = true;\n \t}\n }", "function displayCurrentNoteBook() {\n let currentNotebookHeading = document.getElementById(\"current-notebook\");\n currentNotebookHeading.innerText = openNotebook.toUpperCase();\n newNoteBookIntro(currentNotebookHeading);\n}", "function pageUpdated() {\n if (component.controller.loadAll) {\n // Retrieve new id\n component.updateModel();\n if (component.api && component.api.endLoad) {\n var listener = component.scope.$on(\"rows-rendered\", function (event, parameters) {\n if (parameters.grid === grid.id) {\n // Remove listener\n listener();\n component.api.endLoad();\n }\n });\n }\n } else {\n component.reload();\n }\n }", "updateHook() {\n return true;\n }", "function dataUpdated(changes, area) {\n\t// only do this when the active session data changes\n\tif(changes.hasOwnProperty(\"intention\")){\n\t\tlet newData = changes.intention.newValue\n\n\t\tchrome.tabs.query({\n\t\t\tactive: true\n\t\t}, function(tabs) {\n\t\t\ttabs.forEach(tab => {\n\t\t\t\tlet activeWindow = newData.windowId\n\t\t\t\tif (tab.windowId === activeWindow) {\n\t\t\t\t\tchrome.tabs.sendMessage(tab.id, {\n\t\t\t\t\t\tcontrol: \"updateData\",\n\t\t\t\t\t\tdata: newData\n\t\t\t\t\t}, async response => {})\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t} \n\n}", "changeStatusEdit(state) {\n state.statusEditData = !this.state.statusEditData\n }", "function saveNotebook(notebookFileName) {\n\tif (!desktop) {\n\t var notebookFullPath = $('#' + notebookFileName).data('fullpath');\n\t writeFile(notebookFullPath, $('#txtCache-' + notebookFileName).text(), function(){});\t\t\n\t}\n }", "function update(){\n reconfigFlag = true;\n let curState = {\n curBuffer : buffer,\n curVersion : version,\n curName : name,\n curMode : mode, \n curIp : ip,\n curConns : connsI\n };\n\n //let data = JSON.stringify(curState);\n let data = stringify(curState);\n fs.writeFileSync(\"curState.json\" , data);\n console.log(\"updating data\");\n}", "_update() {\n }", "static updateImproved() {\n improvedTimestamps.forEach((timestamp) => {\n timestamp.update();\n });\n if (navPanel.isMounted()) {\n navPanel.updateTimestampsInRefreshButtonTooltip();\n }\n }", "update () {}", "function notifySnippetDataChanges(){\r\n\t\tvar msg = {snippetList: Data.snippets};\r\n\t\t\r\n\t\tchrome.tabs.query({}, function(tabs){\r\n\t\t\tvar tab;\r\n\r\n\t\t\tfor (var i = 0, len = tabs.length; i < len; i++) {\r\n\t\t\t\ttab = tabs[i];\r\n\t\t\t\tif(!tab || !tab.id) continue;\r\n\t\t\t\t\r\n\t\t\t\tchrome.tabs.sendMessage(tab.id, msg);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tchrome.extension.sendMessage(msg);\r\n\t}", "changeBookShelf(book, shelf) {\n BooksAPI.update(book, shelf).then(() => {\n book.shelf = shelf;\n // this.getCurrentBooks();\n this.setState(state => ({\n // currentBooks: state.currentBooks.filter(currentBook => currentBook.id !== book.id).concat([book])\n currentBooks: [...state.currentBooks.filter(currentBook => currentBook.id !== book.id), book]\n }))\n });\n }", "update(){}", "update(){}", "update(){}", "function reloadOutBrainModules() {\n if (typeof(OBR) !== \"undefined\" && typeof(OBR.extern) !== \"undefined\" &&\n typeof(OBR.extern.researchWidget) !== \"undefined\") {\n OBR.extern.researchWidget(\"http://\" + document.location.hostname + document.location.pathname);\n }\n}", "function dataWatchFn(newData, oldData) {\n\t if (newData !== oldData){\n\t if (!scope._config.disabled) {\n\t scope._config.refreshDataOnly ? scope.api.update() : scope.api.refresh(); // if wanted to refresh data only, use update method, otherwise use full refresh.\n\t }\n\t }\n\t }", "function first_load() {\n var cells = IPython.notebook.get_cells();\n for(var i in cells){\n var cell = cells[i];\n if ((cell instanceof IPython.CodeCell)) {\n cell.code_mirror.on(\"change\", changeEvent);\n var gutters = cell.code_mirror.getOption('gutters');\n cell.code_mirror.setOption('gutters', [gutters, \"cellstate\" ]);\n makeMarker(cell,'n',0);\n }\n }\n }", "patch_note_content(route, nbid, update) { //#ADJUST TO NOTEBOOKS\n const url = this.baseUrl + route + \"/\" + nbid\n return client.fetch(url, {\n method: \"PATCH\",\n body: json(update)\n })\n .then(response => response.json())\n }", "function stateHasChanged() {\n document.getElementById('saveButton').innerHTML = 'Save';\n}", "function update(){\n keepResources()\n keepPopulation();\n keepProtection();\n keepPolitics();\n keepTech();\n}", "function wishlist_ui_edit(wishlist) {\n\t// Update the wishlist title in the sidebar.\n\t$(\"#\" + wishlist._id).html(wishlist.title);\n\t// Update both the title and the description in the main panel.\n\t$(\"#wishlistTitle\").html(wishlist.title);\n\t$(\"#wishlistDescription\").html(wishlist.description);\n}", "function addNewNotebook()\n{\n var ui = DocumentApp.getUi();\n ui.alert(\"To create a notebook, we're going to need the following settings:\\n\" +\n \" + short title \\n\" +\n \" + long title (Optional. Default is to copy the short title's value over) \\n\" +\n \" + pick the directory to create your notebook in. (not implemented, just creates in root rn.)\\n\" +\n \" + pick a cover image (upload, select existing image, or leave it blank) \\n\");\n \n var shortName = ui.prompt(\"Enter short name of your notebook\", ui.ButtonSet.OK);\n var longName = ui.prompt(\"Enter long name of your notebook (Optional)\", ui.ButtonSet.OK_CANCEL);\n //pick a directory one day?\n //pick an image one day .. too complicated now and I'm too lazy.\n \n var newBook = new Notebook(longName, shortName, longName, DriveApp.getRootFolder().getId(), \"\", \"\", \"\");\n \n newBook = makeNewNotebookTree(newBook);\n newBook = makeNewMasterNotebook(newBook,0,0);\n //save for later\n var props = PropertiesService.getUserProperties();\n props.setProperty(newBook.iD, JSON.stringify(newBook)); \n props.setProperty(\"CurrentNotebook\", newBook.iD);\n //TODO need to store notebooks in a list of notebooks\n //TODO make a function to add a notebook to the list\n //\n}", "function dataWatchFn(newData, oldData) {\n if (newData !== oldData){\n if (!scope._config.disabled) {\n scope._config.refreshDataOnly ? scope.api.update() : scope.api.refresh(); // if wanted to refresh data only, use update method, otherwise use full refresh.\n }\n }\n }", "function dataWatchFn(newData, oldData) {\n if (newData !== oldData){\n if (!scope._config.disabled) {\n scope._config.refreshDataOnly ? scope.api.update() : scope.api.refresh(); // if wanted to refresh data only, use update method, otherwise use full refresh.\n }\n }\n }", "function updateViolinChart(gene) {\n console.log('updateViolinChart was called with gene: ', gene);\n violinPlot.updateViolinPlot(gene);\n }", "updateStatus(){\n getStatus();\n }", "function WorkbookAllModule(){Workbook.Inject(DataBind,WorkbookSave,WorkbookNumberFormat,WorkbookCellFormat,WorkbookEdit,WorkbookFormula,WorkbookOpen,WorkbookSort,WorkbookHyperlink,WorkbookFilter,WorkbookInsert,WorkbookDelete,WorkbookFindAndReplace,WorkbookProtectSheet,WorkbookDataValidation,WorkbookMerge,WorkbookConditionalFormat,WorkbookImage,WorkbookChart);}", "updateNoteStore(noteToChangeId, noteKeyToChange, valueToChangeTo) {\n // Grab and set new values on the note we want to change\n const noteToChange = Notebook.findNoteById(noteToChangeId, this.state.notes)\n .set(noteKeyToChange, valueToChangeTo)\n .set('dateModified', Date.now());\n\n const newNoteState = this.state.notes.map(note => (\n note.id === noteToChangeId ? noteToChange : note\n ));\n\n this.setState({\n notes: newNoteState,\n });\n }", "update() {\n // ...\n }", "reloadNotes(){\n this.setState({reloadNotes: true})\n }", "updateChanges(){\n let comp = new Competence();\n let competences = this.state.competences;\n let _this = this;\n let promises = [];\n let counter = 0;\n comp.mayApplyLocalChanges(competences, '{}.{}.name', '-', comp.toView.bind(comp)).then((comps) => {\n if(comps){\n this.loadData(false);\n } else return;\n _this.setState({competences:comps, dataSource: _this.getDatasource(comps)});\n });\n }", "update(repo: Microcosm, nextProps: Object, nextState: Object) {\n // NOOP\n }", "function loadOnUpdated(tab, change) {\n if (change.status === 'complete') {\n delete executed[tab];\n executeScripts(tab);\n }\n}", "function addToNotebookList(name){\n\tg_notebookList.push(name);\n\tg_notebookList.sort();\n//\twriteFile(getDBFilename(\"notebooks\"),\n//\t\tJSON.stringify(g_notebookList));\n}", "_environmentsChanged() {}" ]
[ "0.61587936", "0.5940111", "0.5899971", "0.5836267", "0.574683", "0.5612497", "0.5570089", "0.5567575", "0.5565711", "0.5493417", "0.5491623", "0.54765266", "0.54514295", "0.54513997", "0.54286563", "0.53984255", "0.53809714", "0.53667855", "0.5365714", "0.5354447", "0.5327229", "0.5326836", "0.52929854", "0.52922297", "0.5287084", "0.52743846", "0.52703834", "0.5264721", "0.5263245", "0.5262385", "0.52506256", "0.5250254", "0.52435195", "0.52313", "0.52271473", "0.5218163", "0.5217331", "0.5202155", "0.52012277", "0.51910675", "0.5190791", "0.5187189", "0.5182722", "0.5161039", "0.51597023", "0.51485634", "0.5137593", "0.5137593", "0.5137593", "0.5137593", "0.5137593", "0.5137593", "0.5137593", "0.5137593", "0.5137593", "0.5136695", "0.5135616", "0.5127165", "0.5124006", "0.5122746", "0.5119505", "0.51178414", "0.5115678", "0.5111244", "0.5109153", "0.5104472", "0.51039475", "0.509119", "0.5089405", "0.5085464", "0.5081132", "0.506424", "0.5060866", "0.50550944", "0.50474405", "0.5041296", "0.50353605", "0.5030989", "0.5030989", "0.5030989", "0.5024821", "0.5014478", "0.5008817", "0.5008405", "0.5004588", "0.49971405", "0.4992948", "0.49890834", "0.498622", "0.498622", "0.49847078", "0.49814808", "0.49797925", "0.49765778", "0.49757385", "0.49750012", "0.49707317", "0.4970225", "0.49673852", "0.4967371", "0.49661586" ]
0.0
-1
Changes title of object to Dashboard if notebook is deleted
function moveToDashboard(obj) { for (let i = 0; i < allNotes.length; i++) { if (allNotes[i].titleOfNoteBook == obj.titleOfObject) { allNotes[i].titleOfNoteBook = "Dashboard"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 removeFromTitle(str) {\r\n title = str;\r\n }", "_updateTitle() {\n if (this._changeGuard || !this.content) {\n return;\n }\n this._changeGuard = true;\n const content = this.content;\n this.title.label = content.title.label;\n this.title.mnemonic = content.title.mnemonic;\n this.title.icon = content.title.icon;\n this.title.iconClass = content.title.iconClass;\n this.title.iconLabel = content.title.iconLabel;\n this.title.caption = content.title.caption;\n this.title.className = content.title.className;\n this.title.dataset = content.title.dataset;\n this._changeGuard = false;\n }", "setTitle(title) {\n this.get('headData').set('title', title);\n }", "function savePanelTitle(title){\n var panelTitle = replaceAmpersand($('panelTitle').value);\n var view = tabsFrame.newView;\n var index = view.tableGroups.length - tabsFrame.selectedTableGroup - 1;\n var curTgrp = view.tableGroups[index];\n curTgrp.title = panelTitle;\n tabsFrame.newView = view;\n}", "function removeNoteBooks(titleToRemove) {\n //titleToRemove is a button event bound to the object when created\n\n for (let i = 0; i < existingNoteBooks.length; i++) {\n if (existingNoteBooks[i].titleOfObject == titleToRemove.titleOfObject) {\n existingNoteBooks.splice(i, 1);\n if (existingNoteBooks.length == 1) {\n localStorage.removeItem(\"books\");\n //Testar om bara dashboard är kvar och tar bort nyckeln helt.\n }\n saveNotesToLocalStorage();\n saveNoteBooksToLocalStorage();\n break;\n }\n }\n\n updateCurrentNoteBooks();\n}", "_updateContentTitle() {\n if (this._changeGuard || !this.content) {\n return;\n }\n this._changeGuard = true;\n const content = this.content;\n content.title.label = this.title.label;\n content.title.mnemonic = this.title.mnemonic;\n content.title.icon = this.title.icon;\n content.title.iconClass = this.title.iconClass;\n content.title.iconLabel = this.title.iconLabel;\n content.title.caption = this.title.caption;\n content.title.className = this.title.className;\n content.title.dataset = this.title.dataset;\n this._changeGuard = false;\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "_updateTitlePanelTitle() {\n let current = this.currentWidget;\n const inputElement = this._titleHandler.inputElement;\n inputElement.value = current ? current.title.label : '';\n inputElement.title = current ? current.title.caption : '';\n }", "function HeadingChange(){\n cl(document.title = \"This is new title\")\n}", "function TitleCtrl() { }", "showTitle() {\n this.title.classList.remove(this.workingClass);\n }", "function clearTitle() {\n $('title').html(\"Blacksmith\");\n}", "setTitle(title) {\r\n this.title = title;\r\n if (this.isActive) {\r\n this.router.updateTitle();\r\n }\r\n }", "title() { return this.owner.name + \" - \" + this.label.replace('\\n', ' ') }", "_updateTitle() {\n if (this.$title) {\n const escapedTitle = escapeHtml(this.state.title);\n if (this.$title.innerHTML !== escapedTitle) {\n this.$title.innerHTML = escapedTitle;\n }\n }\n }", "function setTitle(){\n\tvar title = getMessage('title_abEditAction_list');\n\tView.panels.get('abEditAction_list').setTitle(title);\n}", "function update_folder_tab_title() {\n\t\tif ( ! $associated_group_selector.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $associated_group_selector.val().length ) {\n\t\t\tfolder_tab_name = BP_Docs_Folders.folders_tab_label_groups;\n\t\t} else {\n\t\t\tfolder_tab_name = BP_Docs_Folders.folders_tab_label;\n\t\t}\n\n\t\t$( '#doc-folders .toggle-title' ).html( folder_tab_name );\n\t}", "function changeTitle() {\n document.title = 'Star Wars';\n }", "changeTitle( layout, newTitle ){\n\t\tif( layout.title.text ){\n\t\t\tlayout.title.text = newTitle;\n\t\t}\t\n\t}", "removeTitle() {\n this.title.classList.add(this.workingClass);\n }", "setDefaultTitle() {\r\n this.defaultTitle = \"Messages - \" + this.storeAccess.getCurrentUser().name;\r\n let appTitleAction = {\r\n type: AppTitle_Action_1.AppTitleActionTypes.UPDATE_TITLE,\r\n payload: {\r\n title: this.defaultTitle\r\n }\r\n };\r\n this.storeAccess.dispatchAction(appTitleAction);\r\n }", "updateWindowTitle() {\n if (this.win) {\n const {translatableFlat} = this.core.make('osjs/locale');\n const prefix = translatableFlat(this.proc.metadata.title);\n const title = this._createTitle(prefix);\n\n this.win.setTitle(title);\n }\n }", "componentWillUnMount() {\n document.title = Constants.documentTitles.empty;\n }", "updateTitle() {\r\n let parentRouter = this.parent;\r\n if (parentRouter) {\r\n return parentRouter.updateTitle();\r\n }\r\n let currentInstruction = this.currentInstruction;\r\n if (currentInstruction) {\r\n currentInstruction._updateTitle();\r\n }\r\n return undefined;\r\n }", "function checkTitle(object, context) {\n\tif (object.title !== object.original_title) {\n\t\tcontext.original_title = object.original_title;\n\t}\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 set_tab_title (uuid, f_name) {\n\t\tvar info = {\n\t\t\tuuid : uuid,\n\t\t\ttitle : f_name\n\t\t};\n\t\ttoolbar.update_title(info);\n\n\t\tf_handle_cached.send_info ('*', 'title-change', info, 0);\n\t}", "update(){\n this.entry = {\n head: this.current.components.default.head,\n instance: this.current.instances.default\n };\n \n this.updateTitle();\n }", "function resetTitle() {\n let t = $(\"title\").text()\n let notifications = \".gt2-nav-left a[href='/notifications'] > div > div:nth-child(1) > div:nth-child(2)\"\n let messages = \".gt2-nav-left a[href='/messages'] > div > div:nth-child(1) > div:nth-child(2)\"\n let nr = 0\n if ($(notifications).length) nr += parseInt($(notifications).text())\n if ($(messages).length) nr += parseInt($(messages).text())\n $(\"title\").text(`${nr > 0 ? `(${nr}) ` : \"\"}${t.startsWith(\"[\") ? t.split(\"] \")[1] : t}`)\n }", "function ScreedTodoTaskTitle() {\n}", "setTitle(data) {\n this._windowTitle = data;\n this._onTitleChange.fire(data);\n return true;\n }", "_initEmptyTitle(){\n const oldTitle = this.svg.select(\"graph-title\");\n if (oldTitle) {\n oldTitle.remove();\n }\n\n this.titleSVG = this.svg.append(\"text\")\n .attr(\"id\", \"graph-title\")\n .attr(\"x\", (this.width / 2))\n .attr(\"y\", 0 - (this.margin.top / 2))\n .attr(\"text-anchor\", \"middle\");\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 }", "setTitle(canvasObject) {\n canvasObject.domTitle.innerHTML = `<b>${canvasObject.stringTitle}</b>`;\n }", "setTitle(title) {\n this._title = title;\n this.emit('titleChanged', title);\n this.emit('stateChanged');\n }", "setTitle(title) {\n document.title = 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 headline_delete()\n {\n // grab the .data element of the headline to delete\n var axe_it = $(this).parents(\".card\").data();\n $.ajax(\n {\n method: \"DELETE\",\n url: \"/api/headlines/\" + axe_it._id\n }).then(function(data)\n {\n // re-render if deleted\n if (data)\n {\n init_saved();\n }\n });\n }", "function updateImageTitle() {\n ImageService.updateTitle(vm.user.username, $stateParams.id, vm.image.title)\n .then(() => {\n $state.reload();\n $scope.$hide();\n });\n }", "function titleClear(){\n document.querySelector(\".title\").style.display = \"none\";\n document.querySelector(\".line\").style.display = \"none\";\n document.querySelector(\".intro\").style.display = \"none\";\n document.querySelector(\".start\").style.display = \"none\";\n }", "function setPageTitle (newTitle) {\n title = newTitle;\n }", "destroyTitleScreen() {\n\t\tlet titleScreen = document.querySelector(\".titleScreen\");\n\t\ttitleScreen.parentNode.removeChild(titleScreen);\n\t}", "function changeHeaderTitle(newTitle){\n headerTitleDiv.innerHTML = newTitle;\n }", "function setPanelDocumentTitle(newTitle)\n{\n setElementTitle(svgDocument.getElementById(\"title1\"), newTitle);\n}", "function setTitle(_title) {\n chrome.browserAction.setTitle({title:_title});\n}", "_showTitle() {\n if (this._titleJqElem) {\n this._titleJqElem.find(\".chart-title-text:first\").text(this.controlOptions.chartTitle);\n }\n }", "function updateWorksheetCount(southPanel) {\n if (southPanel.xtype === 'tabpanel') {\n southPanel.setTitle(gw.app.localize('ExtJS.View.Worksheet.Title', southPanel.items.getCount()));\n }\n // PLWEB-5731 splitbar on minimized workspace panel not appearing after logout\n // When a south panel renders, there should never be a case where the splitter is hidden\n if (southPanel.splitter && southPanel.splitter.isHidden()) {\n southPanel.splitter.show();\n }\n }", "updatePageTitle (state, title) {\n state.pageTitle = title\n }", "function title_view(title) {\n var titleInput = gId(\"title\");\n gId('story_title').innerHTML = title;\n gId('story_title').style.display = \"block\";\n titleInput.style.display = \"none\";\n gId('add_title').style.display = \"none\";\n}", "function updateTitle(newTitle) {\r\n $(\"#foodTitle\").text(newTitle.name);\r\n}", "setTitleBar() {\n $('[data-book-title]').text(this.book.title);\n $('[data-total-pages]').text(this.book.pages.length);\n $('[data-page-num]').text(this.book.currentPage.num);\n }", "set title( val ) {\n this.title_bar_text.innerText = val;\n }", "function subtaskWasDeleted(data) {\n s.header.siblings('.container').html(data.partial);\n }", "pageTitle() {\n if(this.props.currentContestId) {\n return this.currentContest().contestName;\n }\n return \"Naming Contests\";\n }", "function setTitle(title) {\n document.getElementById(gs_title_id).innerHTML = title;\n document.getElementById(gs_nav_title_id).innerHTML = title;\n\n if (title == 'GitStrap') {\n document.getElementById(gs_ribbon_id).style.display = 'block';\n }\n}", "function setTitle(filename) {\r\n\tvar title;\r\n\tif(filename) {\r\n\t\ttitle = filename+\" | Model Maker\";\r\n\r\n\t} else {\r\n\t\ttitle = \"Model Maker\";\r\n\t}\r\n\twindow.parent.document.title = title;\r\n}", "function deleteName() {\r\n globalNames.splice(index, 1);\r\n render();\r\n }", "function changeDocumentTitle( title )\n{\n document.title = title;\n}", "function updateTitle(text) {\n $('title').html(\"Blacksmith - \" + text);\n}", "pickHeadTable(title) {\n if (this.state.markedTableDiagnostics.includes(title)) {\n this.state.markedTableDiagnostics.splice(\n this.state.markedTableDiagnostics.indexOf(title), 1);\n } else {\n this.state.markedTableDiagnostics.push(title);\n }\n }", "function readTitle(dtxData, value){\n dtxData.chartInfo.title = value;\n }", "get title() { throw new Error(\"The getter for the widget's title must be implemented by the inhering widget.\"); }", "function setTitle() {\n var title = $('h1#nyroModalTitle', modal.contentWrapper);\n if (title.length)\n title.text(currentSettings.title);\n else\n modal.contentWrapper.prepend('<h1 id=\"nyroModalTitle\">'+currentSettings.title+'</h1>');\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 changetitle(currentDiv){\n var compteur = currentDiv.childNodes[4].value;\n var myInput = currentDiv.childNodes[1];\n var myButton = currentDiv.childNodes[2];\n myInput.classList.remove('none');\n myButton.classList.remove('none');\n myButton.onclick = function(){\n for(i=0; i < arraycolumn.length; i++){\n if(arraycolumn[i].id == compteur){\n delete arraycolumn[i];\n }\n }\n if (myInput.value.length == 0){\n currentDiv.childNodes[0].innerHTML = 'Title';\n var array = {id:compteur, title:\"Title\"};\n }\n else{\n currentDiv.childNodes[0].innerHTML = myInput.value;\n var array = {id:compteur, title:myInput.value};\n }\n arraycolumn.push(array);\n arraycolumn = arraycolumn.filter(function(n){ return n != undefined }); \n localStorage.setItem(\"columns\", JSON.stringify(arraycolumn));\n myInput.classList.add('none');\n myButton.classList.add('none');\n }\n refresh_for_column();\n }", "getTitle() {}", "function cleanUpThreadTitle() {\n var title = Thread.title;\n \n if(Page.isThread() && title.text().indexOf('[') > -1) {\n title.text(title.text().substring(0, title.text().indexOf('[') - 1));\n } \n}", "function updateVizTitle(sceneNumber) {\n var sceneTitles = [\"\",\n \"US Annual Trade Deficit\",\n \"Annual Imports and Exports by Commodity\",\n \"Monthly Imports and Exports by Commodity\",\n \"Imports and Exports Under Trump Presidency\"]\n d3.select(\"#viz-title\")\n .html(sceneTitles[sceneNumber]);\n}", "function updateWorksheetCount(southPanel) {\n //@SenchaUpgrade: TODO Is it a Sencha bug that add/remove listeners are called on the Tab not the TabPanel sometimes?\n if (southPanel.xtype == 'tabpanel') {\n // TODO - localize and create a display key:\n southPanel.setTitle('Workspace (' + southPanel.items.getCount() + ')');\n }\n }", "function updateAdvancedPanelTitle(node) {\n const panel = CUSTOM_PANELS[node.id];\n node.querySelector(\"header.webpanel-header h1\").innerHTML = panel.title;\n node.querySelector(\"header.webpanel-header h1\").title = panel.title;\n }", "function setTitle(title) {\r\n\t\t var show = false;\r\n\t\t\tif (self.options.overrideTitle != null) {\r\n\t\t\t show = true;\r\n\t\t\t\tself.bbgCss.jq.title.html(self.options.overrideTitle);\r\n\t\t\t} else if (typeof(title) != 'undefined') {\r\n\t\t\t\tself.bbgCss.jq.title.html(title);\r\n\t\t\t\tshow = true;\r\n\t\t\t} else {\r\n\t\t\t\tself.bbgCss.jq.title.html('');\r\n\t\t\t}\r\n\t\t\tif (show) {\r\n\t\t\t\tself.bbgCss.jq.title.show();\r\n\t\t\t} else {\r\n\t\t\t\tself.bbgCss.jq.title.hide();\r\n\t\t\t}\r\n\t\t}", "function fnTitleNotification(iCounter) {\n //Declare variable which stores the original title\n var sOriginalTitle = document.title;\n //Boolean switch set to 0\n var bSwitch = 0;\n //Declare iCounter\n var iCounter;\n //Declare the variable iTimer which runs function on a set interval\n var iTimer = setInterval(function() {\n //When the bSwitch is 0\n if (bSwitch == 0) {\n //Display the new document title\n document.title = \"PROPERTY MODIFIED\";\n //Set the bSwitch to 1\n bSwitch = 1;\n //If the bSwitch is 1 \n } else {\n //Set the document title to the original title\n document.title = sOriginalTitle;\n //Switch the bSwitch to 0 again\n bSwitch = 0;\n //Decrease the iCounter\n iCounter--;\n //If the iCounter is 0\n if (iCounter == 0) {\n //Stop the interval\n clearInterval(iTimer);\n }\n }\n }, 1000);\n}", "function setPageTitle() {\n const page = document.getElementById('title');\n page.innerHTML = pageTitle;\n}", "async _setDocumentTitle() {\n document.title = this.prefix + this.title + this.suffix;\n }", "function changeTitleForBackButton() {\n if (page.ios) {\n page.ios.title = \"Back\";\n }\n}", "function overrideTitles() {\n\n\tvar columns = document.getElementsByName('columnlist');\n\n\tfor(var j = 0; j < columns.length; j++)\n\t{\n\t\tvar kk = columns[j].id;\n\t\tif (window['title'+kk])\n\t\t\tdocument.getElementById('htitle'+kk).innerHTML = window['title'+kk];\n\t}\n\n\n}", "function deleteNote(index){\r\n // console.log('I am deleting', index);\r\n titleObj.splice(index, 1);\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n localStorage.setItem(\"title\",JSON.stringify(titleObj));\r\n\r\n\r\n showNotes();\r\n}", "function titlePage(){\n\t\t$('.title-page').html('<h2 class=\"text-center\">'+objet_concours[last_concours]+'</h2>');\n\t}", "function viewsEvents()\n { $('#tree .b-delete-view').attr('title', T('DELETE_VIEW'));\n }", "setSlaveTitle() {\n\t\tlet title = `Splinter Agent | Open Windows: ${this.windows.length} | Components:${this.componentsICanSpawn.toString() || \"N/A\"}, Services: ${this.servicesICanSpawn.toString() || \"N/A\"}`;\n\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.debug(`SplinterAgent.setSlaveTitle: ${title}`);\n\t\t__WEBPACK_IMPORTED_MODULE_2__clients_routerClientInstance___default.a.transmit(`${this.app.uuid}.setTitle`, { title: title });\n\t}", "setTitle(title) {\r\n this.title = siteTitle + title\r\n document.title = Site.info.siteName + ' ' + siteTitle + title\r\n }", "async _refreshBarTitle() {\n this._top.attr(\"width\", this._dimView.width).attr(\"height\", this._barTitleHeight);\n }", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tvar titleDiv = document.getElementById( 'title-meta' );\n\n\tif( titleDiv == null ) {\n\t\treturn;\n\t}\n\n\tvar cloneNode = titleDiv.cloneNode( true );\n\tvar firstHeading = getFirstHeading();\n\tvar node = firstHeading.childNodes[0];\n\n\t// new, then old!\n\tfirstHeading.replaceChild( cloneNode, node );\n\tcloneNode.style.display = 'inline';\n\n\tvar titleAlign = document.getElementById( 'title-align' );\n\tfirstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue;\n}", "function title(newtitle){\n\tdpost(\"set new title \" + newtitle + \" -> nodeid = \" + myNodeID + \"\\n\");\n\tmyExpandedMode = 0;\n\texpand();\n\tmyNodeTitle = newtitle;\n\tmyNodeOssiaModel = \"node/\" + newtitle;\n myNodeAddress = \"sparck:/\" + myNodeOssiaModel;\n\tstoreKeyValueInDB(myNodeName, \"_title\", newtitle);\n\tmyNodeVarName = newtitle;\n // the sequence of the following messages matter:\n // we first need to set the title\n // used by: vpl.node.property.logic\n messnamed(myNodeID + \"::props\", \"title\", myNodeTitle);\n messnamed(myNodeID + \"::props\", \"address\", myNodeAddress);\n messnamed(myNodeID + \"::pbody\", \"address\", myNodeTitle, myNodeAddress);\n\toutlet(OUTLET_DUMP, \"setmsgtitle\", newtitle);\n\toutlet(OUTLET_DUMP, \"title\", newtitle);\n\toutlet(OUTLET_DUMP, \"address\", myNodeAddress);\n}", "ngOnInit() {\n this.title = 'Ingresar la lectura del Medidor';\n }", "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "function displayTitle (event) {\n $display.textContent = listoftitles[event.target.getAttribute('id')-1]\n }", "get title() { return this.Nls(\"Export_Title\"); }", "function changeTitle($arr) {\n window.parent.document.title = $arr; // on change l'attribut <title>\n}", "function getTitle(idx, item) {\n if(item) {\n return this.grid.store.getValue(item, 'id') + ':' + \n this.grid.store.getValue(item, 'title');\n }\n return '';\n}", "componentDidMount () {\n window.document.title = `ToDos [${this.state.todos.length}]`\n }", "function title() {\r\n drawScene(gl);\r\n if (!cube_title.isScrambling)\r\n cube_title.scramble();\r\n moveCamera({ movementX: velX, movementY: velY });\r\n cube_title.update(1 / 60);\r\n cube_title.show(programInfo);\r\n titleAnimationRequest = requestAnimationFrame(title);\r\n }", "function setTitle() {\r\n\t\tvar title = $('h1#nyroModalTitle', modal.contentWrapper);\r\n\t\tif (title.length)\r\n\t\t\ttitle.text(currentSettings.title);\r\n\t\telse\r\n\t\t\tmodal.contentWrapper.prepend('<h1 id=\"nyroModalTitle\">'+currentSettings.title+'</h1>');\r\n\t}" ]
[ "0.63929546", "0.6212503", "0.6136175", "0.60601646", "0.60380554", "0.5995445", "0.59926015", "0.5987756", "0.5978453", "0.5978453", "0.5978453", "0.5978453", "0.5978453", "0.59587693", "0.59484005", "0.59426606", "0.58999807", "0.5896582", "0.5849805", "0.5833995", "0.58321524", "0.5807032", "0.5800536", "0.5791088", "0.57809556", "0.5742103", "0.57144576", "0.5708766", "0.56927156", "0.5690282", "0.5672146", "0.5666483", "0.5662881", "0.5662625", "0.5660122", "0.56461537", "0.561415", "0.56058127", "0.5588857", "0.55761725", "0.5575391", "0.5571707", "0.55676544", "0.5565894", "0.5555804", "0.55543625", "0.5548849", "0.5535346", "0.55195606", "0.55123615", "0.551129", "0.5510994", "0.5509907", "0.55078214", "0.550229", "0.5477198", "0.5467937", "0.54626834", "0.54545057", "0.5451735", "0.54454476", "0.544088", "0.54279125", "0.54210126", "0.54209334", "0.54050654", "0.5396112", "0.53959835", "0.5389372", "0.53872615", "0.5386927", "0.5377814", "0.53733855", "0.5371933", "0.5368787", "0.53629977", "0.5361565", "0.533904", "0.5336592", "0.53350896", "0.5334729", "0.53312707", "0.5326711", "0.5326264", "0.53249", "0.53173023", "0.5303794", "0.53024465", "0.5299739", "0.52957934", "0.5293957", "0.5292854", "0.5292854", "0.52887285", "0.5288297", "0.52857083", "0.52854747", "0.52813095", "0.5277108", "0.52727467" ]
0.656114
0
updates the window to show the correct notes
function globalUpdate() { document.querySelectorAll(".note").forEach((e) => e.remove()); //cleares window moveSelected(false); allNotes.forEach((element) => { if (element.titleOfNoteBook == openNotebook && element.delete != true) { main.prepend(element.noteElement); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update() {\n\t\tUtil.txt.setLibraryBrowser( Util.fs.getLibraries() );\n\t\tUtil.txt.setFileBrowser( Util.fs.getNotes(currentLib) );\n\t\tUtil.txt.setInputText( Util.fs.getNoteContent(currentLib,currentNote) );\n\t}", "function displayNotes(notes) {\n\tvar el = document.getElementById('notes-played');\n\tel.innerHTML = notes; \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 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}", "function initNotesDisplay() {\n presenterNotes.style.display = 'flex';\n instructions.style.display = 'none';\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 saveNoteInPopUp() {\n var currentNote = document.querySelector(\".note-list__item[data-item-number='\" + currentNoteId + \"']\");\n notes.forEach(function(element, index) { \n if (element.noteId === currentNoteId) {\n element.noteText = editText.value;\n currentNote.style.background = element.colorBg;\n if (!editHead) {\n element.noteHead = \"\";\n } else {\n element.noteHead = editHead.value;\n }\n }\n });\n currentNote.querySelector(\".note-list__text\").innerHTML = editText.value;\n currentNote.querySelector(\".note-list__head\").innerHTML = editHead.value;\n if (!currentNote.querySelector(\".note-list__head\").innerHTML) {\n currentNote.querySelector(\".note-list__head\").style.marginBottom = \"0px\";\n } else {\n currentNote.querySelector(\".note-list__head\").style.marginBottom = \"10px\";\n }\n notePopUp.style.display = 'none';\n document.querySelector(\".overlay\").style.display = 'none';\n \n }", "function setNotes(e) {\n\n\tvar cursor = e.target.result;\n\n\tif (cursor) {\n\n\t\tconsole.log(cursor.value);\n\t\tpopupPage.addNoteToView(cursor.value);\n\n\t\tcursor.continue();\n\n\t}\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 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 updateNotifications(number) {\n $(\"#notificationNumber\").text(number);\n $(\"#notificationWindow\").text(number + \" new personal notes\");\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 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 showNewNoteModal() {\n var dialog, noteTextarea, hidePreviewInput, noteValue, noteHtml, preview;\n var promise = Dialogs.showModalDialogUsingTemplate(Mustache.render(newNoteTemplate, Strings))\n .done(function (id) {\n // if button OK clicked\n if (id === Dialogs.DIALOG_BTN_OK) {\n noteTextarea = dialog.find('textarea');\n noteValue = noteTextarea.val();\n noteHtml = dialog.find('div[data-id=\"georapbox-new-note-preview\"]').html();\n\n saveNote(noteValue, noteHtml, function () {\n renderNotes();\n });\n\n dialog.unbind('keyup');\n }\n\n // if button CANCEL clicked\n if (id === Dialogs.DIALOG_BTN_CANCEL) {\n dialog.unbind('keyup');\n }\n });\n\n dialog = $('.georapbox-notes-new-note-dialog.instance');\n preview = $('div[data-id=\"georapbox-new-note-preview\"]');\n noteTextarea = dialog.find('textarea');\n hidePreviewInput = dialog.find('input[type=\"checkbox\"]');\n\n noteTextarea.focus();\n\n function togglePreview(isVisible) {\n if (isVisible === true) {\n preview.show();\n noteTextarea.css({ width: '49%' });\n localStorage.setItem(STORAGE_KEY_PREVIEW_VISIBLE, 'true');\n } else {\n preview.hide();\n noteTextarea.css({ width: '99%' });\n localStorage.setItem(STORAGE_KEY_PREVIEW_VISIBLE, 'false');\n }\n }\n\n dialog.on('keyup', 'textarea', debounce(function () {\n previewMarkDown(preview, $(this).val());\n }, 250));\n\n // Determine if Preview is visible or not.\n if (localStorage.getItem(STORAGE_KEY_PREVIEW_VISIBLE) === 'false') {\n hidePreviewInput.attr('checked', 'checked');\n togglePreview(false);\n }\n\n dialog.on('change', 'input[type=\"checkbox\"]', function () {\n togglePreview(!$(this).is(':checked'));\n });\n\n return promise;\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 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 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 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 reloadNotes() {\n pollingObserver.reloadAll(function (notes) {\n var notesList = $(\"#js-notes-list\");\n notesList.html(createNotesHtml(notes));\n addClickHandlers(notesList);\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 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 frmPatientSummary_showpopupnotes()\n{\n searchPatient_closeSearchList();\n frmPatientSummary.lbltitle.text=frmPatientSummary.btnstepsofhealing.text;\n frmPatientSummary.lblerror.setVisibility(false);\n frmPatientSummary.textareanotes.text=\"\";\n notesModule.frmPatientSummaryAddNotes();\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 }", "function setNotes() {\n var base = 260;\n var board_height = Rooms.findOne().board.height;\n var board_width = Rooms.findOne().board.width;\n var notes = getScaleNotes(SCALE_VALUES.MAJOR, base, board_height);\n for(x = 0; x < board_width; x++) {\n for(y = 0; y < board_height; y++) {\n boardData[x][y].frequency = notes[board_height-x-1];\n boardData[x][y].title = notes[board_height-x-1];\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 += ` <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 update(notesPresenter){ \n destroy();\n notes = notesPresenter\n const frag = document.createDocumentFragment();\n for (let i = 0; i < notes.length; i++) {\n frag.appendChild(addNote( notes[i], 'alive'));\n //for each one we add to the count of notes\n addNoteToCount();\n }\n container.append(frag);\n var containerChilds = container.children;\n drag(containerChilds)\n }", "function addNote() {\n self.showAdd = !self.showAdd;\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 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}", "async function showNotesModel() {\n if (currentAdmission.notes.length != 0) {\n const editDeleteNotesModel = document.querySelector('.edit-delete-notes-model');\n editDeleteNotesModel.style.display = \"block\";\n const notesList = document.querySelector('.notes-list');\n const notesListHTML = currentAdmission.notes.map((n, index) => {\n return `<tr>\n <td style=\"padding: 10px 20px;\"><textarea class=\"filed\" id=\"edited-note\">${n}</textarea></td>\n <td style=\"padding: 10px 20px;\"><button class=\"btn action-btn green\" onclick=\"editNote(${index})\">Update</button></td>\n <td style=\"padding: 10px 20px;\"><button class=\"btn action-btn red\" onclick=\"deleteNote(${index})\">Delete</button></td>\n </tr>`\n }).join('\\n');\n notesList.innerHTML = notesListHTML;\n } else\n alert('There are no notes to be edited!')\n}", "function handleNoteButtonEvent(thisObj) {\n _changed = true;\n if ($(thisObj.getHtmlIds().noteContainer).visible()) {\n if (thisObj.getStandardValue() == thisObj.getMeta().seeNoteCui) {\n thisObj.clearNote();\n }\n else {\n thisObj.hideNote();\n }\n }\n else {\n thisObj.showNote();\n }\n }", "function addNotesToPage() {\n // for each data_point in this team's notes_data\n for (let data_point_index in notes_data[selected_team]) {\n // data_point is new notes to add\n let data_point = notes_data[selected_team][data_point_index];\n // adds a new line\n $(\"#notes-\" + selected_team + \"-\" + data_point[1]).prepend('<h4>Stand app:</h4>').append(\"<br><hr><h4>Notes app:</h4>\" + data_point[0]);\n }\n}", "function renderNotes() {\r\n for (var i = 0; i < notesListLS.length; i++) {\r\n createMarkup(i);\r\n }\r\n}", "function editNotes(ele){\n\t\t\tvar formContainer = document.createElement(\"div\"),\n\t\t\t\tformContent = '',\n\t\t\t\theader = '<h3>Edit Notes</h3>',\n\t\t\t\tinputArea = '<textarea placeholder=\"Jot down some notes\" autofocus></textarea>',\n\t\t\t\tsubmitButton = '<input type=\"button\" class=\"btn\" value=\"Update\" onclick=\"BNB.calendar.Notes.submitEditNotes(this)\">',\n\t\t\t\tcloseButton = '<span class=\"close\" onclick=\"BNB.calendar.Notes.removeEditNotes(this.parentNode);\">X</span>';\n\n\t\t\t// If a dialog is already open, close it\n\t\t\tif(document.getElementsByClassName(\"edit-notes-form\")[0]){\n\t\t\t\tremoveEditNotes(document.getElementsByClassName(\"edit-notes-form\")[0]);\n\t\t\t}\n\n\t\t\t// Track the clicked element\n\t\t\tcurrentStepNode = ele.parentNode;\n\n\t\t\t// Add notes to the textarea if notes exist\n\t\t\tif(currentStepNode.getAttribute(\"data-notes\") != \"There are no notes for this event.\"){\n\t\t\t\tinputArea = '<textarea autofocus>' + \n\t\t\t\tcurrentStepNode.getAttribute(\"data-notes\") + \n\t\t\t\t'</textarea>';\n\t\t\t}\n\n\t\t\t// Assemble Notes dialog box\n\t\t\tformContent = header + inputArea + submitButton + closeButton;\n\n\t\t\t// Add a new \"Edit Notes\" dialog box to the page\n\t\t\tformContainer.className = \"edit-notes-form\";\n\t\t\tformContainer.innerHTML = formContent;\n\t\t\taddEditNotes(ele, formContainer);\n\t\t}", "function editNotes()\r\n{\r\n\tvar note = GM_getValue(steam_id, \"Enter notes here\");\r\n\tvar newNote = window.prompt(\"User notes\", note);\r\n\tif (newNote != note && newNote != \"\" && newNote != null)\r\n\t\tGM_setValue(steam_id, newNote);\r\n}", "function openNotesEditModal(e) {\r\n e.preventDefault();\r\n\r\n dmpNotesModal.style.display = \"block\";\r\n\r\n currentEditDay = e.target.dataset.jsEditNotes;\r\n currentEditDayNumber = parseInt(\r\n currentEditDay.charAt(currentEditDay.length - 1)\r\n );\r\n currentDayDisplay = days[currentEditDayNumber - 1];\r\n\r\n dmpNotesModalHeader.textContent = `${currentDayDisplay} Notes`;\r\n dmpNotesModalInput.value = dmpContent[currentEditDay][\"notes\"];\r\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 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 popupnotes_onclickSave()\n{\n notes_info.notes=frmPatientSummary.textareanotes.text.trim();\n notes_list.push(notes_info);\n frmPatientSummary.fcpopupnotes.setVisibility(false);\n frmPatientSummary.fcpatientsummaryheaderhover.setVisibility(false);\n frmPatientSummary.fcpatientsummaryfooterhover.setVisibility(false);\n}", "function updateDisplay() { \n setBoundaries();\n showFinish();\n\n //Set tracking display\n setText(\"tracking\", index + 1 + \"of\" + list.length);\n setText(\"text\", list[index]);\n\n\n}", "function 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 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 updatePreviewWithNote(sender, paeNote) {\r\n // console.log(\"key pressed is \" + paeNote)\r\n plaineEasieCodes.push(paeNote)\r\n updateNotesSVG()\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 += `\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}", "afficher(note){\n\t\tdocument.querySelector(\"#currentNoteView\").innerHTML = this.convertir(note);\n\t}", "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() {\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 handleAdding() {\n notes.style.display = 'flex'\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 displayNotes(id){\n\tvar notesHoverID = \"hover_new_notes_\" + id;\n\t//alert(notesHoverID);\n\t\n\tvar notes = document.getElementById(notesHoverID);\n\tnotes.style.zIndex = \"100\";\n\tnotes.style.display = \"block\";\n\t\n\t//new method\n\tvar el, x, y;\n\n\tel = document.getElementById(notesHoverID);\n\tif (window.event) {\n\t\tx = window.event.clientX + document.documentElement.scrollLeft\n\t\t+ document.body.scrollLeft;\n\t\ty = window.event.clientY + document.documentElement.scrollTop +\n\t\t+ document.body.scrollTop;\n\t}\n\telse {\n\t\tx = event.clientX + window.scrollX;\n\t\ty = event.clientY + window.scrollY;\n\t}\n\tx -= 2; y -= 2;\n\ty = y+15\n\tel.style.left = x + \"px\";\n\tel.style.top = y + \"px\";\n\tel.style.display = \"block\";\n\tdocument.getElementById('PopUpText').innerHTML = notesHoverID.innerHTML;\n\t\n}", "function update_note(data)\n {\n data.id = rcmail.html_identifier_encode(data.uid);\n\n var row, is_new = (notesdata[data.id] == undefined && data.list == me.selected_list);\n notesdata[data.id] = data;\n\n if (is_new || me.selected_note && data.id == me.selected_note.id) {\n render_note(data);\n update_taglist(data.tags || []);\n }\n else if (data.tags) {\n update_taglist(data.tags);\n }\n\n // add list item on top\n if (is_new) {\n noteslist.insert_row({\n id: 'rcmrow' + data.id,\n cols: [\n { className:'title', innerHTML:Q(data.title) },\n { className:'date', innerHTML:Q(data.changed || '') }\n ]\n }, true);\n\n noteslist.select(data.id);\n }\n // update list item\n else if (row = noteslist.rows[data.id]) {\n $('.title', row.obj).text(data.title);\n $('.date', row.obj).text(data.changed || '');\n // TODO: move to top\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 gmQuickNotes() {\n\tif(document.getElementById(\"note\") && document.getElementById(\"PriorLibraryNotes\") ) {\n\t\t\n\t\t// Add quick notes\n\t\tif(document.getElementById(\"PriorLibraryNotes\").innerHTML.indexOf('QuickNotes') < 0) {\n\t\t\tdocument.getElementById(\"PriorLibraryNotes\").innerHTML += \n\t\t\t\t'<div class=\"QuickNotes\">' +\n\t\t\t\tdocument.getElementById(\"gmQuickNoteDiv\").innerHTML + '</div>';\n\t\t}\n\t\t\n\t\t// Set default value\n\t\tif(document.getElementById(\"note\").value == '') {\n\t\t\tdocument.getElementById(\"note\").value = QuickNoteDefaultOption;\n\t\t\tdocument.getElementById(\"note\").select();\n\t\t}\n\t\t\n\t}\n\tsetTimeout(gmQuickNotes, 500);\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 showNotesEditor(noteId, noteTitle = '', noteContent = '') {\n\n newNoteBtn.addClass('d-none');\n let label = noteId ? 'Editar Nota' : 'Nueva Nota';\n let buttonText = noteId ? 'Actualizar Nota' : 'Guardar Nota';\n\n notesContainer.html(`\n <div style='text-align: center;'>\n <h4>${label}</h4>\n </div>\n <div class='form' style='margin: 15px'>\n <input id='note-title' type='text' class='form-control' placeholder='Título' maxlength='500' value='${noteTitle}'>\n <textarea id='note-content' class='form-control mt-3' placeholder='Contenido' id='floatingTextarea' style='height: 350px'>${noteContent}</textarea>\n </div>\n <div style='text-align: right; margin: 15px'>\n <button id='upsert-note' class='btn btn-success ms-auto'>${buttonText}</button>\n <button id='edit-note-cancel' class='btn btn-warning ms-auto'>Cancelar</button>\n </div>\n `);\n\n $('#edit-note-cancel').on('click', function () {\n loadNotes();\n });\n\n $('#upsert-note').on('click', function () {\n\n const title = $('#note-title').val().trim();\n const content = $('#note-content').val().trim();\n\n if (title === '') {\n iziToast.warning({\n message: 'Ingresa el título de la nota',\n close: true,\n timeout: 2000,\n });\n return;\n }\n\n if (content === '') {\n iziToast.warning({\n message: 'Ingresa el contenido de la nota',\n close: true,\n timeout: 2000,\n });\n return;\n }\n\n if (!noteId) {\n // Nueva Nota\n executeRequest('POST', 'notes/create', { title: title, content: content }).then(r => {\n\n iziToast.success({\n message: 'La nota se ha guardado correctamente',\n close: true,\n timeout: 1500,\n });\n\n loadNotes();\n\n }).catch(() => {\n // Se maneja en la petición\n });\n } else {\n // Actualizar Nota\n executeRequest('PATCH', 'notes/update', { id: noteId, title: title, content: content }).then(r => {\n\n iziToast.success({\n message: 'La nota se ha actualizado correctamente',\n close: true,\n timeout: 1500,\n });\n\n loadNotes();\n\n }).catch(() => {\n // Se maneja en la petición\n });\n }\n });\n\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 updateScreen(){\n\t\tsolveWord.innerHTML = answerMask.join(\" \");\n\t\tguessedLetters.sort();\n\t\tshowGuessed.innerHTML = guessedLetters;\n\t\tremLives.innerHTML = heartbeat;\n\t}", "function refreshNotes(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\t\r\n\tnotes = [];\r\n\ttr.childNodes.forEach((td) => {\r\n\t\tvar n = td.childNodes[0].value;\r\n\t\tif(!noteValidation.test(n)) n = td.childNodes[0].value = defaultNote;\r\n\t\tnotes.push(n);\r\n\t});\r\n\t\r\n\tinitMatrix();\r\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 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 addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\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(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 handlenoteEdit() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n editnote(currentnote);\n }", "function displayNote(noteDataObj) {\r\n\r\n\tvar notes_c = document.getElementById(\"notes-container\"); // the notes container\t\r\n\t\r\n\tvar note_div = document.createElement(\"div\"); // create a new div element, of a single note\r\n\r\n\tnotes_c.appendChild(note_div); // apply note div on the notes container\r\n\t\r\n\tnote_div.className = \"note\"; // adding class of css properties to note div\r\n\tnote_div.id = noteDataObj.id; // adding identification for the note div\r\n\t\r\n\t/* image originally taken from: */ // nt_img.src = \"http://www.clker.com/cliparts/d/R/v/M/J/N/posted-not-with-pin-th.png\";\r\n\tnote_div.style.backgroundImage = \"url('http://www.clker.com/cliparts/d/R/v/M/J/N/posted-not-with-pin-th.png')\";\r\n\tnote_div.style.backgroundSize = \"cover\";\r\n\tnote_div.classList.add(\"fade-in\"); // by applying this class the note will be added with fade-in css3 effect properties\r\n\t\t\r\n\tvar icon = document.createElement(\"span\"); // creating bootstrap's glyphicon remove span element\r\n\ticon.className = \"glyphicon glyphicon-remove\";\r\n\ticon.classList.add(\"delete-note-icon\");\r\n\ticon.classList.add(\"hidden\"); // hidden class by default\r\n\t\r\n\tnote_div.addEventListener(\"mouseover\", function() { // change properties upon mouseover event on note\r\n\t\ticon.classList.remove(\"hidden\");\r\n\t\ticon.classList.add(\"visible\");\r\n\t\ticon.style.cursor = \"pointer\";\r\n\t});\r\n\t\r\n\tnote_div.addEventListener(\"mouseout\", function() { // change properties upon mouseout event on note\r\n\t\ticon.classList.remove(\"visible\");\r\n\t\ticon.classList.add(\"hidden\");\r\n\t\ticon.style.cursor = \"default\";\r\n\t});\r\n\t\r\n\tnote_div.appendChild(icon); // apply icon on note div\r\n\r\n\tvar txt_area = document.createElement(\"textarea\"); // create textarea element for note textual content (task)\r\n\ttxt_area.innerHTML = noteDataObj.txt; // get text property from note object into the textarea element\r\n\ttxt_area.className = \"note-txtarea fade-in\";\r\n\ttxt_area.readOnly = \"true\";\r\n\ttxt_area.rows = 7;\t\r\n\tnote_div.appendChild(txt_area); // apply textarea on note div\r\n\t\r\n\tvar timestamp_str = document.createElement(\"p\"); // create p element for date and time\r\n\ttimestamp_str.className = \"timestamp\";\r\n\ttimestamp_str.classList.add(\"fade-in\");\r\n\t\r\n\t// call function to reformat date to the requested DD/MM/YYYY format (date property of note object is a parameter to the function)\r\n\tvar formatted_date = reformatDate(noteDataObj.date);\r\n\ttimestamp_str.innerHTML = formatted_date + \"<br/>\" + noteDataObj.time;\r\n\t\r\n\tnote_div.appendChild(timestamp_str); // apply timestamp (date+time) on note div\r\n\t\r\n\ticon.addEventListener(\"click\", function() {\r\n\t\t// upon clicking on the glyphicon a comparison is being made between the note to be removed (has its glyphicon clicked) \r\n\t\t// to each of the notes elements exist in the notes array, till it's being found. the comparison is between id-s \r\n\t\t// represented by timestamp saved upon note creation. once a match is found, that note element will be removed from the \r\n\t\t// notes array. then, the corresponding note div element will also be removed, from the notes container. finally, the \r\n\t\t// local storage will be updated as well\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tvar idOfNoteToBeRemoved = note_div.id;\r\n\t\t\t\t\t\t\t\t\t\tvar found = false;\r\n\t\t\t\t\t\t\t\t\t\tfor (var k=0; k < notesObj.notes.length && !found; k++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar curr_note_id = notesObj.notes[k].id;\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** current checked: \" + curr_note_id + \" ***\");\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** looking for: \" + idOfNoteToBeRemoved + \" ***\");\r\n\t\t\t\t\t\t\t\t\t\t\tif (curr_note_id === idOfNoteToBeRemoved) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** found it! ***\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tnotesObj.notes.splice(k,1); // once found, remove the \"k\"-th note from the array\r\n\t\t\t\t\t\t\t\t\t\t\t\tfound = true; // stop looking for it, found already\r\n\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\tdocument.getElementById(\"notes-container\").removeChild(note_div);\r\n\t\t\t\t\t\t\t\t\t\t// remove the corresponding note div element from the notes container\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** removed note! ***\");\r\n\t\t\t\t\t\t\t\t\t\tlocalStorage.setItem(\"notes\", JSON.stringify(notesObj)); // save updated json to local storage\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** updated local storage! ***\");\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n}", "function openNote() {\n scene.remove(note);\n noteHTML = document.getElementById(\"note\");\n noteHTML.style.display = \"block\";\n isNoteDisplayed = true;\n\n loader.load(\n // resource URL\n 'src/models/gltf/usb/scene.gltf',\n // called when the resource is loaded\n function ( gltf ) {\n usb = gltf.scene;\n currentObject = usb;\n gltf.scene.scale.set( 0.01, 0.01, 0.01 );\t\t\t \n gltf.scene.position.x = 0.7;\t\t\t\t //Position (x = right+ left-) \n gltf.scene.position.y = -1.2;\t\t\t\t //Position (y = up+, down-)\n gltf.scene.position.z = -3.85;\t\t\t\t //Position (z = front +, back-)\t\t\t \n\n scene.add( gltf.scene );\n }\n );\n}", "render() {\n this.saveNotes()\n this.displayNotes()\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 addNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\tappendNote(tr, defaultNote);\r\n\taddState();\r\n\t\r\n\trefreshNotes();\r\n}", "function displayCurrentNoteBook() {\n let currentNotebookHeading = document.getElementById(\"current-notebook\");\n currentNotebookHeading.innerText = openNotebook.toUpperCase();\n newNoteBookIntro(currentNotebookHeading);\n}", "function openNotes(x){\n\tif(noteDrawerShow == true){\n\t\t//hide the drawer when clicked outside the drawer\n\t\tdocument.getElementById(\"showDrawer\").style.display = \"none\";\n\t\tnoteDrawerShow = false;\n\t}\n\t// else if(numOfNotes < 5 && noteDrawerShow == false){ //currently only allow up to 4 notes\n\telse if(noteDrawerShow == false){ //currently only allow up to 4 notes\n\t\t//show the note drawer\n\t\tdocument.getElementById(\"showDrawer\").style.display = \"block\";\n\t\tnoteDrawerShow = true;\n\t\tnotePosition = x;\n\t}\n}", "function showNote(event) {\n const note = findNote(event);\n if (!note) {\n return;\n }\n\n if (fretboardDiv.lastChild !== image) {\n if (fretboardDiv.lastChild.innerHTML === note.note) {\n return;\n }\n\n removeChildren();\n }\n\n fretboardDiv.appendChild(createButton(note));\n}", "didSwitchToNoteLayout() {\n this.controllerState.viewMode = ViewMode.note;\n this.didSwitchLayout();\n }", "function edit_notes_show_report(userid, notes_id, notes_type) \n\t\t\t{\n\t\t\t\tjQuery(\"#message\").html(\"\");\n\t\t\t\tjQuery(\"#edit_notes_div\").html(\"\");\n\t\t\t\tjQuery(\"#edit_notes_div\").html(\"<img src='../images/ajax-loader.gif'/>\");\n\t\t\t\tjQuery.get('edit_notes_show_report.php?userid='+userid+'&notes_id='+notes_id+'&notes_type='+notes_type, function(html){\n\t\t\t\t\t\n\n\t\t\t\t\t// console.log(html);exit();\n\t\t\t\t\t//console.log(html);exit();\n\t\t\t\t\tjQuery(\"#edit_notes_div\").html(html);\n\t\t\t\t\t$('textarea').summernote({\n\t\t\t\t\t\t toolbar: [\n\t\t\t\t\t\t //[groupname, [button list]]\n\t\t\t\t\t\t ['style', ['bold', 'italic', 'underline']],\n\t\t\t\t\t\t ['fontsize', ['fontsize']],\n\t\t\t\t\t\t ['para', ['ul', 'ol', 'paragraph']],\n\t\t\t\t\t\t ],\n\t\t\t\t\t\t height:200\n\t\t\t\t\t\t});\n\t\t\t\t\tsync_to_v2();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}", "function updatePreviewWithClef(sender, clef) {\r\n // console.log(\"clef changed to \" + clef)\r\n selectedClef = clef\r\n updateNotesSVG()\r\n}", "function drawNotes(){\n if (state === 'piano'){\n \n fill(255);\n // MAKE A FOR LOOP SOON\n rect(width - 400, height/2, 150, 400);\n rect(width - 550, height/2, 150, 400);\n rect(width - 700, height/2, 150, 400);\n rect(width - 850, height/2, 150, 400);\n rect(width - 1000, height/2, 150, 400);\n rect(width - 1150, height/2, 150, 400);\n rect(width - 1300, height/2, 150, 400);\n \n \n fill(0);\n text('G', width - 400, height/2);\n text('F', width - 550, height/2);\n text('E', width - 700, height/2);\n text('D', width - 850, height/2);\n text('C', width - 1000, height/2);\n text('B', width - 1150, height/2);\n text('A', width - 1300, height/2);\n }\n}", "function editnotes(){\n\t\t\tdocument.getElementById(\"notes\").readOnly = false;\n\t\t\t\n\t\t\tdocument.getElementById(\"btnEditNotes\").className += \" hidden\";\n\t\t\tdocument.getElementById(\"btnSaveNotes\").className = \"\";\n\t\t}", "function addNotes(id, con){\n\tvar musicPosition = 0;\n\tvar storeNotes_arr = [];\n\t\n\tif(con){\n\t\tmusicPosition = id.position;\n\t\tstoreNotes_arr = id.notes;\n\t\tid = id.id;\n\t}\n\t\n\tvar notesHTML = '';\n\tvar noteID = 'note'+edtNotesCount;\n\tvar percent = 0;\n\tvar bgColour = '';\n\tvar editAdded = '';\n\t\n\tfor(n=0;n<notes_arr.length;n++){\n\t\tif(id == notes_arr[n].id){\n\t\t\tpercent = 100/(Number(notes_arr[n].amount)+1);\n\t\t\tbgColour = notes_arr[n].colour;\n\t\t\t\n\t\t\tvar totalNote = '';\n\t\t\tfor(p=0;p<notes_arr[n].amount;p++){\n\t\t\t\ttotalNote += '<div class=\"note\"></div>';\n\t\t\t}\n\t\t\t\n\t\t\tif(!con){\n\t\t\t\teditAdded = 'added';\n\t\t\t}\n\t\t\tnotesHTML = '<div id=\"'+noteID+'\" data-array='+id+' data-type='+id+' class=\"notesWrapper '+editAdded+'\">'+totalNote+'</div>';\n\t\t}\n\t}\n\t\n\t$('.playerNotes').append(notesHTML);\n\t$('#'+noteID+', #'+noteID+' .note').css('background', bgColour);\n\t$('#'+noteID+' .note').draggable({ containment: '#'+noteID, scroll: false, start:function(){ curNote=$(this).closest('div.notesWrapper').attr('data-array');highLightNote(false); }, drag:function(){updateNoteValue(false);}});\n\t$('#'+noteID).draggable({ containment:'.editPlayerWrapper', scroll:false, start:function(){ curNote=$(this).attr('data-array');highLightNote(false); }, drag:function(){updateNoteValue(false);}});\n\t\n\t$('#'+noteID).click(function(){\n\t\tcurNote=$(this).attr('data-array');highLightNote(false);\n\t});\n\t\n\t$('#'+noteID+' .note').click(function(){\n\t\tcurNote=$(this).closest('div.notesWrapper').attr('data-array');highLightNote(false);\n\t});\n\t\n\tif(con){\n\t\t$('#'+noteID).css('top', musicPosition * heightScale);\n\t}else{\n\t\t$('#'+noteID).css('top', curMusicPosition);\t\n\t}\n\t\n\tvar curLeft = percent;\n\t$('#'+noteID+' .note').each(function(index, element) {\n\t\tif(con){\n\t\t\t$(this).css('left',storeNotes_arr[index]);\n\t\t}else{\n\t\t\t$(this).css('left',curLeft+'%');\n\t\t\tcurLeft+=percent;\n\t\t}\n });\n\t\n\tedtNotesCount++;\n\tstopGame();\n}", "function delegate_note(action,data) {\n\tswitch(action) {\n\t\tcase \"get\":\n\t\t\tif(haswebsql) {\n\t\t\t\tglossdb.data.getnote(data.title,data.target);\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tglossdb.getnote(data.title,data.target);\n\t\t\t}\n\t\tbreak;\n\t\tcase \"show\":\n\t\t\t// get references to EXT form elements for notes\n\t\t\tvar fta = Ext.getCmp(\"notetextarea\");\n\t\t\tvar ftitle = Ext.getCmp(\"notetitle\");\n\t\t\tvar ftarget= Ext.getCmp(\"notetarget\"); \n\t\t\tvar flabel = Ext.getCmp(\"notelabel\");\n\t\t\t// get note window object\n\t\t\tvar notewindow = Ext.getCmp(\"notewindow\");\n\t\t\t// set the values of the form fields to the new values\n\t\t\tfta.setValue(data.notes);\n\t\t\tftitle.setValue(data.title);\n\t\t\tftarget.setValue(data.target);\n\t\t\tflabel.setText(data.title);\n\t\t\t// show the window\n\t\t\tnotewindow.show();\n\t\tbreak;\n\t\tcase \"delete\":\n\t\t\tif(haswebsql) {\n\t\t\t\tglossdb.data.deletenote(data.title,data.target);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tglossdb.deletenote(data.title,data.target);\n\t\t\t}\n\t\t\tshowMessage(\"notedelete\");\n\t\tbreak;\n\t\tcase \"save\":\n\t\t\t// get values of form fields\n\t\t\tvar notes = Ext.getCmp(\"notetextarea\").getValue();\n\t\t\tvar title = Ext.getCmp(\"notetitle\").getValue();\n\t\t\tvar target= Ext.getCmp(\"notetarget\").getValue(); \n\t\t\t// get reference to notes window\n\t\t\tvar notewindow = Ext.getCmp(\"notewindow\");\n\t\t\t// hide notes window\n\t\t\tnotewindow.hide();\n\t\t\t// show add message\n\t\t\tif(haswebsql) {\n\t\t\t\tglossdb.data.savenote(title,target,notes);\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tglossdb.savenote(title,target,notes);\t\n\t\t\t}\n\t\tbreak;\n\t}\n}", "function showInstructions() {\r\n\tconst INSTRUCTIONS = \"1. Identify the morphological boundaries. \" \r\n\t\t\t\t\t + \"When you mouse over the word, grey slashes will appear in the spaces between the letters, indicating possible morphological boundaries. <br><br>\"\r\n\t\t\t\t\t + \"a. To mark a morphological boundary, click on the space where you think the boundary is using your mouse. <br><br> \" \r\n\t\t\t\t\t + \"b. Once you've made your selection, click on the check button to see whether you've identified the boundaries correctly. <br><br>\"\r\n\t\t\t\t\t + \"c. If you've selected your boundaries correctly, the morphological categories of the word's components will automatically appear above the word.\"\r\n\t\t\t\t\t + \"If you haven't, you will be given the opportunity to try again \"\r\n\t\t\t\t\t + \"(remember, after three tries, the program will provide the correct answer).\"; \r\n\tshowModal(INSTRUCTIONS, false);\r\n}", "function update() {\n\t\tvar f = self.fm.getSelected(0);\n\t\treset();\n\n\t\tself._hash = f.hash;\n\t\tself.title.text(f.name);\n\t\tself.win.addClass(self.fm.view.mime2class(f.mime));\n\t\tself.name.text(f.name);\n\t\tself.kind.text(self.fm.view.mime2kind(f.link ? 'symlink' : f.mime)); \n\t\tself.size.text(self.fm.view.formatSize(f.size));\n\t\tself.date.text(self.fm.i18n('Modified')+': '+self.fm.view.formatDate(f.date));\n\t\tf.dim && self.add.append('<span>'+f.dim+' px</span>').show();\n\t\tf.tmb && self.ico.css('background', 'url(\"'+f.tmb+'\") 0 0 no-repeat');\n\t\tif (f.url) {\n\t\t\tself.url.text(f.url).attr('href', f.url).show();\n\t\t\tfor (var i in self.plugins) {\n\t\t\t\tif (self.plugins[i].test && self.plugins[i].test(f.mime, self.mimes, f.name)) {\n\t\t\t\t\tself.plugins[i].show(self, f);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tself.url.hide();\n\t\t}\n\t\t\n\t\tself.win.css({\n\t\t\twidth : '420px',\n\t\t\theight : 'auto'\n\t\t});\n\t}", "function updateWindowAfterResolve() {\n\trightPane.innerHTML = templates.renderQuestionForm();\n\tif(getStoredQuestions().length < 1) addTemporaryQuestion();\n }", "function drawNotes(tuning) {\n\n $.ajax({\n url: \"notes.php\",\n data: {\n tuning: tuning\n },\n success: function(strings) {\n\n clearNotes();\n\n // for each string\n $.each(strings, function(string_number, string) {\n\n // draw open string note\n var stringNoteHtml = '<div class=\"open_note\">' + string.open + \"</div>\";\n $(\".\" + string_number + \" > .open\").html(stringNoteHtml);\n\n // for each note\n $.each(string.notes, function(note, frets) {\n\n // custom class for half-steps notes\n if (note.length > 1) {\n var noteHtml = '<div class=\"halfstep ' + note + '\">' + note + \"</div>\";\n } else {\n var noteHtml = '<div class=\"note ' + note + '\">' + note + \"</div>\";\n }\n\n // draw note\n $(\".\" + string_number + \" > .fret\" + frets).append(noteHtml);\n\n // hide half-steps by default\n if ($(\"#toggle_halfsteps\").prop(\"checked\") == false) {\n $(\".halfstep\").hide();\n }\n });\n });\n\n // center notes\n center(\".note\");\n center(\".halfstep\");\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\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() {\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 changeNote() {\n editor.value = window.localStorage.getItem(notes.value);\n}", "function openNote(tx, results) {\n\t$(\"#name\").val(results.rows.item(0).name);\n\t$(\"#data\").val(results.rows.item(0).data);\n\t//alert(\"Row = \" + i + \" ID = \" + results.rows.item(0).note_id + \" Name = \" + results.rows.item(i).name + \" Data = \" + results.rows.item(i).data + \" time = \" + results.rows.item(i).save_time);\n\t\t \n }", "function updateNotes (notesList) {\n const notesDisplayArea = document.getElementById('notesDisplayArea')\n notesDisplayArea.innerHTML = notesToHTML(notesList)\n notesDisplayArea.querySelectorAll('delete').forEach(button => {\n button.addEventListener('click', event => {\n const noteId = button.dataset.noteId\n console.log(button.dataset.noteId)\n deleteNote(noteId)\n })\n })\n}", "function openNotesEditor(){\n Swal.fire({\n width: \"80%\",\n customClass: 'editor-swal-height',\n padding: '33px',\n html: \n '<div class=\"editor-container\">\\\n <textarea id=\"sunEditor\"></textarea>\\\n </div>',\n showCloseButton: true,\n showConfirmButton: false,\n }).then(function(result){\n if(typeof editor !== \"undefined\") editor.destroy();\n URL.revokeObjectURL(imgGalleryURL);\n });\n\n createHTMLTemplates();\n dbGetDoc(db, \"Note_\" + currentCalendar.id, {\"not_found\": true}, true).then(function(doc){ \n var content = \"\";\n if(!doc.not_found){\n content = doc.docContent;\n var attachments = doc._attachments;\n Object.keys(attachments).forEach(function(attName){\n var base64 = attachments[attName].data;\n var base64Image = \"data:\" + attachments[attName].content_type + \";base64,\" + base64;\n content = content.replace(\"{{\"+attName+\"}}\", base64Image);\n })\n } \n createEditor(content);\n })\n }", "function create_notes( nid, x, y, store_name, icondata )\n {\n var divId = \"ikanotes_\" + nid + \"div\";\n var taId = \"ikanotes_\" + nid + \"textarea\";\n var iconDivId = \"ikanotes_\" + nid + \"icon_div\";\n var iconId = \"ikanotes_\" + nid + \"icon\";\n\n var cssDivId = \"#\" + divId;\n var cssTaId = \"#\" + taId;\n var cssIconDivId = \"#\" + iconDivId;\n var cssIconId = \"#\" + iconId;\n\n var notes_html = \n\t \"<div id='\" + divId + \"'> \\\n <center>\t\t\t\t\t\t\t\\\n <textarea id='\" + taId + \"' rows='15' cols='45'></textarea> \\\n </center>\t\t\t\t\t\t\t\\\n </div>\";\n\n var link_html =\n\t \"<div id='\" + iconDivId + \"'>\\\n <img id='\" + iconId + \"'/> \\\n\t </div>\";\n\n\n\n $( notes_html ).appendTo( \"body\" );\n $( cssDivId ).css( \"border\", \"1px solid black\" );\n var textVal = GM_getValue( store_name, \"\" );\n if( textVal == \"\" )\n {\n if( store_name == gm_global_name )\n textVal = \"<Global Notes>\";\n else\n textVal = \"<This World Only Notes>\";\n }\n $( cssTaId ).val( textVal );\n\n\n var icon_width = 50;\n var icon_height = 50;\n\n $( link_html ).appendTo( \"body\" );\n $( cssIconId ).attr( \"src\", icondata );\n $( cssIconId ).attr( \"title\", \"Show/Hide notes\" );\n $( cssIconId ).css( \"width\", icon_width + \"px\" );\n $( cssIconId ).css( \"height\", icon_height + \"px\" );\n\n $( cssIconId ).click( function()\n {\n\t var div = $( cssDivId );\n\t if( div.css( \"visibility\" ) == 'hidden' )\n\t div.css( \"visibility\", 'visible' );\n\t else\n\t {\n\t var txt = $( cssTaId ).val();\n\t GM_setValue( store_name, txt );\n\t div.css( \"visibility\", 'hidden' );\n\t }\n });\n \n var notes_width = $( cssTaId ).width() + 10;\n\n var icon_left = x;\n var icon_top = y;\n\n // put icon in upper-right corner\n $( cssIconDivId ).css( \"position\", \"absolute\" );\n $( cssIconDivId ).css( \"zIndex\", 100 );\n $( cssIconDivId ).css( \"left\", icon_left + \"px\" );\n $( cssIconDivId ).css( \"top\" , icon_top + \"px\" );\n\n var notes_left = icon_width + 5;\n var notes_top = icon_top;\n $( cssDivId ).css( \"position\", \"absolute\" );\n $( cssDivId ).css( \"left\", notes_left + \"px\" );\n $( cssDivId ).css( \"top\", notes_top + \"px\" );\n \n // set notes_div hidden\n $( cssDivId ).css( \"visibility\", \"hidden\" );\n $( cssDivId ).css( \"zIndex\", 150 );\n $( cssDivId ).css( \"width\", notes_width + \"px\" );\n }// end create_notes function", "updateHandler() {\n\n // 1. Check if its (a) new note to be added or (b) update the existing note based on selectedBoardID\n var selectedBoardID = this.view.boardView.selectedBoardID;\n if (selectedBoardID === -1) {\n\n // There are 3-scenarios of add/insert\n // 1. First note added\n // 2. Insert after the last board displayed\n // 3. Append at last\n\n // 1. First note added\n if (this.startNoteID === -1 && this.endNoteID === -1) {\n\n // 1. Fetch the noteID after which the note should be inserted\n var insertedNoteID = 0;\n // 2. Insert the new note to the model\n this.model.insertNote(this.noteForm.elementCollection, insertedNoteID);\n // 3. Update the view with the new note added to the empty board (if any) or the last board\n this.view.boardView.displayNoteAtEnd(insertedNoteID, this.model.noteCollection[insertedNoteID].name);\n // 4. Update the startNoteID and endNoteID\n this.startNoteID = 0;\n this.endNoteID = 0;\n\n } else {\n if (this.view.boardView.noOfNotes === this.view.boardView.maxNoBoards) {\n\n // NOTE: Board is full condition\n // 1. Fetch the noteID after which the note should be inserted\n var insertedNoteID = this.endNoteID + 1;\n // 2. Insert the new note to the model\n this.model.insertNote(this.noteForm.elementCollection, insertedNoteID);\n // 3. Update the view with the new note added to the empty board (if any) or the last board\n this.view.boardView.displayNoteAtEnd(insertedNoteID, this.model.noteCollection[insertedNoteID].name);\n // 4. Update the startNoteID and endNoteID\n ++this.endNoteID;\n ++this.startNoteID;\n\n } else if (this.view.boardView.noOfNotes < this.view.boardView.maxNoBoards) {\n\n // Still empty boards are available to be filled\n // 1. Fetch the noteID after which the note should be inserted\n var insertedNoteID = this.endNoteID + 1;\n // 2. Insert the new note to the model\n this.model.insertNote(this.noteForm.elementCollection, insertedNoteID);\n // 3. Update the view with the new note added to the end of the noteCollection\n this.view.boardView.displayNoteAtEnd(insertedNoteID, this.model.noteCollection[insertedNoteID].name);\n // 4. Update the startNoteID and endNoteID \n ++this.endNoteID;\n }\n }\n\n } else {\n\n // Update the existing note\n // 1. Update the note in the model\n var noteToBeUpdated = this.view.boardView.boardCollection[selectedBoardID].getNote();\n this.model.updateNote(noteToBeUpdated.noteID, this.noteForm.elementCollection);\n\n // 2. Update the note in the view\n var updatedNote = this.model.noteCollection[noteToBeUpdated.noteID];\n this.view.boardView.displayNoteAt(selectedBoardID, noteToBeUpdated.noteID, updatedNote.name);\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\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 updateWindow(id,ul){\n document.getElementById(id).innerHTML = ul;\n }", "function showEdit(e) {\n let myTarget= e.target.parentElement.parentElement;\n\n const editMenu = myTarget.querySelector('.notes-list-item-edit');\n const saveBtn = myTarget.querySelector('.edit-save');\n const discardBtn = myTarget.querySelector('.edit-discard');\n\n let newTitleInput = myTarget.querySelector('#note-edit-title');\n let newSubtextInput = myTarget.querySelector('#note-edit-subtext');\n\n let oldTitleInput = myTarget.querySelector('.notes-list-item-title');\n let oldSubtextInput = myTarget.querySelector('.notes-list-item-subtext');\n\n\n //display old values to edit\n newTitleInput.value = oldTitleInput.textContent;\n newSubtextInput.value = oldSubtextInput.textContent;\n\n\n //show menu\n editMenu.style.display = 'flex';\n\n //btn event listeners and functions\n discardBtn.addEventListener('click', function() {\n editMenu.style.display = 'none';\n //clear incase of input\n newTitleInput.value = '';\n newSubtextInput.value = '';\n });\n\n saveBtn.addEventListener('click', function() {\n // dont do anything if no input\n if (newTitleInput.value) {\n // find in Local storage\n let storage = JSON.parse(localStorage.getItem('notes'));\n\n for (let i = 0; i < storage.length; i++) {\n if (storage[i].title === oldTitleInput.textContent && storage[i].subtext === oldSubtextInput.textContent) {\n //update LS item info\n storage[i].title = newTitleInput.value;\n storage[i].subtext = newSubtextInput.value;\n }\n }\n //update LS\n localStorage.setItem('notes', JSON.stringify(storage));\n\n //replace title if new entered\n if (newTitleInput.value != '') {\n oldTitleInput.innerHTML = newTitleInput.value;\n } \n \n oldSubtextInput.innerHTML = newSubtextInput.value;\n\n\n //hide menu\n editMenu.style.display = 'none';\n }\n\n //clear incase of input\n newTitleInput.value = '';\n newSubtextInput.value = '';\n \n });\n\n e.preventDefault();\n\n}", "function ViewNoteEdit() {\n\tthis.id = \"#view_noteedit\";\n\tthis.html = [\n\t\tzdiv, {id:\"top_div\", w:\"100%\", flt:\"left\", bkg:HeadBkg, mbottom:\"0px\",\n\t\t\tpad:\"10px\", b:\"1px solid black\", end:\">\"},\n\t\tzlbl, {id:\"noteburt\", text:\"NoteBurt\", flt:\"left\",\n\t\t\tf:\"1.5em \" + LogoFont, c:\"white\", textshadow:\"1px 1px 2px black\",\n\t\t\tmleft:\"10px\", end:\"tag\"},\n\t\tzlbl, {id:\"tab_name\", text:\"No Tab Selected\", flt:\"left\",\n\t\t\tf:HeadFont, c:HeadColor,\n\t\t\tmleft:\"30px\", pright:\"15px\", end:\"tag\"},\n\t\tzlbl, {id:\"note_title\", flt:\"left\",\n\t\t\tf:HeadFont, c:HeadColor,\n\t\t\tbleft:\"2px solid black\", pleft:\"15px\", end:\"tag\"},\n\t\tzend, zdiv,\n\t \n\t\t// left side of screen containing buttons and options\n\t\tzdiv, {id:\"options_div\", w:\"135px\", h:\"100%\", flt:\"left\", bkg:\"gray\"},\n\t\tzbtn, {id:\"close_btn\", text:\"Close\", clas:\"edit_btn\", end:\"tag\"},\n\t\tzbtn, {id:\"save_btn\", text:\"Save\", clas:\"edit_btn\", end:\"tag\"},\n\t\tzbtn, {id:\"delete_btn\", text:\"Delete\", clas:\"edit_btn\", end:\"tag\"},\n\t\tzbtn, {id:\"position_btn\", text:\"Position\", clas:\"edit_btn\", end:\"tag\"},\n\t\tzditto, '<label><input type=\"checkbox\" id=\"mono_chk\"/>Monospace</label><br>',\n\t\tzditto, '<label><input type=\"checkbox\" id=\"markdown_chk\"/>Markdown</label><br>',\n\t\tzditto, '<label><input type=\"checkbox\" id=\"html_chk\"/>HTML</label><br>',\n\t\tzditto, '<label><input type=\"checkbox\" id=\"view_chk\"/>View</label><br>',\n\t\tzend, zdiv,\n\n\t\t// right side of screen containing note content\n\t\tzdiv, {id:\"note_div\", w:\"80%\", h:\"95%\", flt:\"left\", overflow:\"auto\", pad:\"10px\"},\n\t\tztextarea, {id:\"notetext\", w:\"95%\", h:\"95%\", pad:\"10px\", tab:\"4\", bkg:\"transparent\", end:\"tag\"},\n\t\tzend, zdiv,\n\t \n\t\t// right side of screen containing html content\n\t\tzdiv, {id:\"html_div\", w:\"80%\", h:\"95%\", disp:\"none\", flt:\"left\", position:\"relative\",\n\t\t\tf:NoteFont,\tmaxwidth:NoteWidth, overflow:\"auto\",\n\t\t\tm:\"0px\", p:\"7px\", end:\"tag\"},\n\t]\n\tthis.css = [\n\t\t{ selector:\".edit_btn\",\n\t\t settings: {f:BaseFont, c:\"black\", bkg:Green1,\n\t\t\tb:\"1px solid black\", bradius:\"4px\", w:\"100px\", mleft:\"10px\", mtop:\"15px\"}\n\t\t},\n\t\t{ selector:\"#options_div label\",\n\t\t settings: {f:BaseFont, mtop:\"20px\", mleft:\"5px\", c:\"black\"}\n\t\t},\n\t\t{ selector:\"#options_div input[type='checkbox']\",\n\t\t settings: {mtop:\"15px\", mleft:\"5px\"}\n\t\t},\n\t]\n\tthis.build = function() {\n\t\tvar viewName = this.id.substring(1);\n\t\t$('body').append('<div id=\"' + viewName + '\" class=\"view\"></div>');\n\n\t\t$(this.id).css(\"height\", WinHeight-50);\n\t\t$(this.id).css(\"width\", WinWidth-50);\n\n\t\tvar html = GenHtml(this.html);\n\t\t$(this.id).html(html);\n\n\t\tvar css = GenCss(this.css);\n\t\tApplyCss(this.id, css);\n\n\t\tthis.events();\n\t}\n\tthis.display = function(refresh) {\n\t\t$(\"body\").css(\"background\", Gray1);\n\n\t\tif(refresh) {\n\t\t\t$(this.id + \" #notebook_name\").text(DataBookName);\n\t\t\t$(this.id + \" #tab_name\").text(DataTabs[DataTabid].tabName);\n\t\t\tif( DataNoteid ) {\n\t\t\t\tvar note = DataNotes[DataNoteid];\n\t\t\t\t$(this.id + \" #note_title\").text(note.title);\n\t\t\t\t$(this.id + \" #notetext\").val(note.content);\n\t\t\t\t$(this.id + \" #mono_chk\").prop(\"checked\", note.mono);\n\t\t\t\t$(this.id + \" #html_chk\").prop(\"checked\", note.html);\n\t\t\t\t$(this.id + \" #markdown_chk\").prop(\"checked\", note.markdown);\n\t\t\t} else { // new note\n\t\t\t\t$(this.id + \" #note_title\").text(\"\");\n\t\t\t\t$(this.id + \" #notetext\").val(\"\");\n\t\t\t\t$(this.id + \" #mono_chk\").prop(\"checked\", false);\n\t\t\t\t$(this.id + \" #html_chk\").prop(\"checked\", false);\n\t\t\t\t$(this.id + \" #markdown_chk\").prop(\"checked\", false);\n\t\t\t}\n\t\t\tif( $(this.id + \" #mono_chk\").prop(\"checked\") ) {\n\t\t\t\t$(this.id + \" #notetext\").css(\"font\", MonoFont);\n\t\t\t} else {\n\t\t\t\t$(this.id + \" #notetext\").css(\"font\", NoteFont); \n\t\t\t}\n\t\t\t$(this.id + \" #view_chk\").prop(\"checked\",false);\n\t\t\t$(this.id + \" #html_div\").hide(); \n\t\t\t$(this.id + \" #note_div\").show(); \n\t\t}\n\t\t$(this.id).show();\n\t}\n\tthis.events = function() {\n\t\tvar viewid = this.id;\n\t\tvar thisView = this;\n\t\t$(viewid + \" #close_btn\").click(function() {\n\t\t\tif( noteChanged ) {\n\t\t\t\tvar okFunc = function() {\n\t\t\t\t\tnoteChanged = false;\n\t\t\t\t\t$(viewid).hide();\n\t\t\t\t\tHub.viewNoteEditClose();\n\t\t\t\t};\n\t\t\t\tConfirm(\"Confirm\", \"Changes Not Saved, Close Anyway ?\", okFunc);\n\t\t\t} else {\n\t\t\t\t$(viewid).hide();\n\t\t\t\tHub.viewNoteEditClose();\n\t\t\t}\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #position_btn\").click(function() {\n\t\t\tif( DataNoteid == undefined ) {\n\t\t\t\tNotice(\"note must be saved before changing its position\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tViews.position.display();\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #save_btn\").click(function() {\n\t\t\tthisView.saveNote();\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #delete_btn\").click(function() {\n\t\t\tif( DataNoteid == undefined ) {\n\t\t\t\tNotice(\"Note has not been saved.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tConfirm(\"Confirm\", \"Delete This Note\", function() { thisView.deleteNote(DataNoteid); })\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #mono_chk\").change(function() {\n\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t$(viewid + \" #notetext\").css(\"font\", MonoFont);\n\t\t\t\t$(viewid + \" #html_div\").css(\"font\", MonoFont);\n\t\t\t} else {\n\t\t\t\t$(viewid + \" #notetext\").css(\"font\", NoteFont); \n\t\t\t\t$(viewid + \" #html_div\").css(\"font\", NoteFont); \n\t\t\t}\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #html_chk\").change(function() {\n\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t$(viewid + \" #markdown_chk\").prop(\"checked\", false);\n\t\t\t\tthisView.setHtmlFirstLine(); // makes 1st line an html comment for use as note title\n\t\t\t} \n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #markdown_chk\").change(function() {\n\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t$(viewid + \" #html_chk\").prop(\"checked\", false);\n\t\t\t\tthisView.setHtmlFirstLine(); // makes 1st line an html comment for use as note title\n\t\t\t} \n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #view_chk\").change(function() {\n\t\t\tif( !$(this).prop(\"checked\") ) {\n\t\t\t\t$(viewid + \" #html_div\").hide(); \n\t\t\t\t$(viewid + \" #note_div\").show(); \n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar htmlChecked = $(viewid + \" #html_chk\").prop(\"checked\");\n\t\t\tvar markdownChecked = $(viewid + \" #markdown_chk\").prop(\"checked\");\n\t\t\tif(htmlChecked) {\n\t\t\t\tvar html = $(viewid + \" #notetext\").val();\n\t\t\t\t$(viewid + \" #html_div\").html(html);\n\t\t\t\t$(viewid + \" #note_div\").hide(); \n\t\t\t\t$(viewid + \" #html_div\").show();\n\t\t\t} else if(markdownChecked) {\n\t\t\t\tvar markdown = $(viewid + \" #notetext\").val();\n\t\t\t\tvar html = marked(markdown);\n\t\t\t\t$(viewid + \" #html_div\").html(html);\n\t\t\t\t$(viewid + \" #note_div\").hide(); \n\t\t\t\t$(viewid + \" #html_div\").show();\n\t\t\t} \n\t\t});\n\t\t// --------------------------------------------\n\t\t// handle tab keys in note text\n\t\t// --------------------------------------------\n\t\t$(document).delegate('#notetext', 'keydown', function(e) {\n\t\t\tnoteChanged = true;\n\t\t\tvar keyCode = e.keyCode || e.which;\n\t\t\tif ( keyCode == 9 ) { // tab key\n\t\t\t\te.preventDefault();\n\t\t\t\tvar text = $(this).val();\n\t\t\t\tvar domElement = $(this).get(0);\n\t\t\t\tvar start = domElement.selectionStart; // if no selection, position before cursor\n\t\t\t\tvar end = domElement.selectionEnd; // if no selection, position after cursor\n\t\t\t\t// set textarea value to: text before caret + tab + text after caret\n\t\t\t\t$(this).val(text.substring(0, start) + \"\\t\" + text.substring(end));\n\t\t\t\t// put caret at right position\n\t\t\t\tdomElement.selectionStart = domElement.selectionEnd = start + 1;\n\t\t\t}\n\t\t});\n\t}\n\tthis.setHtmlFirstLine = function() {\n\t\tvar content = $(this.id + \" #notetext\").val();\n\t\tvar\tlineFeed = content.indexOf(\"\\n\");\n\t\tif( lineFeed == -1 ) {\n\t\t\tvar firstLine = content;\n\t\t} else {\n\t\t\tvar firstLine = content.substring(0, lineFeed);\n\t\t}\n\t\tif( firstLine.indexOf(\"<!--\") == -1 ) {\n\t\t\t$(this.id + \" #notetext\").val(\"<!-- Note Description Here -->\\n\" + content);\n\t\t}\n\t}\n\tthis.saveNote = function() {\n\t\tvar path, httpMethod;\n\t\tvar requestData = {\n\t\t\tContent: \t$(this.id + \" #notetext\").val(),\n\t\t\tMono: \t\t$(this.id + \" #mono_chk\").prop(\"checked\"),\n\t\t\tHtml: \t\t$(this.id + \" #html_chk\").prop(\"checked\"),\n\t\t\tMarkdown: \t$(this.id + \" #markdown_chk\").prop(\"checked\"),\n\t\t\tPrevid: \t'', // only used for add, position\n\t\t}\n\t\tif(DataNoteid) {\n\t\t\thttpMethod = \"PUT\";\t\t// change note\n\t\t\tpath = \"note/\" + DataToken + \"/\" + DataBookid + \"/\" + DataTabid + \"/\" + DataNoteid;\n\t\t} else {\n\t\t\thttpMethod = \"POST\";\t// add note\n\t\t\tpath = \"note/\" + DataToken + \"/\" + DataBookid + \"/\" + DataTabid;\n\t\t\trequestData.Previd = DataLastNoteid; // for now add as last note, can be changed later\n\t\t}\n\t\tvar settings = {\n\t\t\turl: UrlPrefix + path,\n\t\t\tmethod: httpMethod,\n\t\t\tdata: JSON.stringify(requestData),\n\t\t\tdataType: \"text\", // returned from server\n\t\t}\n\t\t$(this.id + \" button\").prop(\"disabled\",true);\n\n\t\tvar viewid = this.id;\n\t\t$.ajax(settings)\n\t\t\t.done(function(response) {\n\t\t\t\tnoteChanged = false;\n\t\t\t\tif(httpMethod == \"POST\") { // new note\n\t\t\t\t\tDataNoteid = response;\n\t\t\t\t\tDataNotes[DataNoteid] = {};\n\t\t\t\t\tDataAddPrevid(DataNoteid, requestData.Previd); // see data.js\n\t\t\t\t\tDataBuildNoteOrder();\n\t\t\t\t}\n\t\t\t\t// save screen values to Data\n\t\t\t\tDataNotes[DataNoteid].content = requestData.Content;\n\t\t\t\tDataNotes[DataNoteid].when = new Date();\n\t\t\t\tDataNotes[DataNoteid].mono = requestData.Mono;\n\t\t\t\tDataNotes[DataNoteid].html = requestData.Html;\n\t\t\t\tDataNotes[DataNoteid].markdown = requestData.Markdown;\n\t\t\t\tDataNotes[DataNoteid].title = DataNoteTitle(DataNoteid);\n\t\t\t\t$(viewid + \" #note_title\").text(DataNotes[DataNoteid].title);\n\n\t\t\t\tNotice(\"Note Saved Successfully\");\n\t\t\t})\n\t\t\t.fail(function(xhr) {\n\t\t\t\tErr(\"Note Save Failed \\n\" + xhr.responseText);\n\t\t\t})\n\t\t\t.always(function() {\n\t\t\t\t$(viewid + \" button\").prop(\"disabled\",false);\n\t\t\t})\n\t}\n\tthis.deleteNote = function(deleteid) {\n\t\tvar viewid = this.id;\n\t\tvar path = \"note/\" + DataToken + \"/\" + DataBookid + \"/\" + DataTabid + \"/\" + deleteid;\n\t\tvar settings = {\n\t\t\turl: UrlPrefix + path,\n\t\t\tmethod: \"DELETE\",\n\t\t\tdataType: \"text\", // returned from server\n\t\t}\n\t\t$(viewid + \" button\").prop(\"disabled\",true);\n\n\t\t$.ajax(settings)\n\t\t\t.done(function(response) {\n\t\t\t\tDataDeletePrevid(deleteid); // changes previd on note following deleteid\n\t\t\t\tdelete DataNotes[deleteid];\n\t\t\t\tDataBuildNoteOrder();\n\t\t\t\tNotice(response);\n\t\t\t\tHub.noteDeleted();\n\t\t\t})\n\t\t\t.fail(function(xhr) {\n\t\t\t\tErr(\"Note Delete Failed \\n\" + xhr.responseText);\n\t\t\t})\n\t\t\t.always(function() {\n\t\t\t\t$(viewid + \" button\").prop(\"disabled\",false);\n\t\t\t})\n\t}\n}", "function shownote(event) {\n\tevent.preventDefault();\n\tvar id = $(this).attr(\"value\");\n\t$(\"#addnote\").fadeIn(300).css(\"display\", \"flex\");\n\t$(\"#add-note\").attr(\"value\", id);\n\t$.get(\"/\" + id, function(data) {\n\t\t$(\"#article-title\").text(data.title);\n\t\t$.get(\"/note/\" + id, function(data) {\n\t\t\tif (data) {\n\t\t\t\t$(\"#note-title\").val(data.title);\n\t\t\t\t$(\"#note-body\").val(data.body);\n\t\t\t}\n\t\t});\n\t});\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 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 addNote() {\n let titleEl = document.getElementById(\"title\")\n let detailsEl = document.getElementById(\"details\")\n\n newNote = new Note(titleEl.value, detailsEl.value)\n allNotes.push(newNote)\n\n printNote(newNote)\n resetFields(titleEl, detailsEl)\n checkBadWords(newNote)\n // changeBackground()\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}" ]
[ "0.69537705", "0.6777088", "0.67575276", "0.6704025", "0.6642161", "0.6629163", "0.6580714", "0.65699357", "0.6548809", "0.65239954", "0.65226734", "0.6519642", "0.6507642", "0.63968754", "0.63858116", "0.63771915", "0.6352973", "0.63120097", "0.6306151", "0.62804204", "0.62769437", "0.6272255", "0.62599784", "0.62539095", "0.6242666", "0.62382686", "0.62369025", "0.62270105", "0.6212237", "0.62119263", "0.6210942", "0.61897224", "0.6181556", "0.6178961", "0.6178324", "0.6178274", "0.61755043", "0.61634195", "0.6152579", "0.6149619", "0.6147032", "0.6121774", "0.6115489", "0.61131155", "0.610579", "0.6100171", "0.6096207", "0.6095429", "0.60908276", "0.6077004", "0.6054179", "0.60529375", "0.6051663", "0.6025755", "0.6025", "0.60243505", "0.6022311", "0.6007826", "0.5987074", "0.5980739", "0.59783816", "0.5968405", "0.59662694", "0.5964071", "0.5950602", "0.5945094", "0.59419763", "0.59361994", "0.5933479", "0.5931988", "0.5918049", "0.59153783", "0.59143883", "0.59139967", "0.59138864", "0.5911713", "0.59099764", "0.59065664", "0.5902815", "0.5902065", "0.5900366", "0.58941483", "0.5891862", "0.5890882", "0.58672845", "0.5857704", "0.5848826", "0.5838859", "0.5831406", "0.5831177", "0.5828394", "0.5826164", "0.5823413", "0.5822601", "0.58194685", "0.58091867", "0.5807329", "0.5806912", "0.5800675", "0.5798393" ]
0.67187464
3
removes the noteobject from allnotes that is marked for deletion
function clearDeleted() { for (let i = 0; i < allNotes.length; i++) { if (allNotes[i].delete == true) { allNotes.splice(i, 1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deleteNote(note) {\n this.notes = this.notes.filter(item => item !== note);\n }", "function deleteNote(note) {\n note.remove();\n borderedNote = null;\n}", "function deleteNote(note) {\n setAllNotes(allNotes.filter(item => item !== note));\n const notesDataJson = JSON.stringify(allNotes);\n localStorage.setItem('notesData', notesDataJson);\n }", "deleteNote(id) {\n if(this.locations.hasOwnProperty(id)) {\n delete this.locations[id];\n }\n this.dirtyNotesId.delete(id);\n\n for(let i in this.notes) {\n if(this.notes[i].id === id) {\n this.notes.splice(i,1)\n break;\n }\n }\n }", "function removeNotes() {\n $(\".note\").remove();\n saveNotes();\n}", "function 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}", "function removeNote(){\n\t$('.playerNotes .notesWrapper').each(function(index, element) {\n\t\tif($(this).attr('data-array')==curNote){\n\t\t\t$(this).remove();\n\t\t}\n });\n\tgenerateArray(false);\n\thighLightNote(false);\n\tstopGame();\n}", "function deleteNote() {\n if (oSelectedNote != null) {\n oData.jsFormula.removeNote(oSelectedNote.nuNote);\n oNotesTable.row('.selected').remove().draw( false );\n initNote();\n }\n}", "function deleteNote(id) {\n setNotes((prevNotes) => {\n return prevNotes.filter((noteItem, index) => {\n return index !== id;\n });\n });\n }", "function removeNote(){\n\tthis.parentNode.remove();\n\tupdateNoteNumbers();\n}", "function delNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\ttr.deleteCell(tr.childElementCount-1);\r\n\tdelState();\r\n\t\r\n\trefreshNotes();\r\n}", "function deleteNote (noteId) {\n request\n .delete(`https://notes-api.glitch.me/api/notes/${noteId}`)\n .auth('liz', 'dogsarebetterthancats')\n .then(response => {\n notesList = notesList.filter(note => note._id !== noteId)\n console.log(notesList)\n })\n}", "function deleteNote(id) {\r\n console.log(\"deleted id: \" + id);\r\n\r\n setListNote((prevList) => {\r\n return prevList.filter((note, index) => {\r\n return index !== id;\r\n });\r\n });\r\n }", "function removeNote(id) {\n // find object (note) for which id equals the argument\n const noteIndex = notes.findIndex(function(note) {\n return note.id === id;\n });\n if (noteIndex > -1) {\n // delete that one object\n notes.splice(noteIndex, 1);\n }\n}", "function deleteNote(id) {\n setNotesList(prevList => {\n return (prevList.filter(\n (value, index) => index !== id))\n });\n }", "function deleteElementFromObject(id){\n \n for(let i=0;i<notes.length;i++){\n if(notes[i].id===id){\n notes.splice(i,1);\n }\n}\nconsole.log(notes);\n}", "removeNotesFromStepObject(noteList) {\n\n\n const length = noteList.length ;\n for ( var i = 0 ; i < length ; ++i ) {\n let note = noteList[i] ;\n\n // remove the step if it's not a hold, obviously.\n if ( note.isHold === false ) {\n this.composer.removeObjectFromSteps(note) ;\n\n // add it to the active holds early\n } else {\n this.setHold(note.kind, note.padId, note) ;\n }\n\n\n }\n\n }", "removeNote(id) {\n // use get notes function to acess array of notes\n return this.getNotes()\n // filter through notes array to get all notes besides the one with the matching ID\n .then(notes => this.write(notes.filter(note => note.id != id)))\n }", "function deleteNote(index){\r\n // console.log('I am deleting', index);\r\n titleObj.splice(index, 1);\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n localStorage.setItem(\"title\",JSON.stringify(titleObj));\r\n\r\n\r\n showNotes();\r\n}", "function deleteNote() {\n const note = notes.value;\n window.localStorage.removeItem(note);\n editor.value = '';\n for (let i = 0; i < notes.length; i++) {\n const option = notes[i];\n if (option.value === note) {\n notes.removeChild(option);\n }\n }\n}", "removeNote(noteId) {\n //localizando el hijo y buscarlo por el id\n this.db.child(noteId).remove();\n\n }", "function deleteNote(id) {\n\n firebase\n .firestore()\n .collection(\"NoteApp\")\n .where('id', '==' ,id)\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => doc.ref.delete());\n });\n // To delete that item, we filter out the item we don't want\n setNotes(notes.filter((item) => item.id !== id));\n }", "function deleteNote(noteID) {\n // Retrieve the object store for the notes.\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n console.log(noteID);\n \n // Remove the note from the database.\n objectStore.delete(noteID);\n\n // Remove the radio button for the note.\n var button = $('input[value=\"' + noteID + '\"]');\n $(button[0].parentElement).slideUp(\"fast\");\n}", "function removeNoteBooks(titleToRemove) {\n //titleToRemove is a button event bound to the object when created\n\n for (let i = 0; i < existingNoteBooks.length; i++) {\n if (existingNoteBooks[i].titleOfObject == titleToRemove.titleOfObject) {\n existingNoteBooks.splice(i, 1);\n if (existingNoteBooks.length == 1) {\n localStorage.removeItem(\"books\");\n //Testar om bara dashboard är kvar och tar bort nyckeln helt.\n }\n saveNotesToLocalStorage();\n saveNoteBooksToLocalStorage();\n break;\n }\n }\n\n updateCurrentNoteBooks();\n}", "function deleteNote(index)\n{\n//console.log(\"deleting\",index);\nlet notes=localStorage.getItem(\"notes\");\nif (notes===null)\n{\nnotesObj=[];\n}\nelse\n{\nnotesObj=JSON.parse(notes);\n}\nnotesObj.splice(index,1);\nlocalStorage.setItem(\"notes\",JSON.stringify(notesObj));\nshowNotes();\n}", "deleteNote(id) {\n return this.getNotes()\n .then((notes)=>notes.filter((note)=>note.id !== id))\n .then((filteredNotes)=>this.write(filteredNotes));\n }", "deleteNote() {\n let noteToDelete = this.state.selectedNote;\n let existingNotes = [...this.state.notes];\n let updatedNotes = existingNotes.filter(note => {\n if (note._id !== noteToDelete._id) {\n return note;\n }\n });\n this.setState({\n notes: updatedNotes,\n selectedNote: { _id: null, text: \"\", dateUpdated: \"\" }\n });\n }", "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n markedObj.splice(index, 1);\n titleObj.splice(index, 1);\n localStorage.setItem(\"marked\", JSON.stringify(markedObj));\n localStorage.setItem(\"title\", JSON.stringify(titleObj));\n showNotes();\n}", "function note_delete(_noteindex){\r\n\tif(_noteindex>=0 & _noteindex<notes.length) {\r\n\t\tnotes.splice(_noteindex,1);\r\n\t\tnumnote--;\r\n\t}\r\n}", "function deleteNote(noteId) {\n\tif (confirm('Are you sure?')) {\n\t\t// get branch of the specific note\n\t\tvar toDelete = notesdb.child(noteId);\n\t\t// remove\n\t\ttoDelete.remove();\n\t}\n}", "removeNote(id) {\n return this.getNotes()\n .then((notes) => notes.filter((note) => note.id !== id))\n .then((filteredNotes) => this.write(filteredNotes));\n }", "function removeNote(e) {\n div_id = e.path[2].id;\n if (div_id !== 'data') {\n // do not delete the entire data element accidentally due to html image glitches.\n document.getElementById(div_id).remove();\n save_notes();\n loadNotes();\n }\n }", "deleteNote(privateNote) {\n privateNote.deleteRecord();\n privateNote.save();\n }", "function clearNotes() {\n\n $(\".note\").remove();\n $(\".halfstep\").remove();\n}", "function deleteNote() {\n card_body = $(this).parent();\n card = $(this).parent().parent();\n\n text_delete_title = card_body.find($('textarea')).val();\n changeStatus(text_delete_title, \"binned\");\n\n localStorage.setItem(\"Notes\",JSON.stringify(notes));\n card.remove();\n \n $('.toast').toast(\"show\");\n}", "deleteNote(id) {\n // This retrieves all notes, remotes the note with the specified unique ID, and finally writes the filtered notes.\n return this.retrieveNotes()\n .then((notes) => notes.filter((note) => note.id !== id))\n .then((filteredNotes) => this.writeFile(filteredNotes));\n }", "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n };\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n \n \n let notesTitle = localStorage.getItem('notesTitle');\n if (notesTitle == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(notesTitle);\n };\n titleObj.splice(index, 1);\n localStorage.setItem('notesTitle', JSON.stringify(titleObj));\n // localStorage.removeItem('Name2');\n showNotes();\n}", "function deleteNote(index){\r\n\r\nlet 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 \r\n notesObj.splice(index, 1);\r\n localStorage.setItem('notes', JSON.stringify(notesObj));\r\n showNotes();\r\n}", "removeNote(noteId) {\n var user = this.props.uid;\n const noteRef = firebase.database().ref(`users/${user}/notes/${noteId}`);\n noteRef.remove();\n }", "deleteNote(i) {\n const index = this.state.list.findIndex((p) => p.id === i.id);\n if (index !== -1) {\n this.state.list.splice(index, 1);\n this.props.removeItem(this.state.list);\n this.setState({ listString: JSON.stringify(this.state.list) })\n }\n }", "function deleteNote(index) {\n// console.log(\"I am deleting\", index);\nlet confirmDel = confirm(\"Delete this note?\");\nif (confirmDel == true) {\n \n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}\n}", "function deleteNote(index){\n let confirmDel = confirm(\"Are you sure you want to delete this?\");\n if(confirmDel == true){\n let notes = localStorage.getItem(\"Notes\"+id);\n //if notes in localstorage is empty declare one\n if(notes == null){\n notesObj = [];\n } else{\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"Notes\"+id, JSON.stringify(notesObj));\n showNotes();\n }\n }", "function deleteNote(index) {\r\n console.log(\"deleting this node.\", index);\r\n let notes = localStorage.getItem(\"notes\"); //take notes from localstorage.\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));//updating localstorage..\r\n showNotes();\r\n\r\n}", "deleteNote(id) {\n// get the notes, filter and grab out the one in the id\nreturn this.getNotes()\n.then(notes => (notes.filter(note => note.id !== parseInt(id))))\n.then(newNoteSet => asyncWriteFile(\"db/db.json\", JSON.stringify(newNoteSet)))\n }", "function removeNote() {\n const notesContainer = document.getElementById('notes-container');\n notesContainer.removeChild(this.parentElement);\n\n // push the romoved items into nenw array\n noteCach.push({\n text: this.parentElement.innerText.replace('X',''),\n priority: this.parentElement.className.split(' ')[1],\n })\n \n}", "function handlenoteDelete() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n deletenote(currentnote);\n }", "function deleteNote(index){\n console.log(`I am deleting `,index);\n // let notes=localStorage.getItem(\"notes\");\n // if(notes==null){\n // notesobj=[];\n // }\n // else{\n // notesobj=JSON.parse(notes);\n // }\n notesobj.splice(index,1);\n localStorage.setItem(\"notes\",JSON.stringify(notesobj));\n showNotes();\n}", "function deleteNote(index) {\r\n// console.log(\"I am deleting\", index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function removeFromArray(note){\n //get the contents form the note on the DOM\n var noteText = note.children[1].children[0].innerHTML;\n var noteDate = note.children[2].children[0].innerHTML;\n var noteHour = note.children[2].children[1].innerHTML;\n\n //check over the array for the same contents\n for(var i=0;i<notesArray.length;i++){\n if((notesArray[i].taskDetails ==noteText) &&(noteDate == notesArray[i].taskDate) )\n {\n //hour is optional, can be null\n if((noteHour ==\"\")||(notesArray[i].taskHours ==noteHour))\n {\n notesArray.splice(i,1);\n localStorage.setItem(\"note_local\", JSON.stringify(notesArray));\n //remove only the first one with the same data - if there are two same notes\n break;\n }\n }\n }\n}", "function deleteNote(index) {\r\n //console.log(\"Deleting Note\",index);\r\n let notes = localStorage.getItem(\"notes\");\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\n let notes_check = localStorage.getItem(\"notes\");\n if (notes_check == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes_check);\n }\n\n /*we are deleting from the array notesObj the elemnt in which \"Delete Note\" has been clicked and the index of that element is passed here.1 indicates that we want to delete just one element from that index number.*/\n notesObj.splice(index, 1);\n\n //after deleting, we need to update the local storage and show the updated notes.\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n //showing the updated notes\n showNotes();\n\n}", "function deleteNote(index){\n\t//delete the first headed notes\n\tif(!index){//index == null\n\t\tfor(var i=0; i<numOfKey; i++) {\n\t\t\tvar headNode = firstNote.shift();\n\t\t\tif(headNode != null) {\n\t\t\t\theadNode.remove();\n\t\t\t}\n\t\t}\n\t}\n\telse {//make certain notes invisible\n\t\t\tfirstNote[index].style.backgroundColor = \"transparent\";\n\t}\n}", "function deleteNote(index){\n // console.log('i am deleting' , index);\n let notes = localStorage.getItem(\"notes\");\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index , 1);\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\n shownotes();\n}", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\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 notesObj.splice(index,1);//removes JS array elements and adds the existing elements back in place\r\n localStorage.setItem('notes', JSON.stringify(notesObj));//to update the local storage\r\n showNotes();\r\n\r\n}", "function deleteNote(index){\r\n // console.log(\"I am deleting\",index);\r\n let notes = localStorage.getItem('notes')\r\n if(notes==null){\r\n notesObj = [];\r\n }else{\r\n notesObj = JSON.parse(notes)\r\n\r\n }\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n showNotes();\r\n}", "deleteNote(noteIndex) {\n const updatedNotes = this.state.notes;\n updatedNotes.splice(noteIndex, 1);\n\n this.setState({\n notes: updatedNotes,\n });\n }", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1)\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n// console.log(\"I am deleting\", index);\n let confirmDel = confirm(\"Delete this note?\");\n if (confirmDel == true) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n }\n \n}", "function deleteNote(index){\n console.log('I am deleting Note no ', index);\n const notes= localStorage.getItem('notes');\n if(notes==null){\n notesObj= [];\n }\n else{\n notesObj= JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n console.log(notesObj);\n}", "function deleteNote(index){\n console.log(\"Something deleted\");\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 notesObj.splice(index,1);\n titlesObj.splice(index,1);\n notes=JSON.stringify(notesObj);\n titles=JSON.stringify(titlesObj);\n localStorage.setItem('notes',notes);\n localStorage.setItem('title',titles);\n showNotes();\n}", "function deleteNote(index){\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 // splice will remove element from index, here splice(index from where it should be remove, howmany element shoudl be remove)\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index){\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 // splice will remove element from index, here splice(index from where it should be remove, howmany element shoudl be remove)\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n // console.log(\"A node is being deleted\", index);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1); // Deleting the element from the array\n localStorage.setItem(\"notes\", JSON.stringify(notesObj)); //updating the local storage\n showNotes();\n}", "deleteNote(id) {\n // This uses the same kind of logic. It doesn't actually delete the note...\n return this.getNotes()\n // we find the note we want to delete by filtering throught notesArr by id \n .then(notesArr => notesArr.filter((note) => note.id !== id))\n // and create a NEW ARRAY with the new note inside\n .then(filteredNotesArr => this.write(filteredNotesArr))\n }", "delete({ note }, res) {\n console.log(\n `${dateFormat(null, \"isoUtcDateTime\")} - REQUEST delete [${note.id}]`\n );\n\n db.collection(\"notes\").deleteOne({ id: note.id }, (err, result) => {\n if (err) {\n return console.log(err);\n }\n res.sendStatus(204);\n\n db\n .collection(\"notes\")\n .find()\n .toArray(function(err, results) {\n broadcast(results);\n });\n });\n }", "async function deleteNote(title) {\n setRemoveItem(title)\n setNotes(() => {\n return notes.filter(el => {\n return el.title !== title;\n })\n })\n await axios.delete(\"http://localhost:4000/api/delete\", {data: {item: title}});\n\n }", "function deleteNote(index) {\n \n let confirmDel = confirm(\"Are you sure want to delete this note!!\");\n\n if(confirmDel == true)\n {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesobj = [];\n }\n else {\n notesobj = JSON.parse(notes);\n }\n notesobj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesobj));\n // deletemark(index);\n showNotes();\n }\n\n}", "function removeEditNotes(ele){\n\n\t\t\t// Hide notes form\n\t\t\t$(ele).fadeOut(100, function(){\n\t\t\t\tele.parentNode.removeChild(ele);\n\t\t\t});\n\n\t\t\t// Unset editing attribute\n\t\t\tcurrentStepNode.setAttribute(\"data-editing\", \"false\");\n\n\t\t\t// Clear reference\n\t\t\tcurrentStepNode = null;\n\t\t}", "function removeNote(x){\n x.parentElement.parentElement.removeChild(x.parentElement);\n removeFromArray(x.parentElement);\n}", "function deleteNote(index) {\n // console.log(\"I am deleting\", index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n // console.log(`I am Deleating the notes no :${index}`);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesArr = [];\n }\n else {\n notesArr = JSON.parse(notes);\n }\n notesArr.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesArr));\n showNotes();\n}", "function deleteNote(id, notesArray) {\n let noteID = parseInt(id);\n for (let i = 0; i < notes.length; i++) {\n if (noteID === notes[i].id) {\n notes.splice(i,1);\n if (notes.length > 0) {\n notes[0].id = 0;\n for (let j = 1; j < notes.length; j++) {\n notes[j].id = notes[j-1].id + 1;\n } \n }\n fs.writeFileSync(\n path.join(__dirname, '../db/db.json'),\n JSON.stringify({ notes: notesArray }, null, 2)\n );\n }\n }\n return notes;\n}", "deleteNote(id){\n // // creating a new var that holds current notes\n let newNoteArr = this.state.notes;\n // // mapping through array of all notes that's saved in our state, passing in the current note along with the index of that current note\n newNoteArr.map((note, index) => {\n // //at ever note (from the array in our state) we check to see if the id passed in matches the id of the note we're currently on\n\n if (id === note.id) {\n // // if it matches we're removing just one item from that array\n newNoteArr.splice(index,1);\n }\n });\n // // our array now has the same elements minus the one we just deleted\n // // update our state to show that new array which will trigger a re-render\n this.setState(\n {\n notes: newNoteArr\n }\n );\n }", "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1); // first argument - to start from, second argument - number of elements to delete\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "deleteNote(id) {\n let index = this.jsonData().findIndex(element => parseInt(element.id) === parseInt(id));\n if (index !== -1) {\n let noteData = this.jsonData();\n noteData.splice(index, 1);\n this.storeData(noteData);\n }\n }", "function deleteNote(index) {\n let confirmDel = confirm(`Delete this note?`);\n if (confirmDel == true) {\n let notes = localStorage.getItem(\"notes\")\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n }\n\n}", "function deleteNote(index) {\r\n const uid = localStorage.getItem(\"uid\")\r\n var adaRef = firebase.database().ref('notes/' + uid + '/' + index);\r\n adaRef.remove()\r\n .then(function () {\r\n getNotesForThisUser().then(notes => display(notes)).catch(err => handleError(err))\r\n CKEDITOR.instances[\"addTxt\"].setData('');\r\n })\r\n .catch(function (error) {\r\n console.log(\"Remove failed: \" + error.message)\r\n });\r\n\r\n\r\n\r\n}", "function deleteNote(index) {\n console.log(\"One note deleted\",\"The id is : \",index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n //splice take the starting index from where to delete,and the number of the element\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\r\n // console.log(\"I am deleting\", index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n //for deleting use slice function.\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\n\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n showNotes();\n}", "function clearNotes()\n{\n if(notes.length !== 0)\n {\n notes.length = 0;\n console.log(`Notes are deleted successfully!`);\n }\n}", "removeTodoNote(listIndex){\n this.todoListsBackup = this.todoLists.slice();\n this.todoLists.splice(listIndex, 1);\n }", "deleteNote() {\n\n // Check if any board is selected before delete, else terminate\n var boardID = this.view.boardView.selectedBoardID;\n if (boardID !== -1) {\n\n // 1. Delete the note from the model\n var noteToBeDeleted = this.view.boardView.boardCollection[boardID].getNote();\n this.model.deleteNote(noteToBeDeleted.noteID);\n\n // 2. Delete the note from the view\n this.view.boardView.deleteNote(boardID);\n\n // 3. Update the startNoteID and endNoteID\n if (this.startNoteID === 0 && this.endNoteID === 0) {\n this.startNoteID = -1;\n this.endNoteID = -1;\n\n } else if (this.endNoteID <= this.model.noteCollection.length - 1) {\n // (a) Get the next note from the model to be displayed (if exists) from right\n var nextNote = this.model.noteCollection[this.endNoteID];\n this.view.boardView.displayNoteAtEnd(this.endNoteID, nextNote.name);\n\n } else if (this.startNoteID > 0) {\n // (a) Get the prev note from the mode to be displayed (if exists) from left\n var prevNote = this.model.noteCollection[this.startNoteID - 1];\n this.view.boardView.displayNoteAtStart(this.startNoteID - 1, prevNote.name);\n\n --this.startNoteID;\n --this.endNoteID;\n } else {\n // No note appended at start or end\n --this.endNoteID;\n }\n\n // 4. Unselect the board after delete\n this.view.boardView.unselectBoard();\n }\n }", "function deleteNote(index) {\n //console.log(\"Deleting : \", index);\n let noteField = localStorage.getItem(\"data\");\n if (noteField == null) {\n noteArray = [];\n } else {\n noteArray = JSON.parse(noteField);\n }\n\n noteArray.splice(index, 1); //Splice function to remove elements in array\n localStorage.setItem(\"data\", JSON.stringify(noteArray));\n //console.log(\"Deleted\");\n display();\n}", "handler(argv) {\n notes.removeNote(argv.title)\n // console.log('Removing the note')\n }", "function deleteNote(index)\n{\n console.log(\"I am clicking\" , index)\n let notes = localStorage.getItem('notes');\n if (notes == null)\n {\n notesObj = [];\n }\n else\n {\n notesObj = JSON.parse(notes);\n \n }\n\n notesObj.splice(index,1)\n localStorage.setItem(\"notes\" , JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n if (confirm(\"Do you want to delete the note?\")) {\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 notesObj = notesObj.reverse();\n dateObj = dateObj.reverse();\n starObj = starObj.reverse();\n\n notesObj.splice(index, 1);\n dateObj.splice(index, 1);\n starObj.splice(index, 1);\n\n notesObj = notesObj.reverse();\n dateObj = dateObj.reverse();\n starObj = starObj.reverse();\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n localStorage.setItem(\"dateItem\", JSON.stringify(dateObj));\n localStorage.setItem(\"starItem\", JSON.stringify(starObj));\n }\n showNotes();\n showStarNode();\n}", "function deleteNote(noteId) {\n $('#mainNoteDiv' + noteId).removeClass(\"note\")\n $('#deleted' + noteId).val(\"true\");\n $('#textarea' + noteId).hide();\n $('#goBackButton' + noteId).hide();\n $('#subNoteButton' + noteId).hide();\n $('#select' + noteId).hide();\n $('#delButton' + noteId).hide();\n $('#goBack' + noteId).remove();\n\n for (var i = 0; i < map.length; i++) {\n if (map[i] == noteId) {\n deleteNote(i)\n }\n }\n }", "function DeleteNote(noteIndex) {\n var newNoteArray = [];\n if (stateVars.itemArray != null) {\n newNoteArray = stateVars.itemArray;\n }\n\n newNoteArray.splice(noteIndex, 1);\n\n setStateVars((prevState) => {\n return ({\n ...prevState,\n noteArray: newNoteArray,\n promptNewNote: false,\n editNoteIndex: -1,\n newNoteText: \"\",\n requireUpdate: true\n });\n });\n }", "function deleteNote(username){\n if(db.get('posts').find({username: username}).value() !== undefined){\n // delete note\n db.get('posts').remove({username, username}).write()\n }\n else{\n // note does not exist\n }\n}", "function deleteNote(worker, noteId) {\n if (noteId != null) {\n datastore.deleteNote(noteId);\n worker.port.emit(\"NoteDeleted\", noteId);\n }\n}", "function clearNotesArea() {\n $(\"#noteTable tr\").remove();\n $(\"#noteTable td\").remove();\n }", "removeNote(noteId){\n console.log(noteId);\n // 29) to remove the note from our database, we have to tell it from what reference-- in this case we tell it to go to the key\n //we're grabbing that location in our database and saying to remove it \n //now move on to notesCard.js to allow us to edit our cards\n\n //63) we also need to grab the userID as well again\n // part 64 starts in our notesCard which is for editing \n const userId = firebase.auth().currentUser.uid;\n\n //62) we grabbed from 61) because we tiered it and have to drill down to where the note is\n const dbRef = firebase.database().ref(`users/${userId}/notes/${noteId}`);\n dbRef.remove();\n }", "async delete(noteID) {\r\n let store = await this.notesAccessStore(\"readwrite\")\r\n return store.delete(Number(noteID))\r\n }", "function deleteNote(event) {\n event.preventDefault();\n const element = event.target;\n\n const note = $(this).data('id');\n\n $.ajax({\n method: 'delete',\n url: `/api/notes/${note}`,\n headers: { 'X-CSRF-Token': token },\n }).done(() => {\n $(element).parents('.note').remove();\n });\n }", "async delete(time) {\n let clonedNotes = [...this.state.notes];\n for (let i = 0; i < clonedNotes.length; i++) {\n if (clonedNotes[i].time === time) {\n // We first synchronize the deletion with the ENDPOINT DATABASE..\n await this.syncDelete(clonedNotes[i]);\n // Then we make sure to remove it from local database as well...\n\n await Realm.open({schema: [Schema.Note]})\n .then(realm => {\n realm.write(() => {\n let notes = realm.objects('Note');\n for (let j = 0; j < notes.length; j++) {\n if (notes[j].time == clonedNotes[i].time) {\n realm.delete(notes[j]);\n break;\n }\n }\n\n // And lastly splice it off from the array..\n clonedNotes.splice(i, 1);\n // ...and UPDATE the state.\n this.setState({ realm: realm, notes: clonedNotes });\n });\n realm.close();\n });\n break;\n }\n }\n }", "function deleteNote() {\n const note_id = note.id;\n axios\n .delete(`/api/deleteNote/${note_id}`)\n .then((res) => {\n // console.log(res.data);\n })\n .catch((error) => console.log(error));\n }", "remove() {\r\n if (this.deleted === false) {\r\n this.deleted = true;\r\n } else if (this.deleted === true && DOM.current === 'deleted') {\r\n let input;\r\n do {\r\n input = prompt(`Do you really wanna remove \"${this.title}\" completely? y/n`).toLowerCase();\r\n if (input === 'y') {\r\n console.log(this.id);\r\n database.nukeNote(this.id);\r\n break;\r\n }\r\n if (input === 'n') {\r\n alert('Okey, no deletion made');\r\n break;\r\n }\r\n } while (input === 'y' || input === 'n')\r\n }\r\n }", "function deleteNote(anyValue) {\r\n console.log(anyValue);\r\n let notes = localStorage.getItem('notes');\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(anyValue, 1);\r\n let title = localStorage.getItem('title')\r\n let important = localStorage.getItem('important')\r\n\r\n if (title == null) {\r\n tObj = [];\r\n } else {\r\n tObj = JSON.parse(title);\r\n }\r\n tObj.splice(anyValue, 1);\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 if (important == null) {\r\n importantObj = [];\r\n } else {\r\n importantObj = JSON.parse(important)\r\n }\r\n timeObj.splice(anyValue, 1)\r\n importantObj.splice(anyValue, 1)\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n localStorage.setItem(\"title\", JSON.stringify(tObj));\r\n localStorage.setItem(\"time\", JSON.stringify(timeObj));\r\n localStorage.setItem(\"important\", JSON.stringify(importantObj));\r\n if (notesObj.length == 0) {\r\n console.log('0');\r\n location.reload()\r\n localStorage.clear()\r\n }\r\n showNotes();\r\n}" ]
[ "0.76089793", "0.7041968", "0.70184743", "0.6996954", "0.695652", "0.691289", "0.6806511", "0.68055725", "0.67943794", "0.6751479", "0.67426074", "0.6738711", "0.6738362", "0.6738325", "0.67322916", "0.6699481", "0.6656864", "0.66460276", "0.660822", "0.66030777", "0.6571621", "0.6565484", "0.65648866", "0.6550842", "0.65480703", "0.6547306", "0.6543794", "0.64905924", "0.6490387", "0.648909", "0.64867336", "0.64729106", "0.64534074", "0.64408064", "0.6415649", "0.6411522", "0.6409562", "0.6372858", "0.6350955", "0.6336482", "0.6328118", "0.6324466", "0.63221616", "0.63216555", "0.63204026", "0.6319987", "0.63171655", "0.62850595", "0.6283332", "0.62815005", "0.6280854", "0.6280151", "0.62669086", "0.6263336", "0.62621295", "0.6255212", "0.6253945", "0.6253482", "0.62501204", "0.6250037", "0.6249807", "0.62468255", "0.62468255", "0.62461305", "0.6245537", "0.62441176", "0.6241598", "0.62414336", "0.6235557", "0.6235539", "0.6215046", "0.6213942", "0.62055415", "0.6204641", "0.620279", "0.6185587", "0.61823636", "0.61720556", "0.6168971", "0.6158992", "0.61564773", "0.61555475", "0.6154271", "0.61526674", "0.61511004", "0.61476", "0.6146629", "0.6139816", "0.6138174", "0.6128103", "0.6123878", "0.61184025", "0.6115066", "0.61106396", "0.61078197", "0.6100432", "0.6097146", "0.60787886", "0.6077844", "0.60476375" ]
0.7354453
1
Gets the current open notebook and displays it in the header of the page
function displayCurrentNoteBook() { let currentNotebookHeading = document.getElementById("current-notebook"); currentNotebookHeading.innerText = openNotebook.toUpperCase(); newNoteBookIntro(currentNotebookHeading); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayNotebook($xmlDoc, xmlData, notebookFullPath) {\n var notebookFileName = getFileName(notebookFullPath, false);\n if ($('#navbar a:contains(' + notebookFileName + ')').length > 0) {\n alert('Notebook \"' + notebookFileName + '\" already opened.');\n }\n else {\n // get the root node, i.e. <notebook>\n var rootNode = $xmlDoc.find(\"notebook\");\n \n // create a new tab\n $('#navbar').find(\"*\").andSelf().each(function() { // remove the JQM auto-init classes\n $(this).removeClass(function(i, cn){\n var matches = cn.match (/ui-[\\w\\-]+/g) || [];\n return (matches.join (' '));\n });\n if ($(this).attr(\"class\") == \"\") {\n $(this).removeAttr(\"class\");\n }\n });\n $('#navbar').navbar(\"destroy\");\n $('#navbar a').removeClass('current');\n $('#navbar ul').append('<li><a id=\"' + notebookFileName + '\" href=\"#\" data-role=\"button\" rel=\"external\" class=\"current\" data-fullpath=\"' + notebookFullPath + '\">' + notebookFileName + '</a></li>');\n var tabHtml = '<div id=\"' + notebookFileName + 'Tab\" class=\"tab\"><textarea id=\"txtCache-' + notebookFileName + '\" data-autogrow=\"false\" rows=\"2\"';\n if (!desktop) {\n tabHtml += ' style=\"display: none\"';\n }\n tabHtml += '></textarea></div>';\n $('#tabs').append(tabHtml);\n if ($('#dummyLi').length) { $('#dummyLi').remove(); };\n $('#navbar').navbar();\n $('#txtCache-' + notebookFileName).text(xmlData);\n\t if (desktop) {\n\t $('#txtCache-' + notebookFileName).width($(window).width());\n\t\t$('#' + notebookFileName + 'Tab').prepend('<div style=\"color:red\">Before closing the browser: Copy the text below and save it manually!</div>');\n\t }\n\t \n // construct the collapsible from the xml\n $.each(rootNode, function(key, value) { \n getEntry(value, $('#' + notebookFileName + 'Tab'), notebookFileName);\n });\n $('[data-role=\"collapsible\"]').collapsible();\n MathJax.Hub.Queue(['Typeset', MathJax.Hub, notebookFileName + 'Tab']);\n \n // set currentTabEntryId to refer to the first entry \n currentTabEntryId = $('#' + notebookFileName + 'Tab .entry:first').attr('id');\n // scroll to top\n $(window).scrollTop(0);\n // display the tab\n showTab($('#' + notebookFileName + 'Tab'), $('#' + notebookFileName));\n newNotebookIsJustOpened = true; \n }\n }", "function openNotebook(notebookFullPath) {\n\tif (desktop) {\n\t\t$.ajax({\n\t\t type: \"GET\",\n\t\t url: notebookFullPath,\n\t\t dataType: \"xml\",\n\t\t success: function(xmlData) {\n\t\t\tvar $xmlDoc = $(xmlData);\n\t\t\tdisplayNotebook($xmlDoc, xmlData, notebookFullPath);\n\t\t\tvar notebookFileName = getFileName(notebookFullPath, false);\n\t\t\t$('#txtCache-' + notebookFileName).text((new XMLSerializer()).serializeToString(xmlData));\n\t\t }\n\t\t});\t\t\n\t}\n\telse {\n\t\treadFile(notebookFullPath, function(xmlData) {\n\t\t var xmlDoc = $.parseXML(xmlData);\n\t\t var $xmlDoc = $(xmlDoc);\n\t\t displayNotebook($xmlDoc, xmlData, notebookFullPath);\n\t\t});\t\t\n\t}\n }", "function openNotebook($item){\r\n $('.notes-sidebar .notes-sidebar-title h3').html( $item.text() + '<a href=\"#\" class=\"delete-notebook\"><i class=\"fa fa-trash-alt\"></i></a>');\r\n $('.sidebar-menu .sidebar-sub-menu li').removeClass('selected');\r\n $item.addClass('selected');\r\n\r\n currentNotebook = $item.find('a').attr('data-id');\r\n loadNotes(currentNotebook);\r\n }", "get name() {\n return 'notebook';\n }", "function getNotebookHeader(notebook){\n\tvar alltags = [];\n\n\tfor(var tag in notebook.access_database){\n\t\tvar listlength = notebook.access_database[tag].length;\n\t\talltags.push({\"tag\": tag, \"numEntries\": listlength});\n\t}\n\n\t/*\n\talltags = {};\n\tfor(var tag in notebook.access_database){\n\t\tvar listlength = notebook.access_database[tag].length;\n\t\talltags[tag] = listlength;\n\t}\n\t*/\n\t//Object.keys(notebook.access_database)\n\n return\t{\"notebook_header\": {\t\"name\": notebook.name,\n\t\t\t\t\t\t\t\t\t\"dateCreated\": notebook.dateCreated,\n\t\t\t\t\t\t\t\t\t\"alltags\": alltags,\n\t\t\t\t\t\t\t\t\t\"numEntries\" : notebook.entries.length\n\t\t\t\t\t },\n\t\t\t\t\t \"parsing_delimeters\": getParseTokens(),\n\t\t\t\t\t \"success\": true}\n}", "function loadNotebooks(){\r\n notebooks = getNotebooks();\r\n $('.sidebar-menu-list.sidebar-sub-menu').html(\"\");\r\n $.each(notebooks, function(id, notebook) {\r\n $('.sidebar-menu-list.sidebar-sub-menu').prepend(`<li><a href=\"#\" data-id=\"${id}\">${notebook.title}</a></li>`);\r\n });\r\n }", "function whereAmI()\r\n{\r\n\tvar url = parent.frames[\"ory_doc\"].document.URL;\r\n\t\r\n\tif ( url != null )\r\n\t{\r\n\t\ttopicToDisplay = url;\r\n\t\tfindTocTopic();\r\n\t}\r\n}", "function ShowPopInWindow_ebook(title, content, link, width, top, left, bgcolor, fn, inSuppWindow) {\n\t// PW 9/07: make sure popInWindow is not set to a sticky note popIn\n \t// KC: for popins in supp windows\n\t//alert(\"inSuppWindow in ShowPopInWindow_ebook: \" + inSuppWindow);\n\t// XXX removed code\n popInWindow_ebook = MainPopInWindow()\n\n\t // KC if we have ShowFootnote in the content and we're in a supp window, make sure to adjust the call\n if (inSuppWindow == true) {\n\n content = content.replace(/ShowFootnote\\(([^\\)]*)\\)/, \"ShowFootnote($1, true)\");\n\n }\n\n\t// Remember what we're showing\n\tpopInTitleShowing = title;\n\t\n\t// If the popInContent_ebook span hasn't yet been recognized (this is an issue when\n\t// in IE6, at least), call InitializePopInWindow again\n\tif (popInContent_ebook == null) {\n\t\tInitializePopInWindow_ebook(inSuppWindow);\n\t}\n\t// GUARD AGAINST USER CLICKING ON A TERM BEFORE GLOSSARY.JS HAS LOADED??\n\t\n\t// Set the title, content, and link\n\tpopInTitle_ebook.innerHTML = \"<b>\" + title + \"</b>\";\n\tpopInContent_ebook.innerHTML = content;\n\t\n\t// If link is null, there isn't one, so hide the div\n\tif (link == null) {\n\t\tSetDisplay(popInLinkHolder_ebook, \"none\");\n\t} else {\n\t\tSetDisplay(popInLinkHolder_ebook, \"block\");\n\t\tpopInLink_ebook.innerHTML = link;\n\t}\n\n\t// Position the popInWindow in the same position as it was last left,\n\t// relative to the current scroll position\n\n\t// Find out what the current scroll position is\n\t// Note: in px F&E we have to look at main.parent.document.getElementById('fne-content')\n\t// instead of main.body. Also we assume we have jquery available, \n\t// and that it's scrollTop() will work\n\tvar el = parent.document.getElementById('fne-content');\n\tvar currentScrollY;\n\tif (el == null) {\n \tif (main.document.documentElement && main.document.documentElement.scrollTop) {\n \tcurrentScrollY = main.document.documentElement.scrollTop;\n } else {\n currentScrollY = main.document.body.scrollTop;\n }\n\t} else {\n\t\tcurrentScrollY = $(el).scrollTop();\n\t}\n\t\n\t/*\t\n\tvar d = parent.document.getElementById('fne-content');\n\tif (d == null) {\n\t\td = main.document.body;\n\t}\n\t// this top line is for IE; not sure if it will work...\n\tif (d.documentElement && d.documentElement.scrollTop) {\n\t\tcurrentScrollY = d.documentElement.scrollTop;\n\t} else {\n\t\tcurrentScrollY = d.scrollTop;\n\t}\n\n\tvar currentScrollY;\n\tif (main.document.documentElement && main.document.documentElement.scrollTop) {\n\t\tcurrentScrollY = main.document.documentElement.scrollTop;\n\t} else {\n\t\tcurrentScrollY = main.document.body.scrollTop;\n\t}\n\t*/\n\t\n\t// If top/left are set, scroll to that position\n\t// If left is null set it to -1, meaning that we'll stay wherever we were\n\tif (left == null) {\n\t\tleft = -1;\n\t}\n\t// If top is null, shift so that it's near the top of the screen, regardless of scrolling\n\tif (top == null) {\n\t\ttop = currentScrollY + 25;\n\t}\n\t\n\tShiftPopInWindow_ebook(left, top, true);\n\n\t// Alternatively, we COULD:\n\t// Shift the window to compensate for any scrolling that happened since\n\t// the last time the window moved.\n\t// If, for example, the window was scrolled to 0, 0 before\n\t// and now is scrolled to 100, 0, we want to move down 100 pixels\n\t// ShiftPopInWindow_ebook(0, currentScrollY - lastScrollY_ebook);\n\t\n\t// Record the current scroll position\n\tlastScrollY_ebook = currentScrollY;\n\t\n\t// Set width to provided or default width\n\tif (width != null) {\n \t\tif ((width.toString()).indexOf(\"px\") != -1) {\n\t\t\tpopInWindow_ebook.style.width = width;\n\t\t} else {\n\t\t\tpopInWindow_ebook.style.width = width + \"px\";\n\t\t}\n\n\t} else {\n\t\tpopInWindow_ebook.style.width = defaultWidth_ebook + \"px\";\n\t}\t\n\t\n\t// Set background color to provided or default color\n\tif (inSuppWindow == null) {\n \tif (bgcolor != null) {\n \tmain.document.getElementById('popInBody_n').style.backgroundColor = bgcolor;\n } else {\n main.document.getElementById('popInBody_n').style.backgroundColor = defaultPopInBgColor; // set in defaults.js\n }\n }\n\n\t// Show the popInWindow\n\tSetVisibility(popInWindow_ebook, \"visible\");\n\n\t// Record the clean up function, if one was sent.\n\tcleanUpFunction_ebook = fn;\n}", "function showSidebar() {\n var ui = HtmlService.createHtmlOutputFromFile('sidebar')\n .setTitle('Workbook.open');\n SpreadsheetApp.getUi().showSidebar(ui);\n}", "function displayHeader() {\n log(chalk.yellow(figlet.textSync('Nodewood', { horizontalLayout: 'full' })));\n\n const packageObj = readJsonSync(resolve(__dirname, '../package.json'));\n log(`CLI Version ${packageObj.version}`);\n\n if (existsSync(resolve(process.cwd(), 'wood/package.json'))) {\n const nodewoodObj = readJsonSync(resolve(process.cwd(), 'wood/package.json'));\n log(`Library Version ${nodewoodObj.version}`);\n }\n\n log(''); // Final newline\n}", "render() {\n return getMainUI(this.state.pageExtension);\n }", "static header() {\n return (\n <Grid>\n <br/>\n <Row bsClass='title'>My Files</Row>\n <hr/>\n <Row bsClass='paragraph'>\n <p>This page allows users to view the Documents they have deposited, and manage the requests. <br/>\n To see the details, just click on the row.<br/>\n <br/>You only need to <b>unlock your Metamask extension</b>.\n </p>\n </Row>\n </Grid>\n\n );\n }", "show() {\n this.switchToTitlePage();\n }", "function load_ipython_extension() {\n return new Promise(function(resolve) {\n requirejs([\n 'nbextensions/noworkflow/index',\n 'base/js/namespace',\n 'base/js/events',\n 'base/js/utils',\n 'notebook/js/codecell',\n 'd3-selection',\n '@noworkflow/trial',\n '@noworkflow/history',\n '@noworkflow/utils',\n ], function(\n Extension,\n Jupyter,\n events,\n utils,\n codecell,\n d3_selection,\n trial,\n history,\n nowutils\n ) {\n require('./index.css');\n console.log(\"<<<LOAD noworkflow 2>>>\");\n let notebook = Jupyter.notebook;\n Extension.register_renderer(\n notebook, trial, history, nowutils, d3_selection\n );\n Extension.render_cells(notebook);\n Extension.register_highlight(Jupyter, events, utils, codecell)\n resolve();\n })\n });\n}", "function Header() {\n return (\n <h1>Open the QuestionX files inside the src folder and complete them</h1>\n );\n}", "function open_current() {\n var page = location.pathname.match(/[^\\/]+$/)[0];\n jQuery('div.toc a[href=\"' + page + '\"]') //\n .parentsUntil('ul.toc', 'li.collapsible').addClass('show');\n }", "get overviewTab() {return browser.element(\"~Overview\");}", "get pageHeader() { return $('h1') }", "viewHeader() {\n\t\tif (this.state.page === \"Info\") {\n\t\t\tif (this.state.page === \"Info\") {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Getting Started</div>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Welcome to Cast Off!</div>\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this.props.userkey) {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Welcome to Cast Off!</div>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn (\n\t\t\t\t\t<div>{this.state.page}</div>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function defaultheaderView(){\n\tvar header = document.getElementById('template6');\n\tvar head= getHeader();\n\thead.innerHTML = header.innerHTML;\n}", "function viewDesktop_Master() {\n}", "function showWikiContent() {\n\t// Show everything\n\t$(\"#content.mw-body, #content.mw-body a, .mw-body div, .mw-code, .de1, .de1 span, .mw-body table, .mw-body tr, .mw-body td, .mw-body th, h2, h3, h4, .mw-editsection-bracket, .mw-editsection-divider, #content.mw-body ul, .thumbcaption, .thumb, .noprint, .rquote, .navbox, .catlinks, .external, .infobox\").css({\n\t\tcolor: \"black\",\n\t\tbackgroundColor: \"transparent\",\n\t\tborder: \"none\"\n\t});\n\t$(\"img, ul, .external, .mediaContainer, .reference-text, code\").css({\n\t\topacity: 1.0,\n\t});\n\t$(\"#firstHeading, h2\").css({\n\t\tborderBottom: \"1px solid #aaa\"\n\t});\n\t$(\".infobox, .catlinks\").css({\n\t\tborder: \"1px solid #aaa\"\n\t});\n\n\t// Style title\n\t$(\".firstHeading span\").css({\n\t\tbackground: \"transparent\",\n\t\tposition: \"inherit\",\n\t});\n\t$(\"#siteSub\").css({\n\t\tcolor: \"black\",\n\t\tbackground: \"transparent\",\n\t});\t\n\n\tcontentIsVisible = true;\n\tchrome.storage.sync.set({\"contentIsVisible\": true}, function() {});\n}", "function showTopNote() {\n var note = om.root.__topNote__;\n if (note) {\n isTopNote = true;\n var svc = om.root.get(\"__saveCountForNote__\");\n if (svc ===om.saveCount()) {\n topNoteDiv.setHtml(note);\n }\n }\n }", "get contentType() {\n return 'notebook';\n }", "static header() {\n return (\n <Grid>\n <br/>\n <Row bsClass='title'>Files Store</Row>\n <hr/>\n <Row bsClass='paragraph'>\n <p>This page allows users that have an Ethereum account and are using it on the Metamask\n extension for browsers, to request access to files deposited by other users. <br/>To request a certain file,\n simply click on the row.<br/><br/>\n The owner will have to accept your request for you to be able to decrypt the document.\n <br/>You only need to <b>unlock your Metamask extension</b> and choose the document you want to access.\n </p>\n </Row>\n </Grid>\n );\n }", "function displayWindow(data, marker) {\n currentEvent = data;\n let wikiSearch = data.histEvent;\n $.ajax({\n url: \"/wikipedia\",\n method: \"GET\",\n data: {\n prop: 'pageimages|extracts',\n titles: wikiSearch\n }\n }).done((data) => {\n updateData(data, marker);\n })\n .fail();\n }", "function printPageLabOpen(lab) {\n if ( $.cookie(\"topo\") == undefined ) $.cookie(\"topo\", 'light');\n var html = '<div id=\"lab-sidebar\"><ul></ul></div><div id=\"lab-viewport\" data-path=\"' + lab + '\"></div>';\n $('#body').html(html);\n // Print topology\n $.when(printLabTopology(),getPictures()).done( function (rc,pic) {\n if ((ROLE == 'admin' || ROLE == 'editor') && LOCK == 0 ) {\n $('#lab-sidebar ul').append('<li class=\"action-labobjectadd-li\"><a class=\"action-labobjectadd\" href=\"javascript:void(0)\" title=\"' + MESSAGES[56] + '\"><i class=\"glyphicon glyphicon-plus\"></i></a></li>');\n }\n $('#lab-sidebar ul').append('<li class=\"action-nodesget-li\"><a class=\"action-nodesget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[62] + '\"><i class=\"glyphicon glyphicon-hdd\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-networksget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[61] + '\"><i class=\"glyphicon glyphicon-transfer\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-configsget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[58] + '\"><i class=\"glyphicon glyphicon-align-left\"></i></a></li>');\n $('#lab-sidebar ul').append('<li class=\"action-picturesget-li\"><a class=\"action-picturesget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[59] + '\"><i class=\"glyphicon glyphicon-picture\"></i></a></li>');\n if ( Object.keys(pic) < 1 ) {\n $('.action-picturesget-li').addClass('hidden');\n }\n\n $('#lab-sidebar ul').append('<li><a class=\"action-textobjectsget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[150] + '\"><i class=\"glyphicon glyphicon-text-background\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-moreactions\" href=\"javascript:void(0)\" title=\"' + MESSAGES[125] + '\"><i class=\"glyphicon glyphicon-th\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-labtopologyrefresh\" href=\"javascript:void(0)\" title=\"' + MESSAGES[57] + '\"><i class=\"glyphicon glyphicon-refresh\"></i></a></li>');\n $('#lab-sidebar ul').append('<li class=\"plus-minus-slider\"><i class=\"fa fa-minus\"></i><div class=\"col-md-2 glyphicon glyphicon-zoom-in sidemenu-zoom\"></div><div id=\"zoomslide\" class=\"col-md-5\"></div><div class=\"col-md-5\"></div><i class=\"fa fa-plus\"></i><br></li>');\n $('#zoomslide').slider({value:100,min:10,max:200,step:10,slide:zoomlab});\n //$('#lab-sidebar ul').append('<li><a class=\"action-freeselect\" href=\"javascript:void(0)\" title=\"' + MESSAGES[151] + '\"><i class=\"glyphicon glyphicon-check\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-status\" href=\"javascript:void(0)\" title=\"' + MESSAGES[13] + '\"><i class=\"glyphicon glyphicon-info-sign\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-labbodyget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[64] + '\"><i class=\"glyphicon glyphicon-list-alt\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-lock-lab\" href=\"javascript:void(0)\" title=\"' + MESSAGES[166] + '\"><i class=\"glyphicon glyphicon-ok-circle\"></i></a></li>');\n if ( $.cookie(\"topo\") == 'dark' ) {\n $('#lab-sidebar ul').append('<li><a class=\"action-lightmode\" href=\"javascript:void(0)\" title=\"' + MESSAGES[236] + '\"><i class=\"fas fa-sun\"></i></a></li>');\n } else {\n $('#lab-sidebar ul').append('<li><a class=\"action-nightmode\" href=\"javascript:void(0)\" title=\"' + MESSAGES[235] + '\"><i class=\"fas fa-moon\"></i></a></li>');\n }\n $('#lab-sidebar ul').append('<div id=\"action-labclose\"><li><a class=\"action-labclose\" href=\"javascript:void(0)\" title=\"' + MESSAGES[60] + '\"><i class=\"glyphicon glyphicon-off\"></i></a></li></div>');\n $('#lab-sidebar ul').append('<li><a class=\"action-logout\" href=\"javascript:void(0)\" title=\"' + MESSAGES[14] + '\"><i class=\"glyphicon glyphicon-log-out\"></i></a></li>');\n $('#lab-sidebar ul a').each(function () {\n var t = $(this).attr(\"title\");\n $(this).append(t);\n\n\n })\n if ( LOCK == 1 ) {\n lab_topology.setDraggable($('.node_frame, .network_frame, .customShape'), false);\n $('.customShape').resizable('disable');\n }\n })\n}", "function showSidebar() {\n var html = HtmlService.createTemplateFromFile(\"Librarian\")\n .evaluate()\n .setTitle(\"The BookHound\"); // The title shows in the sidebar\n SpreadsheetApp.getUi().showSidebar(html);\n}", "function viewHtml() {\n var entry = ProjectManager.getSelectedItem();\n if (entry === undefined) {\n entry = DocumentManager.getCurrentDocument().file;\n }\n var path = entry.fullPath;\n var w = window.open(path);\n w.focus();\n }", "function showSidebar() {\n var ui = HtmlService.createTemplateFromFile('Explorer')\n .evaluate()\n .setTitle(SIDEBAR_TITLE)\n .setSandboxMode(HtmlService.SandboxMode.IFRAME);\n SpreadsheetApp.getUi().showSidebar(ui);\n}", "function getPageTitle () {\n return title;\n }", "function klikHeader() {\n console.log(\"kliknąłeś w heaader\");\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 }", "function openNote($item, notebook){\r\n if($item.closest('.note-item').attr('data-notebook')){\r\n notebook = $item.closest('.note-item').attr('data-notebook');\r\n }\r\n let noteContent = getContent(notebook, $item.attr('data-id'));\r\n $('.notes-list-container .note-item').removeClass('selected');\r\n $item.addClass('selected');\r\n editorNotebook = notebook;\r\n editorNote = $item.attr('data-id');\r\n editor.setContents(noteContent);\r\n }", "function header(activeTabName) {\n tabsName = new Array();\n tabsLink = new Array();\n tabsName[0] = 'Downloads'; tabsLink[0] = 'http://traf-builds.esgyn.com/';\n tabsName[1] = 'Trafodion Project'; tabsLink[1] = 'http://trafodion.apache.org';\n tabsName[2] = 'Trafodion Wiki'; tabsLink[2] = 'https://cwiki.apache.org/confluence/display/TRAFODION';\n\n document.write(\n '<div id=\"header\" class=\"container\">'+\n '<div class=\"span-5\">'+\n ' <h1 id=\"logo\"><a href=\"http://trafodion.apache.org/\">Trafodion</a></h1>'+\n '</div>\\n'+\n '<div class=\"span-19 last blueLine\">'+\n '<div id=\"navigation\" class=\"span-19\">'+\n '<ul id=\"Menu1\">\\n')\n\n for (var i = 0; i < tabsName.length; i++) {\n document.write('<li><a id=\"menu-'+tabsName[i]+'\" href=\"'+tabsLink[i]+'\"')\n if (tabsName[i] == activeTabName) {\n document.write(' class=\"current\"');\n }\n document.write('>'+tabsName[i]+'</a></li>\\n');\n }\n\n document.write(\n '</ul>'+\n '</div>'+\n '</div>'+\n '</div>')\n}", "renderHeader () {\n this.header = this.renderSubview(\n new ListHeader({ title: this.title }),\n this.queryByHook('header-container')\n )\n return this.header\n }", "displayWikiDetails() {\n $('#modalBody').html(\n `${this.cleanExtract}<br><a href=https://${this.wikiUrl} target=\"_blank\">Full Wikipedia Article</a>`\n );\n }", "open(theme, lang, classifier = '') {\n return super.open(theme, `${theme}-top${classifier ? '-' : ''}${classifier}-${lang}.html`);\n }", "function LoadCurrentPage(){\n\t// The URL determines which page is fetched, in this case by ?view=<filename>\n\tvar view = getParameterByName('view');\n\tif (view) {\n\t\tLoadDiv('main',view,false);\n\t}\n\telse {\n\t\t// Default page\n\t\tLoadDiv('main','coding',false);\n\t}\t\t\t\n}", "function openOtherTitlesSelectionPage () {\n loadPageWithHeader('./pages/otherTitles/otherTitles_header.html', 'Other Titles', initializeOtherTitlesSelection, \"\")\n }", "function onMain() {\n const winNum = document.querySelector(\"#winNum\");\n winNum.innerHTML = fin.desktop.Window.getCurrent().name\n}", "function showSidebar() {\n var github = getGithub();\n if (!github.hasAccess()) {\n showGithubAuthFlow(github);\n } else {\n var page = HtmlService.createTemplateFromFile(\"Sidebar\")\n .evaluate()\n .setTitle(c.title)\n .setSandboxMode(HtmlService.SandboxMode.IFRAME);\n DocumentApp.getUi().showSidebar(page);\n }\n}", "function _221() {\n\tvar x = document.getElementById('221window');\n\n\tif (window.getComputedStyle(x).getPropertyValue(\"display\") === \"none\") {\n\t\tx.style.display = \"block\";\n\n\t\tvar doc = document.createElement('iframe');\n\t\tdoc.setAttribute(\"id\",\"221doc\");\n\t\tdoc.setAttribute(\"src\", \"./web/viewer.html?file=../projects/2.2.1 Night Light.pdf#navpanes=0&amp;toolbar=0&amp;statusbar=0&amp;view=FitV&amp;pagemode=none&amp;page=1\");\n\t\tdoc.setAttribute(\"style\",\"border: none; width: 100%; height: calc(100% - 32px)\");\n\t\tx.appendChild(doc);\n\n\t\t/* makes current window the top window */\n\t\tvar windows = document.getElementsByClassName('drsElement');\n\t\tvar i = windows.length;\n\t\twhile(i--) {\n\t\t\t\twindows[i].style.zIndex = \"3\";\n\t\t}\n\t\tx.style.zIndex = \"4\";\n\t\tx.focus();\n\t}\n}", "function openToc(){\n \tcpCmndTOCVisible = true;\n cpCmndPause = true; \t\n }", "function GetWikiName() {\n if (STS.controller === 'posts') {\n let wiki_name = \"\";\n let url = $('#show-excerpt-link').attr('href');\n let match = url.match(/^\\/wiki_pages\\/([^/]+)/);\n if (match) {\n wiki_name = match[1];\n }\n return decodeURIComponent(wiki_name);\n } else if (STS.controller === 'wiki-pages') {\n return $('#wiki-page-title a').html();\n }\n}", "function getTitle() {\n try {\n var title = document.title;\n console.log(\"status pass : Current page title is \", title);\n return title;\n } catch (err) {\n console.log(err);\n }\n}", "function openModuleClickTOC () {\r\n $(\"#toc li\").click (function () {\r\n var s = $(this).text().substr(1);\r\n s = s.substr (0,s.indexOf(\".\"));\r\n openModule (s);\r\n });\r\n}", "function section1LeftTop( placeholder )\n {\n var ph = placeholder || {};\n\n ph.stack = fmethods.initTopPaneCell( \"Summary\" );\n ph.stack[1] = {\n image: imagesRack.loadedImages[ 'summary-table00' ].dataURI\n //fit: [444.0, 333.0],\n ,width: 400\n ,margin: [10,10,20,0]\n };\n ///just a filler ... poor design\n ph.stack[2] = {\n text: \" \"\n ,margin: [0,0,0, 0]\n\n };\n\n ///table00-contents\n var JSONrecord = nheap.content_data\n [ \"Page 1\" ]\n [ \"OverallPortfolio.txt\" ]\n [ \"OverAllPortfolio\" ]\n [ 0 ];\n /*\n :[\n {\n \"CURRENT_VALUE\":1124.081205,\n \"INVESTED_AMOUNT\":1013.564488,\n \"GAINLOSS\":112.48128,\n \"UNREALISEDGAINLOSS\":110.516716,\n \"REALISEDGAINLOSS\":3.7530829183,\n \"DIVIDEND\":-1.788519752,\n \"IRR\":148.7088080024194,\n \"BMIRR\":-84.87343195817056\n }\n */\n var num2commasStr = methods.putCommasToBigNumbers;\n\n [ \"INVESTED_AMOUNT\", \"CURRENT_VALUE\", \"GAINLOSS\", \"IRR\", \"BMIRR\" ].forEach( ( fieldName, ix ) => {\n var guiRow = Math.floor( ix/3 );\n var cell = ph.stack[3+ix] = {\n text: methods.putCommasToBigNumbers( JSONrecord[ fieldName ], 2 ) +\n ( guiRow ? '%' : '' )\n ,fontSize: 20\n ,bold: true\n //,margin: [0,10,0, 0]\n ,absolutePosition: {\n x: 45 + (ix%3)*142 + (ix===2 ? -4 : 0),\n y: 80 + Math.floor( ix/3 )*73\n }\n };\n if( \"GAINLOSS\" === fieldName ) {\n cell.color = fmethods.gainLossColor( JSONrecord[ fieldName ] );\n }\n });\n\n var fValue = JSONrecord[ \"REALISEDGAINLOSS\" ];\n ph.stack[8] =\n {\n text: methods.putCommasToBigNumbers( fValue, 2 )\n ,fontSize: 7\n ,color: fmethods.gainLossColor( fValue, null, '#888' )\n ,bold: false\n ,absolutePosition: {\n x: 45 + 325,\n y: 80 + 62\n }\n };\n\n\n var fValue = JSONrecord[ \"UNREALISEDGAINLOSS\" ];\n ph.stack[9] =\n {\n text: methods.putCommasToBigNumbers( fValue, 2 )\n ,fontSize: 7\n ,color: '#888'\n ,bold: false\n ,absolutePosition: {\n x: 45 + 333,\n y: 80 + 74\n }\n };\n\n var fValue = JSONrecord[ \"DIVIDEND\" ];\n ph.stack[10] =\n {\n text: methods.putCommasToBigNumbers( fValue, 2 )\n ,fontSize: 7\n ,color: fmethods.gainLossColor( fValue, null, '#888' )\n ,bold: false\n ,absolutePosition: {\n x: 45 + 319,\n y: 80 + 85\n }\n };\n return ph;\n }", "getHeaderContent() {\n const element = this.sections.modalHeader;\n I.grabTextFrom(element);\n}", "function putHeader() {\n html = \"<html><head><title>Search results</title>\";\n html += \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"idldoc-resources/main.css\\\" />\";\n\n html += \"<style type=\\\"text/css\\\" media=\\\"all\\\">\";\n html += \" span.score { color: black; }\";\n html += \" span.context { color: #A0A0A0; }\";\n html += \" span.term { color: black; background: yellow; }\";\n html += \" li { margin-bottom: 0.5em; }\";\n html += \"</style>\";\n\n html += \"</head><body>\";\n\n html += \"<div class=\\\"header smaller\\\">\";\n html += \"<h1>\" + title + \"</h1>\";\n html += \"<h2>\" + subtitle + \"</h2>\";\n html += \"</div>\";\n\n html += \"<div class=\\\"content\\\">\";\n html += \"<h2>Search results for \\\"\" + searchString + \"\\\"</h2>\";\n}", "showFirstPage() {\n return this.state.showFirstPage ? (\n <Col>\n {displayInfoButton(\n \"Data Info Table\",\n \"This data is the data we use to generate our decision tree. You can change the values on each column on each row, delete rows with the trashcan, randomize data with the shuffle button.\",\n \"left\"\n )}\n {this.showCustomDataTable()}\n </Col>\n ) : null;\n }", "function openModuleDetails(modulename) {\n\n\tdisplay_module();\n\tconsole.log(\"loading \" +modulename);\n\tloadSelectedModule(modulename);\n\n}", "function deviceHeaderView(){\n\tvar local_device = get_local_device();\n\tvar local_session = get_local_simulation();\n\tvar html = viewDeviceTemplate(local_device, local_session);\n\tvar content = getContainer();\n\tcontent.innerHTML = html;\n}", "function header() {\n return E('header#header') . has([\n H1(\"todos\") // some kind of placeholder?\n ]);\n }", "function trackNotebookOpenClose(){\n /* track notebook open and close events */\n trackAction(Notebook, Date.now(), 'notebook-opened', 0, [0]);\n window.onbeforeunload = function(event) {\n trackAction(Notebook, Date.now(), 'notebook-closed', 0, [0]);\n }\n }", "function showHeader() \r\n{\r\n\tdocument.write('<P align=\\\"center\\\">');\r\n\tif (browserOK)\r\n\t{\r\n\t\tdocument.write('<FONT size=\\\"-1\\\"><I>Click on the plus symbol <IMG border=\\\"0\\\" src=\\\"plus.gif\\\" width=\\\"12\\\" height=\\\"12\\\" alt=\\\"+\\\"> to display additional comments, and the minus symbol <IMG border=\\\"0\\\" src=\"\\minus.gif\\\" width=\\\"12\\\" height=\\\"12\\\" alt=\\\"-\\\"> to hide them.<\\/I><\\/FONT>');\r\n\t}\r\n\telse\t// toggling the display of a layer isn't going to work ...\r\n\t{\t\t\t\t \r\n\t\tdocument.write('<FONT size=\\\"-1\\\"><I>Unfortunately your browser indicates that it is not compatible with the Hide/Reveal section facility. <BR>The \\'hidden\\' sections will consequently appear as delineated blocks of text with no interaction available.<BR>A browser version 5 or higher (7 or higher for Opera) is necessary for the interactive element to work.<\\/I><\\/FONT>');\r\n\t}\r\n\tdocument.write('<\\/P>');\r\n}", "function showSidebar() {\n var ui = HtmlService.createHtmlOutputFromFile('sidebar').setTitle(ADDON_TITLE);\n SpreadsheetApp.getUi().showSidebar(ui);\n}", "openFile() {\n controller.openMarkdown();\n }", "function getHeaderView() {\n logger.info('base getHeaderView called');\n\n $.pdp_header_controller = Alloy.createController('product/components/detailHeader');\n\n $.pdp_header_controller.init();\n\n return $.pdp_header_controller.getView();\n}", "function showGaugeSidebar() {\n \n var htmlOutput = HtmlService.createHtmlOutputFromFile('GaugeSidebar.html')\n\n htmlOutput.setTitle('Cells Used'); \n\n SpreadsheetApp.getUi().showSidebar(htmlOutput);\n}", "function renderObservationPage() {\n const observationId = location.hash.split(\"observations/\")[1];\n // get one observation\n const observation = Model.get_observation(parseInt(observationId));\n const userId = observation.participant;\n loadPage(\"observation-details\", {\n observation: Model.get_observation(parseInt(observationId)),\n user: Model.get_user(parseInt(userId)),\n });\n}", "function loadReadme() {\n if (curPage === 0) return;\n curPage = 0;\n $(\".content\").load('html/README.html');\n $(\"#title\").html(\"<b>📜 README.md</b>\");\n}", "function displayTOC() {\n const postHeaders =\n document.getElementById('whole_post').querySelectorAll('h1, h2, h3');\n\n let TOCContents = '<div id=\"toc_label\">Table of Contents</div>';\n TOCContents += `<div id=\"toc_head\"><a href=\"#\"\n onclick=\"scrollTOC('post_title');return false\">Top of Page</a></div>`;\n\n for (let headNumber = 1; headNumber < postHeaders.length; headNumber++) {\n TOCContents +=\n `<div class=\"toc_${postHeaders[headNumber].nodeName}\">\n <a href=\"#${postHeaders[headNumber].id}\"\n onclick=\"scrollTOC('${postHeaders[headNumber].id}');return false\">\n ${postHeaders[headNumber].innerHTML}</a></div>`;\n }\n document.getElementById('TOC').innerHTML = TOCContents;\n}", "function Notebook() {\n loadNoteNamesList();\n\n /*\n * Registering event listeners\n */\n $('#sign-out').click(function() {\n utils.signOut('./');\n });\n $('#create-note').click(function() {\n showCreateNoteModal();\n });\n\n /**\n * Load the notes list from the server\n * Display it in the UI\n *\n * @private\n */\n function loadNoteNamesList() {\n var notesList = $('#notes-list');\n utils.showLoadingOverlay(notesList);\n $.ajax({\n type: 'GET',\n url: constants.API_URI + 'notes',\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n var notes = response.notes;\n var columns = ['Note Name', 'Actions'];\n\n // Creating the 2D data array for the notes list table\n var data = [];\n $.each(notes, function(index, note) {\n var row = [];\n row.push('<span class=\"note-name\">' + note + '</span>');\n row.push(\n '<a href=\"note.html?note=' + note + '\" class=\"btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-view fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">View</span>' +\n '</a>' +\n '<a class=\"delete-note btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-delete fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">Delete</span>' +\n '</a>'\n );\n data.push(row);\n });\n\n var listTable = utils.generateListTable(columns, data,\n { ordering: false, searching: false },\n { 'Actions' : 'text-right' }\n );\n\n // Registering event listeners to the list table\n listTable.find('.delete-note').click(function(event) {\n showDeleteNoteModal(\n $(event.target).closest('tr').find('.note-name').html()\n );\n });\n\n notesList.html(listTable);\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n\n }\n utils.hideLoadingOverlay(notesList);\n },\n error: function() {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n utils.hideLoadingOverlay(notesList);\n }\n });\n }\n\n /**\n * Show the create note modal\n *\n * @private\n */\n function showCreateNoteModal() {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalBody = $('<div >');\n var noteNameInput = $('<input type=\"text\" class=\"form-control form-control-lg\" />');\n var noteNameInputContainer = $('<div class=\"pull-left\"><div class=\"form-group col-sm-12\">');\n var modalFooter = $('<div class=\"pull-right\">');\n var createButton = $('<button type=\"button\" class=\"btn btn-primary\">Create</button>');\n\n // Appending to create the modal content structure\n noteNameInputContainer.append(noteNameInput);\n modalBody.append(noteNameInputContainer);\n modalFooter.append(createButton);\n\n var modal = utils.showModalPopup('Enter a name for your new note', modalBody, modalFooter);\n\n // Registering event listeners for the modal window\n createButton.click(function() {\n createNote(noteNameInput.val());\n modal.modal('hide');\n });\n }\n\n /**\n * Create the Note with the name specified\n *\n * @private\n * @param {string} name Name of the note to be created\n */\n function createNote(name) {\n if (name.indexOf(' ') > 0) {\n utils.handlePageNotification('error', 'Error',\n 'Note name cannot contain white spaces'\n );\n } else {\n $.ajax({\n type: 'POST',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n window.location.href = 'note.html?note=' + name;\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n }\n\n /**\n * Show the delete note confirmation modal\n *\n * @private\n * @param noteName The name of the note to be deleted\n */\n function showDeleteNoteModal(noteName) {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalFooter = $('<div class=\"pull-right\">');\n var deleteButton = $('<button type=\"button\" class=\"btn btn-primary\">Delete</button>');\n\n // Appending to create the modal content structure\n modalFooter.append(deleteButton);\n\n var modal = utils.showModalPopup(\n 'Do you want to delete ' + noteName + ' ?', $(), modalFooter\n );\n\n // Registering event listeners for the modal window\n deleteButton.click(function() {\n deleteNote(noteName);\n modal.modal('hide');\n });\n }\n\n /**\n * Delete the note deleted\n *\n * @private\n * @param {string} name The name of the note to be deleted\n */\n function deleteNote(name) {\n $.ajax({\n type: 'DELETE',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n utils.handlePageNotification('info', 'Info', 'Note successfully deleted');\n loadNoteNamesList();\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n} // End of Notebook prototype constructor", "getTop() {\n return this.ctrl.getTop();\n }", "getHeader() {\n\t\tif(this.inProgress()) {\n\t\t\treturn (\n\t\t\t<Grid className='listingItemGrid'>\n\t\t\t\t<Col className='listingItemHeaderStatusColumn' xs={4} sm={5} md={5} lg={5}>\n\t\t\t\t\t{this.getStatus()}\n\t\t\t\t</Col>\n\t\t\t\t<Col className='listingItemHeaderButtonColumn' xs={8} sm={4} md={4} lg={4}>\n\t\t\t\t\t{this.getButton()}\n\t\t\t\t</Col>\n\t\t\t</Grid>); \n\t\t}\n\t\treturn (\n\t\t\t<Grid className='listingItemGrid'>\n\t\t\t\t<Col className='listingItemHeaderStatusColumn' xs={7} sm={7} md={7} lg={8}>\n\t\t\t\t\t<Time value={this.props.listing.transactionDate} format=\"MMMM D, YYYY\" /> - {this.getStatus()}\n\t\t\t\t</Col>\n\t\t\t\t<Col className='listingItemHeaderButtonColumn' xs={5} sm={2} md={2} lg={1}>\n\t\t\t\t\t{this.getButton()}\n\t\t\t\t</Col>\n\t\t\t</Grid>); \n\t}", "get heading () { return $('h1.page-title > span.base') }", "function load_header(_eatery_name) {\n eatery_name.innerHTML = _eatery_name;\n}", "function h$ghcjs_currentWindow() {\n return window;\n}", "getWikipediaInfo(marker) {\n let self = this;\n let pageId = marker.pageId;\n let url = 'https://cors-anywhere.herokuapp.com/https://pl.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&pageids=' + pageId;\n // ew. explaintext=&\n fetch(url)\n .then(function(response){\n return response.json();\n }).then(function(data){\n let title = data.query.pages[pageId].title;\n let content = data.query.pages[pageId].extract;\n self.state.infoWindow.setContent(`<p>From Wikipedia</p><h3>${title}</h3><p>${content}<p>`);\n }).catch(function(error){\n alert('Failed to load Wikipedia resources ' + error);\n })\n }", "function openAHOFbar(){\n servePage('AHOF', 'pages/LargeBlocksTemplate', 'A History of Forests');\n}", "showDocs(page) {\n // _blank is still required so that the project isn't unloaded\n cordova.InAppBrowser.open(\"../resources/docs/index.htm#\" + page, \"_blank\", \"zoom=no\")\n }", "function _renderHead() {\n if (_$head instanceof $) {\n _$head.setMod(_B_BAR, _E_HEADING, _M_HIDDEN, true);\n setTimeout(function() {\n _$head.text(_$head.data(_DATA_STR) || \"\");\n _$head.setMod(_B_BAR, _E_HEADING, _M_HIDDEN, false);\n }, CFG.TIME.ANIMATION);\n }\n }", "function initNotebook(name, date) {\n\t//Create notebook object\n\tvar notebook = new Notebook(name, date);\n\n\t//Create file for notebook object\n\twriteNotebookToMongo(notebook);\n\n\t//Add to appropriate places\n\taddToNotebookList(name);\n\n\treturn notebook;\n}", "function index() {\n mainWin.open();\n }", "function getHeader() {\n return This.headerTpl({\n date: date,\n teams: teams\n });\n }", "function isOpen() {\n return gitbook.state.$book.hasClass('with-summary');\n }", "async viewPrimaryContent(e){\n\t\te.preventDefault()\n\t\tcontentHolderService\n\t\t.downloadPrimaryContent(this.props.contentHolderId, this.props.containerId)\n\t\t.then( response => {\n\t\t\tvar blob = new Blob([response], {type:\"plain/text;charset=UTF-8\"});\n\t\t\tvar blobUrl = URL.createObjectURL(blob);\n\t\t\twindow.open(blobUrl)\n\t\t})\n\t}", "function viewEntry() {\n var current = getCurEntry();\n var url = $('a.title', current).attr('href');\n window.open(url);\n}", "function openBook(book) {\n \"use strict\";\n\n return function () {\n //Style settings\n var summary = document.getElementById('summary');\n summary.style.display = \"block\";\n console.log(book);\n document.getElementById('bookList').style.display = \"none\";\n document.getElementById('progress').style.display = \"block\";\n\t\n //Open the chosen book\n openFile(book, function (data) {\n var zip = new JSZip(data);\n var container = getContainer(zip);\n\n if (container !== null) {\n //Get all information we need in Container.xml\n var parser = new DOMParser(),\n doc = parser.parseFromString(container, \"application/xml\"),\n rootfile = doc.getElementsByTagNameNS(\"*\", \"rootfile\")[0],\n opffile = rootfile.getAttribute(\"full-path\"),\n opfdata = zip.file(opffile),\n opf = parser.parseFromString(opfdata.data, \"text/xml\"),\n metadata = opf.getElementsByTagNameNS(\"*\", \"metadata\")[0],\n manifest = opf.getElementsByTagNameNS(\"*\", \"manifest\")[0],\n spine = opf.getElementsByTagNameNS(\"*\", \"spine\")[0],\n toc = spine.getAttribute(\"toc\"),\n itemref = spine.getElementsByTagNameNS(\"*\", \"itemref\")[0],\n idRef = itemref.getAttribute(\"idref\"),\n items = manifest.getElementsByTagNameNS(\"*\", \"item\"),\n title = metadata.getElementsByTagNameNS(\"*\", \"title\")[0].childNodes[0].nodeValue,\n author = metadata.getElementsByTagNameNS(\"*\", \"creator\")[0].childNodes[0].nodeValue;\n \n //Display book's title and author\n var h1 = document.getElementById('title');\n var h2 = document.getElementById('author');\n h1.textContent = decodeUTF8(title);\n h2.textContent = decodeUTF8(author);\n\n //Get \"toc.ncx\"\n for (var i = 0; i < items.length; i++) {\n var id = items[i].getAttribute(\"id\");\n if (id === idRef) {\n var HTMLFileName = items[i].getAttribute(\"href\");\n } else if (id === toc) {\n var NcxFileName = items[i].getAttribute(\"href\");\n }\n }\n\n var tocFolder = '',\n isInOPS = zip.folder(\"OPS\").file(\"toc.ncx\"), //If the file exists in OPS folder then the file exists into it\n isInOEBPS = zip.folder(\"OEBPS\").file(\"toc.ncx\"); //If the file exists in OEBPS folder then the file exists into it\n\n if (isInOPS) {\n tocFolder ='OPS/';\n } else if(isInOEBPS) {\n tocFolder = 'OEBPS/';\n } else {\n tocFolder = '';\n }\n\n var ncxFile = zip.file(tocFolder + NcxFileName);\n\n if (ncxFile !== null) {\n var decoded = decodeUTF8(ncxFile.data);\n\n //Get all infos in \"toc.ncx\"\n var parserNcx = parser.parseFromString(decoded, \"text/xml\"),\n navMap = parserNcx.getElementsByTagNameNS(\"*\", \"navMap\")[0],\n navPoints = navMap.getElementsByTagNameNS(\"*\", \"navPoint\"),\n pointsList = [],\n pageFiles = [];\n\n //Get content of chapters\n if (navPoints.length > 0) {\n var pointsCounter = 0;\n for (var i = 0; i < navPoints.length; i++) {\n var label = navPoints[i].getElementsByTagNameNS(\"*\", \"navLabel\")[0].getElementsByTagNameNS(\"*\", \"text\")[0].textContent,\n content = navPoints[i].getElementsByTagNameNS(\"*\", \"content\")[0].getAttribute(\"src\"),\n navPoint = navPoints[i],\n point = [],\n pageFile;\n\n point['label'] = label;\n point['content'] = content;\n pointsList[pointsCounter] = point;\n pointsCounter++;\n\n if (tocFolder === '') {\n pageFile = zip.file(content);\n } else {\n if (content.indexOf(\"#\") !== -1) {\n pageFile = zip.file(tocFolder + content.substring(0, content.indexOf(\"#\")));\n } else {\n pageFile = zip.file(tocFolder + content);\n }\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (pageFile === null) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"We don't support this type of epub for the moment :-( \")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else { \n \tvar decodedPage = decodeUTF8(pageFile.data);\n \tpageFiles.push(decodedPage);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n }\n }\n \n //Display the list of chapters\n var chaptersList = document.getElementById('chaptersList');\n\n for (var i = 0; i < pointsList.length; i++) {\n var chapter = document.createElement('li'),\n dl = document.createElement('dl'),\n dt = document.createElement('dt'),\n chapterName = document.createTextNode(pointsList[i].label),\n completeChapter = pageFiles[i];\n\n chaptersListArray.push(pageFiles[i]);\n \n dl.appendChild(dt);\n chapter.appendChild(dl);\n chapter.id = \"chapter\" + i;\n chapter.onclick = displayChapter(completeChapter, i);\n \n dt.appendChild(chapterName);\n chaptersList.appendChild(chapter);\n }\n \n document.getElementById('book').style.display = \"none\";\n\t\t \n currentChapterTitle = title;\n var idBook = getCounter(title);\n var oLastPageRead = readJson('lastPageRead');\n\t\t \n if (oLastPageRead.books[idBook].lastChapterRead !== -1 && oLastPageRead.books[idBook].lastParagraph !== -1 ) {\n displayLastPageRead2(oLastPageRead.books[idBook].lastChapterRead,oLastPageRead.books[idBook].lastParagraph);\n document.getElementById('progress').style.display = \"none\";\n } else {\n $(\"#chaptersList\").show(\"blind\", { direction: \"up\" }, \"slow\");\n document.getElementById('progress').style.display = \"none\";\n }\t\t \n } else {\n document.getElementById('progress').style.display = \"none\";\n alert(\"Sorry the file you chose is somehow corrupted.\");\n }\n }\n });\n }\n}", "function load_extension() {\n Jupyter.notebook.config.loaded.then(initialize); // trigger loading config parameters\n\n //$.getJSON(\"https://single-cell-codesnippets.firebaseio.com/.json\", function(data) {\n //$.getJSON(Jupyter.notebook.base_url+\"nbextensions/snippets/snippets.json\", function(data) {\n $.getJSON(Jupyter.notebook.base_url+\"nbextensions/snippets/snippets.json\", function(data) {\n // Add the header as the top option, does nothing on click\n var option = $(\"<option></option>\")\n .attr(\"id\", \"snippet_header\")\n .text(\"Snippets\");\n $(\"select#snippet_picker\").append(option);\n\n // Add options for each code snippet in the snippets.json file\n $.each(data['snippets'], function(key, snippet) {\n var option = $(\"<option></option>\")\n .attr(\"value\", snippet['name'])\n .text(snippet['name'])\n .attr(\"code\", snippet['code']);//.join('\\n'));\n $(\"select#snippet_picker\").append(option);\n });\n })\n .error(function(jqXHR, textStatus, errorThrown) {\n // Add an error message if the JSON fails to load\n var option = $(\"<option></option>\")\n .attr(\"value\", 'ERROR')\n .text('Error: failed to load snippets!')\n .attr(\"code\", \"\");\n $(\"select#snippet_picker\").append(option);\n });\n\n }", "getById(id) {\r\n return new Notebook(this, id);\r\n }", "constructor(options) {\n super(options);\n this._changeGuard = false;\n this._spinner = new Spinner();\n this._isRevealed = false;\n this.addClass('jp-MainAreaWidget');\n // Set contain=strict to avoid many forced layout rendering while adding cells.\n // Don't forget to remove the CSS class when your remove the spinner to allow\n // the content to be rendered.\n // @see https://github.com/jupyterlab/jupyterlab/issues/9381\n this.addClass('jp-MainAreaWidget-ContainStrict');\n this.id = DOMUtils.createDomID();\n const trans = (options.translator || nullTranslator).load('jupyterlab');\n const content = (this._content = options.content);\n content.node.setAttribute('role', 'region');\n content.node.setAttribute('aria-label', trans.__('notebook content'));\n const toolbar = (this._toolbar = options.toolbar || new Toolbar());\n toolbar.node.setAttribute('role', 'navigation');\n toolbar.node.setAttribute('aria-label', trans.__('notebook actions'));\n const contentHeader = (this._contentHeader =\n options.contentHeader ||\n new BoxPanel({\n direction: 'top-to-bottom',\n spacing: 0\n }));\n const layout = (this.layout = new BoxLayout({ spacing: 0 }));\n layout.direction = 'top-to-bottom';\n BoxLayout.setStretch(toolbar, 0);\n BoxLayout.setStretch(contentHeader, 0);\n BoxLayout.setStretch(content, 1);\n layout.addWidget(toolbar);\n layout.addWidget(contentHeader);\n layout.addWidget(content);\n if (!content.id) {\n content.id = DOMUtils.createDomID();\n }\n content.node.tabIndex = 0;\n this._updateTitle();\n content.title.changed.connect(this._updateTitle, this);\n this.title.closable = true;\n this.title.changed.connect(this._updateContentTitle, this);\n if (options.reveal) {\n this.node.appendChild(this._spinner.node);\n this._revealed = options.reveal\n .then(() => {\n if (content.isDisposed) {\n this.dispose();\n return;\n }\n content.disposed.connect(() => this.dispose());\n const active = document.activeElement === this._spinner.node;\n this._disposeSpinner();\n this._isRevealed = true;\n if (active) {\n this._focusContent();\n }\n })\n .catch(e => {\n // Show a revealed promise error.\n const error = new Widget();\n // Show the error to the user.\n const pre = document.createElement('pre');\n pre.textContent = String(e);\n error.node.appendChild(pre);\n BoxLayout.setStretch(error, 1);\n this._disposeSpinner();\n content.dispose();\n this._content = null;\n toolbar.dispose();\n this._toolbar = null;\n layout.addWidget(error);\n this._isRevealed = true;\n throw error;\n });\n }\n else {\n // Handle no reveal promise.\n this._spinner.dispose();\n this.removeClass('jp-MainAreaWidget-ContainStrict');\n content.disposed.connect(() => this.dispose());\n this._isRevealed = true;\n this._revealed = Promise.resolve(undefined);\n }\n }", "function showTitle(paper) {\n document.querySelector('.title-header').innerHTML =\n `Paper Overview: ${paper.title}`;\n return paper;\n}", "function Heading() {\n\treturn(<div id='heading'>\n\t</div>);\n}", "function openMark(c_index) {\n saveLastOpenedMark(true);\n updateMarksOnPage(c_index);\n //If it's already open, then openClose() will close it\n if (findCurrentOpenedMark() !== c_index) {\n openClose(c_index);\n }\n let page = getComponent(c_index)['page'];\n if(page){\n //841.89 os the pdf page height, 29 is the margin, 80 is the top part.\n let files = $('.openable-element-submissions');\n for(let i = 0; i < files.length; i++){\n if(files[i].innerText.trim() == \"upload.pdf\"){\n if($(\"#file_view\").is(\":visible\")){\n $('#file_content').animate({scrollTop: ((page-1)*(841.89+29))}, 500);\n } else {\n expandFile(\"upload.pdf\", files[i].getAttribute(\"file-url\")).then(function(){\n $('#file_content').animate({scrollTop: ((page-1)*(841.89+29))}, 500);\n });\n }\n }\n }\n }\n updateProgressPoints(c_index);\n}", "function displayHeader(){\r\n\r\n var headerContent = '<nav class=\"navbar navbar-inverse navbar-fixed-top \">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <div class=\"navbar-header\"></div>'\r\n headerContent += ' <div id=\"navbar\" class=\"navbar-collapse collapse\"></div> <!--/.navbar -->'\r\n headerContent += ' <ul class=\"list-unstyled\">'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/index.html\"><strong>HOME</strong></a></li> '\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/functions.html\">FUNCTIONS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/primeNumGen.html\">CONTROL FLOW</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/debug.html\">DEGUB CODE</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/DOM.html\">DOM/DHTML</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/forms.html\">FORMS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 07</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 08</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 09</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 10</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 11</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 12</a></li></ul>'\r\n headerContent += ' </div>'\r\n headerContent += '</nav>'\r\n headerContent += '<!-- Main jumbotron -->'\r\n headerContent += ' <div class=\"jumbotron\">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <h2><span class=\"glyphicon glyphicon-king\" aria-hidden=\"true\"></span> Tyler Hunt\\'s <code>CS-2513 JavaScript Website</code> </h2>'\r\n headerContent += ' </div>'\r\n headerContent += ' </div>'\r\n headerContent += ' <!-- Main jumbotron -->'\r\n\r\n var pageHeader = document.getElementsByTagName('header');\r\n pageHeader[0].innerHTML = headerContent;\r\n}", "function Header(){\n return(\n <div className=\"list-books-title\">\n <h1>MyReads</h1>\n </div>\n );\n}", "function read_bibliography() {\n\t// Read the Bibliography notebook\n\tdocument.bibliography = {};\n var glob_present = false;\n\t// First, check to see if there is a <!--bibtex here\n\tvar bibtex = find_cell(\".*\", \"<!--bibtex\");\n\tif (bibtex != undefined) {\n var cell_text = bibtex.get_text()\n if (cell_text.includes(\"<!--bibtex*\")) {\n glob_present = true\n cell_text = cell_text.replace(/^<!--bibtex\\*/, \"\");\n } else {\n cell_text = cell_text.replace(/^<!--bibtex/, \"\");\n }\n\t cell_text = cell_text.replace(/-->\\s*$/, \"\");\n\t var json = parse_bibtex(cell_text);\n $.extend(document.bibliography, json);\n\t} else {\n\t // if not, read from Bibliography.ipynb in top-level directory:\n\t // Wait for result:\n\t $.ajaxSetup({ \"async\": false });\n\t $.getJSON(\"/api/notebooks/Bibliography.ipynb\", function(data) {\n\t\tvar index;\n\t\tvar cells;\n\t\tif (data.content.worksheets != undefined) {\n\t\t // We must be in a notebook of version < 4\n\t\t cells = data.content.worksheets[0].cells;\n\t\t} else {\n\t\t // We must be in a notebook of version >= 4\n\t\t cells = data.content.cells;\n\t\t}\n\t\tfor (index in cells) {\n\t\t var cell = cells[index];\n var json;\n\t\t var cell_text;\n\t\t if (cell.cell_type == \"markdown\") {\n\t\t\tcell_text = cell.source;\n\t\t } else if (cell.cell_type == \"raw\") {\n\t\t\tcell_text = cell.source;\n\t\t } else if (cell.cell_type == \"code\") {\n\t\t\tcell_text = cell.input;\n\t\t } else {\n\t\t\tcontinue;\n\t\t }\n\t\t if (cell_text != undefined) { // May have been an empty cell\n\t\t\tif (cell_text.match(/^<!--bibtex/)) {\n\t\t\t cell_text = cell_text.replace(/^<!--bibtex/, \"\");\n\t\t\t cell_text = cell_text.replace(/-->\\s*$/, \"\");\n\t\t\t json = parse_bibtex(cell_text);\n\t\t\t} else if (cell_text.match(/^<!--json/)) {\n\t\t\t json = parse_json(cell_text);\n\t\t\t} else {\n\t\t\t // skip this cell\n\t\t\t continue;\n\t\t\t}\n\t\t } else {\n\t\t\tcontinue;\n\t\t }\n // json is a dict keyed by KEY\n $.extend(document.bibliography, json);\n\t\t}\n\t });\n\t}\n return glob_present;\n }", "function displayHelp() {\t\n\tvar win;\n\tvar baseWindow = window;\n\t\n\t// get mother of all windows \n\twhile (baseWindow.opener) {\t\t\n\t\tbaseWindow = baseWindow.opener;\t\t\n\t}\n\n\t/* PNI, MDO:\n\t * Variable top.helpUrl is set on each page, \n\t * so we know what help page is to be open with certain page\t \n\t */\n\t\t\n\tvar url = top.helpUrl;\n\t\n\tif (url && (url != '')) {\n\n\t\twin = (window.open(url ,'help','menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=yes, status=yes,fullscreen=yes')).focus();\n\t\tbaseWindow.top.openedWindows.push(win);\n\t\t\n\t}\n}", "getHelp () {\n var editor = atom.workspace.getActiveTextEditor()\n\n if (editor && editor.getGrammar().scopeName === 'source.matlab') {\n var keyword = atom.workspace.getActiveTextEditor().getSelectedText()\n var htmlPath = path.join(MatlabHelpView.prototype.getHelpPath(), keyword + '.html')\n var docPath = path.join(MatlabHelpView.prototype.getHelpPath(), '..', 'index.html')\n\n if (!keyword) {\n atom.workspace.open('atom-matlab-editor://matlab-help').then((view) => {\n if (view instanceof MatlabHelpView) view.loadView(docPath, '')\n })\n } else if (fs.existsSync(htmlPath)) {\n atom.workspace.open('atom-matlab-editor://matlab-help').then((view) => {\n if (view instanceof MatlabHelpView) view.loadView(htmlPath, '')\n })\n }\n }\n }", "function SetHeaders(container) {\n let content = container.getElementsByClassName('content')\n let els = container.childNodes;\n console.log(content)\n if (content.length > 0){\n content = content[0]\n els = content.childNodes;\n }\n for (let i = 0; i < els.length; i++) {\n // Only apply this code block to h1, h2, etc\n if (typeof els[i].tagName === 'undefined' || els[i].tagName[0] != 'H' || els[i].tagName == 'HR' ) {\n continue;\n }\n\n // iterate\n let n = 1;\n\n // Test if page is open already in another tab\n anchor_id = els[i].id + '-anchor';\n if (document.getElementById(anchor_id)) {\n let loop = true;\n while (loop) {\n if (document.getElementById(anchor_id + '_' + n)) {\n n++;\n }\n else {\n break;\n }\n }\n anchor_id += '_' + n;\n }\n\n els[i].anchor_id = anchor_id;\n\n // Add link icon + a href to the header\n let href = window.location.origin + container.url + '#!' + els[i].id;\n els[i].innerHTML = '<a id=\"' + anchor_id + '\" class=\"anchor\" href=\"' + href + '\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\"></path></svg></a>\\n' + els[i].innerHTML\n\n // body onload is not called when staying within the page\n // we need to call the load_page() function manually\n let href_el = document.getElementById(anchor_id);\n href_el.onclick = function () {\n window.location.replace(this.href);\n load_page(0);\n }\n\n // Show/hide link icon\n els[i].onmouseover = function () {\n document.getElementById(this.anchor_id).style.visibility = 'visible';\n };\n els[i].onmouseleave = function () {\n document.getElementById(this.anchor_id).style.visibility = 'hidden';\n };\n }\n}", "function inspect() {\n\t$.get(sMWI).done(function(data) {\n\t\tvar $data = $(data);\n\t\tclearDocument();\n\t\t$doc.append('<button onclick=\"inspect()\">↻</button>');\n\t\t$doc.append($data);\n\t\t$('tr.link', $data).on('click', function(oEvent) {\n\t\t\tvar $row = $(this);\n\t\t\tvar $td0 = $('td:first', $row);\n\t\t\tinspectInstance($td0.html() | 0);\n\t\t});\n\t});\n}", "function loadModuleEditorPage() {\n\tMM.BC.TOKENS.getOneTimeToken(MM.BC.SITE.getSiteID(), function (oneTimeToken) {\n\t\tvar completeUrl = MM.BC.UTILS.generateURL(globals.targetURL, oneTimeToken);\n\n\t\tbrowseTo(completeUrl, true, function() {\n\t\t\tonModuleEditorLoad()\n\t\t}, false);\n\t}, function(status) {\n\t\t//MM.BC.log('loadModuleEditorPage##error##showCallFailed', true);\n\t\tshowCallFailed();\n\t}, true);\n}", "function createNotebook() {\n\n if (currentUser) {\n\n let sections = [];\n\n let section = {\n id: 0,\n title: 'Section 1',\n blocks: []\n }\n\n console.log(\"preview : \", preview);\n\n for (let element of preview) {\n\n switch (element.nodeName) {\n // So were going to save the section were working on, then create a new one..\n case \"H1\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H2\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H3\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"P\":\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n\n break;\n\n default:\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n }\n }\n sections.push({...section});\n\n // NOTE: This was supposed to be the cool part of the project but due the the way I have my DB\n // set up I couldnt figure out how to create all the sections separately with a loop of async calls.\n // due to time constraints I had to give up on this and only allow users to see the preview.\n\n createNotebookFromTemplate(searchTerm, currentUser._id, sections, dispatch);\n // dispatch({type:\"CREATE_NOTEBOOK\", sections: sections, title: searchTerm});\n // console.log(\"the title should be :\", searchTerm);\n history.push(\"/notebook/edit/id\");\n\n } else {\n // there is no current user.\n alert(\"please log in to create a notebook\");\n }\n }", "function displayHeader(){\r\n\r\n var headerContent = '<nav class=\"navbar navbar-inverse navbar-fixed-top \">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <div class=\"navbar-header\"></div>'\r\n headerContent += ' <div id=\"navbar\" class=\"navbar-collapse collapse\"></div> <!--/.navbar -->'\r\n headerContent += ' <ul class=\"list-unstyled\">'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/index.html\"><strong>HOME</strong></a></li> '\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/functions.html\">FUNCTIONS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/primeNumGen.html\">CONTROL FLOW</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/debug.html\">DEGUB CODE</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/DOM.html\">DOM/DHTML</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/forms.html\">FORMS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/objects.html\"> OBJECTS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP8</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP9</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP10</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP11</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP12</a></li></ul>'\r\n headerContent += ' </div>'\r\n headerContent += '</nav>'\r\n headerContent += '<!-- Main jumbotron -->'\r\n headerContent += ' <div class=\"jumbotron\">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <h2><span class=\"glyphicon glyphicon-king\" aria-hidden=\"true\"></span> Tyler Hunt\\'s <code>CS-2513 JavaScript Website</code> </h2>'\r\n headerContent += ' </div>'\r\n headerContent += ' </div>'\r\n headerContent += ' <!-- Main jumbotron -->'\r\n\r\n var pageHeader = document.getElementsByTagName('header');\r\n pageHeader[0].innerHTML = headerContent;\r\n}", "function loadGifticonContent() {\n if (curPage === 1) return;\n curPage = 1;\n $(\".content\").load('html/gifticon.html');\n $(\"#title\").html(\"<b>🔧 기프티콘</b>\");\n}", "function doGet() {\n return HtmlService.createTemplateFromFile('index').evaluate()\n .setTitle('NPL Block Information Station')\n}", "function openCaseList() {\n displayElement('leftPanel');\n}", "show() { return this.tellModule(\"show\") }" ]
[ "0.6456809", "0.62782466", "0.6004047", "0.5879495", "0.5603937", "0.54541606", "0.538017", "0.5379227", "0.53348196", "0.532251", "0.5318141", "0.53037447", "0.5293501", "0.52915037", "0.52251756", "0.52216583", "0.52136016", "0.52087945", "0.51802206", "0.51747674", "0.5134641", "0.50889826", "0.5081944", "0.50657994", "0.5028565", "0.5005222", "0.50045246", "0.50027347", "0.50019985", "0.4992037", "0.49915951", "0.4984076", "0.4959652", "0.49516082", "0.49449176", "0.49344712", "0.4931403", "0.49289346", "0.491384", "0.4911956", "0.49073064", "0.49024513", "0.49024165", "0.489934", "0.4899277", "0.48722348", "0.48710242", "0.48684925", "0.4866097", "0.48598734", "0.48582757", "0.48547655", "0.48546854", "0.48543528", "0.48466495", "0.4837486", "0.48336685", "0.4831714", "0.483102", "0.48270592", "0.4823167", "0.48220727", "0.48204133", "0.48160887", "0.4810037", "0.4801132", "0.4799365", "0.47890177", "0.47819334", "0.4780679", "0.47792622", "0.47705153", "0.47675043", "0.4762608", "0.47585905", "0.47550893", "0.4752727", "0.47518158", "0.4745297", "0.47419697", "0.47415078", "0.47345716", "0.47297698", "0.47245458", "0.47243243", "0.47183573", "0.47159618", "0.471098", "0.47089347", "0.4705039", "0.4698173", "0.4685065", "0.46826392", "0.4682408", "0.46813455", "0.4680463", "0.4680285", "0.46763474", "0.46654874", "0.46621245" ]
0.7192698
0
flashes the new notebook name when changing noteBook
function newNoteBookIntro(notebookHeading) { notebookHeading.style.color = "#f7faeb"; notebookHeading.style.transition = "all 0.1s ease-in-out"; notebookHeading.style.transform = "scale(1.1)"; setTimeout(() => { notebookHeading.style.color = "#32292f"; notebookHeading.style.transform = "scale(1)"; }, 100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayCurrentNoteBook() {\n let currentNotebookHeading = document.getElementById(\"current-notebook\");\n currentNotebookHeading.innerText = openNotebook.toUpperCase();\n newNoteBookIntro(currentNotebookHeading);\n}", "function addNewNotebook()\n{\n var ui = DocumentApp.getUi();\n ui.alert(\"To create a notebook, we're going to need the following settings:\\n\" +\n \" + short title \\n\" +\n \" + long title (Optional. Default is to copy the short title's value over) \\n\" +\n \" + pick the directory to create your notebook in. (not implemented, just creates in root rn.)\\n\" +\n \" + pick a cover image (upload, select existing image, or leave it blank) \\n\");\n \n var shortName = ui.prompt(\"Enter short name of your notebook\", ui.ButtonSet.OK);\n var longName = ui.prompt(\"Enter long name of your notebook (Optional)\", ui.ButtonSet.OK_CANCEL);\n //pick a directory one day?\n //pick an image one day .. too complicated now and I'm too lazy.\n \n var newBook = new Notebook(longName, shortName, longName, DriveApp.getRootFolder().getId(), \"\", \"\", \"\");\n \n newBook = makeNewNotebookTree(newBook);\n newBook = makeNewMasterNotebook(newBook,0,0);\n //save for later\n var props = PropertiesService.getUserProperties();\n props.setProperty(newBook.iD, JSON.stringify(newBook)); \n props.setProperty(\"CurrentNotebook\", newBook.iD);\n //TODO need to store notebooks in a list of notebooks\n //TODO make a function to add a notebook to the list\n //\n}", "function saveNotebook(notebookFileName) {\n\tif (!desktop) {\n\t var notebookFullPath = $('#' + notebookFileName).data('fullpath');\n\t writeFile(notebookFullPath, $('#txtCache-' + notebookFileName).text(), function(){});\t\t\n\t}\n }", "get name() {\n return 'notebook';\n }", "function openNotebook($item){\r\n $('.notes-sidebar .notes-sidebar-title h3').html( $item.text() + '<a href=\"#\" class=\"delete-notebook\"><i class=\"fa fa-trash-alt\"></i></a>');\r\n $('.sidebar-menu .sidebar-sub-menu li').removeClass('selected');\r\n $item.addClass('selected');\r\n\r\n currentNotebook = $item.find('a').attr('data-id');\r\n loadNotes(currentNotebook);\r\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 initNotebook(name, date) {\n\t//Create notebook object\n\tvar notebook = new Notebook(name, date);\n\n\t//Create file for notebook object\n\twriteNotebookToMongo(notebook);\n\n\t//Add to appropriate places\n\taddToNotebookList(name);\n\n\treturn notebook;\n}", "function trackRename(){\n oldRename = Notebook.__proto__.rename\n Notebook.__proto__.rename = function(){\n new_name = arguments[0]\n\n // POST request to rename files\n // rename folder\n // rename db\n // rename ipynb\n\n return oldRename.apply(this, arguments)\n }\n }", "function makeNewMasterNotebook(notebook, imageFileID, humanName) {\n //validate\n notebook.shortName = notebook.shortName || \"Notebook\";\n notebook.longName = notebook.longName || notebook.shortName || \"Notebook\";\n //image can be nothing\n humanName = humanName || Session.getActiveUser().getEmail();\n \n var masterFolder = DriveApp.getFolderById(notebook.masterFolderId);\n Logger.log(masterFolder);\n \n var mDoc = DocumentApp.create(notebook.shortName);\n notebook.masterNotebookId = mDoc.getId();\n var docFile = DriveApp.getFileById(notebook.masterNotebookId );\n \n moveFile(docFile, masterFolder, DriveApp.getRootFolder());\n \n var title = mDoc.getBody().appendParagraph(notebook.longName);\n title.setHeading(DocumentApp.ParagraphHeading.TITLE);\n \n var subtitle = mDoc.getBody().appendParagraph(\"by: \" + humanName);\n subtitle.setHeading(DocumentApp.ParagraphHeading.SUBTITLE);\n \n if(imageFileID)\n {\n var blob = DriveApp.getFileById(imageFileID).getBlob();\n mDoc.getBody().appendImage(blob);\n }\n \n return notebook; \n}", "function changeNote() {\n editor.value = window.localStorage.getItem(notes.value);\n}", "function Notebook() {\n loadNoteNamesList();\n\n /*\n * Registering event listeners\n */\n $('#sign-out').click(function() {\n utils.signOut('./');\n });\n $('#create-note').click(function() {\n showCreateNoteModal();\n });\n\n /**\n * Load the notes list from the server\n * Display it in the UI\n *\n * @private\n */\n function loadNoteNamesList() {\n var notesList = $('#notes-list');\n utils.showLoadingOverlay(notesList);\n $.ajax({\n type: 'GET',\n url: constants.API_URI + 'notes',\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n var notes = response.notes;\n var columns = ['Note Name', 'Actions'];\n\n // Creating the 2D data array for the notes list table\n var data = [];\n $.each(notes, function(index, note) {\n var row = [];\n row.push('<span class=\"note-name\">' + note + '</span>');\n row.push(\n '<a href=\"note.html?note=' + note + '\" class=\"btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-view fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">View</span>' +\n '</a>' +\n '<a class=\"delete-note btn padding-reduce-on-grid-view\">' +\n '<span class=\"fw-stack\">' +\n '<i class=\"fw fw-ring fw-stack-2x\"></i>' +\n '<i class=\"fw fw-delete fw-stack-1x\"></i>' +\n '</span>' +\n '<span class=\"hidden-xs\">Delete</span>' +\n '</a>'\n );\n data.push(row);\n });\n\n var listTable = utils.generateListTable(columns, data,\n { ordering: false, searching: false },\n { 'Actions' : 'text-right' }\n );\n\n // Registering event listeners to the list table\n listTable.find('.delete-note').click(function(event) {\n showDeleteNoteModal(\n $(event.target).closest('tr').find('.note-name').html()\n );\n });\n\n notesList.html(listTable);\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n\n }\n utils.hideLoadingOverlay(notesList);\n },\n error: function() {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n utils.hideLoadingOverlay(notesList);\n }\n });\n }\n\n /**\n * Show the create note modal\n *\n * @private\n */\n function showCreateNoteModal() {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalBody = $('<div >');\n var noteNameInput = $('<input type=\"text\" class=\"form-control form-control-lg\" />');\n var noteNameInputContainer = $('<div class=\"pull-left\"><div class=\"form-group col-sm-12\">');\n var modalFooter = $('<div class=\"pull-right\">');\n var createButton = $('<button type=\"button\" class=\"btn btn-primary\">Create</button>');\n\n // Appending to create the modal content structure\n noteNameInputContainer.append(noteNameInput);\n modalBody.append(noteNameInputContainer);\n modalFooter.append(createButton);\n\n var modal = utils.showModalPopup('Enter a name for your new note', modalBody, modalFooter);\n\n // Registering event listeners for the modal window\n createButton.click(function() {\n createNote(noteNameInput.val());\n modal.modal('hide');\n });\n }\n\n /**\n * Create the Note with the name specified\n *\n * @private\n * @param {string} name Name of the note to be created\n */\n function createNote(name) {\n if (name.indexOf(' ') > 0) {\n utils.handlePageNotification('error', 'Error',\n 'Note name cannot contain white spaces'\n );\n } else {\n $.ajax({\n type: 'POST',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n window.location.href = 'note.html?note=' + name;\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n }\n\n /**\n * Show the delete note confirmation modal\n *\n * @private\n * @param noteName The name of the note to be deleted\n */\n function showDeleteNoteModal(noteName) {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalFooter = $('<div class=\"pull-right\">');\n var deleteButton = $('<button type=\"button\" class=\"btn btn-primary\">Delete</button>');\n\n // Appending to create the modal content structure\n modalFooter.append(deleteButton);\n\n var modal = utils.showModalPopup(\n 'Do you want to delete ' + noteName + ' ?', $(), modalFooter\n );\n\n // Registering event listeners for the modal window\n deleteButton.click(function() {\n deleteNote(noteName);\n modal.modal('hide');\n });\n }\n\n /**\n * Delete the note deleted\n *\n * @private\n * @param {string} name The name of the note to be deleted\n */\n function deleteNote(name) {\n $.ajax({\n type: 'DELETE',\n url: constants.API_URI + 'notes/' + name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n utils.handlePageNotification('info', 'Info', 'Note successfully deleted');\n loadNoteNamesList();\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n }\n });\n }\n} // End of Notebook prototype constructor", "function openNote($item, notebook){\r\n if($item.closest('.note-item').attr('data-notebook')){\r\n notebook = $item.closest('.note-item').attr('data-notebook');\r\n }\r\n let noteContent = getContent(notebook, $item.attr('data-id'));\r\n $('.notes-list-container .note-item').removeClass('selected');\r\n $item.addClass('selected');\r\n editorNotebook = notebook;\r\n editorNote = $item.attr('data-id');\r\n editor.setContents(noteContent);\r\n }", "function addToNotebookList(name){\n\tg_notebookList.push(name);\n\tg_notebookList.sort();\n//\twriteFile(getDBFilename(\"notebooks\"),\n//\t\tJSON.stringify(g_notebookList));\n}", "function globalUpdate() {\n document.querySelectorAll(\".note\").forEach((e) => e.remove()); //cleares window\n moveSelected(false);\n\n allNotes.forEach((element) => {\n if (element.titleOfNoteBook == openNotebook && element.delete != true) {\n main.prepend(element.noteElement);\n }\n });\n}", "function displayNotebook($xmlDoc, xmlData, notebookFullPath) {\n var notebookFileName = getFileName(notebookFullPath, false);\n if ($('#navbar a:contains(' + notebookFileName + ')').length > 0) {\n alert('Notebook \"' + notebookFileName + '\" already opened.');\n }\n else {\n // get the root node, i.e. <notebook>\n var rootNode = $xmlDoc.find(\"notebook\");\n \n // create a new tab\n $('#navbar').find(\"*\").andSelf().each(function() { // remove the JQM auto-init classes\n $(this).removeClass(function(i, cn){\n var matches = cn.match (/ui-[\\w\\-]+/g) || [];\n return (matches.join (' '));\n });\n if ($(this).attr(\"class\") == \"\") {\n $(this).removeAttr(\"class\");\n }\n });\n $('#navbar').navbar(\"destroy\");\n $('#navbar a').removeClass('current');\n $('#navbar ul').append('<li><a id=\"' + notebookFileName + '\" href=\"#\" data-role=\"button\" rel=\"external\" class=\"current\" data-fullpath=\"' + notebookFullPath + '\">' + notebookFileName + '</a></li>');\n var tabHtml = '<div id=\"' + notebookFileName + 'Tab\" class=\"tab\"><textarea id=\"txtCache-' + notebookFileName + '\" data-autogrow=\"false\" rows=\"2\"';\n if (!desktop) {\n tabHtml += ' style=\"display: none\"';\n }\n tabHtml += '></textarea></div>';\n $('#tabs').append(tabHtml);\n if ($('#dummyLi').length) { $('#dummyLi').remove(); };\n $('#navbar').navbar();\n $('#txtCache-' + notebookFileName).text(xmlData);\n\t if (desktop) {\n\t $('#txtCache-' + notebookFileName).width($(window).width());\n\t\t$('#' + notebookFileName + 'Tab').prepend('<div style=\"color:red\">Before closing the browser: Copy the text below and save it manually!</div>');\n\t }\n\t \n // construct the collapsible from the xml\n $.each(rootNode, function(key, value) { \n getEntry(value, $('#' + notebookFileName + 'Tab'), notebookFileName);\n });\n $('[data-role=\"collapsible\"]').collapsible();\n MathJax.Hub.Queue(['Typeset', MathJax.Hub, notebookFileName + 'Tab']);\n \n // set currentTabEntryId to refer to the first entry \n currentTabEntryId = $('#' + notebookFileName + 'Tab .entry:first').attr('id');\n // scroll to top\n $(window).scrollTop(0);\n // display the tab\n showTab($('#' + notebookFileName + 'Tab'), $('#' + notebookFileName));\n newNotebookIsJustOpened = true; \n }\n }", "function openNotebook(notebookFullPath) {\n\tif (desktop) {\n\t\t$.ajax({\n\t\t type: \"GET\",\n\t\t url: notebookFullPath,\n\t\t dataType: \"xml\",\n\t\t success: function(xmlData) {\n\t\t\tvar $xmlDoc = $(xmlData);\n\t\t\tdisplayNotebook($xmlDoc, xmlData, notebookFullPath);\n\t\t\tvar notebookFileName = getFileName(notebookFullPath, false);\n\t\t\t$('#txtCache-' + notebookFileName).text((new XMLSerializer()).serializeToString(xmlData));\n\t\t }\n\t\t});\t\t\n\t}\n\telse {\n\t\treadFile(notebookFullPath, function(xmlData) {\n\t\t var xmlDoc = $.parseXML(xmlData);\n\t\t var $xmlDoc = $(xmlDoc);\n\t\t displayNotebook($xmlDoc, xmlData, notebookFullPath);\n\t\t});\t\t\n\t}\n }", "function HeadingChange(){\n cl(document.title = \"This is new title\")\n}", "function existingNotebookName(name){\n\t// Checks if the notebook already exists.\n\tvar inList = g_notebookList.indexOf(name);\n\tif(inList >= 0){\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function handlenoteEdit() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n editnote(currentnote);\n }", "GETNOTEBOOKS (state, notebooks) {\n state.notebooks = notebooks\n }", "function setRankToNote( ranksName )\n{\n\tranksUserNote = document.getElementById('js-usernote');\n\tif ( ranksUserNote && ranksUserNote.children.length == 0 )\n\t{\n\t\tranksNote = ranksUserNote.innerHTML;\n\t\tranksIndex = ranksNote.lastIndexOf('#');\n\t\tif ( ranksIndex > -1 )\n\t\t{\n\t\t\t// some name already in the note\n\t\t\tranksNote = ranksNote.substring( 0, ranksIndex );\n\t\t\tif ( ranksName != null )\n\t\t\t{\n\t\t\t\tdocument.getElementById('js-usernote').innerHTML = ranksNote + \" #\" + ranksName;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdocument.getElementById('js-usernote').innerHTML = ranksNote;\n\t\t\t}\n\t\t\t_$.fireEvent(document.getElementById('js-usernote'), 'click');\n\t\t\t_$.fireEvent(document, 'click');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no name at all\n\t\t\tif ( ranksName != null )\n\t\t\t{\n\t\t\t\tdocument.getElementById('js-usernote').innerHTML = ranksNote + \" #\" + ranksName;\n\t\t\t}\n\t\t}\n\t}\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}", "function updateNote(worker, note) {\n if (note != null) {\n note = datastore.updateNote(note);\n worker.port.emit(\"NoteUpdated\", note);\n }\n}", "function changeDocumentTitle( title )\n{\n document.title = title;\n}", "function resetClipboardNote() {\n if ($clip_note) {\n $clip_note.text('');\n toggleHidden($clip_note, true);\n }\n }", "function loadNotebooks(){\r\n notebooks = getNotebooks();\r\n $('.sidebar-menu-list.sidebar-sub-menu').html(\"\");\r\n $.each(notebooks, function(id, notebook) {\r\n $('.sidebar-menu-list.sidebar-sub-menu').prepend(`<li><a href=\"#\" data-id=\"${id}\">${notebook.title}</a></li>`);\r\n });\r\n }", "function print_note()\n {\n var list = me.notebooks[me.selected_list],\n uid = me.selected_note ? me.selected_note.uid : 0;\n\n if (list && uid) {\n rcmail.open_window(rcmail.url('print', {_uid: uid, _list: list.id}), true, true);\n }\n }", "function NoteSave(){\n\t\tvar noteData;\n\t\tvar newNote = $(\".bootbox-body textarea\").val().trim();\n\t\tif(newNote){\n\t\t\tnoteData = {\n\t\t\t\t_id: $(this).data(\"article\")._id,\n\t\t\t\tnoteText: newNote\n\t\t\t};\n\t\t\t$.post(\"/scrape/notes\", noteData).then(function(){\n\t\t\t\tbootbox.hideAll();\n\t\t\t});\n\t\t}\n\t}", "function newNote() {\n document.getElementById('note_area').value = '';\n document.getElementById('note_area').readOnly = false;\n document.getElementById('btnDelNote').disabled = true;\n document.getElementById('btnEditNote').disabled = true;\n\n oSelectedNote = null;\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 }", "updateName(name) {\n this.setState({note_name: name})\n }", "function addNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\tappendNote(tr, defaultNote);\r\n\taddState();\r\n\t\r\n\trefreshNotes();\r\n}", "function changeTitle() {\n document.title = 'Star Wars';\n }", "handleDisplayEditBookmark(bookmark) {\n\t\tthis.props.updateBookmark(bookmark);\n }", "function Note(type) {\n this.noteType = type;\n this.date = addDate();\n this.titleOfNoteBook = openNotebook;\n this.addingFromLocalStorage = function (\n date,\n savedNoteBookPlacment,\n savedTextarea\n ) {\n if (date != null) {\n this.date = date;\n }\n if (savedNoteBookPlacment != null) {\n this.titleOfNoteBook = savedNoteBookPlacment;\n } else {\n this.titleOfNoteBook = openNotebook;\n }\n if (savedTextarea != \"\" && type == 1) {\n this.noteElement.getElementsByClassName(\n \"textArea\"\n )[0].textContent = savedTextarea;\n }\n };\n\n this.noteElement = createNote(this, type);\n main.prepend(this.noteElement);\n\n this.checkBox = document.createElement(\"input\");\n this.checkBox.type = \"checkbox\";\n this.checkBox.style.display = \"none\";\n this.checkBox.className = \"checkbox\";\n this.noteElement.appendChild(this.checkBox);\n this.delete = false;\n\n this.getNoteLi = function () {\n if (this.noteType == 2) {\n let arrayOfInnerText = [];\n let listItemsArray = this.noteElement.getElementsByClassName(\n \"itemOfList\"\n );\n\n for (let index = 0; index < listItemsArray.length; index++) {\n arrayOfInnerText.push(listItemsArray[index].innerText);\n }\n arrayOfInnerText.toString();\n return arrayOfInnerText;\n }\n };\n\n //om du kan mata varje string som newNext från local sätter denna dit dom en i taget\n this.setNewLi = function (newText) {\n if (this.noteType == 2) {\n let node = this.noteElement.getElementsByClassName(\"list\");\n let listItemContainer = document.createElement(\"div\");\n listItemContainer.className = \"list-item-container\";\n let node_li = document.createElement(\"li\");\n node_li.contentEditable = \"true\";\n node_li.className = \"itemOfList\";\n let textnode = document.createTextNode(newText);\n let span = document.createElement(\"SPAN\");\n let txt = document.createTextNode(\"\\u00D7\");\n span.className = \"remove-list-item\";\n span.addEventListener(\"click\", () => {\n listItemContainer.remove();\n saveNotesToLocalStorage();\n });\n span.appendChild(txt);\n node_li.appendChild(textnode);\n listItemContainer.appendChild(node_li);\n listItemContainer.appendChild(span);\n node[0].appendChild(listItemContainer);\n return node;\n }\n };\n this.getNoteText = function () {\n if (this.noteType == 1) {\n return this.noteElement.getElementsByClassName(\"textArea\")[0].textContent;\n }\n };\n this.setTitleOfNoteBook = (title) => {\n this.titleOfNoteBook = title;\n };\n\n this.checkBoxVisible = function (choise) {\n if (choise == true) {\n return (this.checkBox.style.display = \"block\");\n } else if (choise == false) {\n return (this.checkBox.style.display = \"none\");\n }\n };\n\n this.removeNote = function () {\n this.noteElement.remove();\n this.delete = true;\n clearDeleted();\n saveNotesToLocalStorage();\n };\n}", "function updateNote(e){\n let note = notes[e.path[1].classList[0].split(\"id\")[1]];\n switch(e.target.name){\n case \"title\":\n note.title = e.target.value;\n break;\n case \"content\":\n note.content = e.target.value;\n break;\n case \"color\":\n e.path[1].style.backgroundColor = e.target.value;\n note.color = e.target.value;\n break;\n }\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function createNoteByClick() {\n var newDate = new Date();\n var noteId = newDate.getTime();\n bq.setAttribute(\"id\", \"note-\" + noteId);\n bq.innerText = null;\n localStorage.setItem(noteId, \"\");\n bq.focus();\n}", "_saveDisk ({ notebookPath, note }) {\n const originalName = note.name;\n note.name = `${slug(note.title)}.md`;\n\n let promises = Promise.resolve();\n\n // ensure has a uniqure name for new files or in case it has changed the name\n if (!note.id || originalName !== note.name) {\n promises = promises\n .then(() => this._generateUniqueNameDisk({ notebookPath, note, originalName }))\n .then((newName) => note.name = newName);\n }\n\n // renames in the disk in case it has changed the name\n if (note.id && originalName !== note.name) {\n promises = promises\n .then(() => this._renameDisk({ notebookPath, note, originalName }));\n }\n\n // saves file in the disk\n return promises.then(() => {\n note.filename = path.join(notebookPath, note.name);\n return denodeify(fs.writeFile).call(fs, note.filename, note.content);\n });\n }", "function editnotes(){\n\t\t\tdocument.getElementById(\"notes\").readOnly = false;\n\t\t\t\n\t\t\tdocument.getElementById(\"btnEditNotes\").className += \" hidden\";\n\t\t\tdocument.getElementById(\"btnSaveNotes\").className = \"\";\n\t\t}", "function createNoteBook(inputFromLocalStorage) {\n\n\n let inputTitle = document.getElementsByClassName(\"noteBookTitle\")[0].value;\n if (inputFromLocalStorage != null) {\n \n inputTitle = inputFromLocalStorage;\n }\n\n let changeInputBoxApparance = document.getElementsByClassName(\n \"noteBookTitle\"\n )[0]; \n\n if (inputTitle === \"\") {\n \n changeInputBoxApparance.style.border = \"solid red 3px\";\n } else {\n changeInputBoxApparance.style.border = \"solid 1px\";\n\n existingNoteBooks.push(new NoteBookObject(inputTitle));\n document.getElementsByClassName(\"noteBookTitle\")[0].value = \"\";\n } \n\n updateCurrentNoteBooks(); \n saveNoteBooksToLocalStorage();\n}", "afficher(note){\n\t\tdocument.querySelector(\"#currentNoteView\").innerHTML = this.convertir(note);\n\t}", "function newNote() {\n const note = prompt('Name of note?');\n window.localStorage.setItem(note, '');\n\n const noteElem = document.createElement('option');\n noteElem.innerText = note;\n notes.insertBefore(noteElem, notes.firstChild);\n\n // Focus this note\n notes.value = note;\n changeNote();\n}", "function addNote(worker, note) {\n if (note != null) {\n note = datastore.createNote(note);\n worker.port.emit(\"NoteAdded\", note);\n }\n}", "function save_note(beforesave)\n {\n if (!me.selected_note) {\n return false;\n }\n\n var savedata = get_save_data();\n\n // run savedata through the given callback function\n if (typeof beforesave == 'function') {\n beforesave(savedata);\n }\n\n // add reference to old list if changed\n if (me.selected_note.list && savedata.list != me.selected_note.list) {\n savedata._fromlist = me.selected_note.list;\n }\n\n // do some input validation\n if (savedata.title == '') {\n rcmail.alert_dialog(rcmail.gettext('entertitle', 'kolab_notes'), function() {;\n $('.notetitle', rcmail.gui_objects.noteviewtitle).focus();\n });\n\n return false;\n }\n\n if (check_change_state(savedata)) {\n rcmail.lock_form(rcmail.gui_objects.noteseditform, true);\n saving_lock = rcmail.set_busy(true, 'kolab_notes.savingdata');\n rcmail.http_post('action', {_data: savedata, _do: savedata.uid ? 'edit' : 'new'}, true);\n }\n else {\n rcmail.display_message(rcmail.get_label('nochanges', 'kolab_notes'), 'notice');\n }\n }", "function markBookEmoji() {\n console.log(\"Book Emoji was clicked on\");\n emoji_to_use = 'book.png';\n }", "function delegate_note(action,data) {\n\tswitch(action) {\n\t\tcase \"get\":\n\t\t\tif(haswebsql) {\n\t\t\t\tglossdb.data.getnote(data.title,data.target);\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tglossdb.getnote(data.title,data.target);\n\t\t\t}\n\t\tbreak;\n\t\tcase \"show\":\n\t\t\t// get references to EXT form elements for notes\n\t\t\tvar fta = Ext.getCmp(\"notetextarea\");\n\t\t\tvar ftitle = Ext.getCmp(\"notetitle\");\n\t\t\tvar ftarget= Ext.getCmp(\"notetarget\"); \n\t\t\tvar flabel = Ext.getCmp(\"notelabel\");\n\t\t\t// get note window object\n\t\t\tvar notewindow = Ext.getCmp(\"notewindow\");\n\t\t\t// set the values of the form fields to the new values\n\t\t\tfta.setValue(data.notes);\n\t\t\tftitle.setValue(data.title);\n\t\t\tftarget.setValue(data.target);\n\t\t\tflabel.setText(data.title);\n\t\t\t// show the window\n\t\t\tnotewindow.show();\n\t\tbreak;\n\t\tcase \"delete\":\n\t\t\tif(haswebsql) {\n\t\t\t\tglossdb.data.deletenote(data.title,data.target);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tglossdb.deletenote(data.title,data.target);\n\t\t\t}\n\t\t\tshowMessage(\"notedelete\");\n\t\tbreak;\n\t\tcase \"save\":\n\t\t\t// get values of form fields\n\t\t\tvar notes = Ext.getCmp(\"notetextarea\").getValue();\n\t\t\tvar title = Ext.getCmp(\"notetitle\").getValue();\n\t\t\tvar target= Ext.getCmp(\"notetarget\").getValue(); \n\t\t\t// get reference to notes window\n\t\t\tvar notewindow = Ext.getCmp(\"notewindow\");\n\t\t\t// hide notes window\n\t\t\tnotewindow.hide();\n\t\t\t// show add message\n\t\t\tif(haswebsql) {\n\t\t\t\tglossdb.data.savenote(title,target,notes);\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tglossdb.savenote(title,target,notes);\t\n\t\t\t}\n\t\tbreak;\n\t}\n}", "function addNote(newNote) {\n setNotes(prevNotes => {\n return [...prevNotes, newNote];\n });\n }", "function toggleBookmark () {\n if (currentBookmark) {\n browser.bookmarks.remove(currentBookmark.id)\n } else {\n browser.bookmarks.create({title: currentTab.title, url: currentTab.url})\n }\n}", "function changeNote(event){\n let el = event.target;\n let id=el.parentNode.id;\n let elInData=data.find(function(element){return element.id==id;});\n\n if(el.classList.contains(\"markBut\")) { \n elInData.isMark=!elInData.isMark;\n }\n else if(el.classList.contains(\"delBut\")) {\n position =data.indexOf(elInData);\n if ( ~position ) data.splice(position, 1);\n }\n else if(el.classList.contains(\"textChangeNote\")){\n return;\n }\n else if(el.classList.contains(\"penBut\")) {\n \n if( noteChanging==null)\n { \n let noteTextEl=el.parentNode.querySelector('.noteText');\n let textarea=document.createElement('textarea');\n textarea.className=\"form-control textChangeNote\";\n textarea.value=noteTextEl.innerHTML;\n noteTextEl.innerHTML=null;\n noteTextEl.appendChild(textarea);\n noteChanging=noteTextEl;\n \n el.classList.remove('btn-danger');\n el.classList.add('btn-success'); \n return;\n }\n else{\n \n elInData.text=noteChanging.querySelector('.textChangeNote').value;\n el.classList.remove('btn-success');\n el.classList.add('btn-danger');\n noteChanging=null;\n }\n\n }\n\n localStorage.setItem('arrNotes',JSON.stringify(data));\n refresh();\n}", "function changeNote() {\n var sNote = document.getElementById('note_area').value;\n document.getElementById('note_area').value = sNote.toUpperCase();\n document.getElementById('btnSaveNote').disabled = sNote.length == 0;\n}", "function noteOff(noteNumber) { }", "function noti() {\n note.style.display = \"none\"\n}", "function addNote(note) {\r\n setListNote((prevNote) => {\r\n return [...prevNote, note];\r\n });\r\n }", "patch_note_content(route, nbid, update) { //#ADJUST TO NOTEBOOKS\n const url = this.baseUrl + route + \"/\" + nbid\n return client.fetch(url, {\n method: \"PATCH\",\n body: json(update)\n })\n .then(response => response.json())\n }", "hideNote(input) {\n let name = input.attr('name');\n\n if(name === 'name'){\n this.jQueryNotes.nameShort.addClass('hidden');\n this.jQueryNotes.nameLong.addClass('hidden');\n } else {\n this.jQueryNotes[name].addClass('hidden');\n }\n\n }", "function makeUrlChangeShowNote() {\n window.addEventListener(\"hashchange\", showNoteForCurrentPage);\n }", "function doLogNote(note) {\n if(BD18.noteTimeout !== null) {\n clearTimeout(BD18.noteTimeout);\n }\n var msg = BD18.welcomename + \": \" + note;\n $('#lognote').text(msg);\n BD18.noteTimeout = setTimeout(function() {\n $('#lognote').text(\"\");\n BD18.noteTimeout = null;\n },\"20000\");\n}", "function update() {\n\t\tUtil.txt.setLibraryBrowser( Util.fs.getLibraries() );\n\t\tUtil.txt.setFileBrowser( Util.fs.getNotes(currentLib) );\n\t\tUtil.txt.setInputText( Util.fs.getNoteContent(currentLib,currentNote) );\n\t}", "function setNote() {\n var row = oNotesTable.row('.selected').data();\n var oNote = oData.jsFormula.getNote(row[0]);\n oSelectedNote = oNote;\n\n document.getElementById('note_area').value = oNote.sNote;\n document.getElementById('btnEditNote').disabled = false;\n document.getElementById('btnDelNote').disabled = false;\n document.getElementById('note_area').readOnly = true;\n}", "function updatePreviewWithNote(sender, paeNote) {\r\n // console.log(\"key pressed is \" + paeNote)\r\n plaineEasieCodes.push(paeNote)\r\n updateNotesSVG()\r\n}", "function updateNotifications(number) {\n $(\"#notificationNumber\").text(number);\n $(\"#notificationWindow\").text(number + \" new personal notes\");\n }", "function cancelNote(){\r\n\twindow.arguments[0].saveNote = false;\r\n\treturn true;\r\n}", "function setNotes(e) {\n\n\tvar cursor = e.target.result;\n\n\tif (cursor) {\n\n\t\tconsole.log(cursor.value);\n\t\tpopupPage.addNoteToView(cursor.value);\n\n\t\tcursor.continue();\n\n\t}\n\n}", "function _event_contact_person_note(e){\n try{\n var note_win = Ti.UI.createWindow({\n title:'Edit Note',\n url:self.get_file_path('url', 'base/edit_textarea_field.js'),\n content:_client_contact_note,\n source:'edit_client_contact_note'\n });\n Titanium.UI.currentTab.open(note_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_note');\n return;\n }\n }", "handleChange(e) {\n e.persist();\n let myObj = Object.assign({}, this.state.notebook);\n myObj[e.target.name] = e.target.value;\n this.setState({notebook:myObj});\n this.trueChange(e.target.name, e.target.value)\n }", "function editNote(index){\n let saveindex = document.getElementById('saveindex')\n let saveBtn = document.getElementById('saveBtn')\n let addBtn = document.getElementById('addBtn')\n saveindex.value = index;\n let notes = localStorage.getItem('notes');\n let notesObj = JSON.parse(notes);\n addTitle.value = notesObj[index][0];\n addTxt.value = notesObj[index][1];\n addBtn.style.display=\"none\";\n saveBtn.style.display=\"block\";\n }", "function addNote(note) {\n setNotesList(prevList => { return [...prevList, note] });\n }", "function edit_note(note_id, note_name) {\n fetch(`${note_name}/edit/${note_id}`)\n .then(response => response.json())\n .then(notes => {\n Array.prototype.forEach.call(notes.task, note => {\n document.querySelector(`#edit-note-${note.id}`).style.display == 'block'\n document.getElementById(`edit-note-${note.id}`).innerHTML = `<form id=\"edit_note\"> <textarea rows=\"5\" cols=\"45\" id=\"newnote\">${note.note}</textarea> <br> <button class=\"save_edit btn btn-dark\" type=\"submit\"> Save </button></form>`;\n\n document.querySelector('#edit_note').onsubmit = function() {\n fetch(`${note_name}/edit/${note_id}`, {\n method: 'PUT',\n body: JSON.stringify({\n note: document.querySelector('#newnote').value\n })\n })\n }\n })\n })\n }", "function saveNote() {\n window.localStorage.setItem(notes.value, editor.value);\n}", "function updateCurrentNoteBooks() {\n document.querySelectorAll(\".dropdown-item\").forEach((e) => e.remove()); //cleares window\n document.querySelectorAll(\".noteBookFlex\").forEach((e) => e.remove()); //cleares window\n\n let getDropdownMenu = document.getElementsByClassName(\"dropdown-menu\")[0];\n\n existingNoteBooks.forEach((element) => {\n let flexBox = document.createElement(\"div\");\n let removeNoteBookButton = document.createElement(\"button\");\n let buttonImage = document.createElement(\"img\");\n let notebook = document.createElement(\"button\"); // makes the entie title a button\n\n flexBox.className = \"noteBookFlex\";\n notebook.className = \"dropdown-item\";\n removeNoteBookButton.className = \"removeNoteBookButton\";\n buttonImage.src = \"media/x.svg\";\n notebook.textContent = element.getTitle(); //gets the title variable in noteBookObject\n notebook.style.fontFamily = \"Cursive\";\n\n getDropdownMenu.appendChild(flexBox);\n removeNoteBookButton.appendChild(buttonImage);\n\n if (element.titleOfObject != \"Dashboard\") {\n //checks if element is Dashboard so it wont get removed\n\n flexBox.appendChild(removeNoteBookButton);\n } else {\n notebook.classList.add(\"Dashboard\");\n }\n\n flexBox.appendChild(notebook);\n\n notebook.addEventListener(\"click\", function () {\n // used to call a certain book to display its notes\n\n openNotebook = element.titleOfObject;\n lastVisitedNoteBook(element.titleOfObject);\n displayCurrentNoteBook();\n globalUpdate();\n });\n\n removeNoteBookButton.addEventListener(\"click\", function () {\n moveToDashboard(element);\n if (element.titleOfObject == openNotebook) {\n openNotebook = \"Dashboard\";\n localStorage.setItem(\"lastVisitedNoteBook\", \"Dashboard\");\n }\n removeNoteBooks(element);\n displayCurrentNoteBook();\n globalUpdate();\n });\n });\n}", "function newNote(gameState, text) {\n thisGameState.notes.push(text);\n socket.emit(\"save\", gameState);\n}", "get contentType() {\n return 'notebook';\n }", "function note_save()\n {\n var note_obj;\n // grab the note typed into the input box\n var new_note = $(\".bootbox-body textarea\").val().trim();\n\n if (new_note)\n {\n note_obj =\n {\n _id: $(this).data(\"headline\")._id,\n text: new_note\n };\n $.post(\"/api/notes\", note_obj).then(function()\n {\n // on success, close the modal\n bootbox.hideAll();\n });\n }\n }", "function addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}", "function noteChange(beatNum, noteNum) {\n notes[beatNum][noteNum] = !notes[beatNum][noteNum];\n}", "function handleNoteChanged(changed) {\n \n // default changed value is 'true'\n changed = typeof changed !== 'undefined' ? changed : true;\n \n // save the initial values if the note is unchanged\n if (!changed) {\n\tvar $noteTitle = $(\"#note-title\");\n\t$noteTitle.data('initial-value', $noteTitle.val());\n\tvar $noteText = $(\"#note-area\");\n\t$noteText.data('initial-value', $noteText.val());\n }\n \n // update the state of the save button\n $(\"#save-button\").attr(\"disabled\", !changed);\n noteChanged = changed;\n}", "function editNote() {\n if (oSelectedNote != null) {\n document.getElementById('note_area').readOnly = false;\n document.getElementById('btnSaveNote').disabled = false;\n }\n}", "function editNote(index){\n let saveindex = document.getElementById('saveindex')\n let saveBtn = document.getElementById('saveBtn')\n let addBtn = document.getElementById('addBtn')\n saveindex.value = index;\n let notes = localStorage.getItem('notes');\n let notesObj = JSON.parse(notes);\n addTitle.value = notesObj[index].title;\n addTxt.value = notesObj[index].text;\n addBtn.style.display=\"none\";\n saveBtn.style.display=\"block\";\n }", "reloadNotes(){\n this.setState({reloadNotes: true})\n }", "function restoreNote(divNo) {\n titles.push(trashTitles[divNo]); //restore title in array titles\n notes.push(trashNotes[divNo]); //restore note in array notes\n setArray(\"titles\", titles); //restore also under localStorage\n setArray(\"notes\", notes); //restore also under localStorage\n\n trashTitles.splice(divNo, 1); //delete title text at point divNo\n trashNotes.splice(divNo, 1); //delete note text at point divNo\n setArray(\"trashTitles\", trashTitles); //store also under localStorage\n setArray(\"trashNotes\", trashNotes); //store also under localStorage\n\n showNotes('my-trash-notes', trashTitles, trashNotes);\n}", "saveNote() {\n if (this.noteMessageInput.value) {\n let key = Date.now().toString();\n localStorage.setItem(key, this.noteMessageInput.value);\n this.displayNote(key, this.noteMessageInput.value);\n StickyNotesApp.resetMaterialTextfield(this.noteMessageInput);\n this.toggleButton();\n }\n }", "function setNote(range, x) {\n if (x) {\n range.setNote(new Date().toDateString());\n } else {\n range.clearNote();\n }\n}", "function updateBookInDOM(book) {\n const bookElement = document.querySelector(`[id=\"${book.timestamp}\"]`);\n bookElement.querySelector(\".title\").textContent = book.title;\n bookElement.querySelector(\".author\").textContent = book.author;\n if (book.pages > 0) bookElement.querySelector(\".pages\").textContent = book.pages + \" pp\";\n if (book.status === \"read\") {\n bookElement.querySelector(\".status\").textContent = \"Already read\";\n } else {\n bookElement.querySelector(\".status\").textContent = \"Not read\";\n }\n updateBookInStorage(book);\n clearModalTimestamp();\n}", "function playnotebook(){\n stopSounds();\n audio.src = soundEffects[0];\n audio.play();\n audio.volume = 0.3;\n}", "function addNote(note) {\n setNotes((prevNotes) => {\n return [...prevNotes, note];\n });\n }", "function setTitle(filename) {\r\n\tvar title;\r\n\tif(filename) {\r\n\t\ttitle = filename+\" | Model Maker\";\r\n\r\n\t} else {\r\n\t\ttitle = \"Model Maker\";\r\n\t}\r\n\twindow.parent.document.title = title;\r\n}", "onRenameCheckpoint(checkpointNode) {\n console.log(`Rename checkpoint command invoked on checkpoint: '${checkpointNode.label}'`);\n vscode_1.window\n .showInputBox({\n ignoreFocusOut: true,\n prompt: 'Type in a new name for the checkpoint.',\n value: checkpointNode.label,\n valueSelection: undefined,\n })\n .then(result => {\n if (result === undefined) {\n console.log(`Rename checkpoint canceled`);\n return;\n }\n if (result === checkpointNode.label) {\n console.log(`Checkpoint name is the same as before, returning.`);\n return;\n }\n this.model.renameCheckpoint(checkpointNode.nodeId, result);\n });\n }", "note (control, note) {\n return this.set(0x03, control, note)\n }", "function saveNote() {\n var sText = document.getElementById('note_area').value;\n\n if (oSelectedNote == null) {\n note = new Note();\n note.sNote = sText;\n\n oData.jsFormula.addNote(note);\n\n oNotesTable.row.add([\n note.nuNote,\n note.iIdNote,\n note.sNote\n ]).draw( false );\n }\n else {\n oData.jsFormula.getNote(oSelectedNote.nuNote).sNote = sText;\n $('#notes_table').dataTable().fnUpdate(sText , oSelectedNote.nuNote, 2);\n }\n\n initNote();\n}", "function openNote() {\n scene.remove(note);\n noteHTML = document.getElementById(\"note\");\n noteHTML.style.display = \"block\";\n isNoteDisplayed = true;\n\n loader.load(\n // resource URL\n 'src/models/gltf/usb/scene.gltf',\n // called when the resource is loaded\n function ( gltf ) {\n usb = gltf.scene;\n currentObject = usb;\n gltf.scene.scale.set( 0.01, 0.01, 0.01 );\t\t\t \n gltf.scene.position.x = 0.7;\t\t\t\t //Position (x = right+ left-) \n gltf.scene.position.y = -1.2;\t\t\t\t //Position (y = up+, down-)\n gltf.scene.position.z = -3.85;\t\t\t\t //Position (z = front +, back-)\t\t\t \n\n scene.add( gltf.scene );\n }\n );\n}", "function editNotes()\r\n{\r\n\tvar note = GM_getValue(steam_id, \"Enter notes here\");\r\n\tvar newNote = window.prompt(\"User notes\", note);\r\n\tif (newNote != note && newNote != \"\" && newNote != null)\r\n\t\tGM_setValue(steam_id, newNote);\r\n}", "setViewedItemNote(state, note) {\n state.viewedItemNote = note;\n }", "function handleNewBookmark() {\n $('main').on('click', '#new-bookmark', event => {\n store.adding = true;\n render();\n });\n}", "'change .js-editNote' (event) {\n // Get value from editNote element\n const text = event.currentTarget.value;\n note.set(text);\n }", "updateName() {\n App.elements.name.html(App.state.name);\n }", "function makeNewNotebookTree(notebook, folderIdToMakeItInID) {\n //validate\n notebook.shortName = notebook.shortName || \"Notebook\";\n folderIdToMakeItInID = folderIdToMakeItInID || DriveApp.getRootFolder().getId();\n \n var inFolder = DriveApp.getFolderById(folderIdToMakeItInID);\n //Create new folder structure\n //root\n // |--<enotebookName\n // |--<eOldentries\n // |--<enotebookName_Master\n \n //if rootfolder exists. set notebook fields *grossly unsafely* and bail\n /*var fldrs = rootFolder.searchFolders(notebook.shortName); //I'm still having issues with search queries\n if(fldrs.hasNext())\n {\n var notebookFolder = fldrs.next();\n var conts = notebookFolders.getFolders();\n \n notebook.oldFolderId = conts.next().getId();\n notebook.masterFolderId = conts.next().getId();\n \n return notebook;\n } */\n \n //otherwise make it on the fly, solidly.\n var notebookFolder = inFolder.createFolder(notebook.shortName);\n var oldFolder = notebookFolder.createFolder(\"Old Entries\");\n var masterFolder = notebookFolder.createFolder(notebook.shortName + \"_Master\");\n \n notebook.rootFolderId = notebookFolder.getId();\n notebook.oldFolderId = oldFolder.getId();\n notebook.masterFolderId = masterFolder.getId();\n \n return notebook;\n}", "updateActiveNote(note) {\n this.root.querySelector('.notes__title').value = note.title;\n this.root.querySelector('.notes__body').value = note.body;\n\n this.root.querySelectorAll('.notes__list-item').forEach(noteListItem => {\n noteListItem.classList.remove('notes__list-item--selected');\n });\n\n this.root.querySelector(`.notes__list-item[data-note-id='${note.id}']`).classList.add('notes__list-item--selected');\n }", "function addNote(e) {\n e.preventDefault();\n let newNote = document.createElement(\"div\");\n newNote.className = \"parent-note\";\n newNote.innerHTML = `<div class=\"my-note\" onclick=swapNotes(this)>\n <div class=\"x-btn-container\">\n <button type=\"button\" class=\"x-button\" onclick=deleteNote(this.parentNode.parentNode)>X</button>\n </div>\n <p> ${input.value} </p>\n <button type=\"button\" onclick=editNote(this.parentNode.parentNode)>Edit</button>\n </div>\n `;\n myNotes.appendChild(newNote);\n input.value = \"\";\n}", "handleSaveNote(event) {\n const updatedNote = this.trimNote(); //* returns the selected note with the whitespace around title/text removed\n\n if (this.isValidNote(updatedNote)) {\n //* saves the changes from selectedNote into the savedNotes list\n updatedNote.lastSaved = (new Date()).toUTCString(); //* updates save timestamp\n const savedNotes = this.state.savedNotes;\n\n //* updates selected note & state\n savedNotes.set(updatedNote.id, updatedNote);\n this.setState({ savedNotes });\n }\n\n else {\n alert('COMPUTER SAYS: The note must be filled out to use it...');\n }\n }", "function saveCaption(newCaption, index) {\n var newContent = [...content]\n newContent[index].caption = newCaption\n setContent(newContent)\n setSaved(false)\n delayedSaveAfterLastEdit(newContent)\n }" ]
[ "0.71797764", "0.6752349", "0.6553613", "0.64937544", "0.639407", "0.60809535", "0.6047474", "0.6017998", "0.60169315", "0.5945996", "0.5942281", "0.5926539", "0.59200037", "0.58890426", "0.5882442", "0.57101053", "0.56859577", "0.5651363", "0.5591662", "0.5590272", "0.55845356", "0.5564826", "0.55477697", "0.55442935", "0.554286", "0.55268365", "0.5504955", "0.54968166", "0.5482492", "0.5469329", "0.5459769", "0.54480773", "0.54457176", "0.54326093", "0.5427744", "0.54240423", "0.5416777", "0.54096067", "0.53999734", "0.53854877", "0.53824335", "0.5378373", "0.53680956", "0.5363274", "0.53440905", "0.5333385", "0.53227144", "0.52989274", "0.52988917", "0.5254512", "0.52396446", "0.52370715", "0.52366054", "0.52295303", "0.5216944", "0.5214264", "0.5203842", "0.5197513", "0.5196476", "0.5193171", "0.5192225", "0.5191265", "0.51908606", "0.5186726", "0.5182232", "0.5181712", "0.51802737", "0.5179019", "0.5178992", "0.5176049", "0.5175601", "0.5167911", "0.51670367", "0.5158913", "0.51563984", "0.51491636", "0.5146599", "0.51459014", "0.5140592", "0.51404613", "0.51390374", "0.513201", "0.51290655", "0.51286936", "0.51184374", "0.5118399", "0.51155084", "0.5104554", "0.5102631", "0.5087848", "0.50874656", "0.5085419", "0.50845504", "0.5071364", "0.5070928", "0.5066616", "0.506105", "0.5053317", "0.5050814", "0.5043657" ]
0.6006226
9
Creates a button that lets the user choose which type of note to create.
function createNewNoteButton() { noteButton = document.createElement("div"); noteButton.className = "menuIcon"; document.body.appendChild(noteButton); let span = document.createElement("span"); noteButton.appendChild(span); let icon = document.createElement("img"); icon.src = "/media/plus-circle.svg"; icon.width = "50"; icon.height = "50"; span.appendChild(icon); noteButton.addEventListener("click", function () { let menu = document.querySelector(".menuIcon"); menu.classList.toggle("active"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeNote(note) {\n let noteLi = document.createElement(\"li\")\n noteLi.innerText = note.title\n noteLi.className= 'note-li'\n noteLi.dataset.id = note.id\n noteList.append(noteLi)\n\n //How to crete delete button\n let delBtn = document.createElement(\"button\")\n delBtn.innerText = \"delete\"\n delBtn.className = \"del-btn\"\n delBtn.dataset.id = note.id\n noteLi.append(delBtn)\n }", "function addNoteButton(note) {\n var li = $(\"<div />\", slide.contentDocument);\n li.addClass(\"noteButton\");\n var time = $(\"<div />\", slide.contentDocument);\n time.addClass(\"noteButtonTime\");\n time.text(new Date(note.time).toLocaleString());\n li.append(time);\n var summary = $(\"<div />\", slide.contentDocument);\n summary.addClass(\"noteButtonSummary\");\n summary.text(noteSummary(note));\n li.append(summary);\n li.click(function () showNote(note, li));\n $(\"#noteList\", slide.contentDocument).append(li);\n return li;\n }", "function addButtonClick(){\n\t\tvar note = Note();\n\t\tstorage.push(note);\n\t\tdisplayNotes();\n\n\t}", "function creatNote(tex,priority) {\n const notesContainer = document.getElementById('notes-container');\n const newP = document.createElement('p');\n newP.className = `note ${priority}`;\n newP.innerText = tex;\n\n const deletBtn = document.createElement('button');\n deletBtn.className = 'remove-btn';\n deletBtn.innerText = 'X'; \n deletBtn.onclick = removeNote;\n newP.appendChild(deletBtn);\n\n\n notesContainer.appendChild(newP);\n}", "function createNote(obj, type ) {\n let article = document.createElement(\"article\");\n article = articleAttributes(article);\n article.appendChild(createDiv1(obj));\n article.appendChild(createDiv2(type, article));\n article.appendChild(createBtnConfirm());\n return article;\n}", "function createBtnConfirm() {\n let btnConfirm = document.createElement(\"button\");\n btnConfirm.className = \"note-button note-button-bottom\";\n btnConfirm.addEventListener(\"click\", function () {\n saveNotesToLocalStorage();\n });\n btnConfirm.appendChild(createImgConfirm());\n return btnConfirm;\n}", "function addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}", "function createNoteByClick() {\n var newDate = new Date();\n var noteId = newDate.getTime();\n bq.setAttribute(\"id\", \"note-\" + noteId);\n bq.innerText = null;\n localStorage.setItem(noteId, \"\");\n bq.focus();\n}", "function addNote() {\r\n const newNote = document.createElement('div')\r\n newNote.classList.add('note--new')\r\n\r\n const noteText = document.createElement('li')\r\n noteText.innerText = inputText.value\r\n noteText.classList.add('note--text')\r\n newNote.appendChild(noteText)\r\n\r\n const noteView = document.createElement('button')\r\n noteView.innerHTML = '<i class=\"far fa-eye\"></i>'\r\n noteView.classList.add('note--view-btn')\r\n newNote.appendChild(noteView)\r\n\r\n const noteDelete = document.createElement('button')\r\n noteDelete.innerHTML = '<i class=\"fas fa-trash\"></i>'\r\n noteDelete.classList.add('note--delete-btn')\r\n newNote.appendChild(noteDelete)\r\n\r\n noteContainer.appendChild(newNote)\r\n\r\n console.log(noteText.innerText)\r\n\r\n inputText.value = ''\r\n}", "function createButton(container,type, classHere,idHere,onclick, textContent){ // Form maker\n try {\n const button = document.createElement('button');\n button.type = type;\n button.classList = classHere;\n button.id = idHere;\n button.onclick = onclick;\n button.textContent = textContent;\n container.appendChild(button);\n return button;\n } catch (e) {\n return \"createButton didnt work\";\n }\n}", "function createNote(note) {\n return API.post(\"notes\", \"/notes\", {\n body: note\n });\n }", "function addNote(e) {\n e.preventDefault();\n let newNote = document.createElement(\"div\");\n newNote.className = \"parent-note\";\n newNote.innerHTML = `<div class=\"my-note\" onclick=swapNotes(this)>\n <div class=\"x-btn-container\">\n <button type=\"button\" class=\"x-button\" onclick=deleteNote(this.parentNode.parentNode)>X</button>\n </div>\n <p> ${input.value} </p>\n <button type=\"button\" onclick=editNote(this.parentNode.parentNode)>Edit</button>\n </div>\n `;\n myNotes.appendChild(newNote);\n input.value = \"\";\n}", "function createNewNote()\n{\n randomNote = int(random(notes.length - 1));\n goalNote = notes[randomNote].note\n goalFrequency = -notes[randomNote].frequency\n\n // play voice over when the new note is created\n playVoiceOver();\n}", "function makeButton(backgroundImage, title, type) {\n var button = L.DomUtil.create(\"a\", \"leaflet-control-view-\" + type);\n button.title = title;\n button.href = \"#\";\n button.setAttribute(\"role\", \"button\");\n button.setAttribute(\"aria-label\", title);\n button.style.backgroundImage = \"url(\" + backgroundImage + \")\";\n button.style.backgroundSize = \"contain\";\n\n return button;\n }", "function addNote(lectureID, slideID, note) {\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n objectStore.add({\n slideID: slideID,\n lectureID: lectureID,\n note: note\n }).onsuccess = function(e) {\n // Add a radio button for the note.\n addNoteButton(\n \"Note \" + e.target.result\n + \": Lecture \" + lectureID\n + \" - Slide \"+ slideID,\n e.target.result, note\n );\n };\n}", "function newNote() {\n var csrftoken = $.cookie('csrftoken'),\n folder_id = $('.folder-list>.active>a').attr(\"data-folderid\"),\n data = {\n title: \"Untitled note\",\n body: \"<br>\",\n folder_id: folder_id,\n csrfmiddlewaretoken: csrftoken\n };\n $.post(\"/notes/addnote/\", data, function (data) {\n $('#notelist').children().prepend(data).children().first().trigger('click');\n $('#title').empty();\n });\n }", "onClick(e) {\r\n this.insertNewNote(this);\r\n }", "function createBtnDelete(obj) {\n let btnDelete = document.createElement(\"button\");\n btnDelete.id = \"delete-button\";\n btnDelete.className = \"note-button\";\n\n btnDelete.addEventListener(\"click\", function () {\n obj.removeNote();\n });\n btnDelete.appendChild(createImgDelete());\n return btnDelete;\n}", "function createNoteButtons(buttonInfo) {\n // create a div element to hold the buttons in\n let div = document.createElement(\"div\");\n let buttons = [];\n\n // create a button each button object defined in buttonInfo\n buttonInfo.forEach(function(setOfInfo) {\n let button = createButton();\n let buttonText = document.createTextNode(setOfInfo.label);\n button.appendChild(buttonText);\n setOfInfo.classes.forEach(classItem => button.classList.add(classItem));\n\n //put each button in the buttons array\n buttons.push(button);\n })\n\n //put the buttons in the div\n buttons.forEach(button => div.appendChild(button));\n \n return div;\n}", "function createNote() {\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //set content for note\n $note.html($note_text.val());\n //append note text to note-output\n $(\".note-output\").append($note);\n $note_text.val(\"\");\n }\n }", "function createNewNote(event) {\n event.preventDefault()\n // console.log(event.target.title.value, event.target.content.value)\n const newNoteObj = {}\n newNoteObj.color_id = event.target.color_id.value\n newNoteObj.title = event.target.title.value\n newNoteObj.content = event.target.content.value\n // console.log(newNoteObj) // newNoteObj structure is working: {title: \"meh\", content: \"mehmeh\"}\n postNewNote(newNoteObj) // invoking our postNewNote function here\n renderNoteOnColorShowPage(newNoteObj) // recycling this function (finally, learning to recycle!) Mother Earth you fucking owe me. It works!\n // question for later: wtf happened to those pink notes I created before I added this render? Oh lol I mislabeled it white nvm\n}", "function addBooksToNote(obj) {\n let noteDropDown = document.createElement(\"div\");\n let button = document.createElement(\"button\");\n let btnIcon = document.createElement(\"img\");\n let dropDownContent = document.createElement(\"div\");\n let dropDownList = document.createElement(\"ul\");\n\n noteDropDown.className = \"dropdown\";\n noteDropDown.appendChild(button);\n noteDropDown.appendChild(dropDownContent);\n\n button.className = \"note-button\";\n button.addEventListener(\"click\", () => {\n clearNoteDropDown();\n addBooksToDropDown(obj, dropDownContent);\n dropDownContent.style.display = \"block\";\n });\n button.appendChild(btnIcon);\n\n btnIcon.src = \"media/journal-plus.svg\";\n btnIcon.width = \"24\";\n btnIcon.height = \"24\";\n btnIcon.title = \"Move to notebook\";\n\n dropDownContent.className = \"dropdown-content shadow-sm\";\n dropDownContent.appendChild(dropDownList);\n\n return noteDropDown;\n}", "function createNoteLiItem(note) {\n const li = $('<li class=\"list-group-item\">');\n const noteBody = $('<p>').text(note.body);\n const deleteNoteBtn = $('<button class=\"btn btn-danger delete-note\">').text('Delete Note');\n deleteNoteBtn.attr('data-note-id', note._id);\n li.append(noteBody, deleteNoteBtn);\n notesElem.append(li);\n }", "function addNote(text) {\n var newNote = $(\"<div class = 'note'></div>\");\n var icons = $(\"<div class = 'icons'></div>\");\n\n var tag = $(\"<i class = 'fa fa-tag' aria-hidden = 'true'></i>\");\n var removeButton = $(\"<i class = 'fa fa-times' aria-hidden = 'true'></i>\");\n var textBox = $(\"<textarea></textarea>\");\n\n if (text != undefined) textBox.val(text);\n\n tag.click(changeColor);\n textBox.blur(saveNotes);\n removeButton.click(function() {\n newNote.remove();\n saveNotes();\n });\n\n icons.append(tag);\n icons.append(removeButton);\n\n newNote.append(icons);\n newNote.append(textBox);\n newNote.appendTo($(\"#sticky-notes\"));\n saveNotes();\n}", "function addNewNote(raphaelName) {\n var color = \"white\";\n var text = \" \";\n\n //find color selected\n $(\".dropdown-menu li\").click(function() {\n color = $(this).text();\n $(\"#dropdownbtn\").text(color);\n if(color == \"Pink\") $(\"#dropdownbtn\").css({\"background-color\": \"#ffc0cb\"});\n if(color == \"Blue\") $(\"#dropdownbtn\").css({\"background-color\": \"#8deeee\"});\n if(color == \"Green\") $(\"#dropdownbtn\").css({\"background-color\": \"#98fb98\"});\n });\n\n //add note to the canvas and send message to all pages\n $(\".addnotebutton\").click(function() {\n text = $(\"#newnoteinput\").val();\n var note = controlNote(raphaelName, 400, 300, color, text);\n pushNote(note);\n\n if(TogetherJS.running) {\n TogetherJS.send({\n type: \"controlNote\",\n xPos: 400,\n yPos: 300,\n noteColor: color,\n text: text,\n ID: note.id\n });\n }\n\n $(\"#dropdownbtn\").text(\"Note Color\");\n $(\"#dropdownbtn\").css({\"background-color\": \"rgb(249, 211, 140)\"});\n $(\"#newnoteinput\").val(\"\");\n text = \" \";\n color = \"white\";\n });\n}", "createAddButton() {\n let addSourceButton = document.createElement('button')\n addSourceButton.innerText = 'Add ' + this.capitalize(this.type)\n addSourceButton.addEventListener('click', () => this.toggleFormVisibility())\n this.div.appendChild(addSourceButton)\n }", "function createAddNoteBookButton() {\n\n let getDropdownMenu = document.getElementsByClassName(\"dropdown-menu\")[0];\n let flexBoxForContent = document.createElement(\"div\");\n let buttonToAddBooks = document.createElement(\"button\");\n let buttonImage = document.createElement(\"img\");\n let formToInput = document.createElement(\"form\"); \n let noteBookNameInput = document.createElement(\"input\");\n\n flexBoxForContent.className = \" addNoteBookFlexBox\";\n buttonToAddBooks.className = \"addNoteBookButton\";\n noteBookNameInput.className = \"noteBookTitle\";\n buttonImage.src = \"/media/plus-circle.svg\";\n noteBookNameInput.placeholder = \"Title of book\";\n noteBookNameInput.required = true;\n noteBookNameInput.addEventListener(\"keypress\", function (event) {\n let e = event;\n if (e.code === \"Enter\") {\n createNoteBook();\n }\n });\n\n getDropdownMenu.appendChild(flexBoxForContent);\n buttonToAddBooks.appendChild(buttonImage);\n flexBoxForContent.appendChild(buttonToAddBooks);\n flexBoxForContent.appendChild(formToInput);\n formToInput.appendChild(noteBookNameInput);\n\n buttonToAddBooks.addEventListener(\"click\", function () {\n \n\n createNoteBook(); \n });\n}", "function createFormButton(type, className, text){\n\tconst button = document.createElement(\"button\");\n\tbutton.type = type;\n\tbutton.className = className;\n\tbutton.textContent = text;\n\treturn button;\n}", "function getNote() {\n const li = document.createElement('LI')\n li.className = 'fill'\n li.id = 'list-tag'\n li.setAttribute('draggable', 'true')\n\n // I am creating a div element that will wrap the text coming from textarea input.\n let divTag = document.createElement('div')\n divTag.className = 'div-tag';\n divTag.setAttribute('id', lastid)\n divTag.innerText = textInput.value\n li.appendChild(divTag)\n\n // I am creating a button element that will be a sibling to the div element created earlier. And they will get appended to the same parent element. \n const edit = document.createElement('button')\n edit.className = 'modify';\n edit.setAttribute('id', lastid)\n edit.innerText = 'EDIT';\n li.appendChild(edit)\n \n // Same as above in line 71\n const deleteBtn = document.createElement('button');\n deleteBtn.className = 'erase';\n deleteBtn.setAttribute('id', lastid)\n deleteBtn.appendChild(document.createTextNode('DELETE'));\n li.appendChild(deleteBtn)\n \n lastid += 1;\n orderList.appendChild(li)\n}", "function showCreateNoteModal() {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalBody = $('<div >');\n var noteNameInput = $('<input type=\"text\" class=\"form-control form-control-lg\" />');\n var noteNameInputContainer = $('<div class=\"pull-left\"><div class=\"form-group col-sm-12\">');\n var modalFooter = $('<div class=\"pull-right\">');\n var createButton = $('<button type=\"button\" class=\"btn btn-primary\">Create</button>');\n\n // Appending to create the modal content structure\n noteNameInputContainer.append(noteNameInput);\n modalBody.append(noteNameInputContainer);\n modalFooter.append(createButton);\n\n var modal = utils.showModalPopup('Enter a name for your new note', modalBody, modalFooter);\n\n // Registering event listeners for the modal window\n createButton.click(function() {\n createNote(noteNameInput.val());\n modal.modal('hide');\n });\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 addNote(note){\n let noteElement = document.createElement(\"div\");\n noteElement.addEventListener(\"change\",updateNote);\n noteElement.classList.add(\"noteid\"+notes.indexOf(note));\n noteElement.classList.add(\"note\");\n noteElement.style.backgroundColor = note.color;\n let pinElement = document.createElement(\"div\");\n pinElement.classList.add(\"pin\");\n if(note.pinned)\n pinElement.classList.add(\"pinoff\");\n else\n pinElement.classList.add(\"pinon\");\n pinElement.addEventListener(\"click\",pinSwitch);\n noteElement.appendChild(pinElement);\n let titleElement = document.createElement(\"input\");\n titleElement.type = \"text\";\n titleElement.name = \"title\";\n titleElement.value = note.title;\n noteElement.appendChild(titleElement);\n let contentElement = document.createElement(\"textarea\");\n contentElement.value = note.content;\n contentElement.name = \"content\";\n noteElement.appendChild(contentElement);\n let colorElement = document.createElement(\"input\");\n colorElement.type = \"color\";\n colorElement.name = \"color\";\n colorElement.value = note.color;\n noteElement.appendChild(colorElement);\n let created = document.createElement(\"p\");\n let time = new Date(note.created);\n created.innerHTML = \"Created: \" + time.toLocaleString();\n noteElement.appendChild(created);\n if(note.pinned)\n document.querySelector(\".pinned\").appendChild(noteElement);\n else\n document.querySelector(\".notes\").appendChild(noteElement);\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 createNote(){\n\t// Single function to get value from any input\n\tvar getVal = function(param){\n\t\treturn $get(param).value;\n\t};\n/*\n\t// function to add index numbers - param for id/class/element to count\n\t// Over complicated\n\tvar count = function(param){\n\t\tif (!!$get(param)){ // if there already are notes\n\t\t\treturn ($getAll(param).length) +1; // count them\n\t\t}\n\t\telse { // else this is the first note\n\t\t\treturn 1;\n\t\t}\t\n\t}\n*/\n//\tvar count = 0; // too simple, what if we start with notes?\n\n\n\tvar count = function() {\n\t\treturn ($getAll('.box').length) +1;\n\t} \n\n\tif ( !!(getVal('#noteText')) && !!(getVal('#colourPick')) ){ // if input not empty\n\t\n\t\tvar noteNumber = document.createTextNode(count());\n\n\t\tvar noteNumberPar = document.createElement('span');\n\t\t\tnoteNumberPar.className = 'noteNumber';\n\t\t\tnoteNumberPar.id ='noteNumber'+count();\n\t\t\tnoteNumberPar.appendChild(noteNumber);\n\n\t\tvar stickyText = document.createTextNode(getVal('#noteText'));\n\t\t\n\t\t// div template for sticky note\n\t\tvar template = document.createElement('div');\n\t\t\ttemplate.className = 'box';\n\t\t\t// get value of selected colour from dropdown menu\n\t\t\ttemplate.style.backgroundColor = getVal('#colourPick');\n\t\t\t// Call count function and concatonate with input text\t\n\t\t\ttemplate.appendChild(noteNumberPar);\n\t\t\ttemplate.appendChild(stickyText);\n\n\t\t$get('.container').appendChild(template); // add sticky to div.container \n\n\t\t// create textNode to append text into the remove button\n\t\tvar removeID = 'removeButton' + (count()-1)\n\t\tvar x = document.createTextNode('X')\n\t\tvar removeButton = document.createElement('div');\n\t\t\tremoveButton.className = 'removeButton';\n\t\t\tremoveButton.id = removeID;\n\t\t\t// append textNode to rmove button div\n\t\t\tremoveButton.appendChild(x);\n\t\t\n\t\t$getAll('.box')[($getAll('.box').length)-1].appendChild(removeButton);\n\n\t\t// to add event listeners with dynamic element creation\n\t\t// the function to be called must be wrapped in a function declaration\n\t\t$get('#'+removeID).addEventListener('click', removeNote)\n\n\t\t// clear fields ready for next sticky\n\t\t$get('#noteText').value = '';\n\t\treturn false;\n\t} else { // else show alert input is empty\n\t\talert('No note!');\n\t\treturn false;\n\t}\t\n}", "function addNote() {\n let titleEl = document.getElementById(\"title\")\n let detailsEl = document.getElementById(\"details\")\n\n newNote = new Note(titleEl.value, detailsEl.value)\n allNotes.push(newNote)\n\n printNote(newNote)\n resetFields(titleEl, detailsEl)\n checkBadWords(newNote)\n // changeBackground()\n}", "function createButtons(){\n\n if(currentEvent.type === 'no-action'){\n var confirm = document.createElement('button');\n confirm.id = 'confirm';\n confirm.textContent = 'Proceed';\n btnContainer.appendChild(confirm);\n\n } else {\n var acceptRisk = document.createElement('button');\n acceptRisk.id = 'accept';\n acceptRisk.textContent = 'Risk it!';\n var rejectRisk = document.createElement('button');\n rejectRisk.id = 'reject';\n rejectRisk.textContent = 'No Way!';\n btnContainer.appendChild(acceptRisk);\n btnContainer.appendChild(rejectRisk);\n }\n\n btnContainer.addEventListener('click', choiceClick);\n}", "function addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function addNote(e) {\n\n const userText = note.value;\n const newNote = document.createElement('div');\n newNote.classList.add('note')\n newNote.innerHTML = '<p class=\"noteText\">' + userText + '</p> <button onclick=\"focusNote(this)\" class=\"buttonNote\">view details</button>';\n\n const enfant = noteContainer.children;\n\n function createTextBox () {\n noteContainer.appendChild(newNote);\n note.value = \"\";\n console.log(newNote)\n }\n\n if (enfant[0].classList.contains('delete')){\n enfant[0].remove(); \n createTextBox ();\n } else {\n createTextBox ();\n }\n e.preventDefault();\n}", "function addButton(input) {\n var newButton = $(\"<input>\")\n .attr(\"type\",\"button\")\n .attr(\"value\", input)\n .attr(\"class\", \"topic-button\")\n .text(input);\n $(\"#topics-view\").append(newButton);\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 addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // create HTML node from note object\n const node = createItem(note);\n // append created node in HTML\n noteList.appendChild(node);\n // put created node in Map to match it with note\n map.set(node, note);\n // push current note to notes object\n notes.push(note);\n // overwrite notes in indexedDB with notes\n idbKeyval.set('notes', notes)\n .catch(err => console.error('submit failed: ', err));\n // reset input values\n noteBody.value = '';\n noteImg.value = '';\n noteAlt.value = '';\n }", "function addButton(text, type, position = \"left\") {\n\tlet button = new Button(text, type, position);\n\tbutton.add();\n\treturn button;\n}", "function createNewRow(note) {\n // var formattedDate = new Date(note.createdAt);\n // formattedDate = moment(formattedDate).format(\"MMMM Do YYYY, h:mm:ss a\");\n var newnotePanel = $(\"<div class='note-panel' data-id='\"+note.id+\"'>\");\n newnotePanel.addClass(\"panel panel-default\");\n var newnotePanelHeading = $(\"<div>\");\n newnotePanelHeading.addClass(\"panel-heading\");\n var deleteBtn = $(\"<button>\");\n deleteBtn.text(\"Delete\");\n deleteBtn.addClass(\"delete btn btn-danger btn-sm\");\n var editBtn = $(\"<button>\");\n editBtn.text(\"Edit\");\n editBtn.addClass(\"edit btn btn-warning btn-sm\");\n var newnoteTitle = $(\"<h2>\");\n var newnotePanelBody = $(\"<div>\");\n newnotePanelBody.addClass(\"panel-body\");\n var newnoteBody = $(\"<div>\");\n newnoteTitle.text(note.beerName + \" | \" + note.beerType + \" | \" + note.rating);\n newnoteBody.html(\"<br>Comments: \" + note.notes);\n newnotePanelHeading.append(newnoteTitle);\n newnotePanelBody.append(newnoteBody);\n newnotePanelBody.append(editBtn);\n newnotePanelBody.append(deleteBtn);\n newnotePanel.append(newnotePanelHeading);\n newnotePanel.append(newnotePanelBody);\n return newnotePanel;\n }", "function createButton() {\n var newButton = new HmiObject();\n newButton.uid = Date.now();\n newButton.typeId = 'button';\n newButton.type = 'button';\n return newButton;\n }", "function createNote(note) {\n //the note\n codeOfNote = ` <div id=\"${note.noteNum}note\" class=\"ml-xl-5 mr-xl-5 mt-xl-4 mb-xl-4 col-xl-2 m-lg-4 col-lg-3 m-md-5 col-md-4 m-sm-5 col-sm-6 ml-5 col-5 note\">`\n //row of icons \n codeOfNote += `<div class=\"mt-4 row\">`\n // number of note\n codeOfNote += `<div class=\"mb-2 ml-2 col-10 number\">${note.noteNum + 1}</div>`\n // col of icons\n codeOfNote += `<div class=\"p-3 m-1 col-xl-12 col-md-12\">`\n // close icon \n codeOfNote += `<span type=\"button\" id=\"icon\" class=\"glyphicon glyphicon-remove\" onclick=\"deleteNote(${note.noteNum})\"></span>`\n // close divs for row and col of icons\n codeOfNote += `</div> </div>`\n //row of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 md-form row\">`\n // col of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 col-xl-11 col-xl-10 col-md-11 col-sm-10 col-11\">`\n //the text area (i used text area inside the note and not p)\n codeOfNote += `<textarea type=\"text\" id=\"${note.noteNum}Notetextarea\" class=\"Notetextarea\" rows=\"5\" readonly>${note.InputOfNote}</textarea>`\n //scroll bar\n codeOfNote += `<div class=\"scrollbar\" id=\"style-9\"> <div class=\"force-overflow\"></div> </div>`\n // date and time\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.dateOfNote}</small>`\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.timeOfNote}</small>`\n //closing divs\n codeOfNote += `</div> </div> </div> </div> </div>`\n\n}", "function createNote() {\n //object that wraps each note and its delete link\n var $note_div = $(\"<div/>\")\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //select the delete-all button\n var $deleteAllButton = $(\"#delete-all\")\n //create a delete link for each added note\n var $delLink = $('<a>delete</a>').attr({ \n href: \"#\",\n class: \"del-link\"\n });\n //adds a click listener to the delete link\n $delLink.on(\"click\", function () {\n deleteNote(this); \n });\n\n //set content for note\n $note.html($note_text.val());\n //append note and delete link to note_div\n $note_div.append($note);\n $note_div.append($delLink);\n //hide new note_div to setup fadeIn...\n $note_div.hide();\n //append note_div to note-output\n $(\".note-output\").append($note_div);\n\n //fadeIn hidden new note_div and conditionally \n // the deleteAllButton\n if ($deleteAllButton.is(\":hidden\"))\n $deleteAllButton.fadeIn(\"slow\");\n $note_div.fadeIn(\"slow\");\n $note_text.val(\"\");\n }\n }", "function addNote() { \n SidebarActions.createNote('Content', $scope.data.thisContent); \n}", "static createButton(){\n let button = document.createElement('button');\n button.className = \"btn btn-warning viewBtn\";\n button.innerText = \"More Details\";\n return button;\n }", "_createButtonIcon(type, parent, onClick) {\n var button = this._createElementUnder('button', parent);\n var span = this._createElementUnder('span', button);\n span.classList.add('material-icons-round');\n span.classList.add('md-24');\n span.innerText = type;\n button.addEventListener(\"click\", onClick);\n return button;\n }", "function setupNoteCreateDialog(commentDialog, observer) {\n observer.disconnect();\n\n let commentDialogRenderer = makeHTML(commentDialogRenderer_raw);\n commentDialog.appendChild(commentDialogRenderer);\n let injectedCommentDialogRenderer = commentDialog.querySelector(\"ytd-comment-dialog-renderer\");\n\n var commentDialogObserver = new MutationObserver(function(mutations, observer) {\n let defaultText = commentDialog.querySelector(\"#placeholder\");\n defaultText.textContent = \"Add a private note...\";\n\n let avatar = commentDialog.querySelector(\"#author-thumbnail\");\n avatar.remove();\n\n let btnWrapper = commentDialog.querySelector(\"#buttons\");\n // Move to next fn if possible\n let btns = btnWrapper.querySelectorAll(\"ytd-button-renderer\");\n for (let btn of btns) {\n btn.setAttribute(\"is-paper-button\", \"\");\n }\n setupCreateNoteButtons(btnWrapper, observer);\n });\n commentDialogObserver.observe(injectedCommentDialogRenderer, {childList: true});\n}", "function newNote() {\n document.getElementById('note_area').value = '';\n document.getElementById('note_area').readOnly = false;\n document.getElementById('btnDelNote').disabled = true;\n document.getElementById('btnEditNote').disabled = true;\n\n oSelectedNote = null;\n}", "function addButton(btn_type, parentNode) {\n let btn = document.createElement(\"img\");\n btn.setAttribute(\"class\", btn_type);\n btn.setAttribute(\"alt\", btn_type);\n btn.setAttribute(\"src\", \"./assets/images/\" + btn_type + \".svg\");\n\n if (btn_type == \"check\") \n btn.setAttribute(\"checked\", \"unchecked\"); \n\n parentNode.appendChild(btn);\n}", "function createNewQuestion(questions){\n\tvar button = document.createElement(\"input\");\n\tbutton.setAttribute(\"type\", \"button\");\n\tbutton.setAttribute(\"id\", \"addQuestionButton_\" + questions);\n\tbutton.setAttribute(\"value\", \"Lisää kysymys\");\n\t\n\t// Jos nappia painetaan käynnistetään createQuestionRow-metodi, \n\t// jolla lisätään uusi kysymys\n\tbutton.onclick = function () { createQuestionRow(this); };\n\n\treturn button;\n}", "function createsANote() {\n var note = new Note(\"My favourite language is Ruby\");\n assert.isTrue(\"creates a note\", note.readNote() === \"My favourite language is Ruby\");\n}", "function buttonContent() {\n let listButtons = document.createElement(\"ul\");\n noteButton.appendChild(listButtons);\n let b1 = document.createElement(\"li\");\n let b1img = document.createElement(\"img\");\n b1img.src = \"/media/card-list.svg\";\n b1img.height = \"50\";\n b1img.width = \"50\";\n listButtons.appendChild(b1);\n b1.appendChild(b1img);\n b1.addEventListener(\"click\", function () {\n allNotes.push(new Note(2));\n saveNotesToLocalStorage();\n });\n\n let b2 = document.createElement(\"li\");\n let b2img = document.createElement(\"img\");\n b2img.src = \"/media/card-text.svg\";\n b2img.width = \"50\";\n b2img.height = \"50\";\n listButtons.appendChild(b2);\n b2.appendChild(b2img);\n b2.addEventListener(\"click\", function () {\n allNotes.push(new Note(1));\n saveNotesToLocalStorage();\n });\n}", "function createButton(classType, textString) {\n let newButton = document.createElement(\"button\");\n newButton.type = \"button\";\n newButton.className = classType;\n newButton.innerText = textString;\n return newButton;\n}", "function addNote() {\n if (noteText.value === \"\") {\n return;\n } else {\n notesCounter++; // increamenting notes count\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 notes.unshift(note);\n noteDiv.style.background = \"#ffffff\";\n renderNote(note);\n updateDB();\n clearInputs();\n noteHead.style.display = \"none\";\n noteBot.style.display = \"none\";\n }\n}", "function buildNewJournalButton(){\n\tvar button = document.createElement(\"button\");\n\tvar buttonLabel = document.createTextNode(\"Add Journal\");\n\tbutton.appendChild(buttonLabel);\n\n\tbutton.addEventListener('click', function(event){\t\n\t\tvar journalData = new JournalData ();\n\t\tvar journalsRelation = user.relation(\"userJournals\");\n\t\tvar newJournalTitle = prompt(\"Enter the new journal's title.\");\n\n\t\tif(newJournalTitle != null){\n\t\t\tcurrentJournalIndex = 0;\n\t\t\tcurrentEntryIndex = 0;\n\n\t\t\tjournalData.save({\n\t\t\t\tjournalTitle: newJournalTitle,\n\t\t\t}, \n\t\t\t{\n\t\t\t\tsuccess: function(results){\n\t\t\t\t\tconsole.log(\"Created new journal\");\n\t\t\t\t\tjournalsRelation.add(journalData);\n\t\t\t\t\tuser.save(null, {\n\t\t\t\t\t\tsuccess: function (results){\n\t\t\t\t\t\t\trefreshJournalsSection();\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror:function(error){\n\t\t\t\t\t\t\talert(\"Something went wrong: error is \" + error.message);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\terror: function(error){\n\t\t\t\t\tconsole.log(\"Error creating new journal. Error: \" + error);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n\tnewJournalButton.appendChild(button);\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 let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function addButton(){ \n text = document.createTextNode(\"Delete Task\");\n buttn = document.createElement(\"Button\");\n buttn.className = classNames[\"TODO_DELETE\"];\n buttn.setAttribute(\"onClick\",\"deleteTask(event)\")\n buttn.appendChild(text);\n return buttn;\n}", "function createBtns(artist, classtoAdd, areaToAddTo) {\n $(areaToAddTo).empty();\n\n for (var i = 0; i < artists.length; i++) {\n var b = $(\"<button>\");\n b.addClass(classtoAdd);\n b.attr(\"data-type\", artists[i]);\n b.text(artists[i]);\n $(areaToAddTo).append(b);\n }\n }", "function listButton(type) {\n for (let i = 0; i < listItem.length; i++) {\n listItem[i].appendChild(type);\n }\n }", "function newNote() {\n const note = prompt('Name of note?');\n window.localStorage.setItem(note, '');\n\n const noteElem = document.createElement('option');\n noteElem.innerText = note;\n notes.insertBefore(noteElem, notes.firstChild);\n\n // Focus this note\n notes.value = note;\n changeNote();\n}", "function addNote() {\n\t\t\n\t\tid++;\n\t\tzIndex++;\n\t\t\n\t\tvar body = document.querySelector('body');\n\t\t\n\t\tvar note = document.createElement('div');\n\t\tvar close = document.createElement('div');\n\t\tvar field = document.createElement('div');\n\t\tvar footer = document.createElement('div');\n \t\t\n\t\tnote.setAttribute('id', 'note' + id);\n\t\tclose.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('contenteditable', true);\n\t\t\t\n\t\tnote.classList.add('note');\n\t\tclose.classList.add('close');\n\t\tfield.classList.add('field');\n\t\tfooter.classList.add('footer');\n\t\t\n\t\tnote.style.zIndex = zIndex;\n\t\t\t\n\t\tnote.appendChild(close);\n\t\tnote.appendChild(field);\n\t\tnote.appendChild(footer);\n\t\tbody.appendChild(note);\n\t\t\n\t\tattachListeners(note, close, field, footer);\n\t\t\n\t\tvar data = JSON.parse(localStorage['data']);\n\t\t\n\t\t// Save the current note's data\n\t\tdata.push({\n\t\t\n\t\t\tid: id,\n\t\t\ttext: '',\n\t\t\tposition: { x: 20, y: 20 },\n\t\t\tzIndex: zIndex,\n\t\t\t\n\t\t\ttime: { \n\t\t\t\n\t\t\t\tday: new Date().getDate(), \n\t\t\t\tmonth: new Date().getMonth() + 1, \n\t\t\t\tyear: new Date().getFullYear(), \n\t\t\t\th: new Date().getHours(), \n\t\t\t\tm: new Date().getMinutes(), \n\t\t\t\ts: new Date().getSeconds() \n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t});\n\t\t\n\t\tlocalStorage['data'] = JSON.stringify(data);\n\t\t\n\t}", "get unorderedListButton() {\n return {\n command: \"insertUnorderedList\",\n icon: \"editor:format-list-bulleted\",\n label: \"Unordered List\",\n radio: true,\n type: \"rich-text-editor-button\",\n };\n }", "function note_add(_Poc,_text){\r\n\tNotecurrent_IdNUM++;\r\n\tvar newnote ={\r\n\t\tid:'note'+Notecurrent_IdNUM\r\n\t\t,x: _Poc.x\r\n\t\t,y: _Poc.y\r\n\t\t,text:_text\r\n\t\t,color:defaultCOLOR\r\n\t\t,fontsize:defaultFONTSIZE\r\n\t\t,selected:false\r\n\t};\r\n\tnotes.push(newnote);\r\n\tnumnote++;\r\n\treturn newnote;\r\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 createButton () {\n animal = animal.toUpperCase ();\n $(\"#animalButtons\").append(\"<button type='button' class='btn btn-primary starterGif' id='\" + animal.toLowerCase() +\"'>\" + \"See \" + animal + \" gifs</button>\");\n animals.push(animal);\n }", "function addNote(text = '') {\n const date = new Date();\n const nowDate = `${date.getMonth()}.${date.getDate()}.${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;\n\n const noteHTML = `\n <div class=\"note\">\n <div class=\"note__control\">\n <span class='date'>${nowDate}</span>\n <i class=\"fas fa-check-circle done\" onclick='addNoteTextStorage(event)'></i>\n <i class='fas fa-times-circle delete' onclick='deleteNote(event)'></i>\n </div>\n <div class=\"note__text\" contenteditable=\"true\">${text}</div>\n </div>`\n notesList.insertAdjacentHTML('beforeend', noteHTML);\n}", "function createButton(buttonName) {\n\n\t// button details\n\tvar newButton = $(\"<button>\");\n\t\tnewButton.addClass(\"subjectButton btn btn-primary\");\n\t\tnewButton.attr(\"data-subject\", buttonName);\n\t\tnewButton.text(buttonName);\n\n\t// add button to display\n\t$(\"#buttons\").append(newButton);\n\n}", "function CreateButton(id, text){\n this.button = document.createElement('button');\n this.button.id = id;\n this.button.innerHTML = text;\n document.getElementById('buttons').appendChild(this.button);\n}", "function addNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\tappendNote(tr, defaultNote);\r\n\taddState();\r\n\t\r\n\trefreshNotes();\r\n}", "renderFormButtons() {\n //if the note.id exists, then we can either delete or edit that note\n if (this.props.note.id !== undefined) {\n return (<div>\n { /* Show the save button to edit note */}\n <button type=\"submit\" className=\"btn btn-success float-right\">Add Note</button>\n { /* Show the delete button to delete note */}\n <button onClick={this.deleteNote} className=\"btn btn-danger\">Delete Note</button>\n </div>);\n }\n return (\n /* Show the add button to save a new note */\n <button type=\"submit\" className=\"btn btn-success float-right\">Add Note</button>\n );\n }", "get orderedListButton() {\n return {\n command: \"insertOrderedList\",\n icon: \"editor:format-list-numbered\",\n label: \"Ordered List\",\n radio: true,\n type: \"rich-text-editor-button\",\n };\n }", "function create(idButton, aliasName) {\n if (aliasName == \"\")\n throw \"Alias Name is required\";\n if (idButton == \"\")\n throw \"idButton is required\";\n return Utils_1.default.OSExecute(`apx-onewire-ibutton create ${idButton} ${aliasName}`);\n}", "function makeButtons(topicArr, classToAdd, areaToAddTo) {\n //prvents copies of the buttons from being made\n $(areaToAddTo).empty();\n //looping through the array\n for (let index = 0; index < topicArr.length; index++) {\n //making a button\n const title = $(\"<button>\");\n //adding a class\n title.addClass(classToAdd);\n //adding the indexed string as the data-type\n title.attr(\"data-type\", topicArr[index]);\n //display indexed string on button\n title.text(topicArr[index]);\n //adds button to areaToAddTo\n $(areaToAddTo).append(title);\n }\n }", "function createNote(number_of_note, notesArray, tagsArray) {\n for(var i = 0; i < number_of_note; i++) {\n $(\".notes\").append(\"<div class='note'><div class='notetext'>\" + notesArray[i] + \"</div><div class='notetag'>#\" + tagsArray[i] + \"</div><div class='notecontrol'><div class='highlight'>Highlight</div><div class='addtocanvas'>Add to Canvas</div><div class='deletenote'>Delete</div></div></div>\");\n }\n}", "function makeFavBtn(topic) {\n var topicButton = $('<button>');\n\n topicButton.text(topic);\n topicButton.attr('data-food', topic);\n topicButton.addClass('topic-button grey-text m-1');\n $('#fav-topics').append(topicButton);\n}", "function createTodo(text){\n \n}", "function createNewToDo(textValue){\n //creating text from input\n var parentDiv = document.getElementById('todo-container');\n var originalUl = document.getElementById('list');\n var newToDo = document.createElement('ul');\n newToDo.classList.add('list');\n newToDo.innerText = textValue;\n\n\n //create remove button\n var rmvButton = document.createElement('button');\n rmvButton.setAttribute(\"id\", \"remove-button\");\n rmvButton.innerHTML = \"Remove\";\n\n\n\n\n //create checked button\n var cheButton = document.createElement('button');\n cheButton.setAttribute(\"id\", \"checked-button\");\n cheButton.innerHTML = \"Checked\";\n\n //where the new list-item will go in the DOM\n parentDiv.insertBefore(newToDo, originalUl);\n newToDo.appendChild(rmvButton);\n newToDo.appendChild(cheButton);\n }", "function createSubmitButton(){\r\n var submitButton = document.createElement(\"button\");\r\n submitButton.setAttribute(\"id\", \"handIN\");\r\n submitButton.onclick = function(){\r\n submitChoice();\r\n closeModalWrapper();\r\n };\r\n submitButton.innerHTML = \"save\";\r\n document.getElementById(\"newTuple\").appendChild(submitButton);\r\n}", "function createNoteGenerator() {\n // Create note generator elements\n const form = document.createElement(\"form\");\n form.classList.add(\"form-note-add\");\n form.action = \"\";\n form.method = \"post\";\n\n const noteTitle = document.createElement(\"input\");\n noteTitle.classList.add(\"note-title\");\n noteTitle.placeholder = \"Title\";\n noteTitle.name = \"noteTitle\";\n noteTitle.autocomplete = \"off\";\n\n const noteContent = document.createElement(\"textarea\");\n noteContent.classList.add(\"note-content\");\n noteContent.placeholder = \"Take a note...\";\n noteContent.name = \"noteContent\";\n noteContent.autocomplete = \"off\";\n\n\n // Focus note content when the thread becomes idle\n window.setTimeout(function () {\n noteContent.focus();\n }, 0);\n\n noteContent.addEventListener(\"keydown\", () => {\n autoGrow(noteContent);\n });\n\n const buttons = document.createElement(\"div\");\n buttons.classList.add(\"overlay-buttons\");\n\n const inputAddNote = document.createElement(\"input\");\n inputAddNote.type = \"hidden\";\n inputAddNote.name = \"inputAddNote\";\n inputAddNote.value = \"AddNote\";\n\n const buttonCreatorNote = document.createElement(\"button\");\n buttonCreatorNote.classList.add(\"btn-creator-add-note\");\n buttonCreatorNote.innerText = \"Add note\";\n buttonCreatorNote.type = \"submit\";\n buttonCreatorNote.name = \"buttonAddNote\";\n buttonCreatorNote.value = \"AddNote\";\n // Form submit post when adding a node card\n buttonCreatorNote.addEventListener(\"click\", () => {\n document.querySelector(\".form-note-add\").submit();\n });\n\n const buttonCancel = document.createElement(\"button\");\n buttonCancel.classList.add(\"btn-creator-cancel\");\n buttonCancel.innerText = \"Cancel\";\n buttonCancel.type = \"button\";\n\n listenAddCancelButton(buttonCreatorNote, buttonCancel);\n\n buttons.appendChild(buttonCreatorNote);\n buttons.appendChild(buttonCancel);\n\n\n const overlayNoteCreator = document.createElement(\"div\");\n overlayNoteCreator.classList.add(\"overlay-note-creator\");\n form.appendChild(noteTitle);\n form.appendChild(noteContent);\n form.appendChild(buttons);\n form.appendChild(inputAddNote);\n overlayNoteCreator.appendChild(form);\n\n addBgBlur();\n\n const body = document.querySelector(\"body\");\n body.appendChild(overlayNoteCreator);\n}", "function forSingleElement(name, type, div) {\n var button = document.createElement('button');\n button.style.margin = '10px';\n button.innerHTML = name;\n button.style.background = getRandomColor();\n button.setAttribute('title', type);\n div.appendChild(button);\n}", "function renderNote(note)\n {\n var curNote = document.createElement('li');\n var noteTextBox = note.textBox;\n noteTextBox.setAttribute('class', 'noteTextBox');\n noteTextBox.setAttribute('type', 'text');\n noteTextBox.setAttribute.disabled = true;\n noteTextBox.value = note.msg;\n console.log('Note is active: ', note.active);\n if(!note.active)\n noteTextBox.style.textDecoration = 'line-through';\n else\n noteTextBox.style.textDecoration = 'none';\n curNote.appendChild(noteTextBox);\n curNote.appendChild(note.deleteButton);\n curNote.appendChild(note.editButton);\n curNote.appendChild(note.saveButton);\n curNote.appendChild(note.doneButton);\n curNote.appendChild(note.notDoneButton);\n curNote.appendChild(note.addButton);\n if(note.subNotes.length > 0)\n {\n var newNote = document.createElement('ol');\n for(var i = 0; i < note.subNotes.length; i++)\n newNote.appendChild(renderNote(note.subNotes[i]));\n curNote.appendChild(newNote);\n }\n return curNote;\n }", "function createButton (action, name) {\n var button = document.createElement('button');\n button.innerHTML = name;\n button.setAttribute('id', action);\n document.getElementById('visualizer').appendChild(button);\n}", "function initialBtn(topics,classToAdd,areaToAddTo){\n\t// Must empty area everytime we add a new button (otherwise there will be duplicates)\n\t$(areaToAddTo).empty();\n\tfor(var i=0; i < topics.length; i++){\n\t\tvar a = $('<button>');\n\t\ta.addClass(classToAdd);\n\t\ta.attr('data-type',topics[i]);\n\t\ta.text(topics[i]);\n\t\t$(areaToAddTo).append(a);\n\t}\n}", "function addNote() {\n var form = document.getElementById(\"note-form\");\n var title = document.getElementById(\"title\").value;\n var content = document.getElementById(\"contentbody\").value;\n var pri = document.getElementById(\"priority\").value;\n if (title !== \"\" && content !== \"\") {\n notes.push({\n title: `${title}`,\n content: `${content}`,\n pri: pri,\n id: c,\n state: 1\n });\n sendmsg(\"Note Added\", \"success\");\n } else {\n sendmsg(\"Fill all Fields\", \"danger\");\n }\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"contentbody\").value = \"\";\n c++;\n saveNotes();\n postNotes();\n btn.innerHTML = \"Add\";\n}", "function createButton (text) {\n //console.log(\"Creating a button\");\n var element = document.createElement(\"BUTTON\");\n var textNode = document.createTextNode(text);\n element.appendChild(textNode);\n return element;\n }", "makeNote (note) {\n const el = this.page.noteTemplate.cloneNode(true)\n if (note.severity > ntfn.POKE) {\n const cls = note.severity === ntfn.SUCCESS ? 'good' : note.severity === ntfn.WARNING ? 'warn' : 'bad'\n el.querySelector('div.note-indicator').classList.add(cls)\n }\n\n el.querySelector('div.note-subject').textContent = note.subject\n el.querySelector('div.note-details').textContent = note.details\n return el\n }", "function addLittleButtonsTopic() {\n \n //console.log(INSIDE addLittleButtonsTopic, thisTopicID: \" + thisTopicId);\n //console.log(also inside addLittleButtonsTopic, thisTopicText: \" + thisTopicText);\n //console.log(also inside addLittlebuttonsTopic, thisTopicAnswer: \" + thisTopicAnswer);\n // append the delete and edit buttons, with the id of the current topic as data\n thisBox.append(\n \"<button type='button' class='btn btn-default btn-xs littleXTopic' data_idtopic=\" +\n thisTopicId + \">\" +\n \"<span class='glyphicon glyphicon-remove' aria-hidden='true'></span></button>\");\n var newEditButton = $(\"<span>\");\n newEditButton.attr(\"type\", \"button\");\n newEditButton.addClass(\"btn\");\n newEditButton.addClass(\"btn-default\");\n newEditButton.addClass(\"btn-xs\");\n newEditButton.addClass(\"littleETopic\");\n newEditButton.addClass(\"glyphicon\");\n newEditButton.addClass(\"glyphicon-pencil\");\n newEditButton.attr(\"aria-hidden\", \"true\");\n newEditButton.attr(\"data-idtopic\", thisTopicId);\n newEditButton.attr(\"data-texttopic\", thisTopicText);\n newEditButton.attr(\"data-textanswer\", thisTopicAnswer);\n thisBox.append(newEditButton);\n }", "function generate_button(href, type, text) {\n var button = '<a class=\"btn btn-' + type + '\" ';\n button += 'href=\"' + href + '\" ';\n button += 'data-remote=\"true\" data-method=\"patch\">';\n button += text + '</a>';\n return button;\n }", "static newItem(id, txt) {\n return `<li id='${id}'><button class=\"w3-btn w3-bar w3-red\" type=button\">${txt} <b>&times;</b></button></li>`;\n }", "function _event_contact_person_note(e){\n try{\n var note_win = Ti.UI.createWindow({\n title:'Edit Note',\n url:self.get_file_path('url', 'base/edit_textarea_field.js'),\n content:_client_contact_note,\n source:'edit_client_contact_note'\n });\n Titanium.UI.currentTab.open(note_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_note');\n return;\n }\n }", "function createButton(label, container) {\n\t var btn = L.DomUtil.create('button', '', container);\n\t btn.setAttribute('type', 'button');\n\t btn.innerHTML = label;\n\t return btn;\n\t}", "function createButton(label, container) {\n\t var btn = L.DomUtil.create('button', '', container);\n\t btn.setAttribute('type', 'button');\n\t btn.innerHTML = label;\n\t return btn;\n\t}", "function addLittleButtonsAnswer() {\n \n //console.log(INSIDE addLittleButtonsAnswer, thisTopicID: \" + thisTopicId);\n //console.log(also inside addLittlebuttonsAnswer, thisTopicText: \" + thisTopicText);\n //console.log(also inside addLittlebuttonsAnswer, thisTopicAnswer: \" + thisTopicAnswer);\n // append the delete and edit buttons, with the id of the current topic as data\n thisBox.append(\n \"<button type='button' class='btn btn-default btn-xs littleXAnswer' data_idtopic=\" +\n thisTopicId + \">\" +\n \"<span class='glyphicon glyphicon-remove' aria-hidden='true'></span></button>\");\n var newEditButton = $(\"<span>\");\n newEditButton.attr(\"type\", \"button\");\n newEditButton.addClass(\"btn\");\n newEditButton.addClass(\"btn-default\");\n newEditButton.addClass(\"btn-xs\");\n newEditButton.addClass(\"littleEAnswer\");\n newEditButton.addClass(\"glyphicon\");\n newEditButton.addClass(\"glyphicon-pencil\");\n newEditButton.attr(\"aria-hidden\", \"true\");\n newEditButton.attr(\"data-idtopic\", thisTopicId);\n newEditButton.attr(\"data-texttopic\", thisTopicText);\n newEditButton.attr(\"data-textanswer\", thisTopicAnswer);\n thisBox.append(newEditButton);\n }", "function createSubmitButton() {\n var submitInstance = document.createElement(\"input\");\n var formEl = document.getElementById(\"form\");\n submitInstance.id = \"submitInstance\";\n submitInstance.type = \"button\";\n submitInstance.value = \"Preview Widget\";\n submitInstance.classList.add(\"submitInstance\");\n formEl.appendChild(submitInstance);\n}", "function addSpeakButton() {\n const excersice = document.querySelector(excersiceSelector)\n const speakerButton = document.createElement('button');\n speakerButton.setAttribute('class', 'speaker-button');\n excersice.insertAdjacentElement('afterend', speakerButton);\n speakerButton.addEventListener('click', speakExcersie);\n}", "function createNote(message){\n let noteDiv = document.getElementById('note-container')\n \n let note = `\n <div class=\"callout\">\n <span class=\"callout-closebtn\">&times;</span>\n <div class=\"callout-container\">\n <img src=\"./animations/corgigoingoff.gif\">\n <p>${message}</p>\n </div>\n </div>\n `\n noteDiv.innerHTML += note\n noteDiv.hidden = false\n noteDiv.addEventListener('click', removeNote)\n\n}" ]
[ "0.7222623", "0.7120385", "0.6857252", "0.6772915", "0.65991366", "0.65508413", "0.6453268", "0.6397792", "0.6396739", "0.6383935", "0.626317", "0.6256256", "0.61936224", "0.61821014", "0.6176898", "0.6175251", "0.61672544", "0.61396337", "0.6117959", "0.61174834", "0.6114075", "0.61122274", "0.6108717", "0.60875", "0.6080546", "0.604834", "0.60408", "0.60263014", "0.60182834", "0.6012467", "0.5996779", "0.5995448", "0.599219", "0.59744495", "0.59651405", "0.59580904", "0.59561425", "0.59530133", "0.5948784", "0.5940614", "0.59338444", "0.592854", "0.5922665", "0.58752424", "0.5872502", "0.58692497", "0.58581376", "0.5842718", "0.5838825", "0.5837004", "0.5821777", "0.581787", "0.58137345", "0.5812598", "0.5808562", "0.5804641", "0.57881916", "0.57829505", "0.57779527", "0.5777049", "0.57719946", "0.57683754", "0.576835", "0.57674456", "0.5750198", "0.5740367", "0.57370436", "0.5735187", "0.5723685", "0.57174915", "0.5705196", "0.5700577", "0.56942475", "0.56710815", "0.56695056", "0.56599414", "0.56496274", "0.56493425", "0.56480825", "0.56454504", "0.56409055", "0.56399167", "0.5633854", "0.56293356", "0.5624175", "0.56161934", "0.5611572", "0.5609932", "0.5609158", "0.56024975", "0.56023455", "0.56018096", "0.5596347", "0.5595435", "0.55913264", "0.55913264", "0.5587314", "0.558186", "0.55812407", "0.55793166" ]
0.6875298
2
what the createNewNoteButton contains
function buttonContent() { let listButtons = document.createElement("ul"); noteButton.appendChild(listButtons); let b1 = document.createElement("li"); let b1img = document.createElement("img"); b1img.src = "/media/card-list.svg"; b1img.height = "50"; b1img.width = "50"; listButtons.appendChild(b1); b1.appendChild(b1img); b1.addEventListener("click", function () { allNotes.push(new Note(2)); saveNotesToLocalStorage(); }); let b2 = document.createElement("li"); let b2img = document.createElement("img"); b2img.src = "/media/card-text.svg"; b2img.width = "50"; b2img.height = "50"; listButtons.appendChild(b2); b2.appendChild(b2img); b2.addEventListener("click", function () { allNotes.push(new Note(1)); saveNotesToLocalStorage(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addButtonClick(){\n\t\tvar note = Note();\n\t\tstorage.push(note);\n\t\tdisplayNotes();\n\n\t}", "function addNoteButton(note) {\n var li = $(\"<div />\", slide.contentDocument);\n li.addClass(\"noteButton\");\n var time = $(\"<div />\", slide.contentDocument);\n time.addClass(\"noteButtonTime\");\n time.text(new Date(note.time).toLocaleString());\n li.append(time);\n var summary = $(\"<div />\", slide.contentDocument);\n summary.addClass(\"noteButtonSummary\");\n summary.text(noteSummary(note));\n li.append(summary);\n li.click(function () showNote(note, li));\n $(\"#noteList\", slide.contentDocument).append(li);\n return li;\n }", "onClick(e) {\r\n this.insertNewNote(this);\r\n }", "function addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}", "function createBtnConfirm() {\n let btnConfirm = document.createElement(\"button\");\n btnConfirm.className = \"note-button note-button-bottom\";\n btnConfirm.addEventListener(\"click\", function () {\n saveNotesToLocalStorage();\n });\n btnConfirm.appendChild(createImgConfirm());\n return btnConfirm;\n}", "function makeNote(note) {\n let noteLi = document.createElement(\"li\")\n noteLi.innerText = note.title\n noteLi.className= 'note-li'\n noteLi.dataset.id = note.id\n noteList.append(noteLi)\n\n //How to crete delete button\n let delBtn = document.createElement(\"button\")\n delBtn.innerText = \"delete\"\n delBtn.className = \"del-btn\"\n delBtn.dataset.id = note.id\n noteLi.append(delBtn)\n }", "function creatNote(tex,priority) {\n const notesContainer = document.getElementById('notes-container');\n const newP = document.createElement('p');\n newP.className = `note ${priority}`;\n newP.innerText = tex;\n\n const deletBtn = document.createElement('button');\n deletBtn.className = 'remove-btn';\n deletBtn.innerText = 'X'; \n deletBtn.onclick = removeNote;\n newP.appendChild(deletBtn);\n\n\n notesContainer.appendChild(newP);\n}", "function addNote() {\r\n const newNote = document.createElement('div')\r\n newNote.classList.add('note--new')\r\n\r\n const noteText = document.createElement('li')\r\n noteText.innerText = inputText.value\r\n noteText.classList.add('note--text')\r\n newNote.appendChild(noteText)\r\n\r\n const noteView = document.createElement('button')\r\n noteView.innerHTML = '<i class=\"far fa-eye\"></i>'\r\n noteView.classList.add('note--view-btn')\r\n newNote.appendChild(noteView)\r\n\r\n const noteDelete = document.createElement('button')\r\n noteDelete.innerHTML = '<i class=\"fas fa-trash\"></i>'\r\n noteDelete.classList.add('note--delete-btn')\r\n newNote.appendChild(noteDelete)\r\n\r\n noteContainer.appendChild(newNote)\r\n\r\n console.log(noteText.innerText)\r\n\r\n inputText.value = ''\r\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 handleNoteButtonEvent(thisObj) {\n _changed = true;\n if ($(thisObj.getHtmlIds().noteContainer).visible()) {\n if (thisObj.getStandardValue() == thisObj.getMeta().seeNoteCui) {\n thisObj.clearNote();\n }\n else {\n thisObj.hideNote();\n }\n }\n else {\n thisObj.showNote();\n }\n }", "function addNote() { \n SidebarActions.createNote('Content', $scope.data.thisContent); \n}", "function newNote() {\n var csrftoken = $.cookie('csrftoken'),\n folder_id = $('.folder-list>.active>a').attr(\"data-folderid\"),\n data = {\n title: \"Untitled note\",\n body: \"<br>\",\n folder_id: folder_id,\n csrfmiddlewaretoken: csrftoken\n };\n $.post(\"/notes/addnote/\", data, function (data) {\n $('#notelist').children().prepend(data).children().first().trigger('click');\n $('#title').empty();\n });\n }", "function createNoteByClick() {\n var newDate = new Date();\n var noteId = newDate.getTime();\n bq.setAttribute(\"id\", \"note-\" + noteId);\n bq.innerText = null;\n localStorage.setItem(noteId, \"\");\n bq.focus();\n}", "function addNote(e) {\n\n const userText = note.value;\n const newNote = document.createElement('div');\n newNote.classList.add('note')\n newNote.innerHTML = '<p class=\"noteText\">' + userText + '</p> <button onclick=\"focusNote(this)\" class=\"buttonNote\">view details</button>';\n\n const enfant = noteContainer.children;\n\n function createTextBox () {\n noteContainer.appendChild(newNote);\n note.value = \"\";\n console.log(newNote)\n }\n\n if (enfant[0].classList.contains('delete')){\n enfant[0].remove(); \n createTextBox ();\n } else {\n createTextBox ();\n }\n e.preventDefault();\n}", "function addNote() {\n let titleEl = document.getElementById(\"title\")\n let detailsEl = document.getElementById(\"details\")\n\n newNote = new Note(titleEl.value, detailsEl.value)\n allNotes.push(newNote)\n\n printNote(newNote)\n resetFields(titleEl, detailsEl)\n checkBadWords(newNote)\n // changeBackground()\n}", "function getNote() {\n const li = document.createElement('LI')\n li.className = 'fill'\n li.id = 'list-tag'\n li.setAttribute('draggable', 'true')\n\n // I am creating a div element that will wrap the text coming from textarea input.\n let divTag = document.createElement('div')\n divTag.className = 'div-tag';\n divTag.setAttribute('id', lastid)\n divTag.innerText = textInput.value\n li.appendChild(divTag)\n\n // I am creating a button element that will be a sibling to the div element created earlier. And they will get appended to the same parent element. \n const edit = document.createElement('button')\n edit.className = 'modify';\n edit.setAttribute('id', lastid)\n edit.innerText = 'EDIT';\n li.appendChild(edit)\n \n // Same as above in line 71\n const deleteBtn = document.createElement('button');\n deleteBtn.className = 'erase';\n deleteBtn.setAttribute('id', lastid)\n deleteBtn.appendChild(document.createTextNode('DELETE'));\n li.appendChild(deleteBtn)\n \n lastid += 1;\n orderList.appendChild(li)\n}", "function addNote(e) {\n e.preventDefault();\n let newNote = document.createElement(\"div\");\n newNote.className = \"parent-note\";\n newNote.innerHTML = `<div class=\"my-note\" onclick=swapNotes(this)>\n <div class=\"x-btn-container\">\n <button type=\"button\" class=\"x-button\" onclick=deleteNote(this.parentNode.parentNode)>X</button>\n </div>\n <p> ${input.value} </p>\n <button type=\"button\" onclick=editNote(this.parentNode.parentNode)>Edit</button>\n </div>\n `;\n myNotes.appendChild(newNote);\n input.value = \"\";\n}", "function addNote() {\n self.showAdd = !self.showAdd;\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 addLittleButtonsAnswer() {\n \n //console.log(INSIDE addLittleButtonsAnswer, thisTopicID: \" + thisTopicId);\n //console.log(also inside addLittlebuttonsAnswer, thisTopicText: \" + thisTopicText);\n //console.log(also inside addLittlebuttonsAnswer, thisTopicAnswer: \" + thisTopicAnswer);\n // append the delete and edit buttons, with the id of the current topic as data\n thisBox.append(\n \"<button type='button' class='btn btn-default btn-xs littleXAnswer' data_idtopic=\" +\n thisTopicId + \">\" +\n \"<span class='glyphicon glyphicon-remove' aria-hidden='true'></span></button>\");\n var newEditButton = $(\"<span>\");\n newEditButton.attr(\"type\", \"button\");\n newEditButton.addClass(\"btn\");\n newEditButton.addClass(\"btn-default\");\n newEditButton.addClass(\"btn-xs\");\n newEditButton.addClass(\"littleEAnswer\");\n newEditButton.addClass(\"glyphicon\");\n newEditButton.addClass(\"glyphicon-pencil\");\n newEditButton.attr(\"aria-hidden\", \"true\");\n newEditButton.attr(\"data-idtopic\", thisTopicId);\n newEditButton.attr(\"data-texttopic\", thisTopicText);\n newEditButton.attr(\"data-textanswer\", thisTopicAnswer);\n thisBox.append(newEditButton);\n }", "function enableShowNotesButton() {\n var needed = false;\n for (let i = 0; i < activeQuestion.clues.length; i++) {\n note = activeQuestion.clues[i].r;\n if (note !== \"\") {\n needed = true;\n }\n }\n if (needed) {\n document.getElementById(\"notes-button\").classList.add(\"control-button-active\");\n }\n}", "function createNoteButtons(buttonInfo) {\n // create a div element to hold the buttons in\n let div = document.createElement(\"div\");\n let buttons = [];\n\n // create a button each button object defined in buttonInfo\n buttonInfo.forEach(function(setOfInfo) {\n let button = createButton();\n let buttonText = document.createTextNode(setOfInfo.label);\n button.appendChild(buttonText);\n setOfInfo.classes.forEach(classItem => button.classList.add(classItem));\n\n //put each button in the buttons array\n buttons.push(button);\n })\n\n //put the buttons in the div\n buttons.forEach(button => div.appendChild(button));\n \n return div;\n}", "function note_add(_Poc,_text){\r\n\tNotecurrent_IdNUM++;\r\n\tvar newnote ={\r\n\t\tid:'note'+Notecurrent_IdNUM\r\n\t\t,x: _Poc.x\r\n\t\t,y: _Poc.y\r\n\t\t,text:_text\r\n\t\t,color:defaultCOLOR\r\n\t\t,fontsize:defaultFONTSIZE\r\n\t\t,selected:false\r\n\t};\r\n\tnotes.push(newnote);\r\n\tnumnote++;\r\n\treturn newnote;\r\n}", "function createNewNote(event) {\n event.preventDefault()\n // console.log(event.target.title.value, event.target.content.value)\n const newNoteObj = {}\n newNoteObj.color_id = event.target.color_id.value\n newNoteObj.title = event.target.title.value\n newNoteObj.content = event.target.content.value\n // console.log(newNoteObj) // newNoteObj structure is working: {title: \"meh\", content: \"mehmeh\"}\n postNewNote(newNoteObj) // invoking our postNewNote function here\n renderNoteOnColorShowPage(newNoteObj) // recycling this function (finally, learning to recycle!) Mother Earth you fucking owe me. It works!\n // question for later: wtf happened to those pink notes I created before I added this render? Oh lol I mislabeled it white nvm\n}", "function createNewNoteButton() {\n noteButton = document.createElement(\"div\");\n noteButton.className = \"menuIcon\";\n document.body.appendChild(noteButton);\n let span = document.createElement(\"span\");\n noteButton.appendChild(span);\n let icon = document.createElement(\"img\");\n icon.src = \"/media/plus-circle.svg\";\n icon.width = \"50\";\n icon.height = \"50\";\n span.appendChild(icon);\n noteButton.addEventListener(\"click\", function () {\n let menu = document.querySelector(\".menuIcon\");\n menu.classList.toggle(\"active\");\n });\n}", "function noteId(button) {\n var noteId = button.closest('#todoList').data('noteID');\n return noteId;\n}", "function add_note_button(q_id){\n $(\".alert-notice\").hide();\n $('.view_comment_class').hide();\n $('.edit_comment_class').hide();\n $('.archive_comment_class').hide();\n //$('#add_comment_button_bottom_div_'+ q_id).hide();\n $('#add_comment_button_top_div_'+ q_id).hide();\n //$('#{questionid}new_note_text').text(\"\");\n $('#add_comment_block_div_'+ q_id).show();\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 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 addnotes() {\n const check = document.querySelector(\".addnotes\")\n if (check == null){\n const main = document.getElementById(\"main\");\n const txtarea = document.createElement('textarea' );\n txtarea.className = \"addnotes\";\n const bintxt =document.createTextNode(\"your text goes here\");\n\n txtarea.appendChild(bintxt);\n main.appendChild(txtarea);\n\n const save = document.createElement('button' );\n save.className= \"txtbtn1\"\n const btntxt = document.createTextNode(\"save\");\n\n save.appendChild(btntxt);\n main.appendChild(save);\n\n const dltbtn = document.createElement('button' );\n dltbtn.className= \"txtbtn2\"\n const dlttxt = document.createTextNode(\"delete\");\n\n dltbtn.appendChild(dlttxt);\n main.appendChild(dltbtn);\n \n //removing text area and buttons\n const removetxt= document.querySelector(\".txtbtn2\")\n removetxt.addEventListener(\"click\",function(e){\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n })\n const savenote = document.querySelector(\".txtbtn1\")\n savenote.addEventListener(\"click\",function(s){\n\n if(txtarea.value!==\"your text goes here\"){\n var length = notesarr.length + 1\n var notenum = \"note\" + length.toString()\n notesarr.push({title:notenum,body: txtarea.value})\n \n //adding notes to navbar\n\n const titlebtn = document.createElement(\"button\")\n titlebtn.className= \"titlebtns\"\n const titlebtntxt = document.createTextNode(notenum)\n titlebtn.appendChild(titlebtntxt);\n sidebar.appendChild(titlebtn)\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n\n const display= document.querySelector(\".titlebtns\")\n\n display.addEventListener(\"click\",function(d){\n var notenum = display.innerHTML[4]\n var displaynum = parseInt(notenum)-1\n\n var displaytext =(notesarr[displaynum].body)\n\n var displaynote = document.createElement('textarea' );\n displaynote.className = \"addnotes\";\n var notetxt =document.createTextNode(displaytext);\n\n displaynote.appendChild(notetxt);\n main.appendChild(displaynote);\n\n var cancelbtn = document.createElement(\"button\");\n var cancelbtntxt = document.createTextNode(\"cancel\");\n cancelbtn.className= \"txtbtn2\";\n \n cancelbtn.appendChild(cancelbtntxt);\n main.appendChild(cancelbtn);\n\n //removing displayed note\n\n var removedisplay = document.querySelector(\".txtbtn2\")\n console.log(removedisplay)\n removedisplay.addEventListener(\"click\",function(remove){\n\n main.removeChild(displaynote)\n main.removeChild(cancelbtn)\n })\n\n })\n\n }\n })\n \n }\n\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 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 createBtnDelete(obj) {\n let btnDelete = document.createElement(\"button\");\n btnDelete.id = \"delete-button\";\n btnDelete.className = \"note-button\";\n\n btnDelete.addEventListener(\"click\", function () {\n obj.removeNote();\n });\n btnDelete.appendChild(createImgDelete());\n return btnDelete;\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 addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function addNote() {\n var form = document.getElementById(\"note-form\");\n var title = document.getElementById(\"title\").value;\n var content = document.getElementById(\"contentbody\").value;\n var pri = document.getElementById(\"priority\").value;\n if (title !== \"\" && content !== \"\") {\n notes.push({\n title: `${title}`,\n content: `${content}`,\n pri: pri,\n id: c,\n state: 1\n });\n sendmsg(\"Note Added\", \"success\");\n } else {\n sendmsg(\"Fill all Fields\", \"danger\");\n }\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"contentbody\").value = \"\";\n c++;\n saveNotes();\n postNotes();\n btn.innerHTML = \"Add\";\n}", "function addNote() {\n if (noteText.value === \"\") {\n return;\n } else {\n notesCounter++; // increamenting notes count\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 notes.unshift(note);\n noteDiv.style.background = \"#ffffff\";\n renderNote(note);\n updateDB();\n clearInputs();\n noteHead.style.display = \"none\";\n noteBot.style.display = \"none\";\n }\n}", "function createNote(note) {\n //the note\n codeOfNote = ` <div id=\"${note.noteNum}note\" class=\"ml-xl-5 mr-xl-5 mt-xl-4 mb-xl-4 col-xl-2 m-lg-4 col-lg-3 m-md-5 col-md-4 m-sm-5 col-sm-6 ml-5 col-5 note\">`\n //row of icons \n codeOfNote += `<div class=\"mt-4 row\">`\n // number of note\n codeOfNote += `<div class=\"mb-2 ml-2 col-10 number\">${note.noteNum + 1}</div>`\n // col of icons\n codeOfNote += `<div class=\"p-3 m-1 col-xl-12 col-md-12\">`\n // close icon \n codeOfNote += `<span type=\"button\" id=\"icon\" class=\"glyphicon glyphicon-remove\" onclick=\"deleteNote(${note.noteNum})\"></span>`\n // close divs for row and col of icons\n codeOfNote += `</div> </div>`\n //row of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 md-form row\">`\n // col of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 col-xl-11 col-xl-10 col-md-11 col-sm-10 col-11\">`\n //the text area (i used text area inside the note and not p)\n codeOfNote += `<textarea type=\"text\" id=\"${note.noteNum}Notetextarea\" class=\"Notetextarea\" rows=\"5\" readonly>${note.InputOfNote}</textarea>`\n //scroll bar\n codeOfNote += `<div class=\"scrollbar\" id=\"style-9\"> <div class=\"force-overflow\"></div> </div>`\n // date and time\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.dateOfNote}</small>`\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.timeOfNote}</small>`\n //closing divs\n codeOfNote += `</div> </div> </div> </div> </div>`\n\n}", "function createNote() {\n //object that wraps each note and its delete link\n var $note_div = $(\"<div/>\")\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //select the delete-all button\n var $deleteAllButton = $(\"#delete-all\")\n //create a delete link for each added note\n var $delLink = $('<a>delete</a>').attr({ \n href: \"#\",\n class: \"del-link\"\n });\n //adds a click listener to the delete link\n $delLink.on(\"click\", function () {\n deleteNote(this); \n });\n\n //set content for note\n $note.html($note_text.val());\n //append note and delete link to note_div\n $note_div.append($note);\n $note_div.append($delLink);\n //hide new note_div to setup fadeIn...\n $note_div.hide();\n //append note_div to note-output\n $(\".note-output\").append($note_div);\n\n //fadeIn hidden new note_div and conditionally \n // the deleteAllButton\n if ($deleteAllButton.is(\":hidden\"))\n $deleteAllButton.fadeIn(\"slow\");\n $note_div.fadeIn(\"slow\");\n $note_text.val(\"\");\n }\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 newNote() {\n document.getElementById('note_area').value = '';\n document.getElementById('note_area').readOnly = false;\n document.getElementById('btnDelNote').disabled = true;\n document.getElementById('btnEditNote').disabled = true;\n\n oSelectedNote = null;\n}", "function addNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\tappendNote(tr, defaultNote);\r\n\taddState();\r\n\t\r\n\trefreshNotes();\r\n}", "function writeNotes(notes) {\n const notesDiv = document.querySelector('#notes');\n // clear the div\n notesDiv.innerHTML = '';\n // add all items as Ps to the div\n notes.forEach(function(note) {\n const newItem = document.createElement('p');\n const span1 = document.createElement('span');\n const newButton = document.createElement('button');\n span1.textContent = note.body;\n newButton.textContent = \"x\";\n newButton.addEventListener('click', function() {\n removeNote(note.id);\n localStorage.setItem( 'notes', JSON.stringify(notes) );\n writeNotes(notes);\n });\n // construct the p and append it\n newItem.appendChild(newButton);\n newItem.appendChild(span1);\n notesDiv.appendChild(newItem);\n });\n}", "function getRemoveBtn() {\n let div = document.createElement('div');\n div.innerHTML =\n '<img src=\"images/remove.png\" id=\"image\" style=\"width:30px;height:30px\"/>';\n div.setAttribute('style', 'display: inline;');\n div.addEventListener('click', removeNote, false);\n\n return div;\n }", "function renderNoteInfo(aNote) {\n while(noteTitle.firstChild){\n noteTitle.removeChild(noteTitle.firstChild)\n }\n noteTitle.innerHTML = `<h2>${aNote.title}</h2>`\n let n = document.createElement('p')\n n.innerHTML = `<a>${aNote.content}</a>\n <br>\n <br>\n <button data-id=${aNote.id} id=\"editNoteBtn\">Edit this note</button>\n <button data-id=${aNote.id} id=\"deleteNoteBtn\">Delete this note</button>\n `\n noteTitle.appendChild(n)\n}", "function showNote(event) {\n const note = findNote(event);\n if (!note) {\n return;\n }\n\n if (fretboardDiv.lastChild !== image) {\n if (fretboardDiv.lastChild.innerHTML === note.note) {\n return;\n }\n\n removeChildren();\n }\n\n fretboardDiv.appendChild(createButton(note));\n}", "function addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // create HTML node from note object\n const node = createItem(note);\n // append created node in HTML\n noteList.appendChild(node);\n // put created node in Map to match it with note\n map.set(node, note);\n // push current note to notes object\n notes.push(note);\n // overwrite notes in indexedDB with notes\n idbKeyval.set('notes', notes)\n .catch(err => console.error('submit failed: ', err));\n // reset input values\n noteBody.value = '';\n noteImg.value = '';\n noteAlt.value = '';\n }", "function addLittleButtonsTopic() {\n \n //console.log(INSIDE addLittleButtonsTopic, thisTopicID: \" + thisTopicId);\n //console.log(also inside addLittleButtonsTopic, thisTopicText: \" + thisTopicText);\n //console.log(also inside addLittlebuttonsTopic, thisTopicAnswer: \" + thisTopicAnswer);\n // append the delete and edit buttons, with the id of the current topic as data\n thisBox.append(\n \"<button type='button' class='btn btn-default btn-xs littleXTopic' data_idtopic=\" +\n thisTopicId + \">\" +\n \"<span class='glyphicon glyphicon-remove' aria-hidden='true'></span></button>\");\n var newEditButton = $(\"<span>\");\n newEditButton.attr(\"type\", \"button\");\n newEditButton.addClass(\"btn\");\n newEditButton.addClass(\"btn-default\");\n newEditButton.addClass(\"btn-xs\");\n newEditButton.addClass(\"littleETopic\");\n newEditButton.addClass(\"glyphicon\");\n newEditButton.addClass(\"glyphicon-pencil\");\n newEditButton.attr(\"aria-hidden\", \"true\");\n newEditButton.attr(\"data-idtopic\", thisTopicId);\n newEditButton.attr(\"data-texttopic\", thisTopicText);\n newEditButton.attr(\"data-textanswer\", thisTopicAnswer);\n thisBox.append(newEditButton);\n }", "handler () {\n notes.addNote(title, body);\n }", "function createNote() {\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //set content for note\n $note.html($note_text.val());\n //append note text to note-output\n $(\".note-output\").append($note);\n $note_text.val(\"\");\n }\n }", "function addNote(note){\n let noteElement = document.createElement(\"div\");\n noteElement.addEventListener(\"change\",updateNote);\n noteElement.classList.add(\"noteid\"+notes.indexOf(note));\n noteElement.classList.add(\"note\");\n noteElement.style.backgroundColor = note.color;\n let pinElement = document.createElement(\"div\");\n pinElement.classList.add(\"pin\");\n if(note.pinned)\n pinElement.classList.add(\"pinoff\");\n else\n pinElement.classList.add(\"pinon\");\n pinElement.addEventListener(\"click\",pinSwitch);\n noteElement.appendChild(pinElement);\n let titleElement = document.createElement(\"input\");\n titleElement.type = \"text\";\n titleElement.name = \"title\";\n titleElement.value = note.title;\n noteElement.appendChild(titleElement);\n let contentElement = document.createElement(\"textarea\");\n contentElement.value = note.content;\n contentElement.name = \"content\";\n noteElement.appendChild(contentElement);\n let colorElement = document.createElement(\"input\");\n colorElement.type = \"color\";\n colorElement.name = \"color\";\n colorElement.value = note.color;\n noteElement.appendChild(colorElement);\n let created = document.createElement(\"p\");\n let time = new Date(note.created);\n created.innerHTML = \"Created: \" + time.toLocaleString();\n noteElement.appendChild(created);\n if(note.pinned)\n document.querySelector(\".pinned\").appendChild(noteElement);\n else\n document.querySelector(\".notes\").appendChild(noteElement);\n}", "handleNewNote(event) {\n console.log('new note :D');\n \n //TODO ALL:\n //? ask user to save / discard current note if one is selected and has been modified\n //! REMOVE SAVEDNOTES DATA WHILE TESTING\n //* create new note object and save as selectedNote\n //* if the selectedNote is saved it will need to be added to savedNotes\n\n //* setup for new note object\n let notesCreated = this.state.notesCreated; //* id based on number of notes created (not tied to savedNotes.size)\n const selectedNote = {\n id: notesCreated,\n lastSaved: (new Date()).toUTCString(),\n title: '',\n text: ''\n };\n\n notesCreated += 1; //* updates number of notes created\n this.setState({ notesCreated, selectedNote }); \n }", "function addNote(text) {\n var newNote = $(\"<div class = 'note'></div>\");\n var icons = $(\"<div class = 'icons'></div>\");\n\n var tag = $(\"<i class = 'fa fa-tag' aria-hidden = 'true'></i>\");\n var removeButton = $(\"<i class = 'fa fa-times' aria-hidden = 'true'></i>\");\n var textBox = $(\"<textarea></textarea>\");\n\n if (text != undefined) textBox.val(text);\n\n tag.click(changeColor);\n textBox.blur(saveNotes);\n removeButton.click(function() {\n newNote.remove();\n saveNotes();\n });\n\n icons.append(tag);\n icons.append(removeButton);\n\n newNote.append(icons);\n newNote.append(textBox);\n newNote.appendTo($(\"#sticky-notes\"));\n saveNotes();\n}", "function renderNote(note)\n {\n var curNote = document.createElement('li');\n var noteTextBox = note.textBox;\n noteTextBox.setAttribute('class', 'noteTextBox');\n noteTextBox.setAttribute('type', 'text');\n noteTextBox.setAttribute.disabled = true;\n noteTextBox.value = note.msg;\n console.log('Note is active: ', note.active);\n if(!note.active)\n noteTextBox.style.textDecoration = 'line-through';\n else\n noteTextBox.style.textDecoration = 'none';\n curNote.appendChild(noteTextBox);\n curNote.appendChild(note.deleteButton);\n curNote.appendChild(note.editButton);\n curNote.appendChild(note.saveButton);\n curNote.appendChild(note.doneButton);\n curNote.appendChild(note.notDoneButton);\n curNote.appendChild(note.addButton);\n if(note.subNotes.length > 0)\n {\n var newNote = document.createElement('ol');\n for(var i = 0; i < note.subNotes.length; i++)\n newNote.appendChild(renderNote(note.subNotes[i]));\n curNote.appendChild(newNote);\n }\n return curNote;\n }", "function updatePreviewWithNote(sender, paeNote) {\r\n // console.log(\"key pressed is \" + paeNote)\r\n plaineEasieCodes.push(paeNote)\r\n updateNotesSVG()\r\n}", "function popupnotes_onclickSave()\n{\n notes_info.notes=frmPatientSummary.textareanotes.text.trim();\n notes_list.push(notes_info);\n frmPatientSummary.fcpopupnotes.setVisibility(false);\n frmPatientSummary.fcpatientsummaryheaderhover.setVisibility(false);\n frmPatientSummary.fcpatientsummaryfooterhover.setVisibility(false);\n}", "function addNotes(){\n //i++;\n //var textfield=document.querySelector('.textfield');\n var noteslist=document.querySelector('.notesList');\n var textarea=document.querySelector('.textarea').value;\n var note=document.createElement('div');\n \n // note.id=\"div\"+i;\n var content=document.createTextNode(textarea);\n console.log(content)\n note.appendChild(content);\n note.style.display=\"inline-block\";\n note.style.width='50%';\n note.style.background=\"lightblue\";\n noteslist.appendChild(note);\n //console\n \n\n }", "function addNote(lectureID, slideID, note) {\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n objectStore.add({\n slideID: slideID,\n lectureID: lectureID,\n note: note\n }).onsuccess = function(e) {\n // Add a radio button for the note.\n addNoteButton(\n \"Note \" + e.target.result\n + \": Lecture \" + lectureID\n + \" - Slide \"+ slideID,\n e.target.result, note\n );\n };\n}", "renderFormButtons() {\n //if the note.id exists, then we can either delete or edit that note\n if (this.props.note.id !== undefined) {\n return (<div>\n { /* Show the save button to edit note */}\n <button type=\"submit\" className=\"btn btn-success float-right\">Add Note</button>\n { /* Show the delete button to delete note */}\n <button onClick={this.deleteNote} className=\"btn btn-danger\">Delete Note</button>\n </div>);\n }\n return (\n /* Show the add button to save a new note */\n <button type=\"submit\" className=\"btn btn-success float-right\">Add Note</button>\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 createNote(){\n\t// Single function to get value from any input\n\tvar getVal = function(param){\n\t\treturn $get(param).value;\n\t};\n/*\n\t// function to add index numbers - param for id/class/element to count\n\t// Over complicated\n\tvar count = function(param){\n\t\tif (!!$get(param)){ // if there already are notes\n\t\t\treturn ($getAll(param).length) +1; // count them\n\t\t}\n\t\telse { // else this is the first note\n\t\t\treturn 1;\n\t\t}\t\n\t}\n*/\n//\tvar count = 0; // too simple, what if we start with notes?\n\n\n\tvar count = function() {\n\t\treturn ($getAll('.box').length) +1;\n\t} \n\n\tif ( !!(getVal('#noteText')) && !!(getVal('#colourPick')) ){ // if input not empty\n\t\n\t\tvar noteNumber = document.createTextNode(count());\n\n\t\tvar noteNumberPar = document.createElement('span');\n\t\t\tnoteNumberPar.className = 'noteNumber';\n\t\t\tnoteNumberPar.id ='noteNumber'+count();\n\t\t\tnoteNumberPar.appendChild(noteNumber);\n\n\t\tvar stickyText = document.createTextNode(getVal('#noteText'));\n\t\t\n\t\t// div template for sticky note\n\t\tvar template = document.createElement('div');\n\t\t\ttemplate.className = 'box';\n\t\t\t// get value of selected colour from dropdown menu\n\t\t\ttemplate.style.backgroundColor = getVal('#colourPick');\n\t\t\t// Call count function and concatonate with input text\t\n\t\t\ttemplate.appendChild(noteNumberPar);\n\t\t\ttemplate.appendChild(stickyText);\n\n\t\t$get('.container').appendChild(template); // add sticky to div.container \n\n\t\t// create textNode to append text into the remove button\n\t\tvar removeID = 'removeButton' + (count()-1)\n\t\tvar x = document.createTextNode('X')\n\t\tvar removeButton = document.createElement('div');\n\t\t\tremoveButton.className = 'removeButton';\n\t\t\tremoveButton.id = removeID;\n\t\t\t// append textNode to rmove button div\n\t\t\tremoveButton.appendChild(x);\n\t\t\n\t\t$getAll('.box')[($getAll('.box').length)-1].appendChild(removeButton);\n\n\t\t// to add event listeners with dynamic element creation\n\t\t// the function to be called must be wrapped in a function declaration\n\t\t$get('#'+removeID).addEventListener('click', removeNote)\n\n\t\t// clear fields ready for next sticky\n\t\t$get('#noteText').value = '';\n\t\treturn false;\n\t} else { // else show alert input is empty\n\t\talert('No note!');\n\t\treturn false;\n\t}\t\n}", "function addNewNote(raphaelName) {\n var color = \"white\";\n var text = \" \";\n\n //find color selected\n $(\".dropdown-menu li\").click(function() {\n color = $(this).text();\n $(\"#dropdownbtn\").text(color);\n if(color == \"Pink\") $(\"#dropdownbtn\").css({\"background-color\": \"#ffc0cb\"});\n if(color == \"Blue\") $(\"#dropdownbtn\").css({\"background-color\": \"#8deeee\"});\n if(color == \"Green\") $(\"#dropdownbtn\").css({\"background-color\": \"#98fb98\"});\n });\n\n //add note to the canvas and send message to all pages\n $(\".addnotebutton\").click(function() {\n text = $(\"#newnoteinput\").val();\n var note = controlNote(raphaelName, 400, 300, color, text);\n pushNote(note);\n\n if(TogetherJS.running) {\n TogetherJS.send({\n type: \"controlNote\",\n xPos: 400,\n yPos: 300,\n noteColor: color,\n text: text,\n ID: note.id\n });\n }\n\n $(\"#dropdownbtn\").text(\"Note Color\");\n $(\"#dropdownbtn\").css({\"background-color\": \"rgb(249, 211, 140)\"});\n $(\"#newnoteinput\").val(\"\");\n text = \" \";\n color = \"white\";\n });\n}", "function buttonCreate(content) {\n var alreadyButtons = [];\n for(x=0; x<y; x++) {\n var loadBtn = JSON.parse(localStorage.getItem(x));\n alreadyButtons.push(loadBtn.id);\n }\n if(!alreadyButtons.includes(content)) { //if condition to check if the button is already there\n var saveBtn = {\"id\":content,\"text\":recipe};\n var button = $(\"<button>\").text(recipe);\n button.val(content);\n button.attr(\"id\", y);\n button.attr(\"style\", \"margin: 5px;\");\n button.addClass(\"button is-info\");\n $(\".addButtons\").append(button);\n localStorage.setItem(y, JSON.stringify(saveBtn)); //saving the recipe searched to local storage\n y = y + 1;\n localStorage.setItem(\"tracker\", y); \n }\n }", "function addNewNote(title , content) {\n setTodoList(prev => {\n var newItem = {\n title : title,\n content: content\n }\n return[...prev, newItem]\n })\n \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 }", "function saveNoteInPopUp() {\n var currentNote = document.querySelector(\".note-list__item[data-item-number='\" + currentNoteId + \"']\");\n notes.forEach(function(element, index) { \n if (element.noteId === currentNoteId) {\n element.noteText = editText.value;\n currentNote.style.background = element.colorBg;\n if (!editHead) {\n element.noteHead = \"\";\n } else {\n element.noteHead = editHead.value;\n }\n }\n });\n currentNote.querySelector(\".note-list__text\").innerHTML = editText.value;\n currentNote.querySelector(\".note-list__head\").innerHTML = editHead.value;\n if (!currentNote.querySelector(\".note-list__head\").innerHTML) {\n currentNote.querySelector(\".note-list__head\").style.marginBottom = \"0px\";\n } else {\n currentNote.querySelector(\".note-list__head\").style.marginBottom = \"10px\";\n }\n notePopUp.style.display = 'none';\n document.querySelector(\".overlay\").style.display = 'none';\n \n }", "function createNoteLiItem(note) {\n const li = $('<li class=\"list-group-item\">');\n const noteBody = $('<p>').text(note.body);\n const deleteNoteBtn = $('<button class=\"btn btn-danger delete-note\">').text('Delete Note');\n deleteNoteBtn.attr('data-note-id', note._id);\n li.append(noteBody, deleteNoteBtn);\n notesElem.append(li);\n }", "function showCreateNoteModal() {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalBody = $('<div >');\n var noteNameInput = $('<input type=\"text\" class=\"form-control form-control-lg\" />');\n var noteNameInputContainer = $('<div class=\"pull-left\"><div class=\"form-group col-sm-12\">');\n var modalFooter = $('<div class=\"pull-right\">');\n var createButton = $('<button type=\"button\" class=\"btn btn-primary\">Create</button>');\n\n // Appending to create the modal content structure\n noteNameInputContainer.append(noteNameInput);\n modalBody.append(noteNameInputContainer);\n modalFooter.append(createButton);\n\n var modal = utils.showModalPopup('Enter a name for your new note', modalBody, modalFooter);\n\n // Registering event listeners for the modal window\n createButton.click(function() {\n createNote(noteNameInput.val());\n modal.modal('hide');\n });\n }", "function createNote(number_of_note, notesArray, tagsArray) {\n for(var i = 0; i < number_of_note; i++) {\n $(\".notes\").append(\"<div class='note'><div class='notetext'>\" + notesArray[i] + \"</div><div class='notetag'>#\" + tagsArray[i] + \"</div><div class='notecontrol'><div class='highlight'>Highlight</div><div class='addtocanvas'>Add to Canvas</div><div class='deletenote'>Delete</div></div></div>\");\n }\n}", "function appendNewButtons(newTopic) {\n var topicButton = createButtonHTML(newTopic);\n $(\"#btn-container\").prepend(topicButton);\n}", "function createNewNote()\n{\n randomNote = int(random(notes.length - 1));\n goalNote = notes[randomNote].note\n goalFrequency = -notes[randomNote].frequency\n\n // play voice over when the new note is created\n playVoiceOver();\n}", "function processNewVariableCreateButtonCallback() {\n \n }", "function btnCreate() {\n\n // number counter, used to give each topic a unique identifier\n num++;\n\n // creation of the dynamic buttons\n userBtn = $(\"<button>\")\n userBtn\n .addClass(\"btn search-term-btn dynamicElement\")\n .appendTo($(\".btn-holder\"))\n .text(topics)\n .attr(\"data-name\", topics);\n\n // pushes the topic out of the array, into a new \"used\" array, this is used as a flag.\n usedTopics.push(topics + num);\n topics = [];\n console.log(num);\n\n\n // create space between buttons ___ Ying\n space = $(\"<span>\")\n\n space\n .text(\"\\xa0\\xa0\")\n .appendTo($(\".btn-holder\"));\n\n\n }", "function setupNoteCreateDialog(commentDialog, observer) {\n observer.disconnect();\n\n let commentDialogRenderer = makeHTML(commentDialogRenderer_raw);\n commentDialog.appendChild(commentDialogRenderer);\n let injectedCommentDialogRenderer = commentDialog.querySelector(\"ytd-comment-dialog-renderer\");\n\n var commentDialogObserver = new MutationObserver(function(mutations, observer) {\n let defaultText = commentDialog.querySelector(\"#placeholder\");\n defaultText.textContent = \"Add a private note...\";\n\n let avatar = commentDialog.querySelector(\"#author-thumbnail\");\n avatar.remove();\n\n let btnWrapper = commentDialog.querySelector(\"#buttons\");\n // Move to next fn if possible\n let btns = btnWrapper.querySelectorAll(\"ytd-button-renderer\");\n for (let btn of btns) {\n btn.setAttribute(\"is-paper-button\", \"\");\n }\n setupCreateNoteButtons(btnWrapper, observer);\n });\n commentDialogObserver.observe(injectedCommentDialogRenderer, {childList: true});\n}", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "getAddNewLabel() {\n return 'Add New';\n }", "function addNote() {\n\t\t\n\t\tid++;\n\t\tzIndex++;\n\t\t\n\t\tvar body = document.querySelector('body');\n\t\t\n\t\tvar note = document.createElement('div');\n\t\tvar close = document.createElement('div');\n\t\tvar field = document.createElement('div');\n\t\tvar footer = document.createElement('div');\n \t\t\n\t\tnote.setAttribute('id', 'note' + id);\n\t\tclose.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('contenteditable', true);\n\t\t\t\n\t\tnote.classList.add('note');\n\t\tclose.classList.add('close');\n\t\tfield.classList.add('field');\n\t\tfooter.classList.add('footer');\n\t\t\n\t\tnote.style.zIndex = zIndex;\n\t\t\t\n\t\tnote.appendChild(close);\n\t\tnote.appendChild(field);\n\t\tnote.appendChild(footer);\n\t\tbody.appendChild(note);\n\t\t\n\t\tattachListeners(note, close, field, footer);\n\t\t\n\t\tvar data = JSON.parse(localStorage['data']);\n\t\t\n\t\t// Save the current note's data\n\t\tdata.push({\n\t\t\n\t\t\tid: id,\n\t\t\ttext: '',\n\t\t\tposition: { x: 20, y: 20 },\n\t\t\tzIndex: zIndex,\n\t\t\t\n\t\t\ttime: { \n\t\t\t\n\t\t\t\tday: new Date().getDate(), \n\t\t\t\tmonth: new Date().getMonth() + 1, \n\t\t\t\tyear: new Date().getFullYear(), \n\t\t\t\th: new Date().getHours(), \n\t\t\t\tm: new Date().getMinutes(), \n\t\t\t\ts: new Date().getSeconds() \n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t});\n\t\t\n\t\tlocalStorage['data'] = JSON.stringify(data);\n\t\t\n\t}", "function pushNote(thisNote) {\n //console.log('push has been called');\n myNotes.push(thisNote);\n Cookies.set('storedNotes', myNotes);\n //myNotes = Cookies.getJSON('storedNotes');\n //console.log('New Note Saved');\n confirmation.placeholder = 'New note saved';\n note.value = '';\n}", "render(){\n return(<div className='board'>\n {this.state.notes.map(this.eachNote)}\n <button onClick={()=>this.add('New Note')}>+Add Note+</button>\n </div>)\n }", "function createNote(obj, type ) {\n let article = document.createElement(\"article\");\n article = articleAttributes(article);\n article.appendChild(createDiv1(obj));\n article.appendChild(createDiv2(type, article));\n article.appendChild(createBtnConfirm());\n return article;\n}", "function AddNote(noteText_ = \"\") {\n if (noteText_ == null || noteText_ == \"\") {\n return;\n }\n\n var newNoteArray = [];\n if (stateVars.itemArray != null) {\n newNoteArray = stateVars.itemArray;\n }\n\n newNoteArray.push(noteText_);\n\n setStateVars((prevState) => {\n return ({\n ...prevState,\n noteArray: newNoteArray,\n promptNewNote: false,\n newNoteText: \"\",\n requireUpdate: true\n });\n });\n }", "function createNewQuestion(questions){\n\tvar button = document.createElement(\"input\");\n\tbutton.setAttribute(\"type\", \"button\");\n\tbutton.setAttribute(\"id\", \"addQuestionButton_\" + questions);\n\tbutton.setAttribute(\"value\", \"Lisää kysymys\");\n\t\n\t// Jos nappia painetaan käynnistetään createQuestionRow-metodi, \n\t// jolla lisätään uusi kysymys\n\tbutton.onclick = function () { createQuestionRow(this); };\n\n\treturn button;\n}", "async function confirmClick(removeButton){\n //let noteId = $(removeButton).parent().attr('id');\n if (confirm('Are you sure?')){\n deleteNote (removeButton);\n } else {\n renderNotes ();\n }\n}", "function createNote(note) {\n return API.post(\"notes\", \"/notes\", {\n body: note\n });\n }", "function initialBtn(topics,classToAdd,areaToAddTo){\n\t// Must empty area everytime we add a new button (otherwise there will be duplicates)\n\t$(areaToAddTo).empty();\n\tfor(var i=0; i < topics.length; i++){\n\t\tvar a = $('<button>');\n\t\ta.addClass(classToAdd);\n\t\ta.attr('data-type',topics[i]);\n\t\ta.text(topics[i]);\n\t\t$(areaToAddTo).append(a);\n\t}\n}", "function createNoteCard(i) {\n i = i - 1;\n var new_card = document.createElement(\"div\");\n new_card.className = \"notecard lock\";\n new_card.id = \"n\" + i; //'n' + int i\n new_card.appendChild(createTerm(i));\n new_card.appendChild(createDefintion(i));\n new_card.insertAdjacentHTML(\n \"beforeend\",\n '<input type=\"submit\" class=\"done\" value=\"Done\"/>'\n );\n return new_card;\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 addNote() {\n\t\n\tvar value = $('#add').val();\n\tif (value != '') {\n\n\t\tif (localStorage.getItem('last-id') === null) {\n\t\t\tvar new_id = 6;\n\t\t\tlocalStorage.setItem('last-id', new_id);\n\t\t}\n\t\telse {\n\t\t\tvar last_id = localStorage.getItem('last-id');\n\t\t\tvar new_id = parseInt(last_id)+1;\n\t\t}\n\t\t$('.notas-list').prepend('\\\n\t\t\t<article class=\"box-skin nota-thumb\" id=\"note'+ new_id +'\">\\\n\t\t\t\t<a href=\"#\" class=\"nota-delete\">X</a>\\\n\t\t\t\t<div class=\"nota-content\">\\\n\t\t\t\t\t<pre class=\"nota-title empty\" contenteditable></pre>\\\n <pre class=\"nota-text\" contenteditable>'+ value +'</pre>\\\n </div>\\\n\t\t\t</article>\\\n\t\t');\n\t\tvar $this = $('#note'+new_id);\n\n\t\t// fadeIn note & focus\n\t\tsetTimeout(function() {\n\t\t\t$this.removeClass('transparent').find('.nota-text').focus();\n\t\t}, 200);\n\n\t\t// clean input and hide btn\n\t\t$('#add').val('');\n\n\t\t// store added note\n\t\tsetLocalStorage($this);\n\n\t\t// store next id\n\t\tvar next_id = localStorage.setItem('last-id', new_id);\n\n\t\tsetNoteActive();\n\t\tsetTimeout(function() {\n\t\t\t$this.click();\n\t\t}, 200);\n\n\t\t// reiniciar o localStorage\n\t\t$this.find('.nota-title, .nota-text').keyup(function() {\n\t\t\thideEmptyfields($(this));\n\t\t\tsetLocalStorage($this);\n\t\t});\n\t\tdeleteNote();\n\t}\n}", "function createEditNote() {\n var output = \"\";\n \n output += \" <input id=\\'noteTitle\\' placeholder='제목' style=\\'width: 40%; height: 50px; margin-left: 30%; margin-top: 50px; text-align: center; font-size: 40px;\\'></input> \";\n \n output += \"<table><tr><th>단어</th><th>뜻</th></tr>\";\n \n for (var i = 1; i <= 10; i++) output += \"<tr><td> <input id='word\" + i + \"' placeholder='word\" + i + \"'> </td><td> <input id='mean\" + i + \"' placeholder='mean\" + i + \"'> </td></tr>\"\n \n output += \"</table>\";\n output += \"<button id=\\\"uploadNoteBtn\\\" style=\\'margin-top: 20px; width: 10%; margin-left: 45%;\\'>저장하기</button>\";\n \n \n \n //uploadNote function\n output += \"\\\n <script>\\\n $(\\\"#uploadNoteBtn\\\").click(function() {\\\n var title = $('#noteTitle').val();\\\n for (var i = 1; i <= 10; i++) {\\\n var word = $('#'+'word' + i).val();\\\n var mean = $('#'+'mean' + i).val();\\\n addWord(title, word, mean, i);\\\n }\\\n });\\\n </script>\\\n \";\n \n return output;\n}", "function addParagraph() {\n noteSelf.paragraphs.push(new Paragraph());\n $('#toggle-all-source-views-button').html(\n \"<i class='fw fw-hide'></i> Hide Source\"\n );\n adjustNoteControls();\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 createNote() {\n return '<div class=\"note\"> </div> \\n';\n}", "function setNotes(e) {\n\n\tvar cursor = e.target.result;\n\n\tif (cursor) {\n\n\t\tconsole.log(cursor.value);\n\t\tpopupPage.addNoteToView(cursor.value);\n\n\t\tcursor.continue();\n\n\t}\n\n}", "function createNote(message){\n let noteDiv = document.getElementById('note-container')\n \n let note = `\n <div class=\"callout\">\n <span class=\"callout-closebtn\">&times;</span>\n <div class=\"callout-container\">\n <img src=\"./animations/corgigoingoff.gif\">\n <p>${message}</p>\n </div>\n </div>\n `\n noteDiv.innerHTML += note\n noteDiv.hidden = false\n noteDiv.addEventListener('click', removeNote)\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 testCreate(){\n // debugger\n var notelist = new NoteList()\n var note = notelist.create(\"Go shopping\")\n testisNote(note)\n testDisplayNote()\n }", "function createNewRow(note) {\n // var formattedDate = new Date(note.createdAt);\n // formattedDate = moment(formattedDate).format(\"MMMM Do YYYY, h:mm:ss a\");\n var newnotePanel = $(\"<div class='note-panel' data-id='\"+note.id+\"'>\");\n newnotePanel.addClass(\"panel panel-default\");\n var newnotePanelHeading = $(\"<div>\");\n newnotePanelHeading.addClass(\"panel-heading\");\n var deleteBtn = $(\"<button>\");\n deleteBtn.text(\"Delete\");\n deleteBtn.addClass(\"delete btn btn-danger btn-sm\");\n var editBtn = $(\"<button>\");\n editBtn.text(\"Edit\");\n editBtn.addClass(\"edit btn btn-warning btn-sm\");\n var newnoteTitle = $(\"<h2>\");\n var newnotePanelBody = $(\"<div>\");\n newnotePanelBody.addClass(\"panel-body\");\n var newnoteBody = $(\"<div>\");\n newnoteTitle.text(note.beerName + \" | \" + note.beerType + \" | \" + note.rating);\n newnoteBody.html(\"<br>Comments: \" + note.notes);\n newnotePanelHeading.append(newnoteTitle);\n newnotePanelBody.append(newnoteBody);\n newnotePanelBody.append(editBtn);\n newnotePanelBody.append(deleteBtn);\n newnotePanel.append(newnotePanelHeading);\n newnotePanel.append(newnotePanelBody);\n return newnotePanel;\n }", "function showNewNoteModal() {\n var dialog, noteTextarea, hidePreviewInput, noteValue, noteHtml, preview;\n var promise = Dialogs.showModalDialogUsingTemplate(Mustache.render(newNoteTemplate, Strings))\n .done(function (id) {\n // if button OK clicked\n if (id === Dialogs.DIALOG_BTN_OK) {\n noteTextarea = dialog.find('textarea');\n noteValue = noteTextarea.val();\n noteHtml = dialog.find('div[data-id=\"georapbox-new-note-preview\"]').html();\n\n saveNote(noteValue, noteHtml, function () {\n renderNotes();\n });\n\n dialog.unbind('keyup');\n }\n\n // if button CANCEL clicked\n if (id === Dialogs.DIALOG_BTN_CANCEL) {\n dialog.unbind('keyup');\n }\n });\n\n dialog = $('.georapbox-notes-new-note-dialog.instance');\n preview = $('div[data-id=\"georapbox-new-note-preview\"]');\n noteTextarea = dialog.find('textarea');\n hidePreviewInput = dialog.find('input[type=\"checkbox\"]');\n\n noteTextarea.focus();\n\n function togglePreview(isVisible) {\n if (isVisible === true) {\n preview.show();\n noteTextarea.css({ width: '49%' });\n localStorage.setItem(STORAGE_KEY_PREVIEW_VISIBLE, 'true');\n } else {\n preview.hide();\n noteTextarea.css({ width: '99%' });\n localStorage.setItem(STORAGE_KEY_PREVIEW_VISIBLE, 'false');\n }\n }\n\n dialog.on('keyup', 'textarea', debounce(function () {\n previewMarkDown(preview, $(this).val());\n }, 250));\n\n // Determine if Preview is visible or not.\n if (localStorage.getItem(STORAGE_KEY_PREVIEW_VISIBLE) === 'false') {\n hidePreviewInput.attr('checked', 'checked');\n togglePreview(false);\n }\n\n dialog.on('change', 'input[type=\"checkbox\"]', function () {\n togglePreview(!$(this).is(':checked'));\n });\n\n return promise;\n }", "function createModalHTML(data){ \n data.forEach(function(note){\n $(\".existing-note\").append(`\n <div class=\"panel panel-default\" id=\"${note._id}\">\n <div class=\"panel-body\">\n <div class=\"noteContent\">\n <p>${note.body}</p>\n <button class=\"btn btn-primary edit-note\" data-noteId=\"${note._id}\"\">Edit</button>\n <button class=\"btn btn-primary delete-note\" data-noteId=\"${note._id}\">Delete</button>\n </div>\n <div class=\"update-form\"></div>\n </div>\n </div>\n `)\n }); \n}", "function note_save()\n {\n var note_obj;\n // grab the note typed into the input box\n var new_note = $(\".bootbox-body textarea\").val().trim();\n\n if (new_note)\n {\n note_obj =\n {\n _id: $(this).data(\"headline\")._id,\n text: new_note\n };\n $.post(\"/api/notes\", note_obj).then(function()\n {\n // on success, close the modal\n bootbox.hideAll();\n });\n }\n }" ]
[ "0.74802536", "0.7381172", "0.70298284", "0.6957023", "0.67358464", "0.67260516", "0.6711176", "0.6699864", "0.66497743", "0.6565031", "0.65247077", "0.6523344", "0.65086484", "0.6491537", "0.6453388", "0.6433864", "0.64294523", "0.6415714", "0.6361737", "0.6357423", "0.6332391", "0.6331484", "0.6318884", "0.63073003", "0.630698", "0.6288408", "0.62810576", "0.62775904", "0.62588525", "0.62546724", "0.6244712", "0.6241814", "0.62374705", "0.62348247", "0.62264466", "0.62185496", "0.6200858", "0.61703163", "0.6167492", "0.6149079", "0.61440235", "0.613888", "0.61331683", "0.6132111", "0.6112476", "0.61021566", "0.60977775", "0.60915726", "0.6079589", "0.6075847", "0.6053324", "0.6053076", "0.60504794", "0.6044544", "0.6025055", "0.6025042", "0.602399", "0.6022668", "0.60123897", "0.6010145", "0.60069686", "0.5974393", "0.59695226", "0.5968643", "0.59647256", "0.5950145", "0.5948739", "0.5946327", "0.5945262", "0.59324366", "0.59161675", "0.59089565", "0.59079474", "0.59000146", "0.58969194", "0.58932227", "0.5888982", "0.58842385", "0.588302", "0.58821934", "0.5863522", "0.5861411", "0.58576053", "0.5856664", "0.5856228", "0.5841778", "0.5833041", "0.58297575", "0.5828516", "0.58234924", "0.58220613", "0.58213377", "0.58203167", "0.5819864", "0.58137476", "0.5803888", "0.58036387", "0.58019984", "0.5798718", "0.5792869" ]
0.6375585
18
constructor of note object
function Note(type) { this.noteType = type; this.date = addDate(); this.titleOfNoteBook = openNotebook; this.addingFromLocalStorage = function ( date, savedNoteBookPlacment, savedTextarea ) { if (date != null) { this.date = date; } if (savedNoteBookPlacment != null) { this.titleOfNoteBook = savedNoteBookPlacment; } else { this.titleOfNoteBook = openNotebook; } if (savedTextarea != "" && type == 1) { this.noteElement.getElementsByClassName( "textArea" )[0].textContent = savedTextarea; } }; this.noteElement = createNote(this, type); main.prepend(this.noteElement); this.checkBox = document.createElement("input"); this.checkBox.type = "checkbox"; this.checkBox.style.display = "none"; this.checkBox.className = "checkbox"; this.noteElement.appendChild(this.checkBox); this.delete = false; this.getNoteLi = function () { if (this.noteType == 2) { let arrayOfInnerText = []; let listItemsArray = this.noteElement.getElementsByClassName( "itemOfList" ); for (let index = 0; index < listItemsArray.length; index++) { arrayOfInnerText.push(listItemsArray[index].innerText); } arrayOfInnerText.toString(); return arrayOfInnerText; } }; //om du kan mata varje string som newNext från local sätter denna dit dom en i taget this.setNewLi = function (newText) { if (this.noteType == 2) { let node = this.noteElement.getElementsByClassName("list"); let listItemContainer = document.createElement("div"); listItemContainer.className = "list-item-container"; let node_li = document.createElement("li"); node_li.contentEditable = "true"; node_li.className = "itemOfList"; let textnode = document.createTextNode(newText); let span = document.createElement("SPAN"); let txt = document.createTextNode("\u00D7"); span.className = "remove-list-item"; span.addEventListener("click", () => { listItemContainer.remove(); saveNotesToLocalStorage(); }); span.appendChild(txt); node_li.appendChild(textnode); listItemContainer.appendChild(node_li); listItemContainer.appendChild(span); node[0].appendChild(listItemContainer); return node; } }; this.getNoteText = function () { if (this.noteType == 1) { return this.noteElement.getElementsByClassName("textArea")[0].textContent; } }; this.setTitleOfNoteBook = (title) => { this.titleOfNoteBook = title; }; this.checkBoxVisible = function (choise) { if (choise == true) { return (this.checkBox.style.display = "block"); } else if (choise == false) { return (this.checkBox.style.display = "none"); } }; this.removeNote = function () { this.noteElement.remove(); this.delete = true; clearDeleted(); saveNotesToLocalStorage(); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(notes) {\n this.notes = notes\n }", "function Note() {\n\tthis.maintype = '';\n\tthis.subtype = '';\n\tthis.text = '';\n\tthis.xml_id = '';\n\tthis.custom = '';\n}", "constructor() {\n\t\tthis.notes = [\n\t\t\t {\n\t\t\t \"title\":\"Test Title\",\n\t\t\t \"text\":\"Test text\",\n\t\t\t \"id\": 0\n\t\t\t }\n\t\t\t];\n\t}", "function Note(content) {\n this.content = content;\n}", "function Note(text, id) {\n this._note = text;\n this._id = id \n}", "function Note(title, body, timestamp) {\n this.title = title,\n this.body = body,\n this.timestamp = timestamp\n }", "function Note(title, text, id) {\n this.title = title;\n this.text = text;\n this.id = id;\n}", "function Note(text, title) {\n\tthis.text = text;\n\tthis.title = title;\n}", "function Note(id, title, time, author, body) {\r\n this.id = id;\r\n this.title = title;\r\n this.time = time;\r\n this.author = author;\r\n this.body = body;\r\n}", "constructor(notes = []) {\n if (!notes.length) {\n this.notes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n } else {\n this.notes = notes\n }\n }", "function Note(note, octave, duration, position) {\n var number;\n if(note instanceof Array) {\n position = note[3];\n duration = note[2];\n octave = note[1];\n note = note[0];\n }\n if(arguments.length === 3) {\n // we have number...\n number = note;\n var noteIds = NOTES[note];\n position = arguments[2];\n duration = arguments[1];\n octave = noteIds[1];\n note = noteIds[0];\n } else {\n number = NOTE_STRINGS.indexOf([note, octave].join(''));\n }\n this.note = note;\n this.octave = octave;\n this.duration = duration;\n this.position = position;\n this.number = number;\n // note: this.buffers is an array on the prototype\n // we're using the prototype as a place to hold a global\n // cache of piano notes\n if(this.buffers[this.number]) {\n this.buffer = this.buffers[this.number];\n } else {\n this.getNote(this.number);\n }\n}", "constructor() { \n \n RecentsNote.initialize(this);\n }", "function newNote(body) {\n return { body: body, time: new Date() };\n}", "function genNote(p){\n if (p==null) {\n return null;\n }\n else {\n //WRONG, a note is an obgject as well\n return midiNote = {note: p, channel:1, velocity:100, rawVelocity: 127};\n }\n}", "function NoteList(){ //use the constructor to define a note list model object.\n this.list = [] // store an array of note model.\n }", "function OneNoteGenerator(note){\n\tthis.note = note\n}", "constructor(args, events) {\n this.events = events\n // contains the note objects\n this.notes = [[]]\n // notation is used to make the integer notation (interval value) \"pretty\".\n // Other information is derived from it as well.\n this.notation = [\n 'C',\n 'Db',\n 'D',\n 'Eb',\n 'E',\n 'F',\n 'Gb',\n 'G',\n 'Ab',\n 'A',\n 'Bb',\n 'B'\n ]\n // root of the scale\n this.root = 1\n // tuning of the instrument, defaults to standard guitar tuning.\n this.tuning = [28, 33, 38, 43, 47, 52]\n this.scale = undefined\n // the total number of values in the note system. some other systems such\n // as the Maqam have a different scale length (the octave is divided in 24 parts\n // instead of 12 for the Maqam).\n this.scaleLength = this.notation.length\n // number of strings on the instrument.\n this.strings = 6\n // number of frets on the instrument.\n this.frets = 16\n // the interval values are generated by repeating 1 to scaleLength a number\n // of times defined by the maxIndex\n this.maxIndex = 8\n // And finally we build the whole thing by using the set method which will\n // parse all of the arguments properly.\n this.set(args)\n }", "constructor(props) {\r\n super();\r\n //console.log(props);\r\n this.state = {id: props.note.id, text: props.note.text};\r\n }", "function Note(title) {\n _classCallCheck(this, Note);\n\n this.title = title;\n this.element = this.createElement(title); // HINT🤩 this.element = this.createElement(title);\n }", "function Note( str ) {\n var couple = str.split( space );\n // frequency, in Hz\n this.frequency = Note.getFrequency( couple[ 0 ] ) || 0;\n // duration, as a ratio of 1 beat (quarter note = 1, half note = 0.5, etc.)\n this.duration = Note.getDuration( couple[ 1 ] ) || 0;\n}", "constructor(time, date, note, type) {\n this.time = time || 'time not specified';\n this.date = date || 'date not specified';\n this.note = note || \"No additional notes\";\n this.type = type || \"unknown entry type\";\n }", "constructur() {}", "function Note(x, y, w, h, color, link) {\n\tthis.x = x;\n\tthis.y = y;\n\tthis.w = w;\n\tthis.h = h;\n\tthis.color = color;\n\tthis.link = link;\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 }", "constructor (){}", "initialize() {\n const channel = Radio.channel('notes');\n this.listenTo(channel, 'created', this.addNote);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x12b299d4;\n this.SUBCLASS_OF_ID = 0x9fefa4d4;\n\n this.emoticon = args.emoticon;\n this.documents = args.documents;\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()", "function newNoteAnnotation() {\n return new PSPDFKit.Annotations.NoteAnnotation({\n pageIndex: 0,\n text: {\n format: \"plain\",\n value: \"An example for a Note Annotation\",\n },\n boundingBox: new PSPDFKit.Geometry.Rect({\n left: 500,\n top: 20,\n width: 30,\n height: 30,\n }),\n });\n}", "constructor(props) {\n super(props);\n this.state = {\n edit: false,\n note: this.props.note.note\n }\n }", "constructor({id, tagName}) {\n this.id = id;\n this.tagName = tagName;\n this.notes = [];\n console.log(\"Tag constructor\");\n }", "function createsANote() {\n var note = new Note(\"My favourite language is Ruby\");\n assert.isTrue(\"creates a note\", note.readNote() === \"My favourite language is Ruby\");\n}", "function createNote(note) {\n return API.post(\"notes\", \"/notes\", {\n body: note\n });\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x16115a96;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.title = args.title;\n this.articles = args.articles;\n }", "function NotePlayer(synth, notes) {\n\n this.synth = synth;\n this.SECONDS_PER_BEAT = 60 / TEMPO;\n this.notes = notes || [];\n this.max_loc = 0;\n for (var loc in this.notes) {\n loc = +loc;\n if (loc > this.max_loc) {\n this.max_loc = loc;\n }\n }\n this.active_voices = [];\n\n this.PLAYING = false;\n\n}", "function _construct()\n\t\t{;\n\t\t}", "function note_add(_Poc,_text){\r\n\tNotecurrent_IdNUM++;\r\n\tvar newnote ={\r\n\t\tid:'note'+Notecurrent_IdNUM\r\n\t\t,x: _Poc.x\r\n\t\t,y: _Poc.y\r\n\t\t,text:_text\r\n\t\t,color:defaultCOLOR\r\n\t\t,fontsize:defaultFONTSIZE\r\n\t\t,selected:false\r\n\t};\r\n\tnotes.push(newnote);\r\n\tnumnote++;\r\n\treturn newnote;\r\n}", "function Note(freq, duration, block){\n\n\tthis.freq = freq;\n\tthis.duration = duration;\n\tthis.block = new ElementNode(block);\n\n\t// if the note block passed in is supposed to be a rest\n\tif(freq === 0){\n\t\tthis.block.id = null; // can use note.block.id null check \n\t}\n}", "constructor() {\n super();\n\n /** @private {HTMLElement} */\n this.noteEl = document.querySelector(cssSelector.NOTE);\n\n /** @private {HTMLElement} */\n this.noteMessageEl = document.querySelector(cssSelector.NOTE_MESSAGE);\n }", "function note_copy(_note){\r\n\tvar newnote=null;\r\n\tif (_note===null){\t\t\r\n\t} else {\r\n\t\tvar tPoc={x:_note.x,y:_note.y};\r\n\t\tnewnote=note_add(tPoc,_note.text);\r\n\t\tnewnote ={\r\n\t\t\tid:newnote.id\r\n\t\t\t,x: _note.x\r\n\t\t\t,y: _note.y\r\n\t\t\t,text:_note.text\r\n\t\t\t,color:_note.color\r\n\t\t\t,fontsize:_note.fontsize\r\n\t\t\t,selected:_note.selected\r\n\t\t};\r\n\t}\r\n\treturn newnote;\t\t\t\r\n}", "makeNote (note) {\n const el = this.page.noteTemplate.cloneNode(true)\n if (note.severity > ntfn.POKE) {\n const cls = note.severity === ntfn.SUCCESS ? 'good' : note.severity === ntfn.WARNING ? 'warn' : 'bad'\n el.querySelector('div.note-indicator').classList.add(cls)\n }\n\n el.querySelector('div.note-subject').textContent = note.subject\n el.querySelector('div.note-details').textContent = note.details\n return el\n }", "constructor(id, name, note, lore, icon, rarityText, categoryText, usable) {\n super(id, name, note, lore, icon, rarityText, categoryText, true, false, usable);\n }", "constructor(props) {\n super(props)\n this.state = {\n //this will render an array of dynamic data the will list the number of notes in our app\n //let's set the notes as an empty array to make it dynamic\n notes: []\n }\n //we have to always bind this\n this.add = this.add.bind(this)\n this.eachNote = this.eachNote.bind(this)\n this.update = this.update.bind(this)\n this.remove = this.remove.bind(this)\n this.nextId = this.nextId.bind(this)\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x263d7c26;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.text = args.text;\n this.caption = args.caption;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4f4456d3;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.text = args.text;\n this.caption = args.caption;\n }", "function createNotes(t, c, seq) {\n\t/*if(seq != null)\n\t{\n\t setNoteSeq(seq);\n\t}\n\telse\n\t{\n\t setNoteSeq(this[templateSet[t-1].notes]);\n\t}*/\n\tvar notes = [];\n\tvar args = newGroove; //getNoteSeq();\n\tvar clip = new Clip(t, c);\n\tvar noteBlock = args.length / 2;\n\tvar changedNote;\n\tfor (var ni = 0; ni < args.length; ni++) {\n\n\t\tchangedNote = convertNote(args[ni].note);\n\t\tif (channelSequence[channelSequence.length - 1] == \"Combo\" || singleCombo) {\n\t\t\tchangedNote = args[ni].note;\n\t\t}\n\n\t\tif (args[ni].size != 0) {\n\t\t\tnotes.push(new Note(changedNote, args[ni].init, args[ni].size, 100, 0));\n\t\t}\n\t}\n\n\tclip.setNotes(notes);\n}", "constructor(props) {\n super(props);\n this.state = {\n // initial state with empty attributes.\n Date: '',\n Strategy: '',\n Content: '',\n Time: '',\n Sprint: '',\n noteId: this.generateId()\n }\n }", "function createNewNote()\n{\n randomNote = int(random(notes.length - 1));\n goalNote = notes[randomNote].note\n goalFrequency = -notes[randomNote].frequency\n\n // play voice over when the new note is created\n playVoiceOver();\n}", "initNotetrack() {\n\t\t// clear the existing notetrack\n\t\tif (this.notetrack.gfx) {\n\t\t\tthis.notetrack.gfx.removeAllChildren();\n\t\t}\n\t\t\n\t\t// holds the notetrack of notes\n\t\tvar notetrackGraphics = new createjs.Container();\n\t\tthis.notetrack.gfx = notetrackGraphics;\n\t\t\n\t\t// this grabs the note and mine objects\n\t\tvar notes = this.notetrack.notes;\n\t\tvar mines = this.notetrack.mines;\n\n\t\tfor (var col = 0; col < notes.length; col++) {\n\t\t\t// get the initial position of the note\n\t\t\tvar x = this.getAlignment(this.width/2, this.notetrack.keyCount, 60, 10, col);\n\n\t\t\t// iterate through the notes\n\t\t\tfor (var j = 0; j < notes[col].length; j++) {\n\t\t\t\tvar note = notes[col][j];\n\t\t\t\t// scale note position depending on default scroll speed\n\t\t\t\tvar notePos = note.pos*this.settings.scrollSpeedFactor;\n\t\t\t\tif (this.settings.scrollDirection === 'down') {\n\t\t\t\t\tvar y = this.receptors[0].y - notePos;\n\t\t\t\t} else {\n\t\t\t\t\tvar y = this.receptors[0].y + notePos;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar color = divisionToColor(note.div);\n\n\t\t\t\tif (note.type == 'hold') {\n\t\t\t\t\t// init the graphic\n\t\t\t\t\tvar nonScaledHeight = note.end - note.pos;\n\t\t\t\t\tvar height = nonScaledHeight*this.settings.scrollSpeedFactor;\n\t\t\t\t\tvar holdGfx = this.noteskin.hold(height, color);\n\t\t\t\t\tholdGfx.x = x;\n\t\t\t\t\tholdGfx.y = y;\n\t\t\t\t\tif (this.settings.scrollDirection === 'down') {\n\t\t\t\t\t\tholdGfx.scaleY = -1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// attach it to the note object\n\t\t\t\t\tnote.attachGfx(holdGfx);\n\t\t\t\t\t\n\t\t\t\t\t// attach graphic to the notetrack\n\t\t\t\t\t// notetrackGraphics.addChild(holdGfx);\n\n\t\t\t\t}\n\t\t\t\telse if (note.type == 'tap') {\n\t\t\t\t\t// init the graphic\n\t\t\t\t\tvar noteGfx = this.noteskin.base(color);\n\t\t\t\t\tnoteGfx.x = x;\n\t\t\t\t\tnoteGfx.y = y;\n\t\t\t\t\t\n\t\t\t\t\t// attach it to the note object\n\t\t\t\t\tnote.attachGfx(noteGfx);\n\t\t\t\t\t\n\t\t\t\t\t// attach graphic to the notetrack\n\t\t\t\t\t// notetrackGraphics.addChild(noteGfx);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// iterate through the mines\n\t\t\tfor (var j = 0; j < mines[col].length; j++) {\n\t\t\t\tvar mine = mines[col][j];\n\t\t\t\t// scale mine position depending on default scroll speed\n\t\t\t\tvar minePos = mine.pos*this.settings.scrollSpeedFactor;\n\t\t\t\tif (this.settings.scrollDirection === 'down') {\n\t\t\t\t\tvar y = this.receptors[0].y - minePos;\n\t\t\t\t} else {\n\t\t\t\t\tvar y = this.receptors[0].y + minePos;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar mineGfx = this.noteskin.mine();\n\t\t\t\tmineGfx.x = x;\n\t\t\t\tmineGfx.y = y;\n\t\t\t\t\n\t\t\t\t// attach it to the note object\n\t\t\t\tmine.attachGfx(mineGfx);\n\t\t\t\t\n\t\t\t\t// attach graphic to the notetrack\n\t\t\t\tnotetrackGraphics.addChild(mineGfx);\n\t\t\t}\n\t\t}\n\t\t// attach the notetrack to the stage\n\t\tthis.stage.addChild(notetrackGraphics);\n\t}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbaafe5e0;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.author = args.author;\n this.publishedDate = args.publishedDate;\n }", "function initNote(rankTweak){\n var note = new cosmo.model.Note();\n note.setRank(note.getRank() - rankTweak);\n return note;\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9cb070d7;\n this.SUBCLASS_OF_ID = 0x476cbe32;\n\n this.document = args.document || null;\n this.ttlSeconds = args.ttlSeconds || null;\n }", "constructor(props) {\n super(props);\n /*\n * define the react state object\n */\n this.state = {\n notes: [\n {\n id: 0,\n note: \"Call Lisa\",\n },\n {\n id: 1,\n note: \"Email Jhon\",\n },\n {\n id: 2,\n note: \"Email Jhon\",\n }\n ],\n }\n this.eachNote = this.eachNote.bind(this)\n this.update = this.update.bind(this)\n }", "newNote(note) {\n const { title, text } = note;\n // This is input validation requiring the title and note to both have at least 1 character.\n if (!title || !text) {\n throw new Error(\"Note 'title' and 'text' both have a 1 character minimum requirement!\");\n }\n\n // This adds a unique ID to the new note as well as the title and text.\n const newNote = { title, text, id: uniqueID() };\n\n // This retrives all the notes, writes all the updated notes, adds the new note, and returns the newNote.\n return this.retrieveNotes()\n .then((notes) => [...notes, newNote])\n .then((updatedNotes) => this.writeFile(updatedNotes))\n .then(() => newNote);\n }", "function construct() { }", "function createNote(obj, type ) {\n let article = document.createElement(\"article\");\n article = articleAttributes(article);\n article.appendChild(createDiv1(obj));\n article.appendChild(createDiv2(type, article));\n article.appendChild(createBtnConfirm());\n return article;\n}", "constructor(pos, mark) {\n super();\n this.pos = pos;\n this.mark = mark;\n }", "constructor(pos, mark) {\n super();\n this.pos = pos;\n this.mark = mark;\n }", "constructor(time, date, note, mood) {\n let type = 'mood';\n // -------------------------------------------------------------JavaScript Objects - inheritance (ES6) Ex. 2||\n super(time, date, note, type);\n this.mood = mood || \"Neutral\";\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xb4a2e88d;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.chat = args.chat;\n this.date = args.date;\n }", "function Notes(img, w, h) {\n this.width = w;\n this.height = h;\n this.parse(img);\n return this;\n}", "constructor( ) {}", "function addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // create HTML node from note object\n const node = createItem(note);\n // append created node in HTML\n noteList.appendChild(node);\n // put created node in Map to match it with note\n map.set(node, note);\n // push current note to notes object\n notes.push(note);\n // overwrite notes in indexedDB with notes\n idbKeyval.set('notes', notes)\n .catch(err => console.error('submit failed: ', err));\n // reset input values\n noteBody.value = '';\n noteImg.value = '';\n noteAlt.value = '';\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x7e6260d7;\n this.SUBCLASS_OF_ID = 0xf1d0b479;\n\n this.texts = args.texts;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6f747657;\n this.SUBCLASS_OF_ID = 0x29b8eeb3;\n\n this.text = args.text;\n this.credit = args.credit;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1b0c841a;\n this.SUBCLASS_OF_ID = 0x33d47f45;\n\n this.date = args.date || null;\n }", "function NoteController(tempo) {\n this.tempo = tempo || 120;\n this.SECONDS_PER_BEAT = 60 / TEMPO;\n this.players = [];\n this.loc = 0;\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1e287d04;\n this.SUBCLASS_OF_ID = 0xfaf846f4;\n\n this.file = args.file;\n this.stickers = args.stickers || null;\n this.ttlSeconds = args.ttlSeconds || null;\n }", "constructor() {\n super();\n //region Private Methods\n //endregion\n //region Methods\n //endregion\n //region Events\n //endregion\n //region Properties\n /**\n * Property field\n */\n this._record = null;\n }", "constructor(year, activeCalendar, notes = []) {\n\n\t\tlet lengths = notes.map(note => note.length);\n\n\t\tconst quantiles = {\n\t\t\tlower: \tquantile(lengths, 0.25),\n\t\t\tmid: \t\tquantile(lengths, 0.5),\n\t\t\tupper: quantile(lengths, 0.75)\n\t\t};\n\n\t\tconst lineMultiplier = 3;\n\n\t\tthis.notes = notes.filter(note => {\n\t\t\treturn +year === parseDDBYear(note.date)\n\t\t}).filter(note => {\n\t\t\treturn activeCalendar === note.calendar;\n\t\t}).map(note => {\n\t\t\tif (note.length < quantiles.lower) {\n\t\t\t\tnote.nLines = lineMultiplier * 1;\n\t\t\t} else if (note.length < quantiles.mid) {\n\t\t\t\tnote.nLines = lineMultiplier * 2;\n\t\t\t} else if (note.length < quantiles.upper) {\n\t\t\t\tnote.nLines = lineMultiplier * 3;\n\t\t\t} else {\n\t\t\t\tnote.nLines = lineMultiplier * 4;\n\t\t\t}\n\t\t\treturn note;\n\t\t});\n\n\t\tthis.year = year;\n\t\tthis.activeCalendar = activeCalendar;\n\t\tthis.months = [0,1,2,3,4,5,6,7,8,9,10,11].map(n => {\n\t\t\treturn new Month(year, n, activeCalendar, this.notes);\n\t\t});\n\t}", "constructor() {\n super();\n /**\n * Object containing system-wide default values that can be changed to customize how the library\n * works.\n *\n * @type {object}\n *\n * @property {object} defaults.note - Default values relating to note\n * @property {number} defaults.note.attack - A number between 0 and 127 representing the\n * default attack velocity of notes. Initial value is 64.\n * @property {number} defaults.note.release - A number between 0 and 127 representing the\n * default release velocity of notes. Initial value is 64.\n * @property {number} defaults.note.duration - A number representing the default duration of\n * notes (in seconds). Initial value is Infinity.\n */\n\n this.defaults = {\n note: {\n attack: Utilities.from7bitToFloat(64),\n release: Utilities.from7bitToFloat(64),\n duration: Infinity\n }\n };\n /**\n * The [`MIDIAccess`](https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess)\n * instance used to talk to the lower-level Web MIDI API. This should not be used directly\n * unless you know what you are doing.\n *\n * @type {MIDIAccess}\n * @readonly\n */\n\n this.interface = null;\n /**\n * Indicates whether argument validation and backwards-compatibility checks are performed\n * throughout the WebMidi.js library for object methods and property setters.\n *\n * This is an advanced setting that should be used carefully. Setting `validation` to `false`\n * improves performance but should only be done once the project has been thoroughly tested with\n * `validation` turned on.\n *\n * @type {boolean}\n */\n\n this.validation = true;\n /**\n * Array of all (Input) objects\n * @type {Input[]}\n * @private\n */\n\n this._inputs = [];\n /**\n * Array of disconnected [`Input`](Input) objects. This is used when inputs are plugged back in\n * to retain their previous state.\n * @type {Input[]}\n * @private\n */\n\n this._disconnectedInputs = [];\n /**\n * Array of all [`Output`](Output) objects\n * @type {Output[]}\n * @private\n */\n\n this._outputs = [];\n /**\n * Array of disconnected [`Output`](Output) objects. This is used when outputs are plugged back\n * in to retain their previous state.\n * @type {Output[]}\n * @private\n */\n\n this._disconnectedOutputs = [];\n /**\n * Array of statechange events to process. These events must be parsed synchronously so they do\n * not override each other.\n *\n * @type {string[]}\n * @private\n */\n\n this._stateChangeQueue = [];\n /**\n * @type {number}\n * @private\n */\n\n this._octaveOffset = 0;\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xc070d93e;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.text = args.text;\n this.language = args.language;\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 }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x5e068047;\n this.SUBCLASS_OF_ID = 0xeeda0eb8;\n\n this.num = args.num;\n this.text = args.text;\n }", "get note() {\n\t\treturn this.__note;\n\t}", "get note() {\n\t\treturn this.__note;\n\t}", "get note() {\n\t\treturn this.__note;\n\t}", "get note () {\n\t\treturn this._note;\n\t}", "get note () {\n\t\treturn this._note;\n\t}", "get note () {\n\t\treturn this._note;\n\t}", "get note () {\n\t\treturn this._note;\n\t}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1ccb966a;\n this.SUBCLASS_OF_ID = 0xf1d0b479;\n\n this.text = args.text;\n this.phone = args.phone;\n }", "constructor(note, container) {\n this.container = container;\n this.fretContainer = container.querySelectorAll(\".string-fret\");\n this.note = note;\n // Fill in the HTML initially\n this.writeNotes();\n this.plus = this.container.querySelector(\".plus\");\n this.minus = this.container.querySelector(\".minus\");\n let curString = this;\n this.plus.addEventListener(\"click\", curString.plusClick.bind(curString));\n this.minus.addEventListener(\"click\", curString.minusClick.bind(curString));\n }", "get onenote() {\r\n return new OneNote(this);\r\n }", "function _ctor() {\n\t}", "constructor(lecture, eventController, transcriptArea) {\n this.#lecture = lecture;\n this.#eventController = eventController;\n this.#manager = new DiscussionManager(this.#lecture);\n this.#currentTimeMs = 0;\n this.#nearestComments = [];\n this.#transcriptArea = transcriptArea;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x70abc3fd;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.text = args.text;\n }", "push(note) {\n this._notes.push(note);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x3c20629f;\n this.SUBCLASS_OF_ID = 0x82b1f73b;\n\n this.text = args.text;\n this.startParam = args.startParam;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xc1b15d65;\n this.SUBCLASS_OF_ID = 0x53fb4010;\n\n this.geoPoint = args.geoPoint;\n this.period = args.period;\n this.replyMarkup = args.replyMarkup || null;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x78d4dec1;\n this.SUBCLASS_OF_ID = 0x8af52aac;\n\n this.update = args.update;\n this.date = args.date;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8ffa9a1f;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.text = args.text;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf4e096c3;\n this.SUBCLASS_OF_ID = 0xfaf846f4;\n\n this.title = args.title;\n this.description = args.description;\n this.photo = args.photo || null;\n this.invoice = args.invoice;\n this.payload = args.payload;\n this.provider = args.provider;\n this.providerData = args.providerData;\n this.startParam = args.startParam;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xfff8fdc4;\n this.SUBCLASS_OF_ID = 0x80a4a3de;\n\n this.id = args.id;\n this.type = args.type;\n this.title = args.title || null;\n this.description = args.description || null;\n this.document = args.document;\n this.sendMessage = args.sendMessage;\n }" ]
[ "0.7773287", "0.7723429", "0.75902754", "0.7585428", "0.7398693", "0.7291604", "0.72496986", "0.7248947", "0.7127152", "0.7062785", "0.7054271", "0.6993288", "0.6926729", "0.678038", "0.6760654", "0.67363656", "0.6730014", "0.66590065", "0.6652097", "0.6570798", "0.65284616", "0.6510962", "0.6452003", "0.6451324", "0.6438095", "0.6431614", "0.6425859", "0.64213645", "0.64114404", "0.6292968", "0.62774104", "0.62758154", "0.6270856", "0.6266573", "0.6263646", "0.6260928", "0.62529504", "0.62344706", "0.62332094", "0.61937964", "0.619241", "0.61694366", "0.61640036", "0.61617106", "0.61585575", "0.6154166", "0.6135259", "0.61296", "0.612857", "0.61219287", "0.6107674", "0.6091099", "0.60883033", "0.6083032", "0.6054276", "0.6053237", "0.6051784", "0.6051784", "0.60438967", "0.60423446", "0.60357773", "0.60244673", "0.6019495", "0.60188794", "0.6008577", "0.5999745", "0.59980136", "0.5978983", "0.59773695", "0.5967026", "0.5956328", "0.5956319", "0.5956319", "0.5956319", "0.5956319", "0.5956319", "0.5956319", "0.5956319", "0.5952802", "0.5948321", "0.5944236", "0.59401083", "0.59401083", "0.59401083", "0.5939337", "0.5939337", "0.5939337", "0.5939337", "0.5938477", "0.5924333", "0.5900127", "0.58977383", "0.58909404", "0.5890635", "0.5887249", "0.5884717", "0.58785444", "0.5877917", "0.58770335", "0.5876829", "0.5876468" ]
0.0
-1
save notes data to local storage
function saveNotesToLocalStorage() { let holdsLocalStorageNotes = []; allNotes.forEach((element) => { element.getNoteText(); let temporaryVarForTextContent = ""; if (element.getNoteText() != "") { temporaryVarForTextContent = element.getNoteText(); } let liFromObjArray = element.getNoteLi(); holdsLocalStorageNotes.push( element.noteType, element.titleOfNoteBook, element.date, temporaryVarForTextContent ); //fix here if (element.noteType == 2) { liFromObjArray.forEach((element) => { holdsLocalStorageNotes.push(element); }); } holdsLocalStorageNotes.push("//"); }); toString(holdsLocalStorageNotes); localStorage.setItem("notes", holdsLocalStorageNotes); // maby add a call in remove notes to jsut to keep in current }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveNotes() {\n localStorage.setItem(\"notes\", JSON.stringify(notes));\n localStorage.setItem(\"notesLength\", c);\n}", "function storeNotes() {\n // Store the note in the localStorage\n localStorage.setItem(\"note\", JSON.stringify(notesArray));\n }", "function saveNotes() {\n // Grab the current HTML of the notepad\n let currentNotesHTML = $('#notepad').html();\n // Store the HTML in an object\n let notesData = {\n html: currentNotesHTML\n }\n // Save it to localStorage\n localStorage.setItem('notes', JSON.stringify(notesData));\n}", "function saveNote() {\n window.localStorage.setItem(notes.value, editor.value);\n}", "function saveNotes() {\n var contents = [];\n $(\".note\").each(function() {\n contents.push($(this).find(\"textarea\").val());\n });\n\n localStorage.setItem(\"notes\", JSON.stringify(contents));\n}", "function saveNoteDataToLocalStorage() {\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\n}", "function saveNotesToLocalStorage(noteArray){\n\t localStorage.setItem(\"notes\",JSON.stringify(noteArray));\n}", "function saveNoteDataToLocalStorage() {\n\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\n}", "function saveNotes(notesLs) {\n fs.writeFile('./public/notes.json', JSON.stringify(notesLs), function(err){\n if(err) { console.log(err) }\n });\n }", "function save() {\r\n let arrayNotes = document.getElementsByClassName(\"noteArea\");\r\n let titles = document.getElementsByClassName(\"title\");\r\n let contents = document.getElementsByClassName(\"content\");\r\n let newArray = [];\r\n for (let i = 0; i < arrayNotes.length; i++) {\r\n let obj = {};\r\n obj[\"title\"] = titles[i].value;\r\n obj[\"content\"] = contents[i].value;\r\n newArray.push(obj);\r\n }\r\n localStorage.setItem(\"notes\", JSON.stringify(newArray));\r\n}", "function saveLocalStore(){\n for(i = 0; i < generalInfo.length; i++){\n var displayNow = ($(\"#inputEvent\"+generalInfo[i].display).val());\n var notesNow = generalInfo[i].notes;\n generalInfo[i].notes = displayNow;\n console.log(\"grabo vacio\");\n\n }\n localStorage.setItem(\"generalInfo\", JSON.stringify(generalInfo));\n }", "function saveNote(event) {\n event.preventDefault();\n\n const button = event.target;\n const buttonId = button.id;\n const index = buttonId.slice(-1);\n\n const textarea = document.getElementById('text' + index);\n const userInput = textarea.value;\n\n const noteData = getNoteData();\n\n noteData[index] =userInput;\n\n localStorage.setItem('notes', JSON.stringify(noteData));\n}", "function saveToDos() {\n localStorage.setItem(TODO_LS, JSON.stringify(toDos));\n }", "function saveData(event) {\n let divId = ($(event.target).parent().attr('id'));\n let newNote = ($(event.target).siblings('textarea').val())\n\n // checking that box contains string\n if ($(event.target).siblings('textarea').val()) {\n\n let existingNote = noteArray.find(function (note) {\n return note.id === divId;\n });\n if (existingNote) {\n existingNote.note = newNote;\n } else {\n noteArray.push({\n id: divId,\n note: newNote,\n })\n }\n localStorage.setItem('dayNotes', JSON.stringify(noteArray));\n save.text(\"Saved to Local Storage\");\n setTimeout(function () {\n save.text(\"\");\n }, 2000)\n }\n}", "function saveNote() {\n var noteContent = [];\n // Looping through the paragraphs and getting the contents of them\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n noteContent.push(paragraph.getContent());\n });\n\n // Saving the note content in the server\n utils.showLoadingOverlay($('#paragraphs'));\n $.ajax({\n type: 'PUT',\n data: JSON.stringify(noteContent),\n url: constants.API_URI + 'notes/' + noteSelf.name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n utils.handlePageNotification('info', 'Info', 'Note successfully saved');\n\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n if (paragraph.paragraphClient != null) {\n paragraph.paragraphClient.unsavedContentAvailable = false;\n }\n });\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n utils.hideLoadingOverlay($('#paragraphs'));\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n utils.hideLoadingOverlay($('#paragraphs'));\n }\n });\n }", "function saveNotes() {\n fs.writeFileSync(\"db/db.json\", JSON.stringify(db));\n}", "function saveNote() {\n const text = document.getElementById(\"NotifyText\").value;\n const noteDate = document.getElementById(\"SelectedDay\").value + \".\" + month + \".\" + year;\n\n if(specialCharsMatch(text)) {\n alert(\"Sonderzeichen sind nicht erlaubt.\");\n return;\n }\n\n for(let i = 0; i < noteCount; i++) {\n \n try {\n const existingNoteDate = localStorage.getItem(\"note\"+i).split(\",\")[1];\n \n if(existingNoteDate === noteDate) {\n alert(\"Bitte nur einen Eintrag pro Tag.\");\n return;\n }\n } catch {\n continue;\n }\n }\n\n localStorage.setItem(\"note\" + noteCount, text + \",\" + noteDate);\n noteCount++;\n localStorage.setItem(\"noteCount\", noteCount);\n\n fillCalendar(year, month, day);\n document.getElementById(\"NotifyText\").value = \"\";\n }", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function updateLs() { \n \n const notesText = document.querySelectorAll('textarea'); // queryselector all return array od elements\n\n const notes = [];\n\n notesText.forEach((note) => {\n notes.push(note.value);\n });\n\n localStorage.setItem('notes',JSON.stringify(notes));\n\n }", "function sync() {\r\n // get data from the localStorage\r\n if (_.size(notesStorage.keys()) > 0) {\r\n // save in the data cloud\r\n postData(getUnsavedData())\r\n .then(function () {\r\n notesStorage.clearAll();\r\n }, function () {\r\n // an error while syncing has been occurred\r\n });\r\n }\r\n }", "function storeInputInLocalStorage(myTitle, mySubtext, myDate) {\n let noteObj = {\n title: myTitle,\n subtext: mySubtext,\n date: myDate\n };\n\n let notes;\n if (localStorage.getItem('notes') === null) {\n notes = [];\n } else {\n notes = JSON.parse(localStorage.getItem('notes'));\n }\n\n notes.push(noteObj);\n\n localStorage.setItem('notes', JSON.stringify(notes));\n}", "function getNotes(){\n var notes = $('#notesInput').val().toUpperCase();\n localStorage.setItem(\"notes\", notes);\n}", "function storeNote() {\n let title = document.getElementById(\"title\").value; //receives text from input field\n let note = document.getElementById(\"takeNote\").value; //recieves text from textarea\n note = note.replace(/\\n\\r/g, \"<br />\"); //replace \\n \\r with \"<br />\" as notices are stored as an string\n if ((title || note) == \"\") {\n //leave function if title or note are empty\n return;\n }\n\n titles.push(title); //store title in array titles\n notes.push(note); //store note in array notes\n setArray(\"titles\", titles); //store also under localStorage\n setArray(\"notes\", notes); //store also under localStorage\n\n document.getElementById(\"title\").value = \"\"; // delete input title\n document.getElementById(\"takeNote\").value = \"\"; // delete input notes\n\n showNotes(\"my-notes\", titles, notes); //shows update notes\n}", "function setAllNotes(lists) {\n storage.setItem('P1_todoNotesDB', JSON.stringify(lists));\n }", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "function newNotes() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes), err => {\n if (err) {\n return console.log(err);\n }\n });\n }", "function loadNotes() {\n if (localStorage.notes != undefined) {\n var contents = JSON.parse(localStorage.getItem(\"notes\"));\n\n for (var i = 0; i < contents.length; i ++) {\n addNote(contents[i]);\n }\n }\n}", "saveNote() {\n if (this.noteMessageInput.value) {\n let key = Date.now().toString();\n localStorage.setItem(key, this.noteMessageInput.value);\n this.displayNote(key, this.noteMessageInput.value);\n StickyNotesApp.resetMaterialTextfield(this.noteMessageInput);\n this.toggleButton();\n }\n }", "function storeNotes(key, value){\n // take our date-names for each content column and store it as our key\n //set the key value to the content in the textarea of our content column\n localStorage.setItem(key, value);\n }", "function save() {\n storage.write(filename, data);\n }", "function saveTodo() {\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n }", "function getNoteData(){\n return JSON.parse(localStorage.getItem(\"notes\")) || {};\n}", "function addNote() {\n fs.writeFileSync(\"Develop/db/db.json\", JSON.stringify(notesData))\n}", "function restoreNotes() {\n //check if noteList array is empty \n let checkNoteList = localStorage.getItem(\"noteList\");\n if (checkNoteList == null) {\n localStorage.setItem(\"noteList\", JSON.stringify([]));\n }\n // load existing notes from local storage to array\n noteList = JSON.parse(localStorage.getItem(\"noteList\"));\n\n for (let i = 0; i < noteList.length; i++) {\n createNote(noteList[i], i)\n }\n}", "function saveNotes(note) {\n // Set the note's id to the length of the array\n note.id = data.length;\n // push the note onto the current json array\n data.push(note);\n // write the updated array to the json file\n fs.writeFile(dbPath, JSON.stringify(data), error => {\n if(error){\n throw error;\n }\n });\n\n}", "function writeNotes(notes) {\n const notesDiv = document.querySelector('#notes');\n // clear the div\n notesDiv.innerHTML = '';\n // add all items as Ps to the div\n notes.forEach(function(note) {\n const newItem = document.createElement('p');\n const span1 = document.createElement('span');\n const newButton = document.createElement('button');\n span1.textContent = note.body;\n newButton.textContent = \"x\";\n newButton.addEventListener('click', function() {\n removeNote(note.id);\n localStorage.setItem( 'notes', JSON.stringify(notes) );\n writeNotes(notes);\n });\n // construct the p and append it\n newItem.appendChild(newButton);\n newItem.appendChild(span1);\n notesDiv.appendChild(newItem);\n });\n}", "function saveRecordatorios(recordatorios){\n\tvar recordatorioJSON = JSON.stringify(recordatorios);\n\tlocalStorage.setItem(\"recordatorios\",recordatorioJSON);\n\n}", "saveTodosToLS( ) {\n\n localStorage.setItem( 'todo', JSON.stringify( this.todos ) );\n }", "function saveTodos(todos) {\r\nlocalStorage.setItem('todos', JSON.stringify(todos))\r\n\r\n\r\n}", "function updateNote(e){\n let note = notes[e.path[1].classList[0].split(\"id\")[1]];\n switch(e.target.name){\n case \"title\":\n note.title = e.target.value;\n break;\n case \"content\":\n note.content = e.target.value;\n break;\n case \"color\":\n e.path[1].style.backgroundColor = e.target.value;\n note.color = e.target.value;\n break;\n }\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function saveChanges() {\n var note_id = $('.note-info').attr('id'),\n csrftoken = $.cookie('csrftoken'),\n title = $('#title').text(),\n note_title = title === \"\" ? \"Untitled note\" : title,\n note_content = $('.editor').html(),\n data = {\n id: note_id,\n title: note_title,\n body: note_content,\n csrfmiddlewaretoken: csrftoken\n };\n\n $.post(\"/notes/editnote/\", data).success(function (data) {\n var note = $('#notelist').find('a[data-noteid=' + note_id + ']');\n $(note).find('strong').html(data.title);\n $(note).find('.preview').html(data.preview);\n });\n }", "function saveNote(note, title) {\n\tvar n = document.getElementById(note).value;\n\tvar t = document.getElementById(title).value;\n\tvar o = new Note(n, t);\n\tvar notes_array = $.parseJSON($.cookie(\"notes_array\"));\n\tnotes_array.push(o);\n\t$.cookie(\"notes_array\", JSON.stringify(notes_array), {expire:365});\n\t//save note to cookie\n\t//save title to corresponding cookie\n\t// console.log(notes_array);\n\tloadTitlesToDropdown();\n}", "function loadFromLocalStorage() {\n let notes;\n // check LS\n if (localStorage.getItem('notes') === null) {\n notes = [];\n } else {\n notes = JSON.parse(localStorage.getItem('notes'));\n\n //loop though notes and create items\n for (let i = 0; i < notes.length; i++) {\n // set title and subtext to arr\n let note = [];\n let myTitle = notes[i].title;\n let mySubtext = notes[i].subtext;\n let myDate = notes[i].date;\n note.push(myTitle);\n note.push(mySubtext);\n note.push(myDate);\n \n // create note\n createNote(note);\n }\n }\n}", "async function save() {\n await localStorage.setItem(\n KEY,\n JSON.stringify({\n path,\n text,\n revision,\n lineCount,\n store: store.getState()\n })\n );\n }", "function saveAll() {\r\n if (allNotes.length == 0) {\r\n deleteAllCookies();\r\n return;\r\n }\r\n var allNotesTemp = allNotes.slice();\r\n for (var i = 0; i < allNotesTemp.length; i++) {\r\n allNotesTemp[i] = encodeURIComponent(allNotesTemp[i]);\r\n }\r\n var saveString = btoa(allNotesTemp.toString());\r\n allNotesTemp = null;\r\n setCookie('jscn', saveString);\r\n}", "function saveTodo(todo) {\n localStorage.setItem('todos', JSON.stringify(todos));\n \n}", "function saveNoteBooksToLocalStorage() {\n \n if (existingNoteBooks.length > 1) {\n let arrayToHoldAllCurrentNotebooks = []; \n existingNoteBooks.forEach((element) => {\n if (element.titleOfObject != \"Dashboard\") {\n arrayToHoldAllCurrentNotebooks.push(element.titleOfObject);\n }\n }); //need to clear array after used or check before if there allredy is a existing name\n\n arrayToHoldAllCurrentNotebooks.toString(); // turns the notes ti string\n localStorage.setItem(\"books\", arrayToHoldAllCurrentNotebooks);\n }\n}", "function addNoteToArray(textDetails,taskDate,taskHours){\n var obj = createObjectNote(textDetails,taskDate,taskHours);\n notesArray.push(obj);\n localStorage.setItem(\"note_local\", JSON.stringify(notesArray));\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 changeNote() {\n editor.value = window.localStorage.getItem(notes.value);\n}", "function updateNotesData(notes) {\n fs.writeFile('db/db.json', JSON.stringify(notes,'\\t'), err => {\n if (err) throw err;\n return true;\n })\n}", "_save() {\n if (this.store && localStorage) {\n localStorage.setItem(this.store, JSON.stringify(this.records));\n }\n }", "onSaveNote(){\r\n let new_note = {\r\n title: this.state.title,\r\n note: this.state.note\r\n };\r\n\r\n let list = JSON.parse(localStorage.getItem('list'));\r\n \r\n // update the note by index\r\n // list[this.state.index].title = this.state.title;\r\n // list[this.state.index].note = this.state.note;\r\n\r\n list[this.state.index] = new_note;\r\n\r\n localStorage.setItem('list', JSON.stringify(list));\r\n this.setState({title: '', note: ''});\r\n }", "function saveStorage() {\n $('textarea').each(function () {\n let val = $(this).val();\n let id = $(this).attr(\"id\");\n localStorage.setItem(id, val);\n });\n }", "function addNoteTextStorage(event) {\n const node = event.target.parentNode.parentNode;\n const text = node.querySelector('.note__text').innerText;\n const date = node.querySelector('.date').innerText;\n\n const noteText = { text, date };\n\n notes.push(noteText);\n localStorage.setItem('notes', JSON.stringify(notes));\n\n populateNotes(notes, notesList);\n}", "function save_data() {\r\n\tsessionStorage.setItem('pieces', JSON.stringify(Data.pieces))\r\n\tsessionStorage.setItem('stamps', JSON.stringify(Data.stamps))\r\n\tsessionStorage.setItem('categories', JSON.stringify(Data.categories))\r\n\tsessionStorage.setItem('tuto', JSON.stringify(Data.tuto))\r\n}", "saveTodos(todos) {\r\n localStorage.setItem('todos', JSON.stringify(todos))\r\n }", "exportNotesToFile() {\n\n const data = JSON.stringify(this.todoLists);\n const file = new Blob([data], {type: 'application/json'});\n if (window.navigator.msSaveOrOpenBlob) // IE10+\n window.navigator.msSaveOrOpenBlob(file, 'todo_notes.json');\n else { // Others\n const a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = 'todo_notes.json';\n document.body.appendChild(a);\n a.click();\n setTimeout(function() {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url); \n }, 0); \n }\n }", "function makeNotesFromLocalStorage() {\n \n let noteBookBelongingToNote = \"\";\n let noteOrListType = \"\";\n let dateOfCreatedNote = \"\";\n let noteTosave = [];\n const endOfSavedNoteSymbol = \"//\";\n\n openNotebook = localStorage.getItem(\"lastVisitedNoteBook\");\n\n if (getLocalStorageListsToArray(\"notes\") != null) {\n getLocalStorageListsToArray(\"notes\").forEach((element) => {\n // creates notes\n\n if (element == endOfSavedNoteSymbol && noteTosave[0] == 1) {\n noteOrListType = noteTosave[0];\n noteBookBelongingToNote = noteTosave[1];\n dateOfCreatedNote = noteTosave[2];\n\n let noteTextarea = noteTosave[3];\n let temporaryHolderOfNoteObj = new Note(noteOrListType);\n\n temporaryHolderOfNoteObj.addingFromLocalStorage(\n dateOfCreatedNote,\n noteBookBelongingToNote,\n noteTextarea\n );\n allNotes.push(temporaryHolderOfNoteObj);\n noteTosave = [];\n }\n\n if (element == endOfSavedNoteSymbol && noteTosave[0] == 2) {\n // creates note lists\n\n noteOrListType = noteTosave[0];\n noteBookBelongingToNote = noteTosave[1];\n dateOfCreatedNote = noteTosave[2];\n\n let temporaryHolderOfListObj = new Note(noteOrListType);\n temporaryHolderOfListObj.addingFromLocalStorage(\n dateOfCreatedNote,\n noteBookBelongingToNote,\n \"\"\n );\n for (let index = 4; index < noteTosave.length; index++) {\n temporaryHolderOfListObj.setNewLi(noteTosave[index]);\n }\n\n allNotes.push(temporaryHolderOfListObj); //when fixed sent the rest of array into notes\n noteTosave = [];\n }\n\n if (element != \"//\") {\n noteTosave.push(element);\n }\n });\n }\n}", "function save(){\n if (!isSaveAllowed) {\n log('Save was temporarily disabled until you decide what to do with previously saved content.');\n return;\n }\n\n var data = getFormData();\n data['_autosaveTime'] = now();\n var key = getKey();\n\n if(typeof key === 'string' && key.length > keyPrefix.length && typeof data === 'object'){\n localStorage.setItem(key.trim(), JSON.stringify(data));\n\n log('Content saved.');\n }\n\n removeOldEntries();\n}", "static storeData(todo){\r\n let todos;\r\n if(localStorage.getItem('todo')=== null){\r\n todos = []\r\n }else{\r\n todos = JSON.parse(localStorage.getItem('todo'))\r\n }\r\n todos.push(todo)\r\n localStorage.setItem('todo',JSON.stringify(todos))\r\n }", "function saveInfo(e) {\n e.preventDefault();\n //console.log(\"click\")\n var text = $(this).siblings('textarea').val().trim();\n var id = $(this).siblings('textarea').attr('id');\n\n localStorage.setItem(id, JSON.stringify(text));\n\n}", "function saveComments() {\n\n localStorage.setItem('comments', JSON.stringify(sectionComments));\n\n}", "function saveNote() {\n var sText = document.getElementById('note_area').value;\n\n if (oSelectedNote == null) {\n note = new Note();\n note.sNote = sText;\n\n oData.jsFormula.addNote(note);\n\n oNotesTable.row.add([\n note.nuNote,\n note.iIdNote,\n note.sNote\n ]).draw( false );\n }\n else {\n oData.jsFormula.getNote(oSelectedNote.nuNote).sNote = sText;\n $('#notes_table').dataTable().fnUpdate(sText , oSelectedNote.nuNote, 2);\n }\n\n initNote();\n}", "function NoteSave(){\n\t\tvar noteData;\n\t\tvar newNote = $(\".bootbox-body textarea\").val().trim();\n\t\tif(newNote){\n\t\t\tnoteData = {\n\t\t\t\t_id: $(this).data(\"article\")._id,\n\t\t\t\tnoteText: newNote\n\t\t\t};\n\t\t\t$.post(\"/scrape/notes\", noteData).then(function(){\n\t\t\t\tbootbox.hideAll();\n\t\t\t});\n\t\t}\n\t}", "function saveNote(note, noteArr){\n // if the array is not empty push to the list then write\n if(noteArr){\n noteArr.push(note);\n fs.writeFileSync(path.join(__dirname, '../data/notes.json'), JSON.stringify({notes: noteArr}, null, 2));\n return noteArr;\n }\n // else if empty, assign note as array then write\n noteArr = note;\n fs.writeFileSync(path.join(__dirname, '../data/notes.json'), JSON.stringify({notes: noteArr}, null, 2));\n return noteArr;\n}", "function savePomoData() {\n localStorage.setItem(\"cpid\", currentPomoID);\n localStorage.setItem(\"pomoData\", JSON.stringify(pomoData));\n}", "function saveNote(title,body){\n chrome.storage.sync.set({ [title] : body });\n errorText.innerHTML = \"Notes saved!\";\n // chrome.storage.sync.get(null,function(result){\n // console.log(result);\n // });\n}", "save(){\n var tasks = []; \n this.list.forEach(function(item){\n var task = {}\n task.text = item.text;\n task.priority = item.priority;\n task.duedate = item.duedate;\n task.tag = item.tag;\n task.done = item.done;\n tasks.push(task);\n });\n var stringArray = JSON.stringify(tasks);\n localStorage.setItem(this.key, stringArray);\n }", "function bringNotes() {\n if (localStorage.getItem(\"notes\") != null) {\n notes = JSON.parse(localStorage.getItem(\"notes\"));\n } else {\n notes = [];\n }\n console.log(notes.length);\n if (localStorage.getItem(\"notesLength\") != null)\n c = parseInt(localStorage.getItem(\"notesLength\"));\n console.log(c);\n console.log(notes);\n}", "function storeData(tasks) {\n storedData = localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function saveData() {\n try {\n const fsStorageAsArray = toSaveFormat(fsStorage[0], null);\n localStorage.setItem(\"saveArray\", JSON.stringify(fsStorageAsArray));\n } catch(err) {\n alert(\"Error occurred while saving the data\");\n }\n }", "save() {\n const tasksJson = JSON.stringify(this.tasks);\n localStorage.setItem('tasks', tasksJson);\n const currentId = String(this.currentId);\n localStorage.setItem('currentId', currentId);\n }", "function saveData() {\n localStorage.setItem(SAVE_LOCATION, JSON.stringify(data));\n}", "function saveToLocalStorage(newToDo) {\n localStorage.setItem(\"todos\", JSON.stringify(newToDo));\n}", "function saveTodos(todos) {\r\n let todosInStr = JSON.stringify(todos)\r\n localStorage.setItem('todos', todosInStr)\r\n}", "function saveToStorage() {\n\tlocalStorage.setItem(\"trackers\", JSON.stringify(trackers));\n}", "function save() {\n if(check_web_storage_support() == true) {\n var area = document.getElementById(\"area\");\n if(area.value != '') {\n localStorage.setItem(\"note\", area.value);\n }\n else {\n alert(\"Write someting to save\");\n }\n }\n}", "function storeToDos() {\n localStorage.setItem(\"user-todo\", JSON.stringify(toDos));\n localStorage.setItem(\"user-todo-hour\", JSON.stringify(toDosHours));\n}", "function saveReminders() {\n localStorage.setItem(\"dayReminders\", JSON.stringify(dayReminders));\n}", "function saveData() {\n let saveTask = JSON.stringify(listTask)\n window.localStorage.setItem(\"task_management\", saveTask)\n\n updateHtml()\n}", "function saveClose(noteId) {\n var editPanel = document.getElementById('edit-panel-' + noteId);\n var newContent = editPanel.innerHTML.replace(/(<([^>]+)>)/ig, '<br/>'); //regex removes all html elements present and replaces them with a line break\n //console.log(newContent);\n for (var i = 0; i < myNotes.length; i++) {\n if (myNotes[i].id == noteId) {\n //console.log(myNotes[i].note);\n myNotes[i].note = newContent;\n //console.log(myNotes[i].note);\n Cookies.set('storedNotes', myNotes);\n noteDetailPanel.classList.remove('show');\n }\n }\n if (editorWasOpen === false) { //close the editor panel if it was already closed\n closeEditor();\n }\n}", "function storeTodo() {\n\n // JSON.stringify is a converter of object or aaray into string\n var arrToString = JSON.stringify(todoList);\n\n localStorage.setItem('todoListArr', arrToString);\n}", "save(){\n\t\tvar dataString = JSON.stringify(this.getData());\n\t\tfs.writeFile('app/json/saveData.txt', dataString);\n\t}", "function saveLocalTodo(todo)\n{\n\nlet todos;\nif(localStorage.getItem('todos')=== null)\n{\n todos=[];\n} \nelse\n{\ntodos=JSON.parse(localStorage.getItem('todos')); \n} \ntodos.push(todo);\nlocalStorage.setItem(\"todos\",JSON.stringify(todos)); \n}", "function save() {\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(tasks));\n localStorage.setItem(LOCAL_STORAGE_SELECTED_LIST_ID, selectedListId);\n}", "function note_save()\n {\n var note_obj;\n // grab the note typed into the input box\n var new_note = $(\".bootbox-body textarea\").val().trim();\n\n if (new_note)\n {\n note_obj =\n {\n _id: $(this).data(\"headline\")._id,\n text: new_note\n };\n $.post(\"/api/notes\", note_obj).then(function()\n {\n // on success, close the modal\n bootbox.hideAll();\n });\n }\n }", "save() {\n // Create a JSON string of the tasks\n const tasksJson = JSON.stringify(this.tasks);\n\n // Store the JSON string in localStorage\n localStorage.setItem(\"tasks\", tasksJson);\n\n // Convert the currentId to a string;\n const currentId = String(this.currentId);\n\n // Store the currentId in localStorage\n localStorage.setItem(\"currentId\", currentId);\n }", "save() {\n // Create a JSON string of the tasks\n const tasksJson = JSON.stringify(this.tasks);\n\n // Store the JSON string in localStorage\n localStorage.setItem(\"tasks\", tasksJson);\n\n // Convert the currentId to a string;\n const currentId = String(this.currentId);\n\n // Store the currentId in localStorage\n localStorage.setItem(\"currentId\", currentId);\n }", "function saveToLocalStorage(todo){\n\nlet todos;\nif(localStorage.getItem(\"todos\") === null ){\n todos = [];\n}else{\n todos = JSON.parse(localStorage.getItem(\"todos\"));\n}\n todos.push(todo);\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n}", "@action\n saveToStore() {\n AsyncStorage.setItem(\"dates\", JSON.stringify(this.dates));\n AsyncStorage.setItem(\"content\", JSON.stringify(this.content));\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 }", "function saveLocally(date, mealType, calories, foodName) {\n\n\n //console.log('storing in ' + number)\n //window.localStorage.setItem(number + '', post)\n\n window.localStorage.setItem(date + '', mealType + \"/\" + calories + \"/\" + foodName)\n \n //can we change items? I think we can\n\n //we need to add multiple food mealtimes per day. how can we make it efficient?\n\n //clearScreen()\n //populate()\n}", "function saveData(){\n\tvar listData = document.getElementById(\"toDoList\");\n\tlocalStorage.setItem(\"appData\",listData.innerHTML);\n\n}", "function saveData() {\n localStorage.removeItem(\"tasks\");\n localStorage.setItem(\"tasks\", JSON.stringify(taskList));\n}", "function saveLocalTodos(todo){\n checksaveTodos();\n todos.push(todo);\n localStorage.setItem(\"todos\" , JSON.stringify(todos));\n pendingItem(todos);\n\n}", "function storeData(data){\n localStorage.data = JSON.stringify(data);\n }", "function pushNote(thisNote) {\n //console.log('push has been called');\n myNotes.push(thisNote);\n Cookies.set('storedNotes', myNotes);\n //myNotes = Cookies.getJSON('storedNotes');\n //console.log('New Note Saved');\n confirmation.placeholder = 'New note saved';\n note.value = '';\n}", "function save(key, data) {\n window.localStorage.setItem(key, data);\n }", "function saveOngo(){\n localStorage.setItem(LS_ONGOING, JSON.stringify(ONGOING));\n}" ]
[ "0.85743403", "0.828072", "0.8183288", "0.7982741", "0.7978456", "0.79653776", "0.7956188", "0.7946575", "0.7693433", "0.7688642", "0.7549182", "0.74813306", "0.7425618", "0.7423588", "0.7372362", "0.73708755", "0.73693156", "0.7294581", "0.7252094", "0.7235003", "0.7226063", "0.7184468", "0.71415097", "0.71372384", "0.71366113", "0.71157897", "0.71108925", "0.71085876", "0.7099144", "0.7079355", "0.70622987", "0.7057382", "0.7055651", "0.70521104", "0.70490223", "0.70433134", "0.70356494", "0.7032609", "0.70184726", "0.6982805", "0.6978984", "0.697309", "0.696784", "0.69675344", "0.6952584", "0.6935139", "0.69322306", "0.6929094", "0.6923582", "0.6862403", "0.68522704", "0.684753", "0.6839104", "0.6831177", "0.6822681", "0.6821337", "0.6817057", "0.6809473", "0.6795806", "0.67867905", "0.67785126", "0.676864", "0.6763913", "0.676317", "0.67590034", "0.6750498", "0.6738083", "0.67151994", "0.6701114", "0.6698285", "0.6694733", "0.6692307", "0.66907066", "0.6689388", "0.6678588", "0.6677223", "0.6669783", "0.6659558", "0.66532516", "0.6647274", "0.66465056", "0.6643059", "0.66404134", "0.6639833", "0.6636369", "0.662947", "0.6620216", "0.66146106", "0.66146106", "0.6610763", "0.6610234", "0.6597098", "0.6595682", "0.65904486", "0.6587167", "0.65848345", "0.6579851", "0.65780133", "0.6563629", "0.6562224" ]
0.77816063
8
Creates notes when page is loaded from local storage
function makeNotesFromLocalStorage() { let noteBookBelongingToNote = ""; let noteOrListType = ""; let dateOfCreatedNote = ""; let noteTosave = []; const endOfSavedNoteSymbol = "//"; openNotebook = localStorage.getItem("lastVisitedNoteBook"); if (getLocalStorageListsToArray("notes") != null) { getLocalStorageListsToArray("notes").forEach((element) => { // creates notes if (element == endOfSavedNoteSymbol && noteTosave[0] == 1) { noteOrListType = noteTosave[0]; noteBookBelongingToNote = noteTosave[1]; dateOfCreatedNote = noteTosave[2]; let noteTextarea = noteTosave[3]; let temporaryHolderOfNoteObj = new Note(noteOrListType); temporaryHolderOfNoteObj.addingFromLocalStorage( dateOfCreatedNote, noteBookBelongingToNote, noteTextarea ); allNotes.push(temporaryHolderOfNoteObj); noteTosave = []; } if (element == endOfSavedNoteSymbol && noteTosave[0] == 2) { // creates note lists noteOrListType = noteTosave[0]; noteBookBelongingToNote = noteTosave[1]; dateOfCreatedNote = noteTosave[2]; let temporaryHolderOfListObj = new Note(noteOrListType); temporaryHolderOfListObj.addingFromLocalStorage( dateOfCreatedNote, noteBookBelongingToNote, "" ); for (let index = 4; index < noteTosave.length; index++) { temporaryHolderOfListObj.setNewLi(noteTosave[index]); } allNotes.push(temporaryHolderOfListObj); //when fixed sent the rest of array into notes noteTosave = []; } if (element != "//") { noteTosave.push(element); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadNotes() {\n if (localStorage.notes != undefined) {\n var contents = JSON.parse(localStorage.getItem(\"notes\"));\n\n for (var i = 0; i < contents.length; i ++) {\n addNote(contents[i]);\n }\n }\n}", "function init(){\n notes = JSON.parse(localStorage.getItem(\"notes\"));\n if(!notes) notes =[];\n notes.forEach(element => {\n addNote(element);\n });\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 loadFromLocalStorage() {\n let notes;\n // check LS\n if (localStorage.getItem('notes') === null) {\n notes = [];\n } else {\n notes = JSON.parse(localStorage.getItem('notes'));\n\n //loop though notes and create items\n for (let i = 0; i < notes.length; i++) {\n // set title and subtext to arr\n let note = [];\n let myTitle = notes[i].title;\n let mySubtext = notes[i].subtext;\n let myDate = notes[i].date;\n note.push(myTitle);\n note.push(mySubtext);\n note.push(myDate);\n \n // create note\n createNote(note);\n }\n }\n}", "function init(){\n if (localStorage.getItem(\"note_local\")) {\n notesArray = JSON.parse(localStorage.getItem(\"note_local\"));\n for(var i=0;i<notesArray.length;i++)\n addnoteToDOM(notesArray[i].taskDetails, notesArray[i].taskDate, notesArray[i].taskHours);\n } \n}", "load(){\n\t\t//get data from localstorage\n\t\tlet data = JSON.parse(localStorage.getItem('listNotes'));\n\t\tif(data){\n\t\t\tnoteList.list = data;\n\t\t}\n\t\t//vide la section\n\t\tdocument.getElementById(\"noteListView\").innerHTML = \"\"\n\t\tif (noteList.list) {\n\t\t\tnoteList.list.forEach((e) => {\n\t\t\t\tnoteView.afficher(e); \n\t\t\t\t//affiche le titre de la note dans le bloc gauche\n\t\t\t\tnoteListView.displayItem(e);\n\t\t\t});\n\t\t}\n\t\t//Vider le titre et le contenu\n\t\tdocument.querySelector('#form_add_note_title').value = \"\";\n\t\tdocument.querySelector('#form_add_note_text').value = \"\";\n\t}", "function storeNotes() {\n // Store the note in the localStorage\n localStorage.setItem(\"note\", JSON.stringify(notesArray));\n }", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function saveNotes() {\n localStorage.setItem(\"notes\", JSON.stringify(notes));\n localStorage.setItem(\"notesLength\", c);\n}", "function saveNotes() {\n // Grab the current HTML of the notepad\n let currentNotesHTML = $('#notepad').html();\n // Store the HTML in an object\n let notesData = {\n html: currentNotesHTML\n }\n // Save it to localStorage\n localStorage.setItem('notes', JSON.stringify(notesData));\n}", "function checkNotes() {\n let noteContent = localStorage.getItem(\"note\");\n if (noteContent) { \n console.log(\"Note Exists\");\n document.getElementById(\"notes\").innerHTML = noteContent;\n }\n else {\n document.getElementById(\"notes\").placeholder = \"Whenever you're ready...\";\n }\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}", "function renderNotes() {\n noteArray = JSON.parse(localStorage.getItem(\"dayNotes\")) || [];\n $(noteArray).each(function () {\n $(\"#\" + this.id).find(\"textarea\").text(this.note)\n });\n}", "function restoreNotes() {\n //check if noteList array is empty \n let checkNoteList = localStorage.getItem(\"noteList\");\n if (checkNoteList == null) {\n localStorage.setItem(\"noteList\", JSON.stringify([]));\n }\n // load existing notes from local storage to array\n noteList = JSON.parse(localStorage.getItem(\"noteList\"));\n\n for (let i = 0; i < noteList.length; i++) {\n createNote(noteList[i], i)\n }\n}", "function loadStorage() {\r\n\tif (localStorage.getItem(\"notes\")) { // load only if notes has something in it...\r\n\t\tvar notes_str = localStorage.getItem(\"notes\");\r\n\t\tnotesObj = JSON.parse(notes_str);\r\n\t\tfor (var j=0; j < notesObj.notes.length; j++) {\r\n\t\t\tdisplayNote(notesObj.notes[j]); // call function to display each existing note\r\n\t\t}\r\n\t\tconsole.log(\"*** notes data has been loaded successfully from local storage! ***\");\r\n\t} else {\r\n\t\tconsole.log(\"*** local storage is currently empty! ***\");\r\n\t}\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 getLocalNotes() {\r\n if (JSON.parse(localStorage.getItem(\"Notes\")) !== null) {\r\n noticearr = JSON.parse(localStorage.getItem(\"Notes\")).reverse();\r\n for (var i = 0; i < noticearr.length; i++) {\r\n var inText = noticearr[i];\r\n $('#notizenT').prepend('<li class=\"notMessage list-group-item\"><div class=\"row\"><div class=\"col-md-10 notmsg\">' + inText + '</div><div class=\"col-md-2\"><button onClick=\"$(this).parent().parent().parent().remove()\" type=\"button\" class=\"close\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button></div> </div></li>');\r\n }\r\n } else {\r\n localStorage.setItem(\"Notes\", JSON.stringify(noticearr));\r\n }\r\n}", "function load() {\n let savedNotes = localStorage.getItem(\"dataNotes\");\n let savedTitle = localStorage.getItem(\"dataTitle\");\n if (savedNotes) {\n notes.value = savedNotes;\n }\n if (savedTitle) {\n notesTitle.value = savedTitle;\n headerTitleChange()\n }\n}", "function getNotes() {\n chrome.storage.local.get(['notes-keeper'], function(result) {\n loadNotes(result); //calling loadNotes(result) to display the data on screen\n });\n}", "function getNoteData(){\n return JSON.parse(localStorage.getItem(\"notes\")) || {};\n}", "function bringNotes() {\n if (localStorage.getItem(\"notes\") != null) {\n notes = JSON.parse(localStorage.getItem(\"notes\"));\n } else {\n notes = [];\n }\n console.log(notes.length);\n if (localStorage.getItem(\"notesLength\") != null)\n c = parseInt(localStorage.getItem(\"notesLength\"));\n console.log(c);\n console.log(notes);\n}", "function addNoteTextStorage(event) {\n const node = event.target.parentNode.parentNode;\n const text = node.querySelector('.note__text').innerText;\n const date = node.querySelector('.date').innerText;\n\n const noteText = { text, date };\n\n notes.push(noteText);\n localStorage.setItem('notes', JSON.stringify(notes));\n\n populateNotes(notes, notesList);\n}", "function saveNotes() {\n var contents = [];\n $(\".note\").each(function() {\n contents.push($(this).find(\"textarea\").val());\n });\n\n localStorage.setItem(\"notes\", JSON.stringify(contents));\n}", "function getNotes(){\n var notes = $('#notesInput').val().toUpperCase();\n localStorage.setItem(\"notes\", notes);\n}", "function saveNotesToLocalStorage() {\n let holdsLocalStorageNotes = [];\n allNotes.forEach((element) => {\n element.getNoteText();\n\n let temporaryVarForTextContent = \"\";\n if (element.getNoteText() != \"\") {\n temporaryVarForTextContent = element.getNoteText();\n }\n\n let liFromObjArray = element.getNoteLi();\n\n holdsLocalStorageNotes.push(\n element.noteType,\n element.titleOfNoteBook,\n element.date,\n temporaryVarForTextContent\n ); //fix here\n\n if (element.noteType == 2) {\n liFromObjArray.forEach((element) => {\n holdsLocalStorageNotes.push(element);\n });\n }\n\n holdsLocalStorageNotes.push(\"//\");\n });\n\n toString(holdsLocalStorageNotes);\n\n localStorage.setItem(\"notes\", holdsLocalStorageNotes);\n\n // maby add a call in remove notes to jsut to keep in current\n}", "constructor() {\n\n // przycisk który dodaje nam nową notatke \n document.querySelector('#addNote').addEventListener('click', () => this.createNewNote(document.querySelector('#noteTitle').value, document.querySelector('#noteText').value, document.querySelector('#color').value)); // przycisk do dodawania notatki\n\n\n\n if (typeof localStorage !== 'undefined') { // czy istnieje local storage\n if (localStorage.getItem('notes') != null) { // czy istnieje jakas notatka czyli jak nie jest pusty to pobiera notatke i wyswietlam notatke )\n this.notesArr = JSON.parse(localStorage.getItem('notes'));\n this.show();\n }\n }\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=\"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 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 addNote() {\n\t\t\n\t\tid++;\n\t\tzIndex++;\n\t\t\n\t\tvar body = document.querySelector('body');\n\t\t\n\t\tvar note = document.createElement('div');\n\t\tvar close = document.createElement('div');\n\t\tvar field = document.createElement('div');\n\t\tvar footer = document.createElement('div');\n \t\t\n\t\tnote.setAttribute('id', 'note' + id);\n\t\tclose.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('contenteditable', true);\n\t\t\t\n\t\tnote.classList.add('note');\n\t\tclose.classList.add('close');\n\t\tfield.classList.add('field');\n\t\tfooter.classList.add('footer');\n\t\t\n\t\tnote.style.zIndex = zIndex;\n\t\t\t\n\t\tnote.appendChild(close);\n\t\tnote.appendChild(field);\n\t\tnote.appendChild(footer);\n\t\tbody.appendChild(note);\n\t\t\n\t\tattachListeners(note, close, field, footer);\n\t\t\n\t\tvar data = JSON.parse(localStorage['data']);\n\t\t\n\t\t// Save the current note's data\n\t\tdata.push({\n\t\t\n\t\t\tid: id,\n\t\t\ttext: '',\n\t\t\tposition: { x: 20, y: 20 },\n\t\t\tzIndex: zIndex,\n\t\t\t\n\t\t\ttime: { \n\t\t\t\n\t\t\t\tday: new Date().getDate(), \n\t\t\t\tmonth: new Date().getMonth() + 1, \n\t\t\t\tyear: new Date().getFullYear(), \n\t\t\t\th: new Date().getHours(), \n\t\t\t\tm: new Date().getMinutes(), \n\t\t\t\ts: new Date().getSeconds() \n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t});\n\t\t\n\t\tlocalStorage['data'] = JSON.stringify(data);\n\t\t\n\t}", "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(){\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() {\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 display() {\n let noteField = localStorage.getItem(\"data\"); //getting the localStrorage items (strings)\n if (noteField == null) {\n noteArray = [];\n //noteArray = null;\n } else {\n noteArray = JSON.parse(noteField); //convert string to array using JSON.parse\n }\n\n let htmlDisplay = \"\";\n //Template literals used; element being the data in the array, index being its index no.\n //<h4 class=\"head-note-section\">Note ${index + 1}</h4>\n //including title and note as a single object\n\n noteArray.forEach(function (element, index) {\n htmlDisplay =\n htmlDisplay +\n `<div class=\"saved-note-section\">\n <div class=\"inside-save-section\">\n <h4 class=\"head-note-section\">${element.title}</h4>\n <p class=\"para-note-section\">${element.note}</p>\n <h6 class=\"date-section\">${element.idate}</h6>\n </div> \n <button class=\"delete-button\" onclick=\"deleteNote(${index})\">Delete</button>\n </div> `;\n });\n\n let notesDisplay = document.querySelector(\".saved-notes\");\n if (noteArray.length != 0) {\n notesDisplay.innerHTML = htmlDisplay;\n //console.log(\"Displaying saved notes\");\n } else {\n notesDisplay.innerHTML = `No notes : Add something`;\n //console.log(\"Displayed 0 notes\");\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 check() {\r\n const notearray = localStorage.getItem(\"items\")\r\n ? JSON.parse(localStorage.getItem(\"items\"))\r\n : [];\r\n if (notearray.length == 0) {\r\n notes.innerHTML = `<p>Nothing To Show ! Please Enter Your Notes Using \"Add A Notes\" Session </p>`;\r\n notes.classList.add(\"color\");\r\n }\r\n onload();\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(){\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 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 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 offlineMode () {\n if (localStorage.notes) {\n let parsedNotes = JSON.parse(localStorage.getItem('notes'));\n note._id = Math.floor(Math.random() * 100);\n\n if (localStorage.createNotes === undefined) {\n localStorage.setItem('createdNotes', JSON.stringify([note]));\n } else {\n let createdNotes = JSON.parse(localStorage.createNotes);\n createdNotes.push(note);\n localStorage.setItem('createdNotes', JSON.stringify(createdNotes));\n }\n\n \n parsedNotes.push(note);\n localStorage.setItem('notes', JSON.stringify(parsedNotes));\n\n history.push('/note/' + note._id);\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 newNote() {\n var csrftoken = $.cookie('csrftoken'),\n folder_id = $('.folder-list>.active>a').attr(\"data-folderid\"),\n data = {\n title: \"Untitled note\",\n body: \"<br>\",\n folder_id: folder_id,\n csrfmiddlewaretoken: csrftoken\n };\n $.post(\"/notes/addnote/\", data, function (data) {\n $('#notelist').children().prepend(data).children().first().trigger('click');\n $('#title').empty();\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 saveNotesToLocalStorage(noteArray){\n\t localStorage.setItem(\"notes\",JSON.stringify(noteArray));\n}", "function saveNote() {\n window.localStorage.setItem(notes.value, editor.value);\n}", "function onNoteLoad() {\n\t\n\tvar db = window.openDatabase(\"notes\", \"1.0\", \"Notes Demo\", 2000000);\n\t//db.transaction(checkDb, errorCB, successCB);\n\ttry {\n\t\tdb.transaction(loadNote);\n\t}\n\tcatch(e) {}\n}", "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 saveNoteDataToLocalStorage() {\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\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-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() {\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() {\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 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 getLocalStorage() {\n\n\tvar data = window.localStorage; // array os keys\n\n\t$.each(data, function(key, val) {\n \tlocalStorage.setItem(key, val); // \n \tvar note = key.substring(0,4);\n \tif (note == 'note') {\n \t\t$('.notas-list').prepend('\\\n \t\t\t<article class=\"box-skin nota-thumb\" id=\"'+ key +'\">\\\n \t\t\t\t<a href=\"#\" class=\"nota-delete\">X</a>\\\n \t\t\t\t<div class=\"nota-content\">'+ val +'</div>\\\n \t\t\t</article>\\\n \t\t');\n \t}\n\t});\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 storeInputInLocalStorage(myTitle, mySubtext, myDate) {\n let noteObj = {\n title: myTitle,\n subtext: mySubtext,\n date: myDate\n };\n\n let notes;\n if (localStorage.getItem('notes') === null) {\n notes = [];\n } else {\n notes = JSON.parse(localStorage.getItem('notes'));\n }\n\n notes.push(noteObj);\n\n localStorage.setItem('notes', JSON.stringify(notes));\n}", "function saveNoteDataToLocalStorage() {\n\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\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() {\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(){\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() {\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 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 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 changeNote() {\n editor.value = window.localStorage.getItem(notes.value);\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 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 writeNotes(notes) {\n const notesDiv = document.querySelector('#notes');\n // clear the div\n notesDiv.innerHTML = '';\n // add all items as Ps to the div\n notes.forEach(function(note) {\n const newItem = document.createElement('p');\n const span1 = document.createElement('span');\n const newButton = document.createElement('button');\n span1.textContent = note.body;\n newButton.textContent = \"x\";\n newButton.addEventListener('click', function() {\n removeNote(note.id);\n localStorage.setItem( 'notes', JSON.stringify(notes) );\n writeNotes(notes);\n });\n // construct the p and append it\n newItem.appendChild(newButton);\n newItem.appendChild(span1);\n notesDiv.appendChild(newItem);\n });\n}", "function getItemsFromLocalStorage() {\r\n notesCount = localStorage.getItem(\"count\");\r\n notesFromLocalStorage = JSON.parse(localStorage.getItem(\"notes\"));\r\n }", "function getNotesFromLocalStorage(){\n\t var note = localStorage.getItem(\"notes\"); \n\t noteArray = JSON.parse(note);\n\t if(!noteArray){\n\t\t noteArray=[];\n\t }\n\t return noteArray;\n}", "constructor() {\n // Shortcuts to DOM Elements.\n this.notesContainer = document.getElementById(\"notes-container\");\n this.noteMessageInput = document.getElementById(\"message\");\n this.addNoteButton = document.getElementById(\"save\");\n this.notesSectionTitle = document.getElementById(\"notes-section-title\");\n\n // Saves notes on button click.\n this.addNoteButton.addEventListener(\"click\", () => this.saveNote());\n\n // Toggle for the button.\n this.noteMessageInput.addEventListener(\"keyup\", () => this.toggleButton());\n\n // Loads all the notes.\n for (let key in localStorage) {\n this.displayNote(key, localStorage[key]);\n }\n // Listen for updates to notes from other windows.\n window.addEventListener(\"storage\", e =>\n this.displayNote(e.key, e.newValue)\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 createNoteByClick() {\n var newDate = new Date();\n var noteId = newDate.getTime();\n bq.setAttribute(\"id\", \"note-\" + noteId);\n bq.innerText = null;\n localStorage.setItem(noteId, \"\");\n bq.focus();\n}", "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 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 save() {\r\n let arrayNotes = document.getElementsByClassName(\"noteArea\");\r\n let titles = document.getElementsByClassName(\"title\");\r\n let contents = document.getElementsByClassName(\"content\");\r\n let newArray = [];\r\n for (let i = 0; i < arrayNotes.length; i++) {\r\n let obj = {};\r\n obj[\"title\"] = titles[i].value;\r\n obj[\"content\"] = contents[i].value;\r\n newArray.push(obj);\r\n }\r\n localStorage.setItem(\"notes\", JSON.stringify(newArray));\r\n}", "function getExistingNotes() {\n let notes = localStorage.getItem('notes')\n if (!notes) {\n return null\n }\n return JSON.parse(notes)\n}", "function updateLs() { \n \n const notesText = document.querySelectorAll('textarea'); // queryselector all return array od elements\n\n const notes = [];\n\n notesText.forEach((note) => {\n notes.push(note.value);\n });\n\n localStorage.setItem('notes',JSON.stringify(notes));\n\n }", "function Note(type) {\n this.noteType = type;\n this.date = addDate();\n this.titleOfNoteBook = openNotebook;\n this.addingFromLocalStorage = function (\n date,\n savedNoteBookPlacment,\n savedTextarea\n ) {\n if (date != null) {\n this.date = date;\n }\n if (savedNoteBookPlacment != null) {\n this.titleOfNoteBook = savedNoteBookPlacment;\n } else {\n this.titleOfNoteBook = openNotebook;\n }\n if (savedTextarea != \"\" && type == 1) {\n this.noteElement.getElementsByClassName(\n \"textArea\"\n )[0].textContent = savedTextarea;\n }\n };\n\n this.noteElement = createNote(this, type);\n main.prepend(this.noteElement);\n\n this.checkBox = document.createElement(\"input\");\n this.checkBox.type = \"checkbox\";\n this.checkBox.style.display = \"none\";\n this.checkBox.className = \"checkbox\";\n this.noteElement.appendChild(this.checkBox);\n this.delete = false;\n\n this.getNoteLi = function () {\n if (this.noteType == 2) {\n let arrayOfInnerText = [];\n let listItemsArray = this.noteElement.getElementsByClassName(\n \"itemOfList\"\n );\n\n for (let index = 0; index < listItemsArray.length; index++) {\n arrayOfInnerText.push(listItemsArray[index].innerText);\n }\n arrayOfInnerText.toString();\n return arrayOfInnerText;\n }\n };\n\n //om du kan mata varje string som newNext från local sätter denna dit dom en i taget\n this.setNewLi = function (newText) {\n if (this.noteType == 2) {\n let node = this.noteElement.getElementsByClassName(\"list\");\n let listItemContainer = document.createElement(\"div\");\n listItemContainer.className = \"list-item-container\";\n let node_li = document.createElement(\"li\");\n node_li.contentEditable = \"true\";\n node_li.className = \"itemOfList\";\n let textnode = document.createTextNode(newText);\n let span = document.createElement(\"SPAN\");\n let txt = document.createTextNode(\"\\u00D7\");\n span.className = \"remove-list-item\";\n span.addEventListener(\"click\", () => {\n listItemContainer.remove();\n saveNotesToLocalStorage();\n });\n span.appendChild(txt);\n node_li.appendChild(textnode);\n listItemContainer.appendChild(node_li);\n listItemContainer.appendChild(span);\n node[0].appendChild(listItemContainer);\n return node;\n }\n };\n this.getNoteText = function () {\n if (this.noteType == 1) {\n return this.noteElement.getElementsByClassName(\"textArea\")[0].textContent;\n }\n };\n this.setTitleOfNoteBook = (title) => {\n this.titleOfNoteBook = title;\n };\n\n this.checkBoxVisible = function (choise) {\n if (choise == true) {\n return (this.checkBox.style.display = \"block\");\n } else if (choise == false) {\n return (this.checkBox.style.display = \"none\");\n }\n };\n\n this.removeNote = function () {\n this.noteElement.remove();\n this.delete = true;\n clearDeleted();\n saveNotesToLocalStorage();\n };\n}", "function saveNote() {\n const text = document.getElementById(\"NotifyText\").value;\n const noteDate = document.getElementById(\"SelectedDay\").value + \".\" + month + \".\" + year;\n\n if(specialCharsMatch(text)) {\n alert(\"Sonderzeichen sind nicht erlaubt.\");\n return;\n }\n\n for(let i = 0; i < noteCount; i++) {\n \n try {\n const existingNoteDate = localStorage.getItem(\"note\"+i).split(\",\")[1];\n \n if(existingNoteDate === noteDate) {\n alert(\"Bitte nur einen Eintrag pro Tag.\");\n return;\n }\n } catch {\n continue;\n }\n }\n\n localStorage.setItem(\"note\" + noteCount, text + \",\" + noteDate);\n noteCount++;\n localStorage.setItem(\"noteCount\", noteCount);\n\n fillCalendar(year, month, day);\n document.getElementById(\"NotifyText\").value = \"\";\n }", "function createNoteBooksFromLocalStorage() {\n if (localStorage.getItem(\"lastVisitedNoteBook\" != null)) {\n openNotebook = localStorage.getItem(\"lastVisitedNoteBook\");\n }\n if (getLocalStorageListsToArray(\"books\") != null) {\n getLocalStorageListsToArray(\"books\").forEach((element) => {\n createNoteBook(element);\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 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 storeNote() {\n let title = document.getElementById(\"title\").value; //receives text from input field\n let note = document.getElementById(\"takeNote\").value; //recieves text from textarea\n note = note.replace(/\\n\\r/g, \"<br />\"); //replace \\n \\r with \"<br />\" as notices are stored as an string\n if ((title || note) == \"\") {\n //leave function if title or note are empty\n return;\n }\n\n titles.push(title); //store title in array titles\n notes.push(note); //store note in array notes\n setArray(\"titles\", titles); //store also under localStorage\n setArray(\"notes\", notes); //store also under localStorage\n\n document.getElementById(\"title\").value = \"\"; // delete input title\n document.getElementById(\"takeNote\").value = \"\"; // delete input notes\n\n showNotes(\"my-notes\", titles, notes); //shows update notes\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 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 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_saved_note() {\n if(check_web_storage_support() == true) {\n result = localStorage.getItem('note');\n }\n if(result === null) {\n result = \"\";\n }\n\n document.getElementById('area').value = result;\n}", "function saveLocalStore(){\n for(i = 0; i < generalInfo.length; i++){\n var displayNow = ($(\"#inputEvent\"+generalInfo[i].display).val());\n var notesNow = generalInfo[i].notes;\n generalInfo[i].notes = displayNow;\n console.log(\"grabo vacio\");\n\n }\n localStorage.setItem(\"generalInfo\", JSON.stringify(generalInfo));\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() {\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 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 }", "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 setAllNotes(lists) {\n storage.setItem('P1_todoNotesDB', JSON.stringify(lists));\n }", "function storeTasks() {\r\n\tlocalStorage.todoContents = listOfTasks.innerHTML;\r\n}", "function populate() {\n $('#title').val(localStorage.getItem('title')),\n $('#description').val(localStorage.getItem('description')),\n $('#content').html(localStorage.getItem('content'));\n}", "function pushNote(thisNote) {\n //console.log('push has been called');\n myNotes.push(thisNote);\n Cookies.set('storedNotes', myNotes);\n //myNotes = Cookies.getJSON('storedNotes');\n //console.log('New Note Saved');\n confirmation.placeholder = 'New note saved';\n note.value = '';\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}", "saveNote() {\n if (this.noteMessageInput.value) {\n let key = Date.now().toString();\n localStorage.setItem(key, this.noteMessageInput.value);\n this.displayNote(key, this.noteMessageInput.value);\n StickyNotesApp.resetMaterialTextfield(this.noteMessageInput);\n this.toggleButton();\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\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 addNote() {\n\t\n\tvar value = $('#add').val();\n\tif (value != '') {\n\n\t\tif (localStorage.getItem('last-id') === null) {\n\t\t\tvar new_id = 6;\n\t\t\tlocalStorage.setItem('last-id', new_id);\n\t\t}\n\t\telse {\n\t\t\tvar last_id = localStorage.getItem('last-id');\n\t\t\tvar new_id = parseInt(last_id)+1;\n\t\t}\n\t\t$('.notas-list').prepend('\\\n\t\t\t<article class=\"box-skin nota-thumb\" id=\"note'+ new_id +'\">\\\n\t\t\t\t<a href=\"#\" class=\"nota-delete\">X</a>\\\n\t\t\t\t<div class=\"nota-content\">\\\n\t\t\t\t\t<pre class=\"nota-title empty\" contenteditable></pre>\\\n <pre class=\"nota-text\" contenteditable>'+ value +'</pre>\\\n </div>\\\n\t\t\t</article>\\\n\t\t');\n\t\tvar $this = $('#note'+new_id);\n\n\t\t// fadeIn note & focus\n\t\tsetTimeout(function() {\n\t\t\t$this.removeClass('transparent').find('.nota-text').focus();\n\t\t}, 200);\n\n\t\t// clean input and hide btn\n\t\t$('#add').val('');\n\n\t\t// store added note\n\t\tsetLocalStorage($this);\n\n\t\t// store next id\n\t\tvar next_id = localStorage.setItem('last-id', new_id);\n\n\t\tsetNoteActive();\n\t\tsetTimeout(function() {\n\t\t\t$this.click();\n\t\t}, 200);\n\n\t\t// reiniciar o localStorage\n\t\t$this.find('.nota-title, .nota-text').keyup(function() {\n\t\t\thideEmptyfields($(this));\n\t\t\tsetLocalStorage($this);\n\t\t});\n\t\tdeleteNote();\n\t}\n}", "function onLoad() { \n\tvar db = window.openDatabase(\"notes\", \"1.0\", \"Notes Demo\", 2000000);\n\t//db.transaction(checkDb, errorCB, successCB);\n\tdb.transaction(loadNotesList);\n}", "function storeNotes(key, value){\n // take our date-names for each content column and store it as our key\n //set the key value to the content in the textarea of our content column\n localStorage.setItem(key, value);\n }" ]
[ "0.82129943", "0.78562784", "0.784719", "0.7787464", "0.7723062", "0.7586761", "0.7538566", "0.7522715", "0.7485392", "0.74191415", "0.734278", "0.73172855", "0.7284797", "0.7248811", "0.72059005", "0.7153956", "0.7108009", "0.71079427", "0.69991094", "0.69782436", "0.6960123", "0.6951675", "0.6946134", "0.6926966", "0.69121283", "0.6907721", "0.6889357", "0.6884216", "0.68813944", "0.6851114", "0.6849749", "0.6848459", "0.68421125", "0.6839794", "0.68380857", "0.6837848", "0.6836744", "0.68329185", "0.68252975", "0.6788889", "0.67833555", "0.6782128", "0.6779162", "0.67752284", "0.677209", "0.6769614", "0.6764889", "0.67646724", "0.67631686", "0.6755339", "0.6753203", "0.6752204", "0.6746079", "0.6738245", "0.6736907", "0.67362267", "0.6727549", "0.6718074", "0.6706757", "0.67026514", "0.67014754", "0.6699913", "0.667999", "0.6667919", "0.6667034", "0.66616845", "0.6639491", "0.6631383", "0.66304576", "0.66237575", "0.6623572", "0.6616608", "0.66063535", "0.6597658", "0.6591635", "0.65852237", "0.65630144", "0.6561919", "0.6560785", "0.6559126", "0.65540504", "0.6546419", "0.6537308", "0.65324724", "0.65206724", "0.6516462", "0.651277", "0.65030557", "0.64974385", "0.64940655", "0.6484114", "0.647019", "0.6441737", "0.64179057", "0.6417846", "0.63583505", "0.6346864", "0.6344161", "0.63381696", "0.6335589" ]
0.70500124
18
used to get any key values from local storage and converts them to a array
function getLocalStorageListsToArray(key) { if (localStorage.getItem(key) != null) { let arrayToHoldkeyList = localStorage.getItem(key); arrayToHoldkeyList = arrayToHoldkeyList.split(","); return arrayToHoldkeyList; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllFromLocalStorage() {\n const val = JSON.parse(localStorage.getItem(LOCALSTORAGE_KEY))\n return val || []\n}", "function getStorage() {\n\n //Create an array that will have key equal to local storage. key being \"keys-#\" value-i\"\n var values = [],\n keys = Object.keys(localStorage),\n i = keys.length;\n\n //Loop through localstorage and return keys\n for (var i = 0; i < localStorage.length; i++) {\n\n keys = Object.keys(localStorage),\n values.push(localStorage.getItem(keys[i]));\n\n }\n\n //return the values array\n return values;\n }", "function getArray(){\r\n return JSON.parse(localStorage.getItem('list')) || [];\r\n}", "function getLocalStorage() {\n let storageArray = [];\n for(let i = 0; i < localStorage.length; i++) {\n let item = JSON.parse(localStorage.getItem(localStorage.key(i)));\n storageArray.push(item);\n }\n console.log('Found local items:', storageArray);\n return storageArray;\n}", "function getLocalStorage() {\n var values = [],\n keys = Object.keys(localStorage),\n i = keys.length;\n while ( i-- ) {\n values.push( \n {\n \"name\": JSON.parse(localStorage.getItem(keys[i])).initials,\n \"score\": JSON.parse(localStorage.getItem(keys[i])).timeLeft\n }\n );\n }\n return values;\n}", "function allStorage() {\n var values = [],\n keys = Object.keys(localStorage),\n i = keys.length;\n let temp = 0;\n\n while (temp < i) {\n values.push(localStorage.getItem(keys[temp++]));\n console.log(values);\n }\n\n return values;\n}", "function cargarDatos() {\n base = [];\n baseDeDatos = localStorage.getItem('datos');\n if (baseDeDatos == '') { console.log(\"No hay datos\") } else {\n\n baseDeDatos = JSON.parse(localStorage.getItem('datos'));\n console.log(baseDeDatos);\n baseDeDatos.forEach((key, value) => {\n base.push(JSON.parse(key));\n });\n console.log('cargar() Ejecutado. - base= ' + base);\n }//else\n}//fin de cargar()", "function grabArray() {\n if (localStorage.getItem('bookArray') == null ) {\n return 'undefined';\n } else {\n return JSON.parse(localStorage.getItem('bookArray'));\n }\n }", "function getListFromStorage() {\n var listArray = JSON.parse(window.localStorage.getItem(nickname));\n return listArray;\n}", "function loadLocalStorage() {\n dataList.innerHTML = localStorage.getItem(LOCAL_STORAGE_LIST_KEY);\n let tempVar = JSON.parse(localStorage.getItem(LOCAL_STORAGE_ARRAY_KEY));\n let newList = new Array();\n for (let i in tempVar) {\n newList.push(tempVar[i]);\n }\n\n return newList;\n}", "function getFromStorage() {\n\tlet items;\n\n\t// if local storage is empty\n\tif (localStorage.getItem('items') === null) {\n\t\t// make array from items\n\t\titems = [];\n\t} else {\n\t\t// convert string to array\n\t\titems = JSON.parse(localStorage.getItem('items'));\n\t}\n\n\treturn items;\n}", "function get_persons() {\n var persons_array = [];\n var persons_str = localStorage.getItem('person');\n if (persons_str !== null) {\n persons_array = JSON.parse(persons_str);\n }\n return persons_array;\n}", "function getFromLocalStorage(keyname) {\n var stringedData = localStorage.getItem(keyname);\n var parsedData = JSON.parse(stringedData);\n return parsedData;\n}", "function get_user_array(){\n\tvar user_array_string = localStorage['users'];\n\tif(user_array_string == null){\n\t\treset_user_array();\n\t\treturn [];\n\t}\n\tvar user_array = [];\n\ttry{\n\t\tuser_array = JSON.parse(user_array_string);\n\t} catch(err){\n\t\treset_user_array();\n\t\treturn [];\n\t}\n\treturn user_array;\n}", "function getLocalStorage() {\n return localStorage.getItem('list')\n ? JSON.parse(localStorage.getItem('list'))\n : [];\n}", "function getAllFromLocalStorage(){\n backlog = JSON.parse(localStorage.getItem('backlog')) || [];\n progress = JSON.parse(localStorage.getItem('progress')) || [];\n complete = JSON.parse(localStorage.getItem('complete')) || [];\n onHold = JSON.parse(localStorage.getItem('on-hold')) || [];\n\n}", "function cartStorageToArray() {\n\tcart = JSON.parse(localStorage.cart);\n}", "function getLocalStorage(keys, callback) {\r\n var objects = {};\r\n for (var a = 0; a < keys.length; a++) {\r\n var key = keys[a];\r\n var value = localStorage.getItem(key);\r\n objects[key] = value && JSON.parse(value);\r\n }\r\n callback(objects);\r\n }", "function getUserArray(){\n return localStorage.getItem('userArray');\n}", "function products_array(){\n products = [];\n keys = Object.keys(localStorage);\n var length = keys[0];\n if (length != null){\n length = parseInt(keys[0]);\n }else{\n length = 1 ;\n }\n for (let i = 1 ; i <= length ; i++){\n let array = localStorage.getItem(i);\n let json = JSON.parse(array);\n if(json != null){\n products.push(json._id);\n }\n\n }\n\n return products;\n}", "function readLS(){\n let content = localStorage.getItem('hiScore');\n if(!content){ \n return [];\n }\n return JSON.parse(content); \n}", "static getArray(key) {\n if (Array.isArray(Preferences.get(key))) {\n return Preferences.get(key);\n }\n return JSON.parse(Preferences.get(key));\n }", "static getArray(key) {\n if (Array.isArray(Preferences.get(key))) {\n return Preferences.get(key);\n }\n return JSON.parse(Preferences.get(key));\n }", "static getList() {\n //localStorage.(`${MEMORY_KEY_PREFIX}${key}`)\n\n \n let r = new RegExp('^' + MEMORY_KEY_PREFIX),\n list = Object.keys(localStorage)\n .filter(k=>k.match(r))\n .map(k=>k.replace(r,''));\n return list;\n }", "function readLocalStorageKeyConvertToObject (key){\n let value_deserialize = JSON.parse(window.localStorage.getItem(key));\n console.log(value_deserialize);\n return value_deserialize;\n}", "function retrieFromLocal(key){\n\tconsole.log(\"recovered\");\n\treturn JSON.parse(localStorage.getItem(key));\t\n}", "function readAll() {\r\n const stringLivro = localStorage.getItem('livros-app:livros');\r\n return JSON.parse(stringLivro);\r\n}", "function getDataStored(storage){\n var data = [];\n //check if browser supports storage\n if (typeof(Storage) !== \"undefined\") {\n if(localStorage.getItem(storage) !== null){\n data = JSON.parse(window.localStorage.getItem(storage));\n if(data.length ===0) data = [];\n }\n }\n\n return data;\n\n}", "function obtener_localStorage(clave) {\n\tvar l = localStorage.getItem(clave);\n\tif(l == null) {\n\t\tlista = [];\n\t}else{\n\t\tlista = JSON.parse(l);\n\t}\n\treturn lista;\n}", "function getSettingsValues(){\n const settingsValues = localStorage.getItem('settingValues');\n if(settingsValues){\n return JSON.parse(settingsValues);\n }else{\n return[];\n }\n}", "function getLocalData(key) {\n var retval = null;\n if (Modernizr.localstorage) {\n retval = localStorage.getItem(key);\n if (retval != null && retval.length > 0) {\n retval = JSON.parse(retval);\n }\n }\n\n return retval;\n }", "function getLocalStorage() {\n var storage = JSON.parse(localStorage.getItem(\"cities\"));\n if (storage !== null) {\n citiesArray = storage;\n }\n }", "function returnAllData(){\n\n\tif (localStorage.length = 0)\n\t\treturn null;\n\n\t// create an array that will hold all the savedData Names\n\tvar names = [];\n\n\t// iterate through all files in localStorage and get their JSONs and names\n\t// push the names to the array names\n\tfor (var i = 0; i < localStorage.length; i++){\n\t\tvar tempJSON = localStorage.getItem(localStorage.key(i));\n\t\ttempObj = JSON.parse(tempJSON);\n\t\tnames.push(tempObj.name);\n\t}\n\n\t//return names\n\treturn names;\n}", "static get() {\n return new Promise((resolve, reject) => {\n AsyncStorage.getItem(key, (error, value) => {\n if (error) reject(error);\n resolve(value !== null ? JSON.parse(value) : []);\n });\n });\n }", "function getItemsFromLS(){\r\n if(localStorage.getItem('items')===null){\r\n items=[];\r\n }\r\n else{\r\n items = JSON.parse(localStorage.getItem('items'));\r\n }\r\n return items;\r\n}", "function getProductsFromStorage(){\n let products=localStorage.getItem(\"products\");\n\n return products? JSON.parse(products):[];\n}", "function getShopItemsFromStorage() {\n \n let shopItems;\n\n //if something exists in storage get the values otherwise create an empty array\n if (localStorage.getItem('shopItems') === null) {\n shopItems = [];\n } else {\n shopItems = JSON.parse(localStorage.getItem('shopItems') )\n }\n return shopItems;\n}", "function LocalStorage(){\r\n if(localStorage.getItem(\"todos\")===null){\r\n return [];\r\n }\r\n return JSON.parse(localStorage.getItem(\"todos\"));\r\n}", "function getEmployee() {\n //retrieve the value with the key\n var jsonEmployee = localStorage.getItem(\"Employee\");\n if (jsonEmployee == null) {\n return;\n }\n //convert json strings into array of entries\n gEmployee = JSON.parse(jsonEmployee);\n}", "function getFromStorage(key) {\n return JSON.parse(window.localStorage.getItem(key))\n}", "function loadDataArray(){\n var storage = localStorage.getItem(\"dataArray\");\n if (storage) {\n dataArray = JSON.parse(storage);\n } else {\n dataArray = [];\n }\n console.log(dataArray);\n }", "function loadFavourites() {\n favouritesArray = JSON.parse(localStorage[\"favouritesArray\"]);\n}", "function returnallfromlocalstorage() {\n console.log(\"Step 5\");\n return JSON.parse(localStorage.getItem(\"allthings\"));\n}", "function get() {\n let items;\n // check for previously stored items\n\n if (localStorage.getItem(\"items\") == null) {\n items = [];\n // if no items found in local storage create array\n } else {\n items = JSON.parse(localStorage.getItem(\"items\"));\n // if items found in local storage retrieve array\n }\n return items.reverse();\n }", "function getLocalStorage(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "function getItemsFromLocalStorage() {\r\n notesCount = localStorage.getItem(\"count\");\r\n notesFromLocalStorage = JSON.parse(localStorage.getItem(\"notes\"));\r\n }", "function getFromLocalStorage() {\n if (isLocalStorageNameSupported()) return JSON.parse(localStorage.getItem(\"hitlist\"));\n }", "function getNotesFromLocalStorage(){\n\t var note = localStorage.getItem(\"notes\"); \n\t noteArray = JSON.parse(note);\n\t if(!noteArray){\n\t\t noteArray=[];\n\t }\n\t return noteArray;\n}", "function retrieveData(key) {\n var retrieved = JSON.parse(window.localStorage.getItem(key));\n return retrieved;\n }", "function getLS(key){\n let value= window.localStorage.getItem(key);\n let setString= JSON.parse(value);\n return setString;\n\n}", "function loadUsers() {\n arrayUsers = JSON.parse(localStorage.getItem(\"Users\"));\n console.log(\"Carregado 'Users' da localStorage para o array arrayUsers[] com sucesso.\");\n console.log(arrayUsers);\n}", "function getFromStorage(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "getData(name) {\n\t\tlet data;\n\t\tif (localStorage.getItem(name) === null) {\n\t\t\tdata = [];\n\t\t} else {\n\t\t\tdata = JSON.parse(localStorage.getItem(name));\n\t\t}\n\t\treturn data;\n\t}", "function getValueFromLocalStorage(){\n var dataArray = JSON.parse(localStorage.getItem(\"quizResult\"));\n \n if (dataArray !== null) {\n storedValues = dataArray;\n }\n}", "get() {\n let buddies = LocalStorage.get();\n\n return (buddies === undefined) ? [] : buddies;\n }", "function loadList() {\r\n if(!localStorage.getItem(\"list\"))\r\n return [];\r\n var list = localStorage.getItem(\"list\").split(',');\r\n return list;\r\n}", "function loadStorage() {\n const keys = Object.keys(localStorage);\n let i = keys.length;\n console.log(\"i: \", i);\n\n while ( i-- ) {\n coffees.push( JSON.parse( localStorage.getItem(keys[i]) ) );\n }\n}", "function getDiaryFromLocalStorage() {\n\tif (localStorage.getItem('diary') == null) {\n\t\treturn [];\n\t} else {\n\t\treturn JSON.parse(localStorage.getItem('diary'));\n\t}\n}", "function createArray() {\n var list = localStorage.getItem('Scores');\n // if local storage is empty, it returns an empty string, so reset array to empty.\n if(list === null){\n scores = [];\n } else {\n // list is a string - splice it into an array\n scores = list.split(',');\n }\n return;\n}", "static getFromStorage(keys, area) {\r\n var storageGetter = (area === 'local' ? chrome.storage.local : chrome.storage.sync);\r\n\r\n return new Promise((resolve, reject) => {\r\n storageGetter.get(\r\n keys,\r\n (items) => {\r\n if (chrome.runtime.lastError) {\r\n reject(chrome.runtime.lastError);\r\n }\r\n else {\r\n resolve(items);\r\n }\r\n }\r\n );\r\n });\r\n }", "function cargarDatos(){\n let auxLista = JSON.parse(localStorage.getItem('anunciosAnimales')) || [];\n return auxLista;\n}", "obtenerProductosLocalStorage(){\n let productoLS;\n\n if(localStorage.getItem('productos') === null){\n productoLS = [];\n }\n else {\n productoLS = JSON.parse(localStorage.getItem('productos'));\n }\n return productoLS;\n }", "getAllItems() {\n var itemList = localStorage.getItem(this.DB_KEY_PRODUCT)\n if (itemList == null) {\n return new Array()\n }\n return JSON.parse(itemList)\n }", "function getStorage(key)\n{\n localStorage.length;\n var value = localStorage.getItem(key);\n if (value && (value.indexOf(\"{\") == 0 || value.indexOf(\"[\") == 0))\n {\n return JSON.parse(value);\n }\n return value;\n}", "function loadFromStorage() {\n var favs = storage.getItem(\"favs\");\n if (favs) {\n favs = JSON.parse(favs);\n } else {\n favs = [];\n }\n return favs;\n }", "function readFromLocalStorage() {\n let stringViews = localStorage.getItem('views');\n let stringVotes = localStorage.getItem('votes');\n\n let normalViews = JSON.parse(stringViews);\n let normalVotes = JSON.parse(stringVotes);\n\n if (normalViews) \n {\n viewsArrTemp = normalViews;\n }\n if (normalVotes) \n {\n votesArrTemp = normalVotes;\n }\n // localStorage.clear();\n console.log('votes', votesArrTemp);\n console.log('views', viewsArrTemp);\n}", "function loadOBJFromLocalStorage(key) {\r\n return JSON.parse(window.localStorage.getItem(key));\r\n}", "function retrieveAndParseInputStorageItem(key) {\n return JSON.parse(localStorage.getItem(key));\n }", "function readUserPreferencesFromLocalStorage() {\n let userPrefences = readObjectFromLocalStorage(userPreferencesKeyInLocalStorage);\n if ( Object.keys(userPrefences).length > 0){\n return userPrefences;\n }\n return {\n favouriteMeals : [],\n favouriteAreas : [],\n }\n}", "function getSavedData(){\n let savedTimeStampp = localStorage.getItem('tstamp_last');\n let zap_password = localStorage.getItem('zappassw');\n let zap_login = localStorage.getItem('zaplogin');\n let savedData = [savedTimeStampp,zap_password,zap_login]; // array af saved data\n console.info(\"saved Data from local storage:\");\n console.info(savedData);\n return savedData;\n}", "function get_todos() {\n var todos = new Array;\n var todos_str = localStorage.getItem(todo_element);\n if (todos_str !== null)\n {\n todos = JSON.parse(todos_str);\n }\n return todos;\n}", "function getTweetsFromLocalStorage(){\n let tweets;\n const tweetsLS = localStorage.getItem('tweets');\n // Get the values, if null is returned then we create an empty array\n if(tweetsLS === null){\n tweets = [];\n } else {\n tweets = JSON.parse(tweetsLS); // Convert from string format to array\n }\n\n return tweets;\n}", "function obtenerProductosLocalStorage() {\r\n let productosLS;\r\n\r\n //comprobamos si hay algo en localStorage con if/else\r\n if (localStorage.getItem(\"productos\") === null) {\r\n productosLS = [];\r\n } else {\r\n productosLS = JSON.parse(localStorage.getItem(\"productos\"));\r\n }\r\n return productosLS;\r\n}", "function getDataLocalStorage(key){\r\n let jsonString = localStorage.getItem(key);\r\n let objectData = JSON.parse(jsonString);\r\n return objectData;\r\n}", "function obtenerPersonas()\n{\n //lista = JSON.parse(localStorage.getItem('gente')) || [];//si existe y lo puedo parsear a array de personas, sino creo el array vacio\n return JSON.parse(localStorage.getItem('gente')) || [];\n}", "load () {\n return JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]')\n }", "function getDataFromLocalStorage(){\n var students = JSON.parse(localStorage.getItem(\"students\"));\n return students;\n \n }", "function getStorage()\n\t\t \t{\n\t\t \t\tvar data = localStorage.getItem('data');\n\t\t \t\tdata = JSON.parse(data);\n\t\t \t\treturn data;\n\t\t \t}", "function saveArray(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n}", "function getStorageData() {\r\n if(localStorage.Data) {\r\n Product.all = JSON.parse(localStorage.Data);\r\n }\r\n}", "function getProducts() {\n\n let proStringObj = localStorage.getItem('products');\n let proObj = JSON.parse(proStringObj);\n\n if (proObj !== null) {\n productsArray = proObj;\n }\n\n}", "function getTickerDataFromLocalStorage() {\n return JSON.parse(localStorage.getItem(\"tickerData\"));\n }", "function getUsers(){\n var str = localStorage.getItem(\"users\");\n users = JSON.parse(str);\n console.log(users);\n if (!users){\n users = [];\n }\n}", "function getUsers(){\n var str = localStorage.getItem(\"users\");\n users = JSON.parse(str);\n console.log(users);\n if (!users){\n users = [];\n }\n}", "function fetchLocalStorage() {\n // FETCHING LOCAL STORAGE\n let fromLocalStorage = JSON.parse(localStorage.getItem(\"myBooks\"));\n // IF WE GOT SOMETHING FROM LOCAL STORAGE WE ADD IT TO myBooks ARRAY\n if (fromLocalStorage) {\n myBooks = fromLocalStorage;\n }\n}", "function itemsCart() {\n var arr = [],\n keys = Object.keys(localStorage),\n index = keys.length;\n for (var i = 0; i < index; i++) {\n if (keys[i].length > 30) {\n arr.push(JSON.parse(keys[i]));\n }\n }\n return arr;\n}", "obtenerProductosLocalStorage(){\n let productoLS;\n\n //Comprobar si hay algo en LS\n if(localStorage.getItem('productos') === null){\n productoLS = [];\n }\n else{\n productoLS = JSON.parse(localStorage.getItem('productos'));\n }\n return productoLS; \n }", "static getStorageData() {\n let storedBooks = JSON.parse(localStorage.getItem('storedBooks'));\n return storedBooks;\n }", "function getCoursesFromStorage() {\n\n let courses;\n\n // if something exist on storage then we get the value, otherwise create an empty array\n if (localStorage.getItem('courses') === null) {\n courses = [];\n } else {\n courses = JSON.parse(localStorage.getItem('courses'));\n console.log(courses)\n }\n return courses;\n\n }", "function getEvents() {\n var raw = localStorage.getItem(eventsKey);\n var events;\n\n try {\n events = raw ? JSON.parse(raw) : [];\n } catch(e) {\n if (e instanceof SyntaxError) {\n events = [];\n } else {\n throw e;\n }\n }\n\n // Make sure that events is an array in case localStorage gets into\n // an inconsistent state.\n if (jQuery.isArray(events)) {\n return events;\n } else {\n return [];\n }\n }", "keys() {\n const keysArray = [];\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n // if there's something in memory space\n console.log(this.data[i][0][0]);\n keysArray.push(this.data[i][0][0]);\n }\n }\n return keysArray;\n }", "getToDosFromStorage(){\n let ToDos = localStorage.getItem(\"ToDos\")\n if (!ToDos) {\n return []\n }\n return JSON.parse(ToDos)\n }", "load() {\n this.arr.splice(0);\n let local_store_item = window.localStorage.getItem(this.key);\n if (local_store_item === null) return;\n let arr_of_strings = JSON.parse(local_store_item);\n let arr_of_ints = arr_of_strings.map(el => parseInt(el));\n\n this.arr.push(...arr_of_ints);\n }", "function getListOfBook() {\n if (checkStorage()) {\n return JSON.parse(localStorage.getItem(localBook)) || [];\n } else {\n return [];\n }\n}", "function loadStoredBookings(){\r\n var storedBookings = localStorage.getItem(\"bookings\");\r\n if(!storedBookings){ // if there are no stored bookings...\r\n return []; // ... it returns an empty Array\r\n }\r\n\r\n return JSON.parse(storedBookings); // transforms JSON text to data\r\n}", "function displayCities() {\n if (localStorage.getItem(\"citySearchedArray\") !== null) {\n var citySearchedArray = JSON.parse(localStorage.getItem(\"citySearchedArray\"));\n console.log(citySearchedArray);\n }\n}", "function get (key) {\n return JSON.parse(window.localStorage.getItem(key));\n}", "getLocalStorage() {\r\n return JSON.parse(localStorage.getItem('todos')) || [];\r\n }", "function getLocalStorageItem(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "function getShoesFromStorage() {\r\n let shoes;\r\n\r\n //get the value if present in the storage, else return an empty array\r\n if (localStorage.getItem('shoes') === null) {\r\n shoes = [];\r\n } else {\r\n shoes = JSON.parse(localStorage.getItem('shoes'));\r\n }\r\n return shoes;\r\n}" ]
[ "0.7880724", "0.7761596", "0.75399387", "0.74989885", "0.74292475", "0.7304346", "0.71555644", "0.70329624", "0.7028343", "0.6999476", "0.69656897", "0.69495726", "0.6923919", "0.6913866", "0.68931514", "0.689128", "0.6880078", "0.68743753", "0.6857292", "0.6856865", "0.68386924", "0.6837767", "0.6837767", "0.6834468", "0.6799044", "0.6736124", "0.67311907", "0.6730366", "0.6723107", "0.6717908", "0.66920376", "0.66761327", "0.6672534", "0.6665996", "0.66506773", "0.66445965", "0.66431826", "0.66309536", "0.6627231", "0.66220737", "0.66210115", "0.6610802", "0.66061974", "0.66053474", "0.6576038", "0.6569227", "0.6560928", "0.6557466", "0.6551299", "0.65495926", "0.65448195", "0.65303695", "0.65214545", "0.6519889", "0.6510815", "0.65071505", "0.6506286", "0.6496066", "0.64944416", "0.64905816", "0.64858407", "0.6476084", "0.64733076", "0.64706206", "0.64649373", "0.64617664", "0.6425954", "0.6416602", "0.6405711", "0.6403527", "0.640206", "0.63981694", "0.63940704", "0.63815254", "0.63697886", "0.6357814", "0.63534236", "0.6351476", "0.6348677", "0.63449246", "0.6344379", "0.6343818", "0.63403016", "0.63403016", "0.63398284", "0.63381773", "0.633338", "0.632982", "0.6321217", "0.63190013", "0.63009614", "0.630053", "0.6299399", "0.62965274", "0.62920207", "0.6291592", "0.6289513", "0.62884516", "0.6270223", "0.6256772" ]
0.7885563
0
creates article element and calls all functions needed to create a note
function createNote(obj, type ) { let article = document.createElement("article"); article = articleAttributes(article); article.appendChild(createDiv1(obj)); article.appendChild(createDiv2(type, article)); article.appendChild(createBtnConfirm()); return article; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNote() {\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //set content for note\n $note.html($note_text.val());\n //append note text to note-output\n $(\".note-output\").append($note);\n $note_text.val(\"\");\n }\n }", "function createArticleElement(art){\n \n var publishedContainer = $(\"<div class='published-container'></div>\"); //Create container for published options\n var articleElem = $(\"<article id='Article\" + art.id + \"' data-value='\" + art.id + \"'></article>\"); //Create new Article element \n \n //Select the newest date so it can be displayed at the beginning of article\n var higherDate;\n var lowerDate;\n \n // options for date formatting\n var options = { /*weekday: 'long',*/ year: 'numeric', month: 'long', day: 'numeric',hour:'numeric',minute:'numeric' };\n \n if( isNaN(Date.parse(art.dateModif))){\n \thigherDate = \"Posted: \" + new Date(art.dateCreate).toLocaleString('en-GB', options); //format date\n \tlowerDate = \"Modified: \" + art.dateModif;\n \t\n }else if(Date.parse(art.dateModif) > Date.parse(art.dateCreate)){\n \t\thigherDate = \"Updated: \" + new Date(art.dateModif).toLocaleString('en-GB', options);\n \t\tlowerDate = \"Created: \" + new Date(art.dateCreate).toLocaleString('en-GB', options); \n }else{\n \t\thigherDate = \"Posted: \" + new Date(art.dateCreate).toLocaleString('en-GB', options); //format date\n \t\tlowerDate = \"Modified: \" + new Date(art.dateModif).toLocaleString('en-GB', options);\n }\n\n //Add all needed fields to the article element\n articleElem.append(\"<div class='article-title-container'><h1 class='article-title'>\" + art.title + \"</h1></div>\")\n .append(\"<div class='article-category'><h2>about: <span class='strikeable '>\" + art.category.toUpperCase() + \"</span></h2></div>\")\n .append(publishedContainer)\n .append(\"<div class='article-higherdate inline-block'><i class='material-icons red'>date_range</i><span>\" + higherDate + \"</span></div>\")\n .append(\"<div class='article-author inline-block'><i class='material-icons blue'>person </i><span>\" + art.userName + \"</span></div>\")\n .append(\"<div></div>\")\n .append(\"<div class='main-img-container'><img class='main-img' src= \" + art.img + \" alt='Main Image'></div>\")\n .append(\"<div class='article-content'><p><span>\" + art.content + \"</span></p></div>\")\n .append(\"<div class='clearfix'></div>\")\n .append(\"<div class='article-lowerdate inline-block'><i class='material-icons red'>date_range </i><span>\" + lowerDate +\" </span></div>\")\n .append(\"<div class='comm-count inline-block'><i class='material-icons green'>chat</i><span>\" + art.commCount + \" comments </span></div>\");\n \n //If logged user is admin add Edit and Delete buttons and display published status of article\n if(user.isAdmin){\n \n \tvar buttonsContainer = $(\"<div class='manage-article-btn-container'></div>\");\n \tarticleElem.append(buttonsContainer); \n \tbuttonsContainer.append($(\"<button class='edit-article purple'><span>&#10002;</span> Edit</button>\").click(editArticleClick))\n \t .append($(\"<button class='delete-article red'><span>&#10015;</span> Delete</button>\").click(deleteArticleClick));\n \t \n \tif(art.published == '1'){\n \t\tpublishedContainer.append(\"<h3 class='text-green'>Published!</h3>\");\n \t}else{\n \t\tpublishedContainer.append(\"<h3 class='text-red'> Not published!</h3>\");\n \t} \n }\n \n // If category was deleted meanwhile strike it out\n if(art.cat_active == 0) {\n \tarticleElem.children().find(\"span.strikeable\").addClass(\"strikeout\");\n }\n \n return articleElem;\n \n}//END createArticleElement function", "create($parent) {\n $(`<article id=${this.idDOM} class=\"article-small\">\n <div class=\"article-small-article\">\n <h6 class=\"article-small-category\">${this.config['category']}</h6>\n <h5 class=\"article-small-title\">${this.config['title']}</h5>\n <h6 class=\"article-small-author\">By ${this.config['author']}</h6>\n </div>\n <div class=\"article-small-noise-count\">🎺 ${this.config['noise']}</div>\n </article>`).appendTo($parent);\n }", "function createNotes() {\n\tsetClef('treble-clef');\n\t\n\t/* Creates Empty Div Element for Each Possible Note Location */\n\tfor (var i=1; i <= totalDivs; i++) {\n\t\tvar noteDiv = document.createElement('div');\n\t\tnoteDiv.id = String(i);\n\t\tnoteDiv.classList.add('note-item');\n\t\tnoteDiv.onclick = placeNote;\n\t\t\n\t\tvar parentDiv = document.getElementById('notes-div');\n\t\tparentDiv.appendChild(noteDiv);\n\t\t\n\t\tvar rowNum = getRowNumber(i);\n\t\tif (rowNum >= topRow && rowNum <= bottomRow) {\n\t\t\taddStaffLines(i);\n\t\t}\n\t}\n\n\t/* Establish 1st Note Column and Measure */\n\tlastEmptyCol = 1;\n\tmeasureNum = 1;\n}", "function createNote() {\n return '<div class=\"note\"> </div> \\n';\n}", "handler () {\n notes.addNote(title, body);\n }", "articleMaker(title, imageLink, author, date, text, url) {\n author = author ? author : \"Anonymous\";\n return (\n '<div class=\"box\"><article class=\"media\"><div class=\"media-left\"><a href=\"' +\n url +\n '\"><figure class=\"image is-64x64\"><img src=\"' +\n imageLink +\n '\" alt=\"No Image\"/></figure></a></div><div class=\"media-content\"><div class=\"content\"><p><a href=\"' +\n url +\n '\"><strong>' +\n title +\n \"</strong></a> <small>\" +\n author +\n \"</small> <small>\" +\n date +\n \"</small><br />\" +\n text +\n \"</p></div></div></article></div>\"\n );\n }", "function CreateNewPost(title, body, id) {\n var template = $(\"#templatePost\").text();\n console.log(template);\n\n // return template;\n $(\"body\").append(template);\n\n var $article = $(\"article:last-of-type\");\n\n $article.find(\"h2\").html(title);\n\n body = body.replace(\"\\n\", \"<br>\");\n\n $article.find(\"p\").html(body);\n\n $article.find(\"button\").attr(\"value\", id);\n $article.find(\"button\").attr(\"onClick\", \"ToggleComments(this)\");\n\n //We place our comments in this\n $article.find(\"section\").attr(\"id\", \"comments-\" + id);\n\n}", "function createNoteDiv(note) {\r\n\r\n note.tags.forEach((item) => {\r\n //changed to handle image tags\r\n switch (item) {\r\n case \"F\":\r\n xTagFunTrue = true;\r\n break;\r\n case \"M\":\r\n xTagMetaTrue = true;\r\n break;\r\n case \"U\":\r\n xTagUrgentTrue = true;\r\n break;\r\n }\r\n });\r\n\r\n var dateString = note.date.toLocaleDateString();\r\n\r\n /**number means level of div child from main-parent */\r\n //0. new element: main div wrapper\r\n var newMainDiv = document.createElement(\"DIV\");\r\n newMainDiv.setAttribute(\"class\", \"individualNote\");\r\n newMainDiv.setAttribute(\"id\", \"new-main-div\" + note.number);\r\n newMainDiv.setAttribute(\"js-noteDiv\", note.number)\r\n document.getElementById(\"main-parent\").appendChild(newMainDiv);\r\n\r\n // 1. new element changed innerhtml to createElement for security \r\n var xTitle = document.createElement(\"div\");\r\n xTitle.setAttribute(\"id\", \"new-title-div\" + note.number);\r\n xTitle.setAttribute(\"class\", \"newNoteTopTitle\");\r\n xTitle.textContent = note.title;\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xTitle);\r\n\r\n // 1. first element inside note: subject\r\n var xSubject = document.createElement(\"div\");\r\n xSubject.setAttribute(\"id\", \"new-subject-div\" + note.number);\r\n xSubject.setAttribute(\"class\", \"subjectInNote\");\r\n xSubject.textContent = note.subject;\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xSubject);\r\n\r\n // 1. new vote div\r\n var newVoteDiv = document.createElement(\"DIV\");\r\n newVoteDiv.setAttribute(\"id\", \"new-vote-div\" + note.number);\r\n newVoteDiv.setAttribute(\"class\", \"voteDiv\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(newVoteDiv);\r\n\r\n // 2. vote number\r\n var newVotetext = document.createElement(\"p\");\r\n newVotetext.innerHTML = note.voteNumber;\r\n newVotetext.setAttribute(\"id\", \"vote-n-\" + note.number);\r\n newVotetext.setAttribute(\"class\", \"voteNumber\");\r\n newVotetext.setAttribute(\"js-noteVote\", \"\")\r\n document.getElementById(\"new-vote-div\" + note.number).appendChild(newVotetext);\r\n\r\n // 2. vote button\r\n var newVoteButton = document.createElement(\"input\");\r\n newVoteButton.setAttribute(\"id\", \"vote-b-\" + note.number);\r\n newVoteButton.setAttribute(\"js-access\", \"\");\r\n newVoteButton.src = \"upvote3.png\";\r\n newVoteButton.type = \"image\";\r\n newVoteButton.setAttribute(\"class\", \"voteButton\");\r\n document.getElementById(\"new-vote-div\" + note.number).appendChild(newVoteButton);\r\n\r\n // 1. second element inside note: noteinfo wrapper div\r\n var xNoteinfo = document.createElement(\"div\");\r\n xNoteinfo.setAttribute(\"id\", \"new-note-info-div\" + note.number);\r\n xNoteinfo.setAttribute(\"class\", \"noteInfo\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xNoteinfo);\r\n\r\n // 2. NAME\r\n var xName = document.createElement(\"div\");\r\n xName.setAttribute(\"id\", \"new-tags-div\" + note.number);\r\n xName.setAttribute(\"class\", \"usernameMadenote\");\r\n xName.textContent = xName2;\r\n document.getElementById(\"new-note-info-div\" + note.number).appendChild(xName);\r\n\r\n // 2. DATE element inside noteinfo wrapper div\r\n var xDate = document.createElement(\"div\");\r\n xDate.setAttribute(\"id\", \"new-date-div\" + note.number);\r\n xDate.setAttribute(\"class\", \"dateInNote\");\r\n xDate.textContent = dateString;\r\n document.getElementById(\"new-note-info-div\" + note.number).appendChild(xDate);\r\n\r\n // 1. TAG element tagwrapper\r\n var tagWrapper = document.createElement(\"div\");\r\n tagWrapper.setAttribute(\"id\", \"tagwrapper\" + note.number);\r\n tagWrapper.setAttribute(\"class\", \"tagwrapper\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(tagWrapper);\r\n\r\n // 2.TagFun\r\n var xTagFun = document.createElement(\"img\");\r\n xTagFun.setAttribute(\"src\", \"fun10.png\");\r\n xTagFun.setAttribute(\"class\", \"funloggaInNote\");\r\n if (xTagFunTrue) {\r\n document.getElementById(\"tagwrapper\" + note.number).appendChild(xTagFun);\r\n xTagFunTrue = false;\r\n dontJudgeMe = true;\r\n };\r\n\r\n // 2.TagMeta\r\n var xTagMeta = document.createElement(\"img\");\r\n xTagMeta.setAttribute(\"src\", \"meta10.png\");\r\n xTagMeta.setAttribute(\"class\", \"metaloggaInNote\");\r\n if (xTagMetaTrue) {\r\n document.getElementById(\"tagwrapper\" + note.number).appendChild(xTagMeta);\r\n xTagMetaTrue = false;\r\n dontJudgeMe = true;\r\n };\r\n\r\n // 2.TagUrgent\r\n var xTagUrgent = document.createElement(\"img\");\r\n xTagUrgent.setAttribute(\"src\", \"urgent10.png\");\r\n xTagUrgent.setAttribute(\"class\", \"urgentloggaInNote\");\r\n if (xTagUrgentTrue) {\r\n document.getElementById(\"tagwrapper\" + note.number).appendChild(xTagUrgent);\r\n xTagUrgentTrue = false;\r\n dontJudgeMe = true;\r\n };\r\n\r\n // 2. show Replys \r\n var showReplyButton = document.createElement(\"input\");\r\n showReplyButton.setAttribute(\"id\", \"ReplyButton\" + note.number);\r\n showReplyButton.setAttribute(\"js-access\", \"\");\r\n showReplyButton.src = \"omegapog2.png\";\r\n showReplyButton.type = \"image\";\r\n showReplyButton.setAttribute(\"class\", \"showReplyButton\");\r\n document.getElementById(\"new-date-div\" + note.number).appendChild(showReplyButton);\r\n\r\n // 2. comment numbers \r\n var showCommentsNumbers = document.createElement(\"b\");\r\n showCommentsNumbers.setAttribute(\"id\", \"commentNumbers\" + note.number);\r\n showCommentsNumbers.setAttribute(\"class\", \"commentNumbers\");\r\n showCommentsNumbers.innerText = \"0 comments\";\r\n document.getElementById(\"new-date-div\" + note.number).appendChild(showCommentsNumbers);\r\n\r\n // 1. third element inside note: replay wrapper div\r\n var xReplyParent = document.createElement(\"div\");\r\n xReplyParent.setAttribute(\"id\", \"new-reply-parent-div\" + note.number);\r\n xReplyParent.setAttribute(\"class\", \"replyParent hidden\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xReplyParent);\r\n\r\n // 2. Reply button element\r\n var xReplyButton = document.createElement(\"button\");\r\n xReplyButton.setAttribute(\"id\", \"new-title-reply-button\" + note.number);\r\n xReplyButton.setAttribute(\"class\", \"replyButton\");\r\n xReplyButton.innerText = \"Reply\";\r\n document.getElementById(\"new-reply-parent-div\" + note.number).appendChild(xReplyButton);\r\n\r\n // 2. Reply textarea element\r\n var xReplyTextarea = document.createElement(\"textarea\");\r\n xReplyTextarea.setAttribute(\"id\", \"new-title-reply-textarea\" + note.number);\r\n xReplyTextarea.setAttribute(\"class\", \"replyTextarea\");\r\n xReplyTextarea.setAttribute(\"maxlength\", \"100\");\r\n document.getElementById(\"new-reply-parent-div\" + note.number).appendChild(xReplyTextarea);\r\n\r\n // 2. Replay child element wrapper\r\n var xReplyChild = document.createElement(\"div\");\r\n xReplyChild.setAttribute(\"id\", \"new-reply-child-div\" + note.number);\r\n xReplyChild.setAttribute(\"class\", \"replyChild\");\r\n document.getElementById(\"new-reply-parent-div\" + note.number).appendChild(xReplyChild);\r\n\r\n // 2. Top Secret Eyes Closed\r\n if (dontJudgeMe) {\r\n document.getElementById(\"new-reply-parent-div\" + note.number).style.top = \"-220px\";\r\n dontJudgeMe = false;\r\n }\r\n\r\n // create theme color \r\n colorSnumber = note.number;\r\n colorS();\r\n note.colorReplyTheme = colorSaver;\r\n \r\n\r\n // animation note creation\r\n document.getElementById(\"new-main-div\" + colorSnumber).style.opacity = 0.0\r\n let b = 0;\r\n let z = 0;\r\n let ani = 0; \r\n\r\n function aniMation() {\r\n ani = setInterval(function() { \r\n document.getElementById(\"new-main-div\" + colorSnumber).style.opacity = b; \r\n b = z*5*0.01; \r\n z++;\r\n }, 25);\r\n }\r\n\r\n aniMation();\r\n setTimeout(function(){ \r\n clearTimeout(ani);\r\n }, 550);\r\n\r\n\r\n\r\n\r\n // setting eventlistener to reply button. Adds data from textfield to new div in reply parent div\r\n document.getElementById(\"new-title-reply-button\" + note.number)\r\n .addEventListener(\"click\", function () {\r\n var newReply = document.createElement(\"DIV\");\r\n var userReplyText = document.getElementById(\"new-title-reply-textarea\" + note.number).value;\r\n if (userReplyText == \"\") { } else {\r\n newReply.innerText = xName2 + \" \" + \"said: \" + userReplyText;\r\n document\r\n .getElementById(\"new-reply-child-div\" + note.number)\r\n .prepend(newReply);\r\n //changed order tp push newest reply first \r\n newReply.setAttribute(\"id\", \"reply-div\" + note.number); \r\n document.getElementById(\"reply-div\" + note.number).style.backgroundColor = colorSarray[note.colorReplyTheme].replyDiv;\r\n newReply.setAttribute(\"class\", \"reply\");\r\n document.getElementById(\"new-title-reply-textarea\" + note.number).value = \"\";\r\n note.replies.push(userReplyText);\r\n //added comment counter\r\n document.getElementById(\"commentNumbers\" + note.number).innerText = note.replies.length + \" comments\";\r\n }\r\n });\r\n\r\n //open replay window up or close..\r\n document.getElementById(\"ReplyButton\" + note.number).addEventListener(\"click\", function () {\r\n toggleDisplay(document.getElementById(\"new-reply-parent-div\" + note.number));\r\n });\r\n\r\n //vote function\r\n document.getElementById(\"vote-b-\" + note.number).addEventListener(\"click\", () => {\r\n note.voteNumber++;\r\n document.getElementById(\"vote-n-\" + note.number).innerHTML = note.voteNumber;\r\n });\r\n}", "function f_createArticles() {\n\n //iterate bibtex entries\n for(var id in articles_bibtex) {\n\n var entry = articles_bibtex[id];\n\n //create article element for publication\n var article = $('<article>', {\n id: entry.id,\n year: entry.year,\n title: entry.title,\n 'class': 'publication'\n }).append($('<h3>', {\n text: entry.title\n })).append($('<p>')\n .append($('<span>', {\n text: entry.authors_pretty,\n 'class': 'author'\n }))\n .append($('<span>', {\n text: \" \" + entry.year,\n 'class': 'year'\n }))\n );\n\n //append abstract\n if(entry.hasOwnProperty('abstract')) {\n article.append($('<p>', {\n 'class': 'abstract abstract_short abstract_' + entry.id,\n text: entry.abstract\n }));\n }\n\n //append p for icons\n article.append('<p>');\n\n //append link to document\n if(entry.hasOwnProperty('url'))\n article.children().last().append($('<a>', {\n 'class': 'link',\n href: entry.url,\n click: function(){\n window.open(this.href);\n return false;\n }\n }));\n\n //append bibtex icon\n article.children().last().append($('<a>', {\n id: 'get_bibtex_' + entry.id,\n 'class': 'bibtex',\n click: function(){\n $(this).animate().fadeTo( \"fast\" , 0.5).fadeTo( \"fast\" , 1);\n var entry = articles_bibtex[this.id.substring(11)];\n var bibtex = f_getBibtex(entry, true);\n var input = $(\"<textarea>\", {\n text: bibtex\n });\n $(\"body\").append(input);\n input.select();\n document.execCommand(\"copy\");\n input.remove();\n }\n }))\n\n //append show details icon\n .append($('<a>', {\n id: 'toggle_details_' + entry.id,\n 'class': 'details show_details',\n click: function(){\n var element = $(this);\n var abstract = $('.abstract_' + this.id.substring(15));\n var abstractHeight = abstract.prop('scrollHeight');\n if(element.hasClass('show_details')){\n element.removeClass(\"show_details\");\n element.addClass(\"hide_details\");\n if(abstract.length > 0) {\n //set abstract to full height\n abstract.removeClass('abstract_short');\n if (abstract.height() < abstractHeight) {\n abstract.animate({height: abstractHeight}, 500);\n abstract.css('max-height', abstractHeight);\n abstract.removeClass('abstract_short');\n }\n }\n }\n else {\n element.removeClass(\"hide_details\");\n element.addClass(\"show_details\");\n if(abstract.length > 0)\n //set abstract to max-height{\n abstract.addClass('abstract_short');\n if (abstract.height() > 115)\n abstract.animate({height: 115}, 500);\n }\n }\n }));\n\n //append edit classification icon\n if(editClassifications)\n article.children().last().append($('<a>', {\n id: 'editclass_' + entry.id,\n 'class': 'editclass',\n click: function(){\n var overlay = $('#overlay');\n var article = articles_bibtex[this.id.substring(10)];\n\n //create form\n var form = $('<form>').append($('<h3>', {\n id: 'form_' + this.id,\n text: article.title\n }));\n\n //get available classifications\n var classes = []\n for(entry in dictionaries[lang]){\n if(entry.startsWith('MX'))\n classes.push(entry);\n }\n\n //sort classes\n classes.sort(function(a, b) {\n return a.split('_')[1].localeCompare(b.split('_')[1]);\n });\n\n //create inputs\n for(var i = 0; i < classes.length; i++) {\n var currentClass = f_getClassificationType(classes[i]);\n form.append('<label class=\"checkbox_' + currentClass + '\">' +\n '<input type=\"checkbox\" value=\"' + classes[i] + '\"' + (article['xtruso_componentArray'].indexOf(classes[i]) !== -1 ? 'checked=\"checked\"' : '') + ' onchange=\"f_toggleClassification(this,\\'' + this.id.substr(10) + '\\')\" />' + dictionaries[lang][classes[i]] +\n '</label>');\n if(i < classes.length - 1 && f_getClassificationType(classes[i+1]) !== currentClass)\n form.append('<br>');\n }\n\n //append submit button\n form.append('<br>').append($('<input>', {\n type: 'button',\n 'class': 'button',\n value: 'Exit',\n click: function(){\n $('#overlay').empty().hide();\n }\n }));\n\n //append download button\n form.append($('<input>', {\n type: 'button',\n 'class': 'button',\n value: 'Exit & Download',\n click: function(){\n f_downloadBibtex();\n $('#overlay').empty().hide();\n }\n }));\n\n //append form to overlay\n overlay.append(form);\n overlay.show();\n }\n }));\n\n //init mouseover events to highlight mx components\n article.mouseover(function(){\n f_highlightMXComponents(articles_bibtex[this.id]['xtruso_componentArray']);\n });\n article.mouseout(function(){\n f_clearHighlightMX(articles_bibtex[this.id]['xtruso_componentArray']);\n });\n\n //add article to global var\n articles[entry.id] = article;\n\n }\n}", "function createsANote() {\n var note = new Note(\"My favourite language is Ruby\");\n assert.isTrue(\"creates a note\", note.readNote() === \"My favourite language is Ruby\");\n}", "function createNoteGenerator() {\n // Create note generator elements\n const form = document.createElement(\"form\");\n form.classList.add(\"form-note-add\");\n form.action = \"\";\n form.method = \"post\";\n\n const noteTitle = document.createElement(\"input\");\n noteTitle.classList.add(\"note-title\");\n noteTitle.placeholder = \"Title\";\n noteTitle.name = \"noteTitle\";\n noteTitle.autocomplete = \"off\";\n\n const noteContent = document.createElement(\"textarea\");\n noteContent.classList.add(\"note-content\");\n noteContent.placeholder = \"Take a note...\";\n noteContent.name = \"noteContent\";\n noteContent.autocomplete = \"off\";\n\n\n // Focus note content when the thread becomes idle\n window.setTimeout(function () {\n noteContent.focus();\n }, 0);\n\n noteContent.addEventListener(\"keydown\", () => {\n autoGrow(noteContent);\n });\n\n const buttons = document.createElement(\"div\");\n buttons.classList.add(\"overlay-buttons\");\n\n const inputAddNote = document.createElement(\"input\");\n inputAddNote.type = \"hidden\";\n inputAddNote.name = \"inputAddNote\";\n inputAddNote.value = \"AddNote\";\n\n const buttonCreatorNote = document.createElement(\"button\");\n buttonCreatorNote.classList.add(\"btn-creator-add-note\");\n buttonCreatorNote.innerText = \"Add note\";\n buttonCreatorNote.type = \"submit\";\n buttonCreatorNote.name = \"buttonAddNote\";\n buttonCreatorNote.value = \"AddNote\";\n // Form submit post when adding a node card\n buttonCreatorNote.addEventListener(\"click\", () => {\n document.querySelector(\".form-note-add\").submit();\n });\n\n const buttonCancel = document.createElement(\"button\");\n buttonCancel.classList.add(\"btn-creator-cancel\");\n buttonCancel.innerText = \"Cancel\";\n buttonCancel.type = \"button\";\n\n listenAddCancelButton(buttonCreatorNote, buttonCancel);\n\n buttons.appendChild(buttonCreatorNote);\n buttons.appendChild(buttonCancel);\n\n\n const overlayNoteCreator = document.createElement(\"div\");\n overlayNoteCreator.classList.add(\"overlay-note-creator\");\n form.appendChild(noteTitle);\n form.appendChild(noteContent);\n form.appendChild(buttons);\n form.appendChild(inputAddNote);\n overlayNoteCreator.appendChild(form);\n\n addBgBlur();\n\n const body = document.querySelector(\"body\");\n body.appendChild(overlayNoteCreator);\n}", "function newNote() {\n var csrftoken = $.cookie('csrftoken'),\n folder_id = $('.folder-list>.active>a').attr(\"data-folderid\"),\n data = {\n title: \"Untitled note\",\n body: \"<br>\",\n folder_id: folder_id,\n csrfmiddlewaretoken: csrftoken\n };\n $.post(\"/notes/addnote/\", data, function (data) {\n $('#notelist').children().prepend(data).children().first().trigger('click');\n $('#title').empty();\n });\n }", "function createNote(note) {\n //the note\n codeOfNote = ` <div id=\"${note.noteNum}note\" class=\"ml-xl-5 mr-xl-5 mt-xl-4 mb-xl-4 col-xl-2 m-lg-4 col-lg-3 m-md-5 col-md-4 m-sm-5 col-sm-6 ml-5 col-5 note\">`\n //row of icons \n codeOfNote += `<div class=\"mt-4 row\">`\n // number of note\n codeOfNote += `<div class=\"mb-2 ml-2 col-10 number\">${note.noteNum + 1}</div>`\n // col of icons\n codeOfNote += `<div class=\"p-3 m-1 col-xl-12 col-md-12\">`\n // close icon \n codeOfNote += `<span type=\"button\" id=\"icon\" class=\"glyphicon glyphicon-remove\" onclick=\"deleteNote(${note.noteNum})\"></span>`\n // close divs for row and col of icons\n codeOfNote += `</div> </div>`\n //row of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 md-form row\">`\n // col of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 col-xl-11 col-xl-10 col-md-11 col-sm-10 col-11\">`\n //the text area (i used text area inside the note and not p)\n codeOfNote += `<textarea type=\"text\" id=\"${note.noteNum}Notetextarea\" class=\"Notetextarea\" rows=\"5\" readonly>${note.InputOfNote}</textarea>`\n //scroll bar\n codeOfNote += `<div class=\"scrollbar\" id=\"style-9\"> <div class=\"force-overflow\"></div> </div>`\n // date and time\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.dateOfNote}</small>`\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.timeOfNote}</small>`\n //closing divs\n codeOfNote += `</div> </div> </div> </div> </div>`\n\n}", "function createNote(number_of_note, notesArray, tagsArray) {\n for(var i = 0; i < number_of_note; i++) {\n $(\".notes\").append(\"<div class='note'><div class='notetext'>\" + notesArray[i] + \"</div><div class='notetag'>#\" + tagsArray[i] + \"</div><div class='notecontrol'><div class='highlight'>Highlight</div><div class='addtocanvas'>Add to Canvas</div><div class='deletenote'>Delete</div></div></div>\");\n }\n}", "function addNote(note){\n let noteElement = document.createElement(\"div\");\n noteElement.addEventListener(\"change\",updateNote);\n noteElement.classList.add(\"noteid\"+notes.indexOf(note));\n noteElement.classList.add(\"note\");\n noteElement.style.backgroundColor = note.color;\n let pinElement = document.createElement(\"div\");\n pinElement.classList.add(\"pin\");\n if(note.pinned)\n pinElement.classList.add(\"pinoff\");\n else\n pinElement.classList.add(\"pinon\");\n pinElement.addEventListener(\"click\",pinSwitch);\n noteElement.appendChild(pinElement);\n let titleElement = document.createElement(\"input\");\n titleElement.type = \"text\";\n titleElement.name = \"title\";\n titleElement.value = note.title;\n noteElement.appendChild(titleElement);\n let contentElement = document.createElement(\"textarea\");\n contentElement.value = note.content;\n contentElement.name = \"content\";\n noteElement.appendChild(contentElement);\n let colorElement = document.createElement(\"input\");\n colorElement.type = \"color\";\n colorElement.name = \"color\";\n colorElement.value = note.color;\n noteElement.appendChild(colorElement);\n let created = document.createElement(\"p\");\n let time = new Date(note.created);\n created.innerHTML = \"Created: \" + time.toLocaleString();\n noteElement.appendChild(created);\n if(note.pinned)\n document.querySelector(\".pinned\").appendChild(noteElement);\n else\n document.querySelector(\".notes\").appendChild(noteElement);\n}", "function addNote() {\n let titleEl = document.getElementById(\"title\")\n let detailsEl = document.getElementById(\"details\")\n\n newNote = new Note(titleEl.value, detailsEl.value)\n allNotes.push(newNote)\n\n printNote(newNote)\n resetFields(titleEl, detailsEl)\n checkBadWords(newNote)\n // changeBackground()\n}", "makeNote (note) {\n const el = this.page.noteTemplate.cloneNode(true)\n if (note.severity > ntfn.POKE) {\n const cls = note.severity === ntfn.SUCCESS ? 'good' : note.severity === ntfn.WARNING ? 'warn' : 'bad'\n el.querySelector('div.note-indicator').classList.add(cls)\n }\n\n el.querySelector('div.note-subject').textContent = note.subject\n el.querySelector('div.note-details').textContent = note.details\n return el\n }", "function creatNote(tex,priority) {\n const notesContainer = document.getElementById('notes-container');\n const newP = document.createElement('p');\n newP.className = `note ${priority}`;\n newP.innerText = tex;\n\n const deletBtn = document.createElement('button');\n deletBtn.className = 'remove-btn';\n deletBtn.innerText = 'X'; \n deletBtn.onclick = removeNote;\n newP.appendChild(deletBtn);\n\n\n notesContainer.appendChild(newP);\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 createNoteDOM(title, content)\n{\n var div = document.createElement(\"div\");\n div.classList.add(\"note\");\n var noteId = notes.length;\n div.draggable = true;\n div.onmousedown = function(ev){\n openNote(noteId);\n if(!ev.target.classList.contains(\"note-delete\"))\n clearDelete();\n }\n div.ondragstart = drag;\n div.innerHTML = '<div class=\"note-title\">'+title+'</div><div class=\"note-delete\">x</div><div class=\"note-content\">'+content+'</div>';\n div.getElementsByClassName(\"note-delete\")[0].onclick = function(){var id = noteId; deleteNote(id);}\n return div;\n}", "function addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // create HTML node from note object\n const node = createItem(note);\n // append created node in HTML\n noteList.appendChild(node);\n // put created node in Map to match it with note\n map.set(node, note);\n // push current note to notes object\n notes.push(note);\n // overwrite notes in indexedDB with notes\n idbKeyval.set('notes', notes)\n .catch(err => console.error('submit failed: ', err));\n // reset input values\n noteBody.value = '';\n noteImg.value = '';\n noteAlt.value = '';\n }", "function testCreate(){\n // debugger\n var notelist = new NoteList()\n var note = notelist.create(\"Go shopping\")\n testisNote(note)\n testDisplayNote()\n }", "function createNote() {\n //object that wraps each note and its delete link\n var $note_div = $(\"<div/>\")\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //select the delete-all button\n var $deleteAllButton = $(\"#delete-all\")\n //create a delete link for each added note\n var $delLink = $('<a>delete</a>').attr({ \n href: \"#\",\n class: \"del-link\"\n });\n //adds a click listener to the delete link\n $delLink.on(\"click\", function () {\n deleteNote(this); \n });\n\n //set content for note\n $note.html($note_text.val());\n //append note and delete link to note_div\n $note_div.append($note);\n $note_div.append($delLink);\n //hide new note_div to setup fadeIn...\n $note_div.hide();\n //append note_div to note-output\n $(\".note-output\").append($note_div);\n\n //fadeIn hidden new note_div and conditionally \n // the deleteAllButton\n if ($deleteAllButton.is(\":hidden\"))\n $deleteAllButton.fadeIn(\"slow\");\n $note_div.fadeIn(\"slow\");\n $note_text.val(\"\");\n }\n }", "function addNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\tappendNote(tr, defaultNote);\r\n\taddState();\r\n\t\r\n\trefreshNotes();\r\n}", "function createNewNote(event) {\n event.preventDefault()\n // console.log(event.target.title.value, event.target.content.value)\n const newNoteObj = {}\n newNoteObj.color_id = event.target.color_id.value\n newNoteObj.title = event.target.title.value\n newNoteObj.content = event.target.content.value\n // console.log(newNoteObj) // newNoteObj structure is working: {title: \"meh\", content: \"mehmeh\"}\n postNewNote(newNoteObj) // invoking our postNewNote function here\n renderNoteOnColorShowPage(newNoteObj) // recycling this function (finally, learning to recycle!) Mother Earth you fucking owe me. It works!\n // question for later: wtf happened to those pink notes I created before I added this render? Oh lol I mislabeled it white nvm\n}", "function create_notes( nid, x, y, store_name, icondata )\n {\n var divId = \"ikanotes_\" + nid + \"div\";\n var taId = \"ikanotes_\" + nid + \"textarea\";\n var iconDivId = \"ikanotes_\" + nid + \"icon_div\";\n var iconId = \"ikanotes_\" + nid + \"icon\";\n\n var cssDivId = \"#\" + divId;\n var cssTaId = \"#\" + taId;\n var cssIconDivId = \"#\" + iconDivId;\n var cssIconId = \"#\" + iconId;\n\n var notes_html = \n\t \"<div id='\" + divId + \"'> \\\n <center>\t\t\t\t\t\t\t\\\n <textarea id='\" + taId + \"' rows='15' cols='45'></textarea> \\\n </center>\t\t\t\t\t\t\t\\\n </div>\";\n\n var link_html =\n\t \"<div id='\" + iconDivId + \"'>\\\n <img id='\" + iconId + \"'/> \\\n\t </div>\";\n\n\n\n $( notes_html ).appendTo( \"body\" );\n $( cssDivId ).css( \"border\", \"1px solid black\" );\n var textVal = GM_getValue( store_name, \"\" );\n if( textVal == \"\" )\n {\n if( store_name == gm_global_name )\n textVal = \"<Global Notes>\";\n else\n textVal = \"<This World Only Notes>\";\n }\n $( cssTaId ).val( textVal );\n\n\n var icon_width = 50;\n var icon_height = 50;\n\n $( link_html ).appendTo( \"body\" );\n $( cssIconId ).attr( \"src\", icondata );\n $( cssIconId ).attr( \"title\", \"Show/Hide notes\" );\n $( cssIconId ).css( \"width\", icon_width + \"px\" );\n $( cssIconId ).css( \"height\", icon_height + \"px\" );\n\n $( cssIconId ).click( function()\n {\n\t var div = $( cssDivId );\n\t if( div.css( \"visibility\" ) == 'hidden' )\n\t div.css( \"visibility\", 'visible' );\n\t else\n\t {\n\t var txt = $( cssTaId ).val();\n\t GM_setValue( store_name, txt );\n\t div.css( \"visibility\", 'hidden' );\n\t }\n });\n \n var notes_width = $( cssTaId ).width() + 10;\n\n var icon_left = x;\n var icon_top = y;\n\n // put icon in upper-right corner\n $( cssIconDivId ).css( \"position\", \"absolute\" );\n $( cssIconDivId ).css( \"zIndex\", 100 );\n $( cssIconDivId ).css( \"left\", icon_left + \"px\" );\n $( cssIconDivId ).css( \"top\" , icon_top + \"px\" );\n\n var notes_left = icon_width + 5;\n var notes_top = icon_top;\n $( cssDivId ).css( \"position\", \"absolute\" );\n $( cssDivId ).css( \"left\", notes_left + \"px\" );\n $( cssDivId ).css( \"top\", notes_top + \"px\" );\n \n // set notes_div hidden\n $( cssDivId ).css( \"visibility\", \"hidden\" );\n $( cssDivId ).css( \"zIndex\", 150 );\n $( cssDivId ).css( \"width\", notes_width + \"px\" );\n }// end create_notes function", "function loadDescription(description, notes) {\n let div = document.getElementById(\"description\");\n cleanDiv(div);\n\n let notebook = document.createElement(\"div\");\n notebook.classList.add(\"notebook\");\n let contentP = document.createElement(\"p\");\n contentP.classList.add(\"content\");\n contentP.textContent = description;\n notebook.appendChild(contentP);\n div.appendChild(notebook);\n\n let addDescripDiv = document.getElementById(\"add-description\");\n addDescripDiv.onclick = function() {\n addNote();\n };\n}", "createdCallback() {\n this.innerHTML = StickyNote.TEMPLATE;\n this.$note = '';\n this.$noteElement = this.querySelector('#note');\n this.$titleElement = this.querySelector('#title');\n this.$deleteElement = this.querySelector('#delete');\n this.$deleteElement.addEventListener('click', () => this.deleteNote());\n }", "function createCardElement(id, title, content, date) {\r\n // Create the element that will hold the text\r\n var element = document.createElement('div')\r\n // Add all the classes\r\n element.setAttribute('class', 'shadow-md rounded p-4 bg-green-lightest mb-4');\r\n // Add the id so that it can be called apon later\r\n element.setAttribute('id', id);\r\n // Set the innerHTML\r\n content = content.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\r\n var data = `<button class=\"text-red float-right\" onclick=\"deleteNote('${id}')\"><i class=\"fas fa-2x fa-times\"></i></button><h1>${title}</h1><p>${content}</p>`\r\n element.innerHTML = data;\r\n // Add the element to the page\r\n findIdentifier('lessonNotes').prepend(element)\r\n}", "function createNoteByClick() {\n var newDate = new Date();\n var noteId = newDate.getTime();\n bq.setAttribute(\"id\", \"note-\" + noteId);\n bq.innerText = null;\n localStorage.setItem(noteId, \"\");\n bq.focus();\n}", "function addNotes(){\n //i++;\n //var textfield=document.querySelector('.textfield');\n var noteslist=document.querySelector('.notesList');\n var textarea=document.querySelector('.textarea').value;\n var note=document.createElement('div');\n \n // note.id=\"div\"+i;\n var content=document.createTextNode(textarea);\n console.log(content)\n note.appendChild(content);\n note.style.display=\"inline-block\";\n note.style.width='50%';\n note.style.background=\"lightblue\";\n noteslist.appendChild(note);\n //console\n \n\n }", "create() {\n let $self = $('#articles-small');\n let $seeAllButton = $self.find('#see-all-button');\n\n $seeAllButton.click(() => {\n articlesBigContainer.setContent(\n this.articles.map(article => article.config),\n 'noisiest');\n });\n }", "function createNote(data) {\r\n alert(\"test\");\r\n \r\n}", "create($parent) {\n let $self = $(`<article id=\"${this.idDOM}\" class=\"article-big\"></article>`).appendTo($parent);\n\n $(`<div class=\"article-big-header\">` +\n `<div class=\"article-big-image\" style=\"background-image: url('/Vuvuzela/img/articles/${this.config['img']}');\"></div>` +\n `<h6 class=\"article-big-category\">${this.config['category']}</h6>` +\n `<h3 class=\"article-big-title\">${this.config['title']}</h3>` +\n `<h4 class=\"article-big-description\">${this.config['description']}</h4>` +\n `</div>`).appendTo($self);\n\n let $topBar = $(`<div class=\"article-big-top-bar\">` +\n `<h6 class=\"article-big-author-date\">By ${this.config['author']} • ${this.config['date']} </h6>` +\n `</div>`).appendTo($self);\n\n $(`<div class=\"article-big-content\"></div>`).appendTo($self);\n\n $self.find('.article-big-image, .article-big-title').click(() => this.showContent());\n\n this.buttons = {\n 'noiseButton': new VuvuzelaButton(this, !!this.config['noised'] /* int -> bool */),\n 'favouriteButton': new FavouriteButton(this, !!this.config['favourite']),\n 'readLaterButton': new ReadLaterButton(this, !!this.config['read_later'])\n };\n if(isEditor) this.buttons['deleteButton'] = new DeleteButton(this); // Delete operation only allowed to editors\n Object.keys(this.buttons).forEach(type => this.buttons[type].create($topBar)); // Creates the buttons specified in this.buttons\n }", "newNews () {\n new comp.div({className: \"newsForum\"},\n new comp.div({id: \"alert\"}),\n new comp.input({name: \"articleName\", placeholder: \"Article Name\", id: \"articleName\" }),\n new comp.input({name: \"articleUrl\", placeholder: \"Article Link\", id: \"articleLink\"}),\n new comp.input({name: \"articleImageUrl\", placeholder: \"Article Image Link\", id: \"articleImage\"}),\n new comp.input({name: \"articleDescription\", placeholder: \"Article Description\", id: \"articleDescription\"}),\n new comp.btn(\"Save New Article\")).render(\".new--news\")\n this.eventListener()\n }", "function addNote() {\n\t\t\n\t\tid++;\n\t\tzIndex++;\n\t\t\n\t\tvar body = document.querySelector('body');\n\t\t\n\t\tvar note = document.createElement('div');\n\t\tvar close = document.createElement('div');\n\t\tvar field = document.createElement('div');\n\t\tvar footer = document.createElement('div');\n \t\t\n\t\tnote.setAttribute('id', 'note' + id);\n\t\tclose.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('contenteditable', true);\n\t\t\t\n\t\tnote.classList.add('note');\n\t\tclose.classList.add('close');\n\t\tfield.classList.add('field');\n\t\tfooter.classList.add('footer');\n\t\t\n\t\tnote.style.zIndex = zIndex;\n\t\t\t\n\t\tnote.appendChild(close);\n\t\tnote.appendChild(field);\n\t\tnote.appendChild(footer);\n\t\tbody.appendChild(note);\n\t\t\n\t\tattachListeners(note, close, field, footer);\n\t\t\n\t\tvar data = JSON.parse(localStorage['data']);\n\t\t\n\t\t// Save the current note's data\n\t\tdata.push({\n\t\t\n\t\t\tid: id,\n\t\t\ttext: '',\n\t\t\tposition: { x: 20, y: 20 },\n\t\t\tzIndex: zIndex,\n\t\t\t\n\t\t\ttime: { \n\t\t\t\n\t\t\t\tday: new Date().getDate(), \n\t\t\t\tmonth: new Date().getMonth() + 1, \n\t\t\t\tyear: new Date().getFullYear(), \n\t\t\t\th: new Date().getHours(), \n\t\t\t\tm: new Date().getMinutes(), \n\t\t\t\ts: new Date().getSeconds() \n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t});\n\t\t\n\t\tlocalStorage['data'] = JSON.stringify(data);\n\t\t\n\t}", "function createNote(note) {\n return API.post(\"notes\", \"/notes\", {\n body: note\n });\n }", "function mmArticleMaker(article, title, mdText) {\n this.name = 'mm-content-' + article;\n this.template = '#mm-content-article-template';\n this.path = '/' + article + '.html';\n this.components = {\n 'mm-quickstart': mmQuickStart,\n 'mm-content-heading': mmContentHeading\n };\n\n this.data = function () {\n return {\n title: title,\n mdText: mdText,\n prevLink: mmArticleLink(article, 'prev'),\n nextLink: mmArticleLink(article, 'next')\n };\n };\n\n this.mixins = [drawerMixin, samecaseMixin, markedMixin];\n}", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function setArticle(article){\n cleanArticleFields(); \n \n if(article){\n $('.author').text('Author: ');\n $('.date').text('Date: '); \n $('.title').append('<span>' + article.title + '</span>' );\n var authorWithLink = '<span> <a href=\\'mailto:'\n + article.authorEmail \n + '\\'>' + article.author \n +'</a></span>';\n \n $('.author').append(authorWithLink);\n $('.date').append('<span>' + article.date + '</span>' ); \n $('.text').append( article.text );\n $('.text').append( '<p> <button>Remove article</button></p>' );\n $('.article-view button').on('click', function(){\n removeArticle(article._id);\n });\n \n } else {\n showDefaultPage(errorArticleObject); \n }\n }", "function addNote() { \n SidebarActions.createNote('Content', $scope.data.thisContent); \n}", "create() {\n let $self = $('#articles');\n let $backButton = $self.find('#back-button');\n let $loadMoreButton = $self.children('#load-more-button');\n\n $backButton.click(() => { this.loadNewest(true); });\n\n $loadMoreButton.click(() => { this.loadCurrent(false); });\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 createCard(comment){\n let article = createEl('article', 'comment');\n\n let avatar = createEl('img','card__photo');\n article.appendChild(avatar)\n \n let heading = createEl('h4','card__name');\n \n heading.innerText = comment.name;\n \n article.appendChild(heading);\n\n let date = createEl('p','card__date'); \n\n let time = new Date (comment.timestamp)\n let day = time.getUTCDate();\n let month = time.getUTCMonth() + 1;\n let year = time.getUTCFullYear();\n let timeStamp = `${day}/${month}/${year}`\n\n date.innerText= timeStamp\n article.appendChild(date);\n\n let text = createEl('p','card__text');\n \n text.innerText = comment.comment;\n article.appendChild(text);\n \n return article; \n}", "function articleCreator(data) {\n\n const divCard = document.createElement('div');\n const divHead = document.createElement('div');\n const divAuthor = document.createElement('div');\n const divImg = document.createElement('div');\n const img = document.createElement('img');\n const span3 = document.createElement('span');\n\n divCard.classList.add('card');\n divHead.classList.add('headline');\n divAuthor.classList.add('author');\n divImg.classList.add('img-container');\n\n divHead.textContent = data.headline;\n img.src = data.authorPhoto;\n span3.textContent = `By ${data.authorName}`;\n\n divCard.appendChild(divHead);\n divCard.appendChild(divAuthor);\n divAuthor.appendChild(divImg);\n divImg.appendChild(img);\n divAuthor.appendChild(span3);\n\n document.querySelector('.cards-container').appendChild(divCard);\n}", "function createNote(){\n\t// Single function to get value from any input\n\tvar getVal = function(param){\n\t\treturn $get(param).value;\n\t};\n/*\n\t// function to add index numbers - param for id/class/element to count\n\t// Over complicated\n\tvar count = function(param){\n\t\tif (!!$get(param)){ // if there already are notes\n\t\t\treturn ($getAll(param).length) +1; // count them\n\t\t}\n\t\telse { // else this is the first note\n\t\t\treturn 1;\n\t\t}\t\n\t}\n*/\n//\tvar count = 0; // too simple, what if we start with notes?\n\n\n\tvar count = function() {\n\t\treturn ($getAll('.box').length) +1;\n\t} \n\n\tif ( !!(getVal('#noteText')) && !!(getVal('#colourPick')) ){ // if input not empty\n\t\n\t\tvar noteNumber = document.createTextNode(count());\n\n\t\tvar noteNumberPar = document.createElement('span');\n\t\t\tnoteNumberPar.className = 'noteNumber';\n\t\t\tnoteNumberPar.id ='noteNumber'+count();\n\t\t\tnoteNumberPar.appendChild(noteNumber);\n\n\t\tvar stickyText = document.createTextNode(getVal('#noteText'));\n\t\t\n\t\t// div template for sticky note\n\t\tvar template = document.createElement('div');\n\t\t\ttemplate.className = 'box';\n\t\t\t// get value of selected colour from dropdown menu\n\t\t\ttemplate.style.backgroundColor = getVal('#colourPick');\n\t\t\t// Call count function and concatonate with input text\t\n\t\t\ttemplate.appendChild(noteNumberPar);\n\t\t\ttemplate.appendChild(stickyText);\n\n\t\t$get('.container').appendChild(template); // add sticky to div.container \n\n\t\t// create textNode to append text into the remove button\n\t\tvar removeID = 'removeButton' + (count()-1)\n\t\tvar x = document.createTextNode('X')\n\t\tvar removeButton = document.createElement('div');\n\t\t\tremoveButton.className = 'removeButton';\n\t\t\tremoveButton.id = removeID;\n\t\t\t// append textNode to rmove button div\n\t\t\tremoveButton.appendChild(x);\n\t\t\n\t\t$getAll('.box')[($getAll('.box').length)-1].appendChild(removeButton);\n\n\t\t// to add event listeners with dynamic element creation\n\t\t// the function to be called must be wrapped in a function declaration\n\t\t$get('#'+removeID).addEventListener('click', removeNote)\n\n\t\t// clear fields ready for next sticky\n\t\t$get('#noteText').value = '';\n\t\treturn false;\n\t} else { // else show alert input is empty\n\t\talert('No note!');\n\t\treturn false;\n\t}\t\n}", "function addNews(item) {\n \"use strict\";\n item.notes = \"Your notes here...\";\n\n // title as a link\n var $title = $(\"<a><h2>\" + item.title + \"</h2></a>\").attr({href: item.url, target: \"_blank\"}, \"www.apple.com\");\n\n // description the of article\n var $description = \"<p/>\";\n\n // image to the article\n\n var $imageCard = $(\"<img/>\", {\n class: \"card-image\"\n });\n\n //buttons at the bottom\n var $saveButton = $(\"<img/>\", {\n class: \"save-img\",\n src: \"images/floppy_disk_1.svg\"\n });\n var $noteButton = $(\"<img/>\", {\n class: \"note-img\",\n src: \"images/pen-15.svg\"\n });\n var $notePad = $(\"<textarea/>\", {\n class: \"card-notes\"\n });\n\n // delete-x in the top right corner\n var $imageX = $(\"<img/>\", {\n class: \"delete-img\",\n src: \"images/x-small.svg\"\n });\n\n// construct the cards\n $(\".card-wrapper\").append(\n $(\"<div class='card-main'/>\")\n .append(\n $(\"<div class='card-header'/>\")\n .append($title).after(\"<div class='delete-start'/>\")\n .append($imageX),\n $(\"<div class='line-1'/>\"),\n $(\"<div class='card-body'/>\")\n .append(\n $(\"<p/>\").text(item.description),\n $($imageCard).attr({src: item.urlToImage})\n ),\n $(\"<div class='button-wrap'/>\")\n .append(\n $(\"<div class='save-button'/>\")\n .append($saveButton),\n $(\"<div class='note-button'/>\")\n .append($noteButton),\n $($notePad)\n .text(item.notes)\n )\n )\n );\n\n\n\n //$(\".card-wrapper\").append(\"<div class='card-main'><div class='card-header'><a href='\" + item.url + \"' target='_blank'><h2>\" + item.title + \"</h2></a><div class='delete-start'><img class='delete-img'src='images/x-small.svg'/></div></div><div class='line-1'></div><div class='card-body'><p>\" + item.description + \"</p> <img class='card-image' src='\" + item.urlToImage + \"' /></div><div class='button-wrap'><div class='save-button'><img class='save-img'src='images/floppy_disk_1.svg'/></div><div class='note-button'><img class='note-img'src='images/pen-15.svg'/></div><textarea class='card-notes' id='text'>\" + item.notes + \"</textarea></div></div></br>\");\n}", "function aboutNarrative(){\n alter.innerHTML = '';\n let about = document.createElement('div');\n about.classList.add('about');\n alter.appendChild(about);\n let title = document.createElement('h1');\n title.textContent = aboutHTML.title;\n let p1 = document.createElement('p');\n p1.textContent = aboutHTML.p1;\n let p2 = document.createElement('p');\n p2.textContent = aboutHTML.p2;\n about.appendChild(title);\n about.appendChild(p1);\n about.appendChild(p2);\n}", "function createPostElement(\n title = \"\",\n content = \"\",\n id = \"\",\n name = \"\",\n date = \"\"\n) {\n var postContainer = document.createElement(\"DIV\");\n var header = document.createElement(\"H3\");\n var p = document.createElement(\"P\");\n var hiddenIdTag = document.createElement(\"P\");\n var creator = document.createElement(\"H6\");\n\n postContainer.className = \"row post mx-auto\";\n header.className = \"title\";\n p.className = \"description\";\n hiddenIdTag.className = \"hide\";\n\n header.innerText = title;\n p.innerText = content;\n creator.innerText = \"posted by: \" + name + \" at: \" + date;\n hiddenIdTag.innerText = id;\n\n postContainer.addEventListener(\"click\", () => {\n location.assign(`/post/${id}`);\n });\n\n postContainer.appendChild(creator);\n postContainer.appendChild(header);\n postContainer.appendChild(p);\n postContainer.appendChild(hiddenIdTag);\n\n myPostContainer.appendChild(postContainer);\n}", "handler(argv){\n notes.addNote(argv.title, argv.body)\n }", "function articleAttributes(article) {\n article.className = \"note shadow-sm\";\n article.id = \"note-article\";\n return article;\n}", "function newNote(body) {\n return { body: body, time: new Date() };\n}", "handler(argv) {\n notes.addNote(argv.title,argv.body)\n }", "function create(article) {\n article.type = 'article';\n article._id = 'article-' + (new Date()).toISOString();\n return db.put(article);\n }", "function createNoteFromPopup(text) {\n\n\tvar note = {\n\t\ttext: text,\n\t\turl: \"\",\n\t\tid: new Date().getTime()\n\t};\n\n\tconsole.log(note);\n\taddNoteToDB(note, 'popup');\n\tpopupPage.addNoteToView(note);\n\n}", "function allNewsCreateDOMnodes() {\n headlinesArray.forEach((article, i) => {\n // console.log('headlinesArray: ', headlinesArray)\n const newsItem = document.createElement('div')\n newsItem.classList.add('news-item')\n // NEWS COMPANY LOGOS\n const logo = document.createElement('img')\n logo.classList.add('logo')\n logo.loading = 'lazy'\n if (article.url || article.web_url) {\n logo.src = './images/NYTimesLogo.png'\n logo.alt = 'New York Times Logo' // If image doesn't load, this message will display\n } else {\n logo.src = './images/the-guardian.png'\n logo.alt = 'The Guardian Logo'\n }\n // LINK TO ARTICLES\n const link = document.createElement('a')\n if (article.url) {\n link.href = article.url \n } else if (article.web_url) {\n link.href = article.web_url \n } else {\n link.href = article.webUrl \n }\n link.title = 'Read Full Article' // Info when hovering on image\n link.target = '_blank' // OPEN ARTICLE IN NEW TAB\n // ARTICLE IMAGES\n const picture = document.createElement('img')\n picture.loading = 'lazy'\n picture.classList.add('picture')\n if (article.fields) {\n picture.src = article.fields.thumbnail\n } else if (!article.multimedia[0]) {\n picture.src = './images/newspapers.png' \n } else if (!article.multimedia[0].url.includes('https://')) {\n picture.src = 'https://static01.nyt.com/' + article.multimedia[0].url // NYT SEARCH\n } else if (article.multimedia[0].url) { \n picture.src = article.multimedia[0].url // NYT TOP HEADLINES\n } else {\n picture.src = article.fields.thumbnail // THE GUARDIAN SEARCH AND TOP HEADLINES\n }\n // ARTICLE TITLES\n const headline = document.createElement('p')\n if (article.title) {\n headline.textContent = article.title\n headline.classList.add('NYheadline') \n } else if (article.headline) {\n headline.textContent = article.headline.main\n headline.classList.add('NYheadline') \n } else { \n headline.textContent = article.webTitle\n headline.classList.add('Gheadline') \n }\n // DATES\n const dateEl = document.createElement('strong')\n dateEl.classList.add('date')\n const format = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }\n if (article.webPublicationDate) {\n dateEl.textContent = new Date(article.webPublicationDate).toLocaleDateString(('en-GB'), format)\n } else if (article.pub_date) {\n dateEl.textContent = new Date(article.pub_date).toLocaleDateString(('en-GB'), format)\n } else {\n dateEl.textContent = new Date(article.published_date).toLocaleDateString(('en-GB'), format)\n }\n // TWEET A SINGLE ARTICLE\n const twitterBtn = document.createElement('a')\n twitterBtn.classList.add('fab', 'fa-twitter', 'fa-3x', 'twitterBtn')\n if (article.web_url) {\n twitterBtn.setAttribute('onclick', `tweetArticle('${article.web_url}')`) // NYT TWEET\n } else if (article.url) {\n twitterBtn.setAttribute('onclick', `tweetArticle('${article.url}')`) // NYT TWEET top stories\n } else {\n twitterBtn.setAttribute('onclick', `tweetArticle('${article.webUrl}')`) // GUARDIAN TWEET\n }\n twitterBtn.addEventListener('click', tweetArticle)\n // CONNECT ALL DOM NODES \n link.appendChild(picture)\n newsItem.append(logo, headline, link, twitterBtn, dateEl)\n setTimeout(() => {\n newsContainer.appendChild(newsItem)\n }, i * 100)\n })\n}", "function addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function createPost(id, title, body, date) { \n var post = [`<div class=\"post-preview\">`,\n `<h2 class=\"post-title\">${title}</h2>`,\n `<p class=\"post-subtitle\">${body}</p>`, \n `<p class=\"post-meta\">Posted at ${date}`,\n `<a href=\"javascript:edit(${id})\" class=\"btn\"><span class=\"glyphicon glyphicon-pencil\"></span></a>`,\n `<a href=\"javascript:del(${id})\" class=\"btn\"><span class=\"glyphicon glyphicon-trash\"></span></a></p>`,\n `</div>`,\n `<hr>`].join(\"\\n\")\n return post;\n}//E N D function createPost", "function buildAnote(obj) {\n\n var myRow = document.getElementById('notesRow');\n\n for (let index = 0; index < obj.length; index++) {\n\n var myNoteDiv = document.createElement('div');\n myNoteDiv.setAttribute(\"class\", \"col-md-2 col-sm-6 col-xs-12\");\n var myNote = document.createElement('div');\n myNote.setAttribute(\"class\", \"note\");\n var noteTrash = document.createElement('div');\n noteTrash.setAttribute('class', \"glyphicon glyphicon-trash noteDelete fade-in\");\n noteTrash.setAttribute('slot', index);\n noteTrash.setAttribute('onclick', \"deleteNote(this)\");\n noteTrash.setAttribute('onclick', 'deleteNote(this);'); // for FF\n noteTrash.onclick = function () { deleteNote(this); }; // for IE\n var noteDesc = document.createElement('div');\n noteDesc.setAttribute(\"class\", 'noteInnerDescription');\n noteDesc.innerText = obj[index].desc;\n var noteDate = document.createElement('div');\n noteDate.setAttribute(\"class\", \"noteDateValue\");\n noteDate.innerText = obj[index].date;\n var noteTime = document.createElement('div');\n noteTime.setAttribute(\"class\", \"noteTimeValue\");\n noteTime.innerText = obj[index].time;\n ////\n myNote.appendChild(noteTrash);\n myNote.appendChild(noteDesc);\n myNote.appendChild(noteDate);\n myNote.appendChild(noteTime);\n ////\n myNoteDiv.appendChild(myNote);\n ////\n myRow.appendChild(myNoteDiv);\n }\n}", "function renderNoteInfo(aNote) {\n while(noteTitle.firstChild){\n noteTitle.removeChild(noteTitle.firstChild)\n }\n noteTitle.innerHTML = `<h2>${aNote.title}</h2>`\n let n = document.createElement('p')\n n.innerHTML = `<a>${aNote.content}</a>\n <br>\n <br>\n <button data-id=${aNote.id} id=\"editNoteBtn\">Edit this note</button>\n <button data-id=${aNote.id} id=\"deleteNoteBtn\">Delete this note</button>\n `\n noteTitle.appendChild(n)\n}", "function createNewNote()\n{\n randomNote = int(random(notes.length - 1));\n goalNote = notes[randomNote].note\n goalFrequency = -notes[randomNote].frequency\n\n // play voice over when the new note is created\n playVoiceOver();\n}", "function createArticle (articleInfo) {\n try {\n return fetch('/api/newarticle', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n title: articleInfo.title,\n subtitle: articleInfo.subtitle,\n link: articleInfo.link,\n source: articleInfo.source,\n stance: articleInfo.stance\n })\n });\n } catch (err) {\n console.log(err);\n }\n}", "function createNote(message){\n let noteDiv = document.getElementById('note-container')\n \n let note = `\n <div class=\"callout\">\n <span class=\"callout-closebtn\">&times;</span>\n <div class=\"callout-container\">\n <img src=\"./animations/corgigoingoff.gif\">\n <p>${message}</p>\n </div>\n </div>\n `\n noteDiv.innerHTML += note\n noteDiv.hidden = false\n noteDiv.addEventListener('click', removeNote)\n\n}", "function note_add(_Poc,_text){\r\n\tNotecurrent_IdNUM++;\r\n\tvar newnote ={\r\n\t\tid:'note'+Notecurrent_IdNUM\r\n\t\t,x: _Poc.x\r\n\t\t,y: _Poc.y\r\n\t\t,text:_text\r\n\t\t,color:defaultCOLOR\r\n\t\t,fontsize:defaultFONTSIZE\r\n\t\t,selected:false\r\n\t};\r\n\tnotes.push(newnote);\r\n\tnumnote++;\r\n\treturn newnote;\r\n}", "function createNote(noteText) {\n fetch(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n title: noteText,\n body: noteText,\n created_at: moment().format()\n })\n })\n .then(res => res.json())\n .then(data => {renderNoteText(data)})\n console.log(data)\n }", "function Note(title, text, id) {\n this.title = title;\n this.text = text;\n this.id = id;\n}", "function retrieveNotesAndAppend() {\n\n\t\tsetTimeout(function() {\n\t\t\tvar thisId = $('div.item.fetched-article.active').attr('data-id');\n\n\t\t\t$.ajax({\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\turl: \"/articles/\" + thisId,\n\t\t\t\t})\n\t\t\t\t.done(function(data) {\n\n\t\t\t\t\t$('#saved-notes').empty();\n\n\t\t\t\t\t$.each(data.notes, function(index, value) {\n\t\t\t\t\t\tvar $noteTitle = $('<h4>').addClass('article-note-titles text-uppercase')\n\t\t\t\t\t\t\t\t\t\t\t\t .html('<strong>' + value.title + '</strong>');\n\n\t\t\t\t\t\tvar $noteBody = $('<p>').addClass('article-note-body')\n\t\t\t\t\t\t\t\t\t\t\t\t.text(value.body);\n\n\t\t\t\t\t\tvar $noteRemoveBtn = $('<a>').addClass('btn btn-xs btn-danger btn-block note-remove-btn')\n\t\t\t\t\t\t\t\t\t\t\t\t\t .html('DELETE');\n\n\t\t\t\t\t\tvar $noteDiv = $('<div>').addClass('article-note-div')\n \t\t\t\t\t\t\t\t\t\t\t\t .attr('data-note-id', value._id);\n\n\t\t\t\t\t\t$noteDiv.append('<hr>',\n\t\t\t\t\t\t\t\t\t\t$noteTitle,\n\t\t\t\t\t\t\t\t\t\t$noteBody,\n\t\t\t\t\t\t\t\t\t\t$noteRemoveBtn,\n\t\t\t\t\t\t\t\t\t\t'<hr>')\n\t\t\t\t\t\t\t\t.appendTo('#saved-notes');\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t}, 1000);\n\t}", "function create_article(content, content_type, options) {\n options = options || {};\n var q = {\n id: null,\n type: \"/common/document\",\n create: \"unconditional\"\n };\n return freebase.mqlwrite(q, options)\n .then(function(env) {\n return env.result;\n })\n .then(function(doc) {\n return upload(content, content_type, h.extend({}, options, {document:doc.id}))\n .then(function(uploaded) {\n h.extend(doc, {\"/common/document/content\": uploaded});\n return doc;\n });\n })\n .then(function(doc) {\n if (options.topic) {\n q = {\n id: options.topic,\n \"/common/topic/article\": {\n id: doc.id,\n connect: \"insert\"\n }\n };\n return freebase.mqlwrite(q)\n .then(function() {\n return doc;\n });\n }\n return doc;\n });\n}", "function headlineDom(data) {\n\tlet articles = data.articles;\n\n\tfor (let i = 0; i < articles.length; i++) {\n\t\tlet content = data.articles[i].content;\n\t\t// console.log(content);\n\t\tlet image = articles[i].urlToImage;\n\t\tlet preview = articles[i].description;\n\t\tlet title = articles[i].title;\n\t\tlet count = Math.floor(Math.random() * 100) + ' comments';\n\t\tlet link = articles[i].url;\n\t\t//hides template replace with article layout\n\t\t$(article).attr('id', `template`);\n\t\t$('#template *').addClass('hidden');\n\n\t\t// // console.log(content);\n\t\t// article layout variable\n\t\tlet articleLayOut = `\n \t<article id=\"article${i}\" class=\"article\">\n \t <section class=\"featuredImage\">\n \t <img src=${image} alt=\"thumbnail\" />\n \t </section>\n \t <section class=\"articleContent\">\n \t <a href=\"#\" id=\"title\"><h3>${title}</h3></a>\n \t <h6>${preview}</h6>\n \t </section>\n \t <section class=\"impressions\">\n \t ${count}\n \t </section>\n \t <div class=\"clearfix\"></div>\n \t</article>\n `;\n\n\t\t$('#main').append(articleLayOut);\n\n\t\t// open pop up with link to news source\n\n\t\t$('#article' + i).on('click', function (event) {\n\t\t\t$('#popUp .container').show();\n\t\t\tevent.preventDefault();\n\t\t\t$('#popUp a').show();\n\t\t\t$('#popUp').removeClass('loader hidden');\n\n\t\t\t$('#popUp .container h1').text(title);\n\t\t\t$('#popUp p').text(content);\n\n\t\t\t$('.popUpAction').text('Read more from News');\n\t\t\t$('.popUpAction').attr('href', link);\n\t\t});\n\n\t\thidePop();\n\t}\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 }", "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 prepareDocument(){\r\n\tlinkify(document.getElementById('ctl00_ContentPlaceHolder1_DiscussionText'));\r\n\tvar posts = getPostBodies();\r\n\tfor ( var i=0; i<posts.length; i++ ) {\r\n\t\tlinkify(posts[i]);\r\n\t}\r\n}", "newNote(note) {\n const { title, text } = note;\n // This is input validation requiring the title and note to both have at least 1 character.\n if (!title || !text) {\n throw new Error(\"Note 'title' and 'text' both have a 1 character minimum requirement!\");\n }\n\n // This adds a unique ID to the new note as well as the title and text.\n const newNote = { title, text, id: uniqueID() };\n\n // This retrives all the notes, writes all the updated notes, adds the new note, and returns the newNote.\n return this.retrieveNotes()\n .then((notes) => [...notes, newNote])\n .then((updatedNotes) => this.writeFile(updatedNotes))\n .then(() => newNote);\n }", "async function createAnote() {\n let notesService = new NotesService(process.env.MICRO_API_TOKEN);\n let rsp = await notesService.create({\n text: \"This is my note\",\n title: \"New Note\",\n });\n console.log(rsp);\n}", "function renderNotes() {\r\n for (var i = 0; i < notesListLS.length; i++) {\r\n createMarkup(i);\r\n }\r\n}", "function creationElementListe(){\n cadre = document.createElement(\"li\");\n articleFiche = document.createElement(\"div\");\n articleImage = document.createElement(\"img\");\n articleNom = document.createElement(\"h2\");\n articlePrix = document.createElement(\"p\");\n articleDetails = document.createElement(\"a\");\n}", "function renderNewNote(noteObj) {\n const li = document.createElement('li')\n console.log(noteObj)\n// make the id of the li element the id of my todo object\n li.id = noteObj.id\n renderNewNote(li, noteObj)\n todoList.appendChild(li)\n}", "function Note(type) {\n this.noteType = type;\n this.date = addDate();\n this.titleOfNoteBook = openNotebook;\n this.addingFromLocalStorage = function (\n date,\n savedNoteBookPlacment,\n savedTextarea\n ) {\n if (date != null) {\n this.date = date;\n }\n if (savedNoteBookPlacment != null) {\n this.titleOfNoteBook = savedNoteBookPlacment;\n } else {\n this.titleOfNoteBook = openNotebook;\n }\n if (savedTextarea != \"\" && type == 1) {\n this.noteElement.getElementsByClassName(\n \"textArea\"\n )[0].textContent = savedTextarea;\n }\n };\n\n this.noteElement = createNote(this, type);\n main.prepend(this.noteElement);\n\n this.checkBox = document.createElement(\"input\");\n this.checkBox.type = \"checkbox\";\n this.checkBox.style.display = \"none\";\n this.checkBox.className = \"checkbox\";\n this.noteElement.appendChild(this.checkBox);\n this.delete = false;\n\n this.getNoteLi = function () {\n if (this.noteType == 2) {\n let arrayOfInnerText = [];\n let listItemsArray = this.noteElement.getElementsByClassName(\n \"itemOfList\"\n );\n\n for (let index = 0; index < listItemsArray.length; index++) {\n arrayOfInnerText.push(listItemsArray[index].innerText);\n }\n arrayOfInnerText.toString();\n return arrayOfInnerText;\n }\n };\n\n //om du kan mata varje string som newNext från local sätter denna dit dom en i taget\n this.setNewLi = function (newText) {\n if (this.noteType == 2) {\n let node = this.noteElement.getElementsByClassName(\"list\");\n let listItemContainer = document.createElement(\"div\");\n listItemContainer.className = \"list-item-container\";\n let node_li = document.createElement(\"li\");\n node_li.contentEditable = \"true\";\n node_li.className = \"itemOfList\";\n let textnode = document.createTextNode(newText);\n let span = document.createElement(\"SPAN\");\n let txt = document.createTextNode(\"\\u00D7\");\n span.className = \"remove-list-item\";\n span.addEventListener(\"click\", () => {\n listItemContainer.remove();\n saveNotesToLocalStorage();\n });\n span.appendChild(txt);\n node_li.appendChild(textnode);\n listItemContainer.appendChild(node_li);\n listItemContainer.appendChild(span);\n node[0].appendChild(listItemContainer);\n return node;\n }\n };\n this.getNoteText = function () {\n if (this.noteType == 1) {\n return this.noteElement.getElementsByClassName(\"textArea\")[0].textContent;\n }\n };\n this.setTitleOfNoteBook = (title) => {\n this.titleOfNoteBook = title;\n };\n\n this.checkBoxVisible = function (choise) {\n if (choise == true) {\n return (this.checkBox.style.display = \"block\");\n } else if (choise == false) {\n return (this.checkBox.style.display = \"none\");\n }\n };\n\n this.removeNote = function () {\n this.noteElement.remove();\n this.delete = true;\n clearDeleted();\n saveNotesToLocalStorage();\n };\n}", "function createArticleSection(article) {\n var section = \n `<div class = \"card\">\n <div class = \"card-body\">\n <h3 class = \"card-title\">\n <a href = ${article.url}>\n ${article.headline}\n </a>\n <a class = \"btn btn-primary save\">\n Save Article\n </a>\n </h3>\n <p class = \"card-text\">\n ${article.summary}\n </p>\n </div>\n </div>`;\n section.data(\"_id\", article._id);\n return section;\n }", "function createArticleContent (cryptoType){\n var response = JSON.parse(localStorage.getItem(`${cryptoType}CryptoData`));\n //empty article div content before trying to create content\n $articlediv.empty()\n $articlediv.addClass(\"is-scrollable\");\n for (var i = 0; i < response.length; i++) {\n\n //capture link from the API response and apply it to the whole div content\n var $link = $(\"<a>\");\n $link.attr(\"href\", response[i].url);\n $link.attr(\"target\", \"_blank\");\n $articlediv.append($link);\n\n var $article = $(\"<article>\");\n $article.addClass(\"message is-small\");\n $link.append($article);\n\n //article header containing the description\n var $articleHeader = $(\"<div>\");\n $articleHeader.addClass(\"message-header\");\n $article.append($articleHeader);\n\n var $title = $(\"<p>\");\n $title.text(response[i].title);\n $articleHeader.append($title);\n\n // div element containing article image\n var $iconContainer = $(\"<div>\");\n $iconContainer.addClass(\"media-left columns is-mobile articleContainer\");\n $article.append($iconContainer);\n\n var $articleImgCol = $(\"<div>\");\n $articleImgCol.addClass(\"column is-one-quarter\");\n $iconContainer.append($articleImgCol);\n\n var $imgContainer = $(\"<img>\");\n $imgContainer.attr(\"src\", response[i].thumbnail);\n $articleImgCol.append($imgContainer);\n\n // article detail description goes here\n var $articleContent = $(\"<div>\");\n $articleContent.addClass(\"column is-black is-link\");\n $iconContainer.append($articleContent);\n\n var $description = $(\"<p>\");\n $description.text(response[i].description);\n $articleContent.append($description);\n if (i === 4) {\n break;\n }\n }\n}", "function Note(content) {\n this.content = content;\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 generateArticleElements(articleBlockLeftTemplate, articleBlockRighTemplate){\r\n // input? Need to know the number of articles\r\n var $secondToLast\r\n var\r\n\r\n }", "function makeArticle(obj){\n this.title = obj.title;\n this.category = obj.category;\n this.author = obj.author;\n this.authorUrl = obj.authorUrl;\n this.publishedOn = obj.publishedOn;\n this.body = obj.body;\n }", "function createPost() {\n}", "function create_note() {\r\n\tvar offset = $('#drag_resize').offset();\r\n\tvar top_pos =offset.top;\r\n\tvar left_pos =offset.left;\r\n\tvar notepaper_top =top_pos + $('#drag_resize').height()/2;\r\n\tvar notepaper_left =left_pos + $('#drag_resize').width()/2;\r\n\t$('.note').css({\"display\":\"block\", 'top' : notepaper_top+'px', 'left' : notepaper_left+'px'});\r\n\t$('#drag_resize').draggable( \"disable\"); \r\n\t$('#choose_area').css({\"display\":\"none\"});\r\n\t$('#delete_circle').css({\"display\":\"none\"});\r\n}", "function addNote(text) {\n var newNote = $(\"<div class = 'note'></div>\");\n var icons = $(\"<div class = 'icons'></div>\");\n\n var tag = $(\"<i class = 'fa fa-tag' aria-hidden = 'true'></i>\");\n var removeButton = $(\"<i class = 'fa fa-times' aria-hidden = 'true'></i>\");\n var textBox = $(\"<textarea></textarea>\");\n\n if (text != undefined) textBox.val(text);\n\n tag.click(changeColor);\n textBox.blur(saveNotes);\n removeButton.click(function() {\n newNote.remove();\n saveNotes();\n });\n\n icons.append(tag);\n icons.append(removeButton);\n\n newNote.append(icons);\n newNote.append(textBox);\n newNote.appendTo($(\"#sticky-notes\"));\n saveNotes();\n}", "function newElement() {\r\n var li = document.createElement(\"li\");// create a blank sticky note \r\n li.className=\"animation\";\r\n var pin = document.createElement(\"i\");//create a red pin\r\n var p_text = document.createElement(\"p\");//create a paragraph for a text\r\n var p_date = document.createElement(\"p\");//create a paragraph for a date\r\n var p_time = document.createElement(\"p\");//create a paragraph for a time\r\n var div_date = document.createElement(\"div\");//create a div for time & date\r\n var div_text = document.createElement(\"div\");//create a div for a text\r\n pin.setAttribute(\"class\", \"pin\");//giving a class name to a pin\r\n div_date.setAttribute(\"id\", \"noteDiv\");//giving an id to a date div\r\n div_text.setAttribute(\"id\",\"textDiv\");// giving an id to a text div\r\n var inputValue = document.getElementById(\"myInput\").value;//creating a text var, taken from text input\r\n var inputDate = document.getElementById(\"dateInput\").value;//creating a date var, taken from date input\r\n var inputTime = document.getElementById(\"timeInput\").value;//creating a time var, taken from time input\r\n\r\n var text = document.createTextNode(inputValue);//coding a text into a node\r\n var date= document.createTextNode(inputDate);//coding a date into a node\r\n var time = document.createTextNode(inputTime);//coding a time into a node\r\n\r\n p_text.appendChild(text);//inserting text to a text paragraph\r\n p_date.appendChild(date);//inserting date to a date paragraph\r\n p_time.appendChild(time);//inserting time to time paragraph\r\n div_date.appendChild(p_date);//inserting date paragraph to a divdate\r\n div_date.appendChild(p_time);//inserting time paragraph to a divdate\r\n div_text.appendChild(p_text);//inserting text paragraph to a divtext\r\n\r\n if (inputValue === '') {//if there is nothing in the text iput\r\n alert(\"You're supposed to write your note before pressing add!\");\r\n}\r\n else if (inputDate === '') {//if there is nothing in the date input\r\n alert(\"You're supposed to write a due date before pressing add!\"); \r\n } else {\r\n li.appendChild(pin);//insert the pin to the (li) note\r\n li.appendChild(div_text);//insert the text to the (li) note\r\n li.appendChild(div_date);//insert the date to the (li) note\r\n\r\n//storing item in local storage \r\n var span = document.createElement(\"SPAN\");//creating a span for a close button\r\n var txt = document.createTextNode(\"\\u00D7\");//cross sign\r\n span.className = \"close\";//giving a name to a span\r\n span.appendChild(txt);//adding text to span\r\n id++;\r\n span.setAttribute(\"id\", String(id));\r\n span.setAttribute(\"onclick\", \"removeNote(this)\");\r\n li.appendChild(span); //adding span to li\r\n\t\r\n\t var userObjectAsString = localStorage.getItem(\"note\");\r\n\tif(JSON.parse(userObjectAsString) != null){\r\n\t\tnoteArr = JSON.parse(userObjectAsString);\r\n\t\tconsole.log(\"a\");\r\n\t}\r\n\tconsole.log(noteArr);\r\n\tnoteArr.push(createNote(String(id),inputValue,inputDate,inputTime));\r\n\tlocalStorage.setItem(\"note\", JSON.stringify(noteArr));\r\n\t\r\n document.getElementById(\"myUL\").appendChild(li); //insert the note into myUL (notes container)\r\n\r\n }\r\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 renderNote(newNote) {\n var div = document.createElement(\"div\"),\n remove = document.createElement(\"span\"),\n title = document.createElement(\"h6\"),\n text = document.createElement(\"p\"),\n favorite = document.createElement(\"span\"),\n tags = document.createElement(\"span\");\n\n div.className = \"note-list__item\";\n remove.className = \"note-list__del\";\n favorite.className = \"note-list__pin\";\n tags.className = \"note-list-tags\";\n text.className = \"note-list__text\";\n title.className = \"note-list__head\";\n\n \n remove.innerHTML =\"<img class='icon-cancel' src='./img/icons8-cancel-50.png' width='25px' height='auto'/>\"\n text.innerHTML = newNote.noteText;\n title.innerHTML = newNote.noteHead;\n\n addRemoveListner(remove, newNote);\n div.setAttribute(\"data-item-number\", (newNote.noteId));\n div.appendChild(remove);\n div.appendChild(title);\n if (noteHead.value.length > 0) {\n title.style.marginBottom = \"10px\"\n }\n div.appendChild(text);\n div.appendChild(favorite);\n div.appendChild(tags);\n mainDiv.insertBefore(div, mainDiv.firstChild);\n headVisible(mainDiv, document.querySelector(\".note-list__main-head\"));\n div.style.background = newNote.colorBg; \n // Knocking down the background of the main unit\n if (text.innerHTML.length < 51) {\n text.style.lineHeight = \"30px\";\n text.style.fontSize = \"27px\";\n } else if (text.innerHTML.length < 81) {\n text.style.lineHeight = \"25px\";\n text.style.fontSize = \"20px\";\n }\n if (!title.innerHTML) {\n title.style.marginBottom = \"0px\";\n } else {\n title.style.marginBottom = \"10px\";\n }\n\n addTag(); // Tag add function\n }", "addNote(note) {\n const {title,text}=note;\n if (!title || !text){\n throw new Error(\"Neither text or title can be blank for the note entered\");\n }\n const newNote={title,text,id:uniqid()};\n return this.getNotes()\n .then((notes)=>[...notes,newNote])\n .then((currentNotes)=>this.write(currentNotes))\n .then(()=>newNote);\n }", "function Note(text, title) {\n\tthis.text = text;\n\tthis.title = title;\n}", "function Note() {\n\tthis.maintype = '';\n\tthis.subtype = '';\n\tthis.text = '';\n\tthis.xml_id = '';\n\tthis.custom = '';\n}", "function addToHTML() {\n for(var i = 0; i < blog.post.length; i++) {\n var article = document.querySelector('#blog_posts');\n var title = document.createElement('h1');\n var date = document.createElement('p');\n var image = document.createElement('img');\n var text = document.createElement('p');\n var blog_title = blog.post[i].title;\n var blog_date = blog.post[i].date;\n var blog_image = blog.post[i].image;\n var blog_text = blog.post[i].text;\n title.textContent=blog_title;\n date.textContent=blog_date;\n image.setAttribute('src', blog_image);\n text.textContent=blog_text;\n article.appendChild(title);\n article.appendChild(date);\n article.appendChild(image);\n article.appendChild(text);\n }\n}", "function Note(title) {\n _classCallCheck(this, Note);\n\n this.title = title;\n this.element = this.createElement(title); // HINT🤩 this.element = this.createElement(title);\n }", "function createNewNote(body, notesArray) {\n console.log('body',body)\n //create id\n let newId = getId();\n if(!ids.assigned(newId)){\n createNewNote(body, notesArray)\n }else {\n body.id = newId\n }\n\n let note = body;\n notesArray.push(note);\n\n fs.writeFileSync(\n path.join(__dirname, '../data/notes.json'),\n JSON.stringify({ notes: notesArray }, null, 2)\n );\n return note;\n}", "function createDiv2(type, article) {\n let div2 = document.createElement(\"div\");\n div2.className = \"content\";\n\n if (type == 1) {\n let textarea = document.createElement(\"div\");\n textarea.className = \"textArea\";\n textarea.contentEditable = \"true\";\n div2.appendChild(textarea);\n }\n\n if (type == 2) {\n article.className = \"note note-list shadow-sm\";\n let inputContainer = document.createElement(\"div\");\n inputContainer.className = \"input-container\";\n let input = document.createElement(\"input\");\n input.type = \"text\";\n input.className = \"list-input\";\n input.placeholder = \"Add to list\";\n\n let button = document.createElement(\"button\");\n button.className = \"list-btn note-button\";\n let imgAddList = document.createElement(\"img\");\n imgAddList.src = \"media/plus.svg\";\n imgAddList.alt = \"Add\";\n imgAddList.width = \"28\";\n imgAddList.height = \"28\";\n imgAddList.title = \"Add to list\";\n button.appendChild(imgAddList);\n let node = document.createElement(\"ul\");\n node.className = \"list\";\n\n inputContainer.appendChild(input);\n inputContainer.appendChild(button);\n\n div2.appendChild(inputContainer);\n div2.appendChild(node);\n\n input.addEventListener(\"keypress\", function (event) {\n let e = event;\n if (\n e.code === \"Enter\" &&\n document.getElementsByClassName(\"list-input\")[0].value != \"\"\n ) {\n addListItemOnClick();\n }\n });\n\n function addListItemOnClick() {\n if (input.value.length > 0) {\n let listItemContainer = document.createElement(\"div\");\n listItemContainer.className = \"list-item-container\";\n let node_li = document.createElement(\"li\");\n node_li.contentEditable = \"true\";\n node_li.className = \"itemOfList\";\n let textnode = document.createTextNode(input.value);\n let span = document.createElement(\"SPAN\");\n let txt = document.createTextNode(\"\\u00D7\");\n span.className = \"remove-list-item\";\n span.addEventListener(\"click\", () => {\n listItemContainer.remove();\n saveNotesToLocalStorage();\n });\n span.appendChild(txt);\n node_li.appendChild(textnode);\n listItemContainer.appendChild(node_li);\n listItemContainer.appendChild(span);\n node.prepend(listItemContainer);\n\n div2.appendChild(node);\n document.getElementsByClassName(\"list-input\")[0].value = \"\";\n saveNotesToLocalStorage();\n }\n }\n button.addEventListener(\"click\", addListItemOnClick);\n }\n return div2;\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}", "function createPost(title, price, description, url){\n // Set page title to post title.\n document.title = title;\n\n // Book title header.\n document.getElementById(\"title\").innerHTML = title;\n\n // Gets container to post it in.\n var content = document.getElementById(\"container\");\n\n\n // Getting images and setting text.\n document.getElementById(\"image\").src = url;\n document.getElementById(\"price\").innerHTML = \"$\" + price;\n document.getElementById(\"description\").innerHTML = description;\n}" ]
[ "0.68710387", "0.6724821", "0.6685581", "0.6683752", "0.654901", "0.6516873", "0.64985716", "0.6458424", "0.6451335", "0.6433407", "0.63533705", "0.63507533", "0.63122886", "0.630761", "0.629974", "0.628593", "0.627859", "0.6274803", "0.6255771", "0.62408084", "0.62273866", "0.62049377", "0.6172979", "0.6156496", "0.61115855", "0.6110862", "0.6097973", "0.60975266", "0.6080444", "0.60748416", "0.604412", "0.60303646", "0.6029473", "0.60032696", "0.59852225", "0.59841347", "0.5983124", "0.5973386", "0.5972156", "0.59458715", "0.593603", "0.5933847", "0.5933222", "0.59212387", "0.5912422", "0.59001464", "0.5882172", "0.58796346", "0.58775055", "0.58752584", "0.58730716", "0.58730114", "0.5868524", "0.5864012", "0.5853218", "0.5841899", "0.5837853", "0.58376205", "0.5837151", "0.5823603", "0.5817846", "0.5816019", "0.58147854", "0.57835823", "0.57831913", "0.5782873", "0.57749593", "0.5774295", "0.57716286", "0.57637805", "0.5759333", "0.5753565", "0.5750749", "0.57335365", "0.57329977", "0.57290316", "0.5725999", "0.5711621", "0.57105625", "0.5705934", "0.57053703", "0.57039434", "0.5701716", "0.5698569", "0.5697024", "0.56925344", "0.56882036", "0.567772", "0.567196", "0.567187", "0.56640714", "0.5663437", "0.56633556", "0.5658952", "0.5647492", "0.5635445", "0.5633511", "0.56280285", "0.5620968", "0.5620316" ]
0.7406209
0
set attributes to article
function articleAttributes(article) { article.className = "note shadow-sm"; article.id = "note-article"; return article; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setArticles(){\n\t\t\t// Foreach the article tags\n\t\t\tthisElement.children().each(function(_, node) {\n\t\t\t\tarticles[ _ ] = { };\n\t\t\t\tarticles[ _ ][\"data-cols\"]\t\t=\t(node.getAttribute('data-cols') != null)?node.getAttribute('data-cols'):'3';\n\t\t\t\tarticles[ _ ][\"data-theme\"]\t=\t(node.getAttribute('data-theme') != null)?node.getAttribute('data-theme'):'a';\n\t\t\t\tvar count\t=\t0;\n\t\t\t\tvar items\t=\t{ };\n\t\t\t\tvar title;\n\t\t\t\tvar titleFound\t=\tfalse;\n\t\t\t\t$(this).children().each(function(_, node) {\n\t\t\t\t\tif(node.nodeName != '#text' && node.innerHTML.trim() != ''){\n\t\t\t\t\t\titems[ count ] = { };\n\t\t\t\t\t\titems[ count ][\"node\"]\t\t\t=\tnode.nodeName;\n\t\t\t\t\t\titems[ count ][\"value\"]\t\t\t=\tnode.innerHTML;\n\t\t\t\t\t\tif(node.nodeName == \"H1\" && titleFound != true){\n\t\t\t\t\t\t\ttitle = node.textContent;\n\t\t\t\t\t\t\ttitleFound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tarticles[ _ ][\"title\"]\t\t\t\t\t=\ttitle;\n\t\t\t\tarticles[ _ ][\"article\"]\t\t\t\t=\titems;\n\t\t\t});\n\t\t}", "function setAttributes(attributes) {\n roktLoaded.then((rokt) => {\n rokt.setAttributes(attributes);\n });\n }", "function setArticle(article){\n cleanArticleFields(); \n \n if(article){\n $('.author').text('Author: ');\n $('.date').text('Date: '); \n $('.title').append('<span>' + article.title + '</span>' );\n var authorWithLink = '<span> <a href=\\'mailto:'\n + article.authorEmail \n + '\\'>' + article.author \n +'</a></span>';\n \n $('.author').append(authorWithLink);\n $('.date').append('<span>' + article.date + '</span>' ); \n $('.text').append( article.text );\n $('.text').append( '<p> <button>Remove article</button></p>' );\n $('.article-view button').on('click', function(){\n removeArticle(article._id);\n });\n \n } else {\n showDefaultPage(errorArticleObject); \n }\n }", "function assignAttributes() {\n\t$(\"#amethyst\").attr(amethyst);\n\t$(\"#celestite\").attr(celestite);\n\t$(\"#titaniumquartz\").attr(titaniumquartz);\n\t$(\"#citrine\").attr(citrine);\n}", "function setAttributes(element, attributes) {\n for(var key in attributes) {\n\tif(key){\n\t\telement.setAttribute(key, attributes[key]);\t\t\n\t}\n }\n}", "function setAttributes(elm, attrs){\r\n for(var attr in attrs)\r\n elm.setAttribute(attr, attrs[attr]);\r\n return elm;\r\n}", "function setAttributes(element, attributes){\r\n for(const key in attributes) {\r\n element.setAttribute(key, attributes[key]);\r\n }\r\n}", "attributes(node) {\n const elem = mona_dish_1.DQ.byId(node.id.value, true);\n node.byTagName(Const_1.XML_TAG_ATTR).each((item) => {\n elem.attr(item.attr(Const_1.ATTR_NAME).value).value = item.attr(Const_1.ATTR_VALUE).value;\n });\n }", "function Article (opts) {\n for (key in opts) {\n this[key] = opts[key];\n }\n}", "function setAttributes(element, attributes) {\r\n for (const key in attributes) {\r\n element.setAttribute(key, attributes[key]);\r\n }\r\n \r\n\r\n}", "function setAttributes(element,attributes)\n{\n for(const key in attributes){\n element.setAttribute(key,attributes[key]);\n }\n}", "function setAttributes(el, attrs) {\n for(var key in attrs) {\n el.setAttribute(key, attrs[key]);\n console.log('setting key: ' + key + ', value: ' + attrs[key]);\n }\n}", "function setAttributes(el, attrs) {\n for(var key in attrs) {\n el.setAttribute(key, attrs[key]);\n console.log('setting key: ' + key + ', value: ' + attrs[key]);\n }\n}", "function setAttributes(el, attrs) {\n for (var key in attrs) {\n el.setAttribute(key, attrs[key]);\n }\n}", "function populateArticle(html, article) {\n if (html.length > 1) {\n html = $(html[0]);\n }\n if (!article.seen) {\n html.find(\".breaking-news\").removeClass(\"hidden\");\n } else {\n html.find(\".breaking-news\").addClass(\"hidden\");\n }\n article.seen = true;\n html.find(\".network-icon\").attr(\"src\", article.network_image);\n html.find(\".network-icon\").attr(\"alt\", article.network_short);\n html.find(\".network-name\").text(article.network_full);\n html.find(\".title\").text(article.title);\n html.find(\".author\").text(\"By \" + article.author);\n html.find(\".image\").attr(\"src\", article.img_url);\n html.find(\".article-text\").text(article.article_body);\n}", "function setAttributes(el, attrs) {\n for(var key in attrs) {\n el.setAttribute(key, attrs[key]);\n }\n}", "function setAttributes(el, attrs) {\n for(var key in attrs) {\n el.setAttribute(key, attrs[key]);\n }\n}", "function assignAttributes(element, attributes) {\n\tObject.keys(attributes).forEach(key => element.setAttribute(key, attributes[key]))\n}", "function createAttribute() {\n newAttribute = document.createAttribute(\"congressional-district\")\n newAttribute.value = \"5\"\n articleRef.setAttributeNode(newAttribute)\n }", "function setAttributes(element, attributes){\n for(const key in attributes){\n element.setAttribute(key, attributes[key]);\n }\n}", "function setAttributes(element, attributes) {\n for (let key in attributes) {\n element.setAttribute(key, attributes[key]);\n }\n}", "setAttributes(myAttributes){\n \tif (myAttributes instanceof Attribute){\n \t\tvar keys = myAttributes.getKeys();\n \t\tfor(let i in keys){\n \t\t\tthis.setAttribute(keys[i], myAttributes.getAttribute(keys[i]);\n \t\t}\n \t}else if(Array.isArray(myAttributes)){\n \t\tvar keys = Object.keys(myAttributes);\n \t\tfor(let i in keys){\n \t\t\tthis.setAttribute(keys[i], myAttributes[keys[i]]);\n \t\t}\n \t}\n \t\n }", "function setAttributes(element, attributes){\n for (const key in attributes){\n element.setAttribute(key, attributes[key]);\n }\n}", "function setAttr(el, attrs) {\n for (const attr in attrs) {\n el.setAttribute(attr, attrs[attr]);\n }\n}", "function setAttributes(el, attrs) {\n for (let key in attrs) {\n el.setAttribute(key, attrs[key]);\n }\n}", "function setAttributes(element, attributes) {\n for (const key in attributes) {\n element.setAttribute(key, attributes[key]);\n }\n}", "function setAttributes(element, attributes) {\n for (const key in attributes) {\n element.setAttribute(key, attributes[key]);\n }\n}", "function setAttributes(element, attributes) {\n for(const key in attributes) {\n element.setAttribute(key, attributes[key]);\n }\n}", "function setAttributes(el, attrs) {\n for (const key in attrs) {\n if ({}.hasOwnProperty.call(attrs, key)) {\n el.setAttribute(key, attrs[key]);\n }\n }\n}", "function setAttributes(element, attributes) {\n for (const key in attributes) {\n element.setAttribute(key, attributes[key]);\n }\n}", "setAttributes(geometry, translations, values, originalValues) {\n geometry.addAttribute('translation', translations)\n geometry.addAttribute('size', values)\n geometry.addAttribute('originalsize', originalValues)\n }", "function setAttributes(element, attributes) {\n for (const key in attributes) {\n element.setAttribute(key, attributes[key])\n }\n}", "function setup (elem, state) {\n elem.$attribute('story', story => state.story = story)\n}", "function Article (title, category, point, summary, image){\n\t\tthis.title = title;\n\t\tthis.category = category;\n\t\tthis.point = point;\n\t\tthis.summary = summary;\n\t\tthis.image = image;\n\t\t}", "function setAttributes(element, attributes) {\n for (const key in attributes) {\n if (Object.hasOwnProperty.call(attributes, key)) {\n const attrValue = attributes[key];\n element.setAttribute(key, attrValue);\n }\n }\n}", "function setAttrs( model, attrs, options ){\n\t model.__begin();\n\t\n\t applyTransform( model, attrs, model.__attributes, options );\n\t\n\t model.__commit( attrs, options );\n\t\n\t return model;\n\t}", "function makeArticle(obj){\n this.title = obj.title;\n this.category = obj.category;\n this.author = obj.author;\n this.authorUrl = obj.authorUrl;\n this.publishedOn = obj.publishedOn;\n this.body = obj.body;\n }", "function setAttr(element, attr, alt_text) {\n $(element).attr(attr, alt_text);\n}", "function viewArticle() {\n\t\t//set the content of the elements using the list items' attributes\n\t\t$(\"article h1\").html($(this).attr(\"title\"));\n\t\t$(\"article img\").attr(\"src\", $(this).attr(\"backgr\"));\n\t\t$(\"article h4\").html($(this).attr(\"author\") + \" - \" + $(this).attr(\"date\"));\n\t\t$(\"article .content\").html($(this).attr(\"description\"));\n\t}", "static attrs(element, attrs) {\n if(element.setAttribute) {\n Object.keys(attrs).forEach((prop) => {\n element.setAttribute(prop, attrs[prop]);\n }); \n }\n }", "function setPreview(article){\n\t// Preview Display\n\t$('#ne-side-title').text(article.data('title'));\n\t$('#ne-side-article').text(article.data('article'));\n\t// Edit Display\n\t$('#ne-title-edit').val(article.data('title'));\n\t$('#ne-intro-edit').val(article.data('intro'));\n\t$('#ne-article-edit').val(article.data('article'));\n\t$('#ne-img-preview').css('background-image', article.data('img-url'));\n\t$('#ne-img-id').val(article.data('img-id'));\n\n\t// Date Formatting\n\tvar start = new Date(article.data('start'));\n\tvar sDate = start.getFullYear() + \"-\" + (\"0\" + (start.getMonth() + 1)).slice(-2) + \"-\" + (\"0\" + start.getDate()).slice(-2);\n\t$('#ne-sdate-edit').val(sDate);\n\tvar end = new Date(article.data('end'));\n\tvar eDate = end.getFullYear() + \"-\" + (\"0\" + (end.getMonth() + 1)).slice(-2) + \"-\" + (\"0\" + end.getDate()).slice(-2);\n\t$('#ne-edate-edit').val(eDate);\n}", "function safeSetAttributes(el, attributes) {\n Object.keys(attributes).forEach((name) => {\n safeSetAttribute(el, name, attributes[name].toString());\n });\n}", "function setAttributes(ele,o)\n{\n\tfor (var i in o) {\n\t\tif ( o.hasOwnProperty(i) )\n\t\t\tele.setAttribute( i, o[i] );\n\t}\n}", "function setImgAttributes(imgToSetAttributes, width, height, src) {\n // $(imgToSetAttributes).width = width;\n // $(imgToSetAttributes).height = height;\n $(imgToSetAttributes).attr(\"src\", src).width(width).height(height);\n }", "setContent(articles, section, tag, keyword) {\n this.reset();\n\n this.section = section;\n this.tag = tag;\n this.keyword = keyword;\n\n this.updateTitle(section);\n this.addContent(articles);\n }", "function Article(title, body) {\n this.title = title;\n this.body = body;\n}", "setAttributes(data) {\n if(isArray(data) || isObject(data)) {\n each(data, (value, key) => {\n this.setAttribute(key, value);\n });\n }\n }", "read() {\n this._attributes.update();\n }", "setAttributes() {\n Object.keys(this.DOMAttributes).forEach((key) => {\n const isValidValue = !!this.DOMAttributes[key];\n if (isValidValue) {\n console.log(`KEY/VALUE BEING WRITTEN: ${key} | ${this.DOMAttributes[key]}`);\n this.DOMElement.setAttribute(key, this.DOMAttributes[key]);\n }\n });\n }", "function setAttribute(elmName,attribute){\r\n for(let key in attribute){\r\n elmName.setAttribute('elmName','attribute[key]');\r\n }\r\n }", "function setAttributes(el, options) {\n Object.keys(options).forEach(function (attr) {\n el.setAttribute(attr, options[attr]);\n });\n}", "function setAttributes(el, options) {\n Object.keys(options).forEach(function(attr) {\n el.setAttribute(attr, options[attr]);\n })\n}", "function $add_att(aElem, attributes) {\r\n\tif (attributes) {\r\n\t\tvar xi;\r\n\t\tfor (xi = 0; xi < attributes.length; xi++) {\r\n\t\t\tvar attribute = attributes[xi];\r\n\t\t\tif (attribute instanceof Array && attribute.length >= 2) {\r\n\t\t\t\taElem.setAttribute(attribute[0], attribute[1]);\r\n\t\t\t\tif ( attribute[0].toUpperCase() === 'TITLE' ) {\r\n\t\t\t\t\taElem.setAttribute('alt', attribute[1]);\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}", "function setActiveArticle(){\n const dataId = $(this).attr(\"data-id\");\n $(\".active-article\").removeClass(\"active-article\");\n $(this).addClass(\"active-article\");\n $(\".send-comment\").attr(\"data-id\", dataId);\n loadComments(dataId);\n}", "function setAttribute(element, attributes){\n for(const key in attributes){\n element.setAttribute(key, attributes[key]);\n }\n}", "function Article(){\r this.nr = null;\r this.folder = null;\r this.images = [];\r this.price = null;\r this.txt = null;\r this.name = null;\r this.group = null;\r this.discr = null;\r this.brand = null;\r this.footage = [];\r this.comp = null;\r this.imgcomp = null;\r this.rqitem = null;\r}", "function setAttributes(element, attr) {\n for (let key in attr) {\n element.setAttribute(key, attr[key]);\n }\n}", "function setAttributes(element, attr) {\n for (let key in attr) {\n element.setAttribute(key, attr[key]);\n }\n}", "function applyFeatureAttributes(feature, area) {\n\t\t\tfor (var attr in attrs) {\n\t\t\t\tvar value = attrs[attr];\n\t\t\t\tif (typeof value == \"function\") {\n\t\t\t\t\tvalue = value(feature);\n\t\t\t\t}\n\t\t\t\tif (typeof value != \"undefined\") {\n\t\t\t\t\tarea.setAttribute(attr, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function setAttributes(element, attribute) {\n for(var key in attribute) {\n element.setAttribute(key, attribute[key]);\n }\n}", "function dom_attr_mod(ev) {\n\tvar $this = $(this);\n\t$this.attr('width',$this.width());\n\t$this.attr('height',$this.height());\n}", "function setAttributes(element, attr) {\n for (const key in attr) {\n element.setAttribute(key, attr[key]);\n }\n}", "constructor(article, tagsArticles) {\n this.article = article || null;\n this.tagMap = {};\n this.tagsArticles = tagsArticles || [];\n this.tagsArticles.forEach( (el) => {\n this.tagMap[el.tag.name] = el.tag;\n });\n }", "setContent(articles, section) {\n let $self = $('#articles-small');\n let $sectionTitle = $self.find('#section-title-title');\n let $articlesContainer = $self.children('#articles-small-list');\n\n this.articles.forEach(article => article.delete());\n this.articles = [];\n this.section = section;\n\n $sectionTitle.text(ArticlesContainer.titles[this.section]);\n\n if(this.articles.length > 0)\n articles.forEach(article => article.delete());\n\n let articlesObj = articles.slice(0, 5).map(article => new ArticleSmall(article));\n articlesObj.forEach(article => article.create($articlesContainer));\n\n this.articles = articlesObj;\n }", "addAttribute(attributes){\n const addDirectly = ['value', 'onchange', 'onblur'];\n const element = this.element || this;\n for (var n in attributes){\n if (attributes.hasOwnProperty(n)){\n if (n === \"classname\" || n === \"className\"){\n element.className += \" \"+attributes[n] + \" \";\n } else if (n === \"style\" && typeof attributes[n] === 'object'){\n for (var i in attributes[n]) {\n element.style[i] = attributes[n][i];\n }\n }\n else if (addDirectly.indexOf(n) !== -1) {\n element[n] = attributes[n];\n }\n else {\n element.setAttribute(n, attributes[n]);\n }\n }\n }\n }", "function setAttributes(element, attibutes) {\n for (const key in attibutes) {\n element.setAttribute(key, attibutes[key]);\n }\n}", "parseAttributes() {\n if (this.hasAttribute('uri')) {\n this.uri = this.getAttribute('uri');\n }\n\n }", "function attr(element,attrs) {\n\t\tfor (var i in attrs) {\n\t\t\telement.setAttribute(i,attrs[i]);\n\t\t}\n\t}", "async setNewArticle(context, articleInfo) {\n /*\n Parameters\n article = {\n title,\n author,\n bodyText,\n image,\n avatarImage,\n sectionId --> to be seperated out\n }\n */\n\n // seperate out the sectionId from the actual article\n const {\n sectionId,\n ...article\n } = articleInfo;\n\n // get the reference to the section\n const sectionRef = fb.sections.doc(sectionId);\n const sectionSnapshot = await sectionRef.get();\n\n // if the section is already in the db write to it\n if (sectionSnapshot.exists) {\n await sectionRef.collection('articles').doc().set(article);\n\n // create the section if it does not exist, then add the article\n } else {\n await fb.sections.doc(sectionId).set({});\n await sectionRef.collection('articles').doc().set(article);\n }\n }", "addAttribute(key, value) {\n this.attributes[key] = value;\n }", "function addAltText(data) {\n bibrefs = document.getElementsByTagName('bibl')\n Array.from(bibrefs).forEach(function(element) {\n let citekey = element.getAttribute('id');\n console.log(data[citekey][\"text\"]);\n element.setAttribute(\"title\", data[citekey][\"text\"].replace(/<[^>]*>?/gm, ''));\n });\n \n}", "setAttribute(key, value) {\n this.attributes[key] = value;\n }", "setAttribute(key, value) {\n this.attributes[key] = value;\n }", "_clean_article() {\n if (this.article['title']) {\n this.article['title'] = this.article['title'].strip();\n }\n }", "function transferAttributes(attrs, elt) {\n for(var i = 0, n = attrs.length; i < n; i++) {\n var name = attrs[i][0], value = attrs[i][1];\n if (elt.hasAttribute(name)) continue;\n elt._setAttribute(name, value);\n }\n}", "function setPortalAttribute(element) {\r\n element.setAttribute(DATA_PORTAL_ATTRIBUTE, 'true');\r\n}", "function setPortalAttribute(element) {\r\n element.setAttribute(DATA_PORTAL_ATTRIBUTE, 'true');\r\n}", "function setArticleParams() {\n var articleId;\n var versionNumber;\n var runId;\n var url = window.location.pathname;\n if (config.ISPP) {\n // for use in the PP\n url = window.location.search;\n url = url.replace('?', '/');\n }\n\n url = url.split('/');\n url = _.compact(url);\n articleId = (!_.isEmpty(url[1])) ? url[1] : null;\n versionNumber = (!_.isEmpty(url[2])) ? url[2] : null;\n runId = (!_.isEmpty(url[3])) ? url[3] : null;\n\n /* If you have come through the PP nav we need to force some id's */\n if (config.ISPP && url[0] !== 'article') {\n articleId = '00353';\n versionNumber = '1';\n runId = 'c03211f7-6e1e-492d-9312-e0a80857873c';\n }\n\n detail.queryParams = {\n articleId: articleId,\n versionNumber: versionNumber,\n runId: runId,\n };\n }", "function AttrSet () { this.attrs = new Object(); }", "set attributes(value) {\n return this.$attributes = value;\n }", "static setAttr(el, attr) {\n return new Promise((resolve) => {\n for (const key in attr) {\n el.setAttribute(key, attr[key]);\n }\n resolve();\n });\n }", "function SetAttribute(elem_name, elem_index, attr_name, attr_value){\r\n var elem = document.getElementsByTagName(elem_name)[elem_index];\r\n elem.setAttribute(attr_name, attr_value);\r\n}", "function AttributeExtras() {}", "function ModdleElement(attrs) {\n props.define(this, '$type', { value: name, enumerable: true });\n props.define(this, '$attrs', { value: {} });\n props.define(this, '$parent', { writable: true });\n\n forEach(attrs, function(val, key) {\n this.set(key, val);\n }, this);\n }", "function ModdleElement(attrs) {\n props.define(this, '$type', { value: name, enumerable: true });\n props.define(this, '$attrs', { value: {} });\n props.define(this, '$parent', { writable: true });\n\n forEach(attrs, function(val, key) {\n this.set(key, val);\n }, this);\n }", "attributeChangedCallback(attrName, oldVal, newVal){\n let shadow = this.shadowRoot;\n let childNodes = shadow.childNodes;\n let list = childNodes[1];\n \n // (1) img src\n if(attrName == 'src'){\n console.log(list.childNodes[1]); //img tag\n list.childNodes[1].setAttribute('src', newVal);\n \n }\n // (2) img alt\n else if(attrName == 'alt'){\n console.log(list.childNodes[1]); //img tag\n list.childNodes[1].setAttribute('alt', String(newVal));\n\n }\n // (3A) p txt - title\n else if(attrName == 'title'){\n list.childNodes[3].textContent = String(newVal); \n \n }\n // (3B) p txt - price\n else if(attrName == 'price'){\n //console.log(list.childNodes[5]); // p price tag\n list.childNodes[5].textContent = String(newVal); \n\n }\n }", "setOrOverwriteAttributes_() {\n const ctaLinks = this.element.querySelectorAll('a');\n for (let i = 0; i < ctaLinks.length; i++) {\n ctaLinks[i].setAttribute('target', '_blank');\n\n if (!ctaLinks[i].getAttribute('role')) {\n ctaLinks[i].setAttribute('role', 'link');\n }\n }\n\n const ctaButtons = this.element.querySelectorAll('button');\n for (let i = 0; i < ctaButtons.length; i++) {\n if (!ctaButtons[i].getAttribute('role')) {\n ctaButtons[i].setAttribute('role', 'button');\n }\n }\n }", "function Article (opts) {\n this.author = opts.author;\n this.authorUrl = opts.authorUrl;\n this.title = opts.title;\n this.category = opts.category;\n this.body = opts.body;\n this.publishedOn = opts.publishedOn;\n}", "function postprocess(article, cb) {\n article.id = article.slug = myUtils.slugify(article.config.title);\n\n // TODO rething whether we still need to keep almost entire category doc in article\n // after we changed the way how we query articles by category...\n article.category = {\n id: myUtils.slugify(article.config.category),\n name: myUtils.titlefy(article.config.category)\n }\n article.tags = article.config.tags.map(tag => {\n return {\n id: myUtils.slugify(tag),\n name: myUtils.camelizefy(tag)\n };\n });\n\n delete article.config.category;\n delete article.config.tags;\n\n // to avoid \"RangeError: Maximum call stack size exceeded.\"\n async.setImmediate(function() {\n cb(null, article);\n });\n }", "setAttributes(_attributes) {\n return this;\n }", "function setPortalAttribute(element) {\n element.setAttribute(DATA_PORTAL_ATTRIBUTE, 'true');\n}", "function setPortalAttribute(element) {\n element.setAttribute(DATA_PORTAL_ATTRIBUTE, 'true');\n}", "function setPortalAttribute(element) {\n element.setAttribute(DATA_PORTAL_ATTRIBUTE, 'true');\n}", "function changeTextSize(c){\n text = document.getElementsByTagName(\"article\");\n console.log(text)\n for(var i = 0; i < text.length; i++)\n {\n text[i].className=c;\n };\n \n}", "setAttrs(type, attrs) {\n this.getAttributesManager()[\"set\" + type + \"Attributes\"](attrs);\n return this;\n }", "function setUpAttributes(onePiece) {\r\n\tonePiece['Violin 1'] = [];\r\n\tonePiece['Violin 2'] = [];\r\n\tonePiece['Viola'] = [];\r\n\tonePiece['Cello'] = [];\r\n\tonePiece['Bass'] = [];\r\n\t\r\n\treturn onePiece;\r\n}", "function setLinkAttr(arg) {\n let title = popLink[arg].innerHTML;\n let text = popText[arg].innerHTML;\n let desc = title + \"\\r\\n\" + text;\n let mediaLink = document.location.href + \"/\" + pics[arg].getAttribute(\"src\");\n let url = popLink[arg].getAttribute(\"href\");\n\n function setProp(attr, value) {\n if (!pinterestBtn[arg].hasAttribute(attr)){\n pinterestBtn[arg].setAttribute(attr, value);\n }\n }\n\n pinterestBtn[arg].setAttribute(\"href\", \"https://www.pinterest.com/pin/create/button/\");\n\n setProp(\"data-pin-custom\", \"true\");\n setProp(\"data-pin-do\", \"buttonPin\");\n setProp(\"data-pin-description\", desc);\n setProp(\"data-pin-media\", mediaLink);\n setProp(\"data-pin-url\", url);\n }", "_createPart(){return new AttributePart(this)}", "_createPart(){return new AttributePart(this)}", "function setMetaInformation(results) {\n var i;\n for (i = 0; i < results.length; i += 1) {\n results[i].url = getLink(results[i].$el);\n results[i].title = getTitle(results[i].$el);\n results[i].date = results[i].value;\n }\n }" ]
[ "0.6538193", "0.631075", "0.62744415", "0.6005192", "0.5960833", "0.5943872", "0.59389657", "0.5927844", "0.5927825", "0.5924469", "0.58666223", "0.5759843", "0.5759843", "0.5739936", "0.5725239", "0.5723421", "0.5723421", "0.57205445", "0.57091326", "0.568364", "0.5683276", "0.56830466", "0.56755847", "0.56590706", "0.56580734", "0.5646909", "0.5646909", "0.56451035", "0.56372017", "0.56303585", "0.56211156", "0.5609405", "0.55696553", "0.55684745", "0.5563826", "0.55358326", "0.55326664", "0.55230397", "0.5517755", "0.5504672", "0.5501989", "0.5495327", "0.5495319", "0.54919684", "0.54872257", "0.5471284", "0.54674464", "0.54465777", "0.54443103", "0.54417056", "0.5438114", "0.5396813", "0.5383644", "0.5371223", "0.5339674", "0.5337531", "0.5335618", "0.5335618", "0.5324694", "0.53164786", "0.5298421", "0.5280189", "0.5265759", "0.52542436", "0.524973", "0.5239826", "0.52302086", "0.5217141", "0.521552", "0.5205308", "0.5189432", "0.51881987", "0.51881987", "0.51876223", "0.516531", "0.5154022", "0.5154022", "0.5148209", "0.5146258", "0.5138159", "0.5127658", "0.51240516", "0.5120153", "0.5116645", "0.5116645", "0.5106503", "0.51046175", "0.50996464", "0.509771", "0.50859445", "0.50750697", "0.50750697", "0.50750697", "0.507238", "0.50667137", "0.50626063", "0.50533074", "0.5050514", "0.5050514", "0.50396585" ]
0.7435575
0
creates a div that holds date , delete and change note book buttons
function createDiv1(obj) { let div1 = document.createElement("div"); div1.className = "note-buttons-top"; div1.appendChild(addBooksToNote(obj)); div1.appendChild(createP(obj)); div1.appendChild(createBtnDelete(obj)); return div1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNoteButton(note) {\n var li = $(\"<div />\", slide.contentDocument);\n li.addClass(\"noteButton\");\n var time = $(\"<div />\", slide.contentDocument);\n time.addClass(\"noteButtonTime\");\n time.text(new Date(note.time).toLocaleString());\n li.append(time);\n var summary = $(\"<div />\", slide.contentDocument);\n summary.addClass(\"noteButtonSummary\");\n summary.text(noteSummary(note));\n li.append(summary);\n li.click(function () showNote(note, li));\n $(\"#noteList\", slide.contentDocument).append(li);\n return li;\n }", "function makeNote(note) {\n let noteLi = document.createElement(\"li\")\n noteLi.innerText = note.title\n noteLi.className= 'note-li'\n noteLi.dataset.id = note.id\n noteList.append(noteLi)\n\n //How to crete delete button\n let delBtn = document.createElement(\"button\")\n delBtn.innerText = \"delete\"\n delBtn.className = \"del-btn\"\n delBtn.dataset.id = note.id\n noteLi.append(delBtn)\n }", "function createCardElement(id, title, content, date) {\r\n // Create the element that will hold the text\r\n var element = document.createElement('div')\r\n // Add all the classes\r\n element.setAttribute('class', 'shadow-md rounded p-4 bg-green-lightest mb-4');\r\n // Add the id so that it can be called apon later\r\n element.setAttribute('id', id);\r\n // Set the innerHTML\r\n content = content.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\r\n var data = `<button class=\"text-red float-right\" onclick=\"deleteNote('${id}')\"><i class=\"fas fa-2x fa-times\"></i></button><h1>${title}</h1><p>${content}</p>`\r\n element.innerHTML = data;\r\n // Add the element to the page\r\n findIdentifier('lessonNotes').prepend(element)\r\n}", "function createBookInfo(book) {\n\n deleteBookInfo();\n\n var myBookDiv = document.createElement('div');\n myBookDiv.id = \"arqsiWidgetBookInfo_div\";\n \n var closeA = document.createElement(\"a\");\n closeA.href = \"#\";\n closeA.onclick = deleteBookInfo;\n var closePic = document.createElement(\"img\");\n closePic.className = \"infoClose\";\n closePic.src = \"images/bot_close.png\";\n closePic.style.width = 20;\n closePic.style.height = 20;\n closePic.style.border = 0;\n closeA.appendChild(closePic);\n myBookDiv.appendChild(closeA);\n\n var title = document.createElement(\"p\");\n title.className = \"bookTitle\";\n title.innerHTML = book.getElementsByTagName(\"title\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(title);\n \n if (book.getElementsByTagName(\"picture\")[0].childNodes[0].nodeValue!=\"\"){\n var bookPic = document.createElement(\"img\");\n bookPic.className = \"bookPic\";\n bookPic.src = book.getElementsByTagName(\"picture\")[0].childNodes[0].nodeValue;\n bookPic.style.width = 100;\n bookPic.style.border = 0;\n bookPic.align = \"left\";\n myBookDiv.appendChild(bookPic);\n } \n\n var author = document.createElement(\"p\");\n author.className = \"bookAuthor\";\n author.innerHTML = \"Autor: \"+book.getElementsByTagName(\"author\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(author);\n \n var editora = document.createElement(\"p\");\n editora.className = \"bookEditora\";\n editora.innerHTML = \"Editora: \"+book.getElementsByTagName(\"editora\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(editora);\n\n var category = document.createElement(\"p\");\n category.className = \"bookCategory\";\n category.innerHTML = \"Categoria: \"+book.getElementsByTagName(\"category\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(category);\n\n var lblIsbn = document.createElement(\"p\");\n lblIsbn.className = \"bookIsbn\";\n lblIsbn.innerHTML = \"ISBN: \"+book.getElementsByTagName(\"isbn\")[0].childNodes[0].nodeValue;\n ;\n myBookDiv.appendChild(lblIsbn);\n\n var lblAno = document.createElement(\"p\");\n lblAno.className = \"bookPublicacao\";\n lblAno.innerHTML = \"Ano Publicacão: \"+book.getElementsByTagName(\"publicacao\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(lblAno);\n\n var description = document.createElement(\"p\");\n description.className = \"bookDescription\";\n description.innerHTML = book.getElementsByTagName(\"description\")[0].childNodes[0].nodeValue;\n myBookDiv.appendChild(description);\n\n div.appendChild(myBookDiv);\n}", "function addBooksToNote(obj) {\n let noteDropDown = document.createElement(\"div\");\n let button = document.createElement(\"button\");\n let btnIcon = document.createElement(\"img\");\n let dropDownContent = document.createElement(\"div\");\n let dropDownList = document.createElement(\"ul\");\n\n noteDropDown.className = \"dropdown\";\n noteDropDown.appendChild(button);\n noteDropDown.appendChild(dropDownContent);\n\n button.className = \"note-button\";\n button.addEventListener(\"click\", () => {\n clearNoteDropDown();\n addBooksToDropDown(obj, dropDownContent);\n dropDownContent.style.display = \"block\";\n });\n button.appendChild(btnIcon);\n\n btnIcon.src = \"media/journal-plus.svg\";\n btnIcon.width = \"24\";\n btnIcon.height = \"24\";\n btnIcon.title = \"Move to notebook\";\n\n dropDownContent.className = \"dropdown-content shadow-sm\";\n dropDownContent.appendChild(dropDownList);\n\n return noteDropDown;\n}", "function createBookTable() {\n\n deleteBookInfo();\n deleteBookTable();\n deleteUserFeed();\n\n var div = document.getElementById('arqsiWidget');\n var myTableDiv = document.createElement('div');\n myTableDiv.id = \"arqsiWidgetBookList_div\";\n div.appendChild(myTableDiv);\n\n var strInnerHTML = \"<br/><table id='arqsiWidgetDados'><thead><tr>\";\n strInnerHTML += \"<th width='70'></th>\";\n strInnerHTML += \"<th width='400'>Titulo</th>\";\n strInnerHTML += \"<th width='70'>Editora</th>\";\n strInnerHTML += \"<th width='90'></th>\";\n strInnerHTML += \"</tr></thead><tbody>\";\n var j=0;\n for (var i = currRec; j < recPag && i < bookList.length; i++, j++) { \n var book = bookList[i];\n var titulo = book.getElementsByTagName(\"title\")[0].childNodes[0].nodeValue; \n var editora = book.getElementsByTagName(\"editora\")[0].childNodes[0].nodeValue; \n var novidade = book.getElementsByTagName(\"news\")[0].childNodes[0].nodeValue == \"sim\"; \n var link = \"<a href='#' onClick=afterBookInfoSelected(\"+i+\")>+ info</a>\";\n strInnerHTML += '<tr>';\n strInnerHTML += '<td align=\"right\">'\n if (novidade) strInnerHTML += '<img src=\"' + HOST + 'images/new.gif\" height=\"14\"/>';\n strInnerHTML += '</td>' \n strInnerHTML += '<td>' + titulo + '</td>';\n strInnerHTML += '<td>' + editora + '</td>';\n strInnerHTML += '<td>' + link + '</td>';\n strInnerHTML += '</tr>';\n }\n strInnerHTML += \"</tbody></table>\"; \n myTableDiv.innerHTML = strInnerHTML;\n //Nav Buttons\n strInnerHTML = \"<table id='arqsiWidgetNav' border='0'><thead><tr>\";\n strInnerHTML += \"<th width='300'></th>\";\n strInnerHTML += \"<th width='335'></th>\";\n strInnerHTML += \"</tr></thead><tbody>\";\n strInnerHTML += '<tr>';\n strInnerHTML += ' <td width=\"300\" ><div id=\"arqsiWidgetBookListNav1_div\"></div></td>';\n strInnerHTML += ' <td width=\"335\" ><div id=\"arqsiWidgetBookListNav2_div\"></div></td>';\n strInnerHTML += '<tr>';\n myTableDiv.innerHTML += strInnerHTML;\n\n var myNavDiv = document.getElementById('arqsiWidgetBookListNav1_div');\n myNavDiv.innerHTML = \"\";\n myNavDiv.className = \"navleft\";\n myNavDiv.innerHTML += '<p>Visualizar <input id=\"arqsiWidgetPaging\" name=\"paging\" type=\"text\" value=\"' + recPag + '\" maxlength=\"2\" style=\"width:20px\" onChange=\"changeRecPag()\"/> registos por página </p>';\n var myNavDiv2 = document.getElementById('arqsiWidgetBookListNav2_div');\n myNavDiv2.className = \"navleft\";\n myNavDiv2.innerHTML = \"\";\n myNavDiv2.innerHTML += '<p>';\n if (currRec==0){\n myNavDiv2.innerHTML += \"<img src='\" + HOST + \"images/left_dis.gif' height='16' width='16' style='border:0;'/>\";\n }else{\n myNavDiv2.innerHTML += \"<a href='#' onClick=decPaging()><img src='\" + HOST + \"images/left.gif' height='16' width='16' style='border:0;'/></a>\";\n }\n var recShown = parseInt(currRec + recPag);\n if (recShown > bookList.length){\n recShown = parseInt(bookList.length);\n }\n myNavDiv2.innerHTML += '&nbsp' + recShown + '/' + bookList.length + '&nbsp';\n if (currRec + recPag >= bookList.length){\n myNavDiv2.innerHTML += \"<img src='\" + HOST + \"images/right_dis.gif' height='16' width='16' style='border:0;'/>&nbsp\";\n }else{\n myNavDiv2.innerHTML += \"<a href='#' onClick=incPaging()><img src='\" + HOST + \"images/right.gif' height='16' width='16' style='border:0;'/></a>&nbsp\";\n }\n myNavDiv2.innerHTML += '</p>';\n\n}", "function createButton() {\n const parent = $('#my_indv_tab')\n\n const button = $('<div>').attr({\n id: 'get_cal',\n type: 'button',\n name: 'Download',\n style: 'padding:5px; margin:0px 10px 10px 0px; font-weight:600; font-size:115%; background-color:#F26A38; color:white; float:left; cursor:pointer;'\n })\n\n parent.prepend(button)\n\n $('#get_cal').html('Download Calendar')\n $('#get_cal').on('click', main)\n\n checkPeriod()\n}", "function getNote() {\n const li = document.createElement('LI')\n li.className = 'fill'\n li.id = 'list-tag'\n li.setAttribute('draggable', 'true')\n\n // I am creating a div element that will wrap the text coming from textarea input.\n let divTag = document.createElement('div')\n divTag.className = 'div-tag';\n divTag.setAttribute('id', lastid)\n divTag.innerText = textInput.value\n li.appendChild(divTag)\n\n // I am creating a button element that will be a sibling to the div element created earlier. And they will get appended to the same parent element. \n const edit = document.createElement('button')\n edit.className = 'modify';\n edit.setAttribute('id', lastid)\n edit.innerText = 'EDIT';\n li.appendChild(edit)\n \n // Same as above in line 71\n const deleteBtn = document.createElement('button');\n deleteBtn.className = 'erase';\n deleteBtn.setAttribute('id', lastid)\n deleteBtn.appendChild(document.createTextNode('DELETE'));\n li.appendChild(deleteBtn)\n \n lastid += 1;\n orderList.appendChild(li)\n}", "function displayTasks() {\r\n\r\n document.getElementById(\"tasks\").innerHTML = \"\";\r\n\r\n for (let i = 0; i < taskList.length; i++) {\r\n let itemDiv = document.createElement(\"div\");\r\n itemDiv.id = \"tn\" + i;\r\n itemDiv.className = \"taskNote fade-in\";\r\n let noteAdd = document.getElementById(\"tasks\").appendChild(itemDiv);\r\n\r\n let textDiv = document.createElement(\"div\");\r\n textDiv.className = \"taskText\";\r\n textDiv.innerHTML = taskList[i].details;\r\n let textAdd = document.getElementById(itemDiv.id).appendChild(textDiv);\r\n\r\n let timeDiv = document.createElement(\"div\");\r\n timeDiv.className = \"dateTime\";\r\n timeDiv.innerHTML = taskList[i].date + \"<br />\" + taskList[i].time;\r\n let timeAdd = document.getElementById(itemDiv.id).appendChild(timeDiv);\r\n\r\n let iconDiv = document.createElement(\"div\");\r\n iconDiv.id = \"di\" + i;\r\n iconDiv.className = \"del\";\r\n let iconDivAdd = document.getElementById(itemDiv.id).appendChild(iconDiv);\r\n\r\n let delButton = document.createElement(\"button\");\r\n delButton.className = \"delInv glyphicon glyphicon-trash\";\r\n let delButtonAdd = document.getElementById(iconDiv.id).appendChild(delButton);\r\n\r\n let spaceAdd = document.getElementById(iconDiv.id).innerHTML += \"&nbsp;&nbsp;\";\r\n\r\n let editButton = document.createElement(\"button\");\r\n editButton.className = \"edInv glyphicon glyphicon-pencil\";\r\n let editButtonAdd = document.getElementById(iconDiv.id).appendChild(editButton);\r\n\r\n }\r\n\r\n deleteButtons();\r\n editButtons();\r\n\r\n}", "function showBooks() { \n delAll();\n for(let i = 0; i < myLibrary.length; i++ ){\n let cell = document.createElement(\"div\");\n cell.style.setProperty(\"grid-column\", 1)\n cell.style.setProperty(\"border\", \"solid black\");\n cell.style.setProperty(\"margin\", \"5px\")\n cell.style.setProperty(\"padding\", \"1em\")\n cell.style.setProperty(\"background-color\", \"rgb(69, 201, 245)\")\n cell.innerText = myLibrary[i].info();\n container.appendChild(cell).id = \"book\" + i;\n makeBtnDel(i);\n makeBtnRead(i);\n }\n}", "function createNoteDOM(title, content)\n{\n var div = document.createElement(\"div\");\n div.classList.add(\"note\");\n var noteId = notes.length;\n div.draggable = true;\n div.onmousedown = function(ev){\n openNote(noteId);\n if(!ev.target.classList.contains(\"note-delete\"))\n clearDelete();\n }\n div.ondragstart = drag;\n div.innerHTML = '<div class=\"note-title\">'+title+'</div><div class=\"note-delete\">x</div><div class=\"note-content\">'+content+'</div>';\n div.getElementsByClassName(\"note-delete\")[0].onclick = function(){var id = noteId; deleteNote(id);}\n return div;\n}", "function createButtons()\r\n{\r\n if (!button)\r\n {\r\n button = document.createElement(\"div\");\r\n button.innerHTML = \"<center><div id='remove_activity_buttons'> \\\r\n\t\t<span id=\\\"expand_all_older_posts_button\\\" style='margin-bottom: 10px; margin-left:10px; padding:3px 8px' class='uiButton uiButtonDefault uiButtonMedium'>Wall Auto Expander</span>\";\r\n var a;\r\n\t\ta = $('#profile_stream_blankstate');\r\n\t\tif (a.length)\r\n\t\t\t$(button).insertBefore($('#profile_stream_blankstate'));\r\n\t\ta = $('#pagelet_event_wall');\r\n\t\tif (a.length)\r\n\t\t\t$(button).insertBefore($('#pagelet_event_wall'));\r\n\t\ta = $('#MessagingMainContent');\r\n\t\tif (a.length)\r\n\t\t\t$(button).insertBefore($('#MessagingMainContent'));\r\n\t\t// Third button\r\n $('#expand_all_older_posts_button').click(function()\r\n {\r\n expandOlderPosts(true);\r\n });\r\n }\r\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 createNote(note) {\n //the note\n codeOfNote = ` <div id=\"${note.noteNum}note\" class=\"ml-xl-5 mr-xl-5 mt-xl-4 mb-xl-4 col-xl-2 m-lg-4 col-lg-3 m-md-5 col-md-4 m-sm-5 col-sm-6 ml-5 col-5 note\">`\n //row of icons \n codeOfNote += `<div class=\"mt-4 row\">`\n // number of note\n codeOfNote += `<div class=\"mb-2 ml-2 col-10 number\">${note.noteNum + 1}</div>`\n // col of icons\n codeOfNote += `<div class=\"p-3 m-1 col-xl-12 col-md-12\">`\n // close icon \n codeOfNote += `<span type=\"button\" id=\"icon\" class=\"glyphicon glyphicon-remove\" onclick=\"deleteNote(${note.noteNum})\"></span>`\n // close divs for row and col of icons\n codeOfNote += `</div> </div>`\n //row of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 md-form row\">`\n // col of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 col-xl-11 col-xl-10 col-md-11 col-sm-10 col-11\">`\n //the text area (i used text area inside the note and not p)\n codeOfNote += `<textarea type=\"text\" id=\"${note.noteNum}Notetextarea\" class=\"Notetextarea\" rows=\"5\" readonly>${note.InputOfNote}</textarea>`\n //scroll bar\n codeOfNote += `<div class=\"scrollbar\" id=\"style-9\"> <div class=\"force-overflow\"></div> </div>`\n // date and time\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.dateOfNote}</small>`\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.timeOfNote}</small>`\n //closing divs\n codeOfNote += `</div> </div> </div> </div> </div>`\n\n}", "function buttonContent() {\n let listButtons = document.createElement(\"ul\");\n noteButton.appendChild(listButtons);\n let b1 = document.createElement(\"li\");\n let b1img = document.createElement(\"img\");\n b1img.src = \"/media/card-list.svg\";\n b1img.height = \"50\";\n b1img.width = \"50\";\n listButtons.appendChild(b1);\n b1.appendChild(b1img);\n b1.addEventListener(\"click\", function () {\n allNotes.push(new Note(2));\n saveNotesToLocalStorage();\n });\n\n let b2 = document.createElement(\"li\");\n let b2img = document.createElement(\"img\");\n b2img.src = \"/media/card-text.svg\";\n b2img.width = \"50\";\n b2img.height = \"50\";\n listButtons.appendChild(b2);\n b2.appendChild(b2img);\n b2.addEventListener(\"click\", function () {\n allNotes.push(new Note(1));\n saveNotesToLocalStorage();\n });\n}", "function createEditingElements(content) {\n $(content).append(\"<section id='add_button' class='color'></section>\");\n\t$(content).after(\"<section id='ok' class='color'>OK</section> \" +\n \"<section id='cancel' class='color_discreet'>Abbrechen</section>\");\n}", "function todoList() {\n var updateDiv = $(\".container\");\n for (var i=9; i <=17; i++){\n var newRow = $(\"<div>\").attr(\"class\",\"row\");\n var timeCol =$(\"<div>\").attr(\"class\",\"hour\");\n\n if ([i] <= 12) {\n timeCol.text([i] + \"a.m\");\n } \n else {\n timeCol.text(([i]-12) + \"p.m\");\n }\n\n var noteAdd = $(\"<textarea>\").attr(\"class\", \"description\");\n noteAdd.attr(\"hour-now\", [i]);\n noteAdd.attr(\"id\", `textarea${[i]}`);\n noteAdd.attr(\"value\",[i]);\n \n var saveBtn = $(\"<button>\").attr(\"class\", \"saveBtn\");\n var iconImg = $(\"<i>\").attr(\"class\",\"far fa-save fa-2x\")\n \n updateDiv.append(newRow);\n newRow.append(timeCol);\n newRow.append(noteAdd);\n newRow.append(saveBtn);\n saveBtn.append(iconImg);\n }\n}", "function add_note_button(q_id){\n $(\".alert-notice\").hide();\n $('.view_comment_class').hide();\n $('.edit_comment_class').hide();\n $('.archive_comment_class').hide();\n //$('#add_comment_button_bottom_div_'+ q_id).hide();\n $('#add_comment_button_top_div_'+ q_id).hide();\n //$('#{questionid}new_note_text').text(\"\");\n $('#add_comment_block_div_'+ q_id).show();\n}", "function displayBook(book){\n //get the div where books will be displayed\n let displayDiv = document.querySelector('.library');\n\n //add new book entry div\n let bookEntry = document.createElement('div');\n bookEntry.setAttribute('data-index', book.numID.toString());\n displayDiv.appendChild(bookEntry);\n\n //add paragraph with book info\n let bookInfo = document.createElement('p');\n bookInfo.innerHTML = book.info();\n bookEntry.appendChild(bookInfo);\n\n //add remove button\n let removeButton = document.createElement('button');\n removeButton.innerHTML = \"Remove\";\n removeButton.addEventListener('click', deleteEntry);\n bookEntry.appendChild(removeButton);\n\n //add read status button\n let readButton = document.createElement('button');\n readButton.innerHTML = \"Change Read Status\";\n readButton.addEventListener('click', changeReadStatus);\n bookEntry.appendChild(readButton); \n}", "function displayTask(task) {\r\n\r\n let itemIndex = task.id;\r\n\r\n let itemDiv = document.createElement(\"div\");\r\n itemDiv.id = \"tn\" + itemIndex;\r\n itemDiv.className = \"taskNote fade-in\";\r\n let noteAdd = document.getElementById(\"tasks\").appendChild(itemDiv);\r\n\r\n let textDiv = document.createElement(\"div\");\r\n textDiv.className = \"taskText\";\r\n textDiv.innerHTML = task.details;\r\n let textAdd = document.getElementById(itemDiv.id).appendChild(textDiv);\r\n\r\n let timeDiv = document.createElement(\"div\");\r\n timeDiv.className = \"dateTime\";\r\n timeDiv.innerHTML = task.date + \"<br />\" + task.time;\r\n let timeAdd = document.getElementById(itemDiv.id).appendChild(timeDiv);\r\n\r\n let iconDiv = document.createElement(\"div\");\r\n iconDiv.id = \"di\" + itemIndex;\r\n iconDiv.className = \"del\";\r\n let iconDivAdd = document.getElementById(itemDiv.id).appendChild(iconDiv);\r\n\r\n let delButton = document.createElement(\"button\");\r\n delButton.className = \"delInv glyphicon glyphicon-trash\";\r\n let delButtonAdd = document.getElementById(iconDiv.id).appendChild(delButton);\r\n\r\n let spaceAdd = document.getElementById(iconDiv.id).innerHTML += \"&nbsp;&nbsp;\";\r\n\r\n let editButton = document.createElement(\"button\");\r\n editButton.className = \"edInv glyphicon glyphicon-pencil\";\r\n let editButtonAdd = document.getElementById(iconDiv.id).appendChild(editButton);\r\n\r\n deleteButtons();\r\n editButtons();\r\n\r\n}", "function createCommentElement(comm){\n \n var commentElem = $(\"<li id='Comment\"+comm.id+\"' class='comment'></li>\"); //New JQuery <li> element\n var btnContainer = $(\"<div class='manage-comments'></div>\"); //Create Manage comments container\n var dateCreated;\n var dateUpdated;\n var options = { /*weekday: 'long',*/ year: 'numeric', month: 'long', day: 'numeric',hour:'numeric',minute:'numeric' }; //Options for date formatting\n \n // Format dates\n if( !isNaN(Date.parse(comm.dateCreate)) ){\n dateCreated = new Date(comm.dateCreate).toLocaleString('en-GB', options); //format date\n }else{\n dateCreated = 'Unknown';\n }\n if( !isNaN(Date.parse(comm.dateModif)) ){\n dateUpdated = new Date(comm.dateModif).toLocaleString('en-GB', options); //format date\n }else{\n dateUpdated = 'Never';\n }\n \n //Add needed fields to commet element\n commentElem.append(\"<div class='comm-title'><h3>\" + comm.title + \"</h3></div>\")\n .append(\"<div class='comm-author comm-details'><strong>Posted by: </strong><em>\" + comm.userName + \"</em></div>\")\n .append(\"<div class='comm-created comm-details'><strong>on: </strong><em>\" + dateCreated + \"</em></div>\")\n .append(\"<div class='comm-updated comm-details'><strong>Updated: </strong><em>\"+dateUpdated+\"</em></div>\")\n .append(\"<div class='clearfix'></div>\")\n .append(\"<div class='comm-content'><p>\" + comm.content +\"</p></div>\")\n .append(btnContainer);\n \n //If owner user is logged add edit and delete buttons\n //If user is not owner but is admin add only delete button\n if(comm.userId === user.loggedUserId){\n btnContainer.append($(\"<button class='edit-article purple'><span><i class='fa fa-pencil-square'></i></span>Edit</button>\").click(editCommentClick))\n .append($(\"<button class='delete-article red'><span><i class='fa fa-trash'></i></span>Delete</button>\").click(deleteCommentClick));\n } \n else if(user.isAdmin){\n btnContainer.append($(\"<button class='delete-article red'><span><i class='fa fa-trash'></i></span>Delete</button>\").click(deleteCommentClick));\n }\n \n return commentElem;\n \n}//END createCommentElement", "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 }", "function DisplayToHtml(title,dec,dueDate,status){\n let tasksContainer = document.getElementById('tasks-container');\n // make the html to append it to a new div\n let html = `\n <h3 class=\"title\">${title}</h3>\n <h4 class=\"discription\" >${dec}</h4>\n <h6 class=\"time\">${dueDate}</h6>\n <h1 class=\"link hides\">x</h1>\n <h1 class=\"complete hides\"><span class=\"glyphicon glyphicon-ok\"></span></h1>\n <i class=\"glyphicon glyphicon-edit edit-icon hides\" style=\"font-size: 20px; position:absolute;top: 0; right: 0;\"></i>\n `;\n // create a new div to store into it \n let div = document.createElement('div');\n //some styles\n div.classList = 'ToDo-container list-group-item list-group-item-priamry';\n div.style.marginBottom = '20px';\n // append the html to the div\n div.innerHTML = html;\n\n // if there is no task but this task at top\n if(!tasksContainer.lastElementChild){\n div.style.order = 1 ;\n }else{ // else but it above the first task\n div.style.order = tasksContainer.lastElementChild.style.order - 13 ;\n }\n\n // check is status of the task from the local storage is finshed or not \n if(status){\n div.style.order = div.lastElementChild.style.order + 7;\n div.style.cssText += 'background-color:green; color:white;'\n div.getElementsByClassName('link')[0].classList.add('hides');\n div.getElementsByClassName('complete')[0].classList.add('hides');\n div.getElementsByClassName('edit-icon')[0].classList.remove('hides');\n }\n\n // append the div and buttons to html or the buttons to there arrays \n TaskContainer.unshift(div);\n tasksContainer.appendChild(div);\n CheckIcon.unshift(div.getElementsByClassName('complete')[0]);\n DeletIcons.unshift(div.getElementsByClassName('link')[0]);\n EditIicons.unshift(div.getElementsByClassName('edit-icon')[0]);\n\n // call these functions to add the listeners to the buttons\n DeleteButtons()\n Hover();\n DoneTask();\n EditIicon();\n closeForm();\n}", "function renderNote(newNote) {\n var div = document.createElement(\"div\"),\n remove = document.createElement(\"span\"),\n title = document.createElement(\"h6\"),\n text = document.createElement(\"p\"),\n favorite = document.createElement(\"span\"),\n tags = document.createElement(\"span\");\n\n div.className = \"note-list__item\";\n remove.className = \"note-list__del\";\n favorite.className = \"note-list__pin\";\n tags.className = \"note-list-tags\";\n text.className = \"note-list__text\";\n title.className = \"note-list__head\";\n\n \n remove.innerHTML =\"<img class='icon-cancel' src='./img/icons8-cancel-50.png' width='25px' height='auto'/>\"\n text.innerHTML = newNote.noteText;\n title.innerHTML = newNote.noteHead;\n\n addRemoveListner(remove, newNote);\n div.setAttribute(\"data-item-number\", (newNote.noteId));\n div.appendChild(remove);\n div.appendChild(title);\n if (noteHead.value.length > 0) {\n title.style.marginBottom = \"10px\"\n }\n div.appendChild(text);\n div.appendChild(favorite);\n div.appendChild(tags);\n mainDiv.insertBefore(div, mainDiv.firstChild);\n headVisible(mainDiv, document.querySelector(\".note-list__main-head\"));\n div.style.background = newNote.colorBg; \n // Knocking down the background of the main unit\n if (text.innerHTML.length < 51) {\n text.style.lineHeight = \"30px\";\n text.style.fontSize = \"27px\";\n } else if (text.innerHTML.length < 81) {\n text.style.lineHeight = \"25px\";\n text.style.fontSize = \"20px\";\n }\n if (!title.innerHTML) {\n title.style.marginBottom = \"0px\";\n } else {\n title.style.marginBottom = \"10px\";\n }\n\n addTag(); // Tag add function\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 createNoteButtons(buttonInfo) {\n // create a div element to hold the buttons in\n let div = document.createElement(\"div\");\n let buttons = [];\n\n // create a button each button object defined in buttonInfo\n buttonInfo.forEach(function(setOfInfo) {\n let button = createButton();\n let buttonText = document.createTextNode(setOfInfo.label);\n button.appendChild(buttonText);\n setOfInfo.classes.forEach(classItem => button.classList.add(classItem));\n\n //put each button in the buttons array\n buttons.push(button);\n })\n\n //put the buttons in the div\n buttons.forEach(button => div.appendChild(button));\n \n return div;\n}", "function createNote() {\n //object that wraps each note and its delete link\n var $note_div = $(\"<div/>\")\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //select the delete-all button\n var $deleteAllButton = $(\"#delete-all\")\n //create a delete link for each added note\n var $delLink = $('<a>delete</a>').attr({ \n href: \"#\",\n class: \"del-link\"\n });\n //adds a click listener to the delete link\n $delLink.on(\"click\", function () {\n deleteNote(this); \n });\n\n //set content for note\n $note.html($note_text.val());\n //append note and delete link to note_div\n $note_div.append($note);\n $note_div.append($delLink);\n //hide new note_div to setup fadeIn...\n $note_div.hide();\n //append note_div to note-output\n $(\".note-output\").append($note_div);\n\n //fadeIn hidden new note_div and conditionally \n // the deleteAllButton\n if ($deleteAllButton.is(\":hidden\"))\n $deleteAllButton.fadeIn(\"slow\");\n $note_div.fadeIn(\"slow\");\n $note_text.val(\"\");\n }\n }", "function createNoteByClick() {\n var newDate = new Date();\n var noteId = newDate.getTime();\n bq.setAttribute(\"id\", \"note-\" + noteId);\n bq.innerText = null;\n localStorage.setItem(noteId, \"\");\n bq.focus();\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}", "createDOMElements(){\n // Main Book Container Div\n let bookContainer = document.createElement(\"div\");\n bookContainer.classList.add(\"book\");\n bookContainer.dataset.id = this.id;\n //Details Div\n let bookDetailsContainer = document.createElement(\"div\");\n bookDetailsContainer.classList.add(\"bookdetails\");\n //Book Name Heading\n let bookNameH2 = document.createElement(\"h2\");\n // Complete/Incomplete and Author name Container\n let completeAuthorContainer = document.createElement(\"div\");\n completeAuthorContainer.classList.add(\"complete-author\");\n // Completed or Not Completed text Content\n let compIncompPara = document.createElement(\"p\");\n //Author name textContent\n let authorSpan = document.createElement(\"span\");\n \n // Container for Buttons\n let btnContainer = document.createElement(\"div\");\n btnContainer.classList.add(\"btn-container\");\n //Edit Book Btn\n let btnEdit = document.createElement(\"button\");\n btnEdit.classList.add(\"btn\",\"btn-primary\");\n //Remove Book Btn\n let btnRemove = document.createElement(\"button\");\n btnRemove.classList.add(\"btn\",\"btn-danger\");\n //Toggle Complete and Incomplete Reading Book Btn\n let btnToggleComplete = document.createElement(\"button\");\n btnToggleComplete.classList.add(\"btn\",\"btn-warning\");\n\n //Adding TextContents\n bookNameH2.textContent = this.bookName;\n compIncompPara.textContent = this.isCompleted ? \"Completed\" : \"Not Completed\";\n authorSpan.textContent = \"~ \"+ this.bookAuthor;\n btnEdit.textContent = \"Edit\";\n btnRemove.textContent = \"Remove\";\n btnToggleComplete.textContent = `Mark as ${this.isCompleted ? \"Completed\" : \"Not Completed\"}`;\n \n //Apending Content to Main Containers\n completeAuthorContainer.append(compIncompPara,authorSpan);\n bookDetailsContainer.append(bookNameH2,completeAuthorContainer);\n btnContainer.append(btnEdit,btnRemove,btnToggleComplete);\n bookContainer.append(bookDetailsContainer,btnContainer);\n //Event Listeners\n btnEdit.addEventListener(\"click\",()=>{\n FormBookModal(\"edit\",this);\n });\n btnRemove.addEventListener(\"click\",()=>{\n let index = myLibrary.filter((book)=>{\n if(book.id === this.id)\n return true;\n });\n myLibrary.splice(index.id-1,1);\n updateToDOM();\n saveAllToLocalStorage();\n });\n btnToggleComplete.addEventListener(\"click\",()=>{\n this.toggleIsCompleted();\n btnToggleComplete.textContent = `Mark as ${this.isCompleted ? \"Completed\" : \"Not Completed\"}`;\n compIncompPara.textContent = this.isCompleted ? \"Completed\" : \"Not Completed\";\n updateToDOM();\n saveAllToLocalStorage();\n });\n return bookContainer;\n }", "function createButtons () {\r\n $(\".toc-parent\").prepend (\"<button>+</button>\");\r\n $(\".toc-leaf\").prepend (\"<button>.</button>\");\r\n}", "function showTasksOnPage() {\r\n //clears notes that exist- if there are any\r\n document.getElementById(\"shoeNotesFromLS\").innerHTML = \"\";\r\n if (localStorage.tasks) {\r\n tasks = JSON.parse(localStorage.tasks);\r\n for (let task of tasks){\r\n //the following DOM commands create all the HTML elements taht appear on each note\r\n let divOfTask = document.createElement(\"div\");\r\n //(I put the button in a div so that I will be able to do float:right and the X will apear on the top right corner of the note)\r\n let divOfButton = document.createElement(\"div\");\r\n let button = document.createElement(\"input\");\r\n let POfText = document.createElement(\"p\");\r\n let DivOfDate = document.createElement(\"div\");\r\n let DivOfTime = document.createElement(\"div\");\r\n\r\n //the following DOM commands create attributes, set there values and add them to the elements created above\r\n //creates id attribute for each note - the id of each note is the same id of the task (set when adding a new task to array of tasks)\r\n let attrIDOfNote = document.createAttribute(\"id\");\r\n attrIDOfNote.value = task.id;\r\n divOfTask.setAttributeNode(attrIDOfNote);\r\n \r\n let classAttribute = document.createAttribute(\"class\");\r\n classAttribute.value = \"col-sm-12 col-lg-3 card myNote\";\r\n divOfTask.setAttributeNode(classAttribute);\r\n\r\n let attr = document.createAttribute(\"class\");\r\n attr.value = \"card-body text-center myText\";\r\n POfText.setAttributeNode(attr);\r\n\r\n\r\n let ClassType = document.createAttribute(\"type\");\r\n ClassType.value = \"button\";\r\n let ClassValue = document.createAttribute(\"class\");\r\n ClassValue.value = \"myButton\";\r\n let attrValue = document.createAttribute(\"value\");\r\n attrValue.value = \"X\";\r\n button.setAttributeNode(ClassType);\r\n button.setAttributeNode(ClassValue);\r\n button.setAttributeNode(attrValue);\r\n button.addEventListener(\"click\",function(){\r\n deleteTask(task.id)\r\n });\r\n POfText.innerText = task.text;\r\n DivOfDate.innerText = task.date;\r\n DivOfTime.innerText = task.time;\r\n divOfButton.append(button);\r\n divOfTask.append(divOfButton, POfText, DivOfDate, DivOfTime);\r\n document.getElementById(\"shoeNotesFromLS\").appendChild(divOfTask);\r\n }\r\n }\r\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 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 createNoteDiv(note) {\r\n\r\n note.tags.forEach((item) => {\r\n //changed to handle image tags\r\n switch (item) {\r\n case \"F\":\r\n xTagFunTrue = true;\r\n break;\r\n case \"M\":\r\n xTagMetaTrue = true;\r\n break;\r\n case \"U\":\r\n xTagUrgentTrue = true;\r\n break;\r\n }\r\n });\r\n\r\n var dateString = note.date.toLocaleDateString();\r\n\r\n /**number means level of div child from main-parent */\r\n //0. new element: main div wrapper\r\n var newMainDiv = document.createElement(\"DIV\");\r\n newMainDiv.setAttribute(\"class\", \"individualNote\");\r\n newMainDiv.setAttribute(\"id\", \"new-main-div\" + note.number);\r\n newMainDiv.setAttribute(\"js-noteDiv\", note.number)\r\n document.getElementById(\"main-parent\").appendChild(newMainDiv);\r\n\r\n // 1. new element changed innerhtml to createElement for security \r\n var xTitle = document.createElement(\"div\");\r\n xTitle.setAttribute(\"id\", \"new-title-div\" + note.number);\r\n xTitle.setAttribute(\"class\", \"newNoteTopTitle\");\r\n xTitle.textContent = note.title;\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xTitle);\r\n\r\n // 1. first element inside note: subject\r\n var xSubject = document.createElement(\"div\");\r\n xSubject.setAttribute(\"id\", \"new-subject-div\" + note.number);\r\n xSubject.setAttribute(\"class\", \"subjectInNote\");\r\n xSubject.textContent = note.subject;\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xSubject);\r\n\r\n // 1. new vote div\r\n var newVoteDiv = document.createElement(\"DIV\");\r\n newVoteDiv.setAttribute(\"id\", \"new-vote-div\" + note.number);\r\n newVoteDiv.setAttribute(\"class\", \"voteDiv\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(newVoteDiv);\r\n\r\n // 2. vote number\r\n var newVotetext = document.createElement(\"p\");\r\n newVotetext.innerHTML = note.voteNumber;\r\n newVotetext.setAttribute(\"id\", \"vote-n-\" + note.number);\r\n newVotetext.setAttribute(\"class\", \"voteNumber\");\r\n newVotetext.setAttribute(\"js-noteVote\", \"\")\r\n document.getElementById(\"new-vote-div\" + note.number).appendChild(newVotetext);\r\n\r\n // 2. vote button\r\n var newVoteButton = document.createElement(\"input\");\r\n newVoteButton.setAttribute(\"id\", \"vote-b-\" + note.number);\r\n newVoteButton.setAttribute(\"js-access\", \"\");\r\n newVoteButton.src = \"upvote3.png\";\r\n newVoteButton.type = \"image\";\r\n newVoteButton.setAttribute(\"class\", \"voteButton\");\r\n document.getElementById(\"new-vote-div\" + note.number).appendChild(newVoteButton);\r\n\r\n // 1. second element inside note: noteinfo wrapper div\r\n var xNoteinfo = document.createElement(\"div\");\r\n xNoteinfo.setAttribute(\"id\", \"new-note-info-div\" + note.number);\r\n xNoteinfo.setAttribute(\"class\", \"noteInfo\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xNoteinfo);\r\n\r\n // 2. NAME\r\n var xName = document.createElement(\"div\");\r\n xName.setAttribute(\"id\", \"new-tags-div\" + note.number);\r\n xName.setAttribute(\"class\", \"usernameMadenote\");\r\n xName.textContent = xName2;\r\n document.getElementById(\"new-note-info-div\" + note.number).appendChild(xName);\r\n\r\n // 2. DATE element inside noteinfo wrapper div\r\n var xDate = document.createElement(\"div\");\r\n xDate.setAttribute(\"id\", \"new-date-div\" + note.number);\r\n xDate.setAttribute(\"class\", \"dateInNote\");\r\n xDate.textContent = dateString;\r\n document.getElementById(\"new-note-info-div\" + note.number).appendChild(xDate);\r\n\r\n // 1. TAG element tagwrapper\r\n var tagWrapper = document.createElement(\"div\");\r\n tagWrapper.setAttribute(\"id\", \"tagwrapper\" + note.number);\r\n tagWrapper.setAttribute(\"class\", \"tagwrapper\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(tagWrapper);\r\n\r\n // 2.TagFun\r\n var xTagFun = document.createElement(\"img\");\r\n xTagFun.setAttribute(\"src\", \"fun10.png\");\r\n xTagFun.setAttribute(\"class\", \"funloggaInNote\");\r\n if (xTagFunTrue) {\r\n document.getElementById(\"tagwrapper\" + note.number).appendChild(xTagFun);\r\n xTagFunTrue = false;\r\n dontJudgeMe = true;\r\n };\r\n\r\n // 2.TagMeta\r\n var xTagMeta = document.createElement(\"img\");\r\n xTagMeta.setAttribute(\"src\", \"meta10.png\");\r\n xTagMeta.setAttribute(\"class\", \"metaloggaInNote\");\r\n if (xTagMetaTrue) {\r\n document.getElementById(\"tagwrapper\" + note.number).appendChild(xTagMeta);\r\n xTagMetaTrue = false;\r\n dontJudgeMe = true;\r\n };\r\n\r\n // 2.TagUrgent\r\n var xTagUrgent = document.createElement(\"img\");\r\n xTagUrgent.setAttribute(\"src\", \"urgent10.png\");\r\n xTagUrgent.setAttribute(\"class\", \"urgentloggaInNote\");\r\n if (xTagUrgentTrue) {\r\n document.getElementById(\"tagwrapper\" + note.number).appendChild(xTagUrgent);\r\n xTagUrgentTrue = false;\r\n dontJudgeMe = true;\r\n };\r\n\r\n // 2. show Replys \r\n var showReplyButton = document.createElement(\"input\");\r\n showReplyButton.setAttribute(\"id\", \"ReplyButton\" + note.number);\r\n showReplyButton.setAttribute(\"js-access\", \"\");\r\n showReplyButton.src = \"omegapog2.png\";\r\n showReplyButton.type = \"image\";\r\n showReplyButton.setAttribute(\"class\", \"showReplyButton\");\r\n document.getElementById(\"new-date-div\" + note.number).appendChild(showReplyButton);\r\n\r\n // 2. comment numbers \r\n var showCommentsNumbers = document.createElement(\"b\");\r\n showCommentsNumbers.setAttribute(\"id\", \"commentNumbers\" + note.number);\r\n showCommentsNumbers.setAttribute(\"class\", \"commentNumbers\");\r\n showCommentsNumbers.innerText = \"0 comments\";\r\n document.getElementById(\"new-date-div\" + note.number).appendChild(showCommentsNumbers);\r\n\r\n // 1. third element inside note: replay wrapper div\r\n var xReplyParent = document.createElement(\"div\");\r\n xReplyParent.setAttribute(\"id\", \"new-reply-parent-div\" + note.number);\r\n xReplyParent.setAttribute(\"class\", \"replyParent hidden\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xReplyParent);\r\n\r\n // 2. Reply button element\r\n var xReplyButton = document.createElement(\"button\");\r\n xReplyButton.setAttribute(\"id\", \"new-title-reply-button\" + note.number);\r\n xReplyButton.setAttribute(\"class\", \"replyButton\");\r\n xReplyButton.innerText = \"Reply\";\r\n document.getElementById(\"new-reply-parent-div\" + note.number).appendChild(xReplyButton);\r\n\r\n // 2. Reply textarea element\r\n var xReplyTextarea = document.createElement(\"textarea\");\r\n xReplyTextarea.setAttribute(\"id\", \"new-title-reply-textarea\" + note.number);\r\n xReplyTextarea.setAttribute(\"class\", \"replyTextarea\");\r\n xReplyTextarea.setAttribute(\"maxlength\", \"100\");\r\n document.getElementById(\"new-reply-parent-div\" + note.number).appendChild(xReplyTextarea);\r\n\r\n // 2. Replay child element wrapper\r\n var xReplyChild = document.createElement(\"div\");\r\n xReplyChild.setAttribute(\"id\", \"new-reply-child-div\" + note.number);\r\n xReplyChild.setAttribute(\"class\", \"replyChild\");\r\n document.getElementById(\"new-reply-parent-div\" + note.number).appendChild(xReplyChild);\r\n\r\n // 2. Top Secret Eyes Closed\r\n if (dontJudgeMe) {\r\n document.getElementById(\"new-reply-parent-div\" + note.number).style.top = \"-220px\";\r\n dontJudgeMe = false;\r\n }\r\n\r\n // create theme color \r\n colorSnumber = note.number;\r\n colorS();\r\n note.colorReplyTheme = colorSaver;\r\n \r\n\r\n // animation note creation\r\n document.getElementById(\"new-main-div\" + colorSnumber).style.opacity = 0.0\r\n let b = 0;\r\n let z = 0;\r\n let ani = 0; \r\n\r\n function aniMation() {\r\n ani = setInterval(function() { \r\n document.getElementById(\"new-main-div\" + colorSnumber).style.opacity = b; \r\n b = z*5*0.01; \r\n z++;\r\n }, 25);\r\n }\r\n\r\n aniMation();\r\n setTimeout(function(){ \r\n clearTimeout(ani);\r\n }, 550);\r\n\r\n\r\n\r\n\r\n // setting eventlistener to reply button. Adds data from textfield to new div in reply parent div\r\n document.getElementById(\"new-title-reply-button\" + note.number)\r\n .addEventListener(\"click\", function () {\r\n var newReply = document.createElement(\"DIV\");\r\n var userReplyText = document.getElementById(\"new-title-reply-textarea\" + note.number).value;\r\n if (userReplyText == \"\") { } else {\r\n newReply.innerText = xName2 + \" \" + \"said: \" + userReplyText;\r\n document\r\n .getElementById(\"new-reply-child-div\" + note.number)\r\n .prepend(newReply);\r\n //changed order tp push newest reply first \r\n newReply.setAttribute(\"id\", \"reply-div\" + note.number); \r\n document.getElementById(\"reply-div\" + note.number).style.backgroundColor = colorSarray[note.colorReplyTheme].replyDiv;\r\n newReply.setAttribute(\"class\", \"reply\");\r\n document.getElementById(\"new-title-reply-textarea\" + note.number).value = \"\";\r\n note.replies.push(userReplyText);\r\n //added comment counter\r\n document.getElementById(\"commentNumbers\" + note.number).innerText = note.replies.length + \" comments\";\r\n }\r\n });\r\n\r\n //open replay window up or close..\r\n document.getElementById(\"ReplyButton\" + note.number).addEventListener(\"click\", function () {\r\n toggleDisplay(document.getElementById(\"new-reply-parent-div\" + note.number));\r\n });\r\n\r\n //vote function\r\n document.getElementById(\"vote-b-\" + note.number).addEventListener(\"click\", () => {\r\n note.voteNumber++;\r\n document.getElementById(\"vote-n-\" + note.number).innerHTML = note.voteNumber;\r\n });\r\n}", "function addsButton(element) {\n\t\tvar buttonsDiv = document.createElement('div');\n\t\tbuttonsDiv.className = 'ml-auto btn-group list-group-btn';\n\t\tbuttonsDiv.innerHTML = `<!--\n\t\t \t\t--><span class=\"btn px-2 btn-sm btn-edit btn-secondary\" data-toggle=\"modal\" data-target=\"#editModal\"><svg style=\"width:16px;height:16px\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z\" /></svg></span><!--\n\t\t\t\t--><span class=\"btn px-2 btn-sm btn-up btn-secondary\"><svg style=\"width:16px;height:16px\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z\" /></svg></span><!--\n\t\t\t\t--><span class=\"btn px-2 btn-sm btn-down btn-secondary\"><svg style=\"width:16px;height:16px\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z\" /></svg></span><!--\n\t\t\t\t--><span class=\"btn px-2 btn-sm btn-delete btn-secondary text-danger mr-3\"><svg style=\"width:16px;height:16px\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z\" /></svg></span>\n\t\t\t</div>`;\n\t\telement.appendChild(buttonsDiv);\n\t}", "function addNote(e) {\n e.preventDefault();\n let newNote = document.createElement(\"div\");\n newNote.className = \"parent-note\";\n newNote.innerHTML = `<div class=\"my-note\" onclick=swapNotes(this)>\n <div class=\"x-btn-container\">\n <button type=\"button\" class=\"x-button\" onclick=deleteNote(this.parentNode.parentNode)>X</button>\n </div>\n <p> ${input.value} </p>\n <button type=\"button\" onclick=editNote(this.parentNode.parentNode)>Edit</button>\n </div>\n `;\n myNotes.appendChild(newNote);\n input.value = \"\";\n}", "function ViewNoteEdit() {\n\tthis.id = \"#view_noteedit\";\n\tthis.html = [\n\t\tzdiv, {id:\"top_div\", w:\"100%\", flt:\"left\", bkg:HeadBkg, mbottom:\"0px\",\n\t\t\tpad:\"10px\", b:\"1px solid black\", end:\">\"},\n\t\tzlbl, {id:\"noteburt\", text:\"NoteBurt\", flt:\"left\",\n\t\t\tf:\"1.5em \" + LogoFont, c:\"white\", textshadow:\"1px 1px 2px black\",\n\t\t\tmleft:\"10px\", end:\"tag\"},\n\t\tzlbl, {id:\"tab_name\", text:\"No Tab Selected\", flt:\"left\",\n\t\t\tf:HeadFont, c:HeadColor,\n\t\t\tmleft:\"30px\", pright:\"15px\", end:\"tag\"},\n\t\tzlbl, {id:\"note_title\", flt:\"left\",\n\t\t\tf:HeadFont, c:HeadColor,\n\t\t\tbleft:\"2px solid black\", pleft:\"15px\", end:\"tag\"},\n\t\tzend, zdiv,\n\t \n\t\t// left side of screen containing buttons and options\n\t\tzdiv, {id:\"options_div\", w:\"135px\", h:\"100%\", flt:\"left\", bkg:\"gray\"},\n\t\tzbtn, {id:\"close_btn\", text:\"Close\", clas:\"edit_btn\", end:\"tag\"},\n\t\tzbtn, {id:\"save_btn\", text:\"Save\", clas:\"edit_btn\", end:\"tag\"},\n\t\tzbtn, {id:\"delete_btn\", text:\"Delete\", clas:\"edit_btn\", end:\"tag\"},\n\t\tzbtn, {id:\"position_btn\", text:\"Position\", clas:\"edit_btn\", end:\"tag\"},\n\t\tzditto, '<label><input type=\"checkbox\" id=\"mono_chk\"/>Monospace</label><br>',\n\t\tzditto, '<label><input type=\"checkbox\" id=\"markdown_chk\"/>Markdown</label><br>',\n\t\tzditto, '<label><input type=\"checkbox\" id=\"html_chk\"/>HTML</label><br>',\n\t\tzditto, '<label><input type=\"checkbox\" id=\"view_chk\"/>View</label><br>',\n\t\tzend, zdiv,\n\n\t\t// right side of screen containing note content\n\t\tzdiv, {id:\"note_div\", w:\"80%\", h:\"95%\", flt:\"left\", overflow:\"auto\", pad:\"10px\"},\n\t\tztextarea, {id:\"notetext\", w:\"95%\", h:\"95%\", pad:\"10px\", tab:\"4\", bkg:\"transparent\", end:\"tag\"},\n\t\tzend, zdiv,\n\t \n\t\t// right side of screen containing html content\n\t\tzdiv, {id:\"html_div\", w:\"80%\", h:\"95%\", disp:\"none\", flt:\"left\", position:\"relative\",\n\t\t\tf:NoteFont,\tmaxwidth:NoteWidth, overflow:\"auto\",\n\t\t\tm:\"0px\", p:\"7px\", end:\"tag\"},\n\t]\n\tthis.css = [\n\t\t{ selector:\".edit_btn\",\n\t\t settings: {f:BaseFont, c:\"black\", bkg:Green1,\n\t\t\tb:\"1px solid black\", bradius:\"4px\", w:\"100px\", mleft:\"10px\", mtop:\"15px\"}\n\t\t},\n\t\t{ selector:\"#options_div label\",\n\t\t settings: {f:BaseFont, mtop:\"20px\", mleft:\"5px\", c:\"black\"}\n\t\t},\n\t\t{ selector:\"#options_div input[type='checkbox']\",\n\t\t settings: {mtop:\"15px\", mleft:\"5px\"}\n\t\t},\n\t]\n\tthis.build = function() {\n\t\tvar viewName = this.id.substring(1);\n\t\t$('body').append('<div id=\"' + viewName + '\" class=\"view\"></div>');\n\n\t\t$(this.id).css(\"height\", WinHeight-50);\n\t\t$(this.id).css(\"width\", WinWidth-50);\n\n\t\tvar html = GenHtml(this.html);\n\t\t$(this.id).html(html);\n\n\t\tvar css = GenCss(this.css);\n\t\tApplyCss(this.id, css);\n\n\t\tthis.events();\n\t}\n\tthis.display = function(refresh) {\n\t\t$(\"body\").css(\"background\", Gray1);\n\n\t\tif(refresh) {\n\t\t\t$(this.id + \" #notebook_name\").text(DataBookName);\n\t\t\t$(this.id + \" #tab_name\").text(DataTabs[DataTabid].tabName);\n\t\t\tif( DataNoteid ) {\n\t\t\t\tvar note = DataNotes[DataNoteid];\n\t\t\t\t$(this.id + \" #note_title\").text(note.title);\n\t\t\t\t$(this.id + \" #notetext\").val(note.content);\n\t\t\t\t$(this.id + \" #mono_chk\").prop(\"checked\", note.mono);\n\t\t\t\t$(this.id + \" #html_chk\").prop(\"checked\", note.html);\n\t\t\t\t$(this.id + \" #markdown_chk\").prop(\"checked\", note.markdown);\n\t\t\t} else { // new note\n\t\t\t\t$(this.id + \" #note_title\").text(\"\");\n\t\t\t\t$(this.id + \" #notetext\").val(\"\");\n\t\t\t\t$(this.id + \" #mono_chk\").prop(\"checked\", false);\n\t\t\t\t$(this.id + \" #html_chk\").prop(\"checked\", false);\n\t\t\t\t$(this.id + \" #markdown_chk\").prop(\"checked\", false);\n\t\t\t}\n\t\t\tif( $(this.id + \" #mono_chk\").prop(\"checked\") ) {\n\t\t\t\t$(this.id + \" #notetext\").css(\"font\", MonoFont);\n\t\t\t} else {\n\t\t\t\t$(this.id + \" #notetext\").css(\"font\", NoteFont); \n\t\t\t}\n\t\t\t$(this.id + \" #view_chk\").prop(\"checked\",false);\n\t\t\t$(this.id + \" #html_div\").hide(); \n\t\t\t$(this.id + \" #note_div\").show(); \n\t\t}\n\t\t$(this.id).show();\n\t}\n\tthis.events = function() {\n\t\tvar viewid = this.id;\n\t\tvar thisView = this;\n\t\t$(viewid + \" #close_btn\").click(function() {\n\t\t\tif( noteChanged ) {\n\t\t\t\tvar okFunc = function() {\n\t\t\t\t\tnoteChanged = false;\n\t\t\t\t\t$(viewid).hide();\n\t\t\t\t\tHub.viewNoteEditClose();\n\t\t\t\t};\n\t\t\t\tConfirm(\"Confirm\", \"Changes Not Saved, Close Anyway ?\", okFunc);\n\t\t\t} else {\n\t\t\t\t$(viewid).hide();\n\t\t\t\tHub.viewNoteEditClose();\n\t\t\t}\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #position_btn\").click(function() {\n\t\t\tif( DataNoteid == undefined ) {\n\t\t\t\tNotice(\"note must be saved before changing its position\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tViews.position.display();\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #save_btn\").click(function() {\n\t\t\tthisView.saveNote();\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #delete_btn\").click(function() {\n\t\t\tif( DataNoteid == undefined ) {\n\t\t\t\tNotice(\"Note has not been saved.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tConfirm(\"Confirm\", \"Delete This Note\", function() { thisView.deleteNote(DataNoteid); })\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #mono_chk\").change(function() {\n\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t$(viewid + \" #notetext\").css(\"font\", MonoFont);\n\t\t\t\t$(viewid + \" #html_div\").css(\"font\", MonoFont);\n\t\t\t} else {\n\t\t\t\t$(viewid + \" #notetext\").css(\"font\", NoteFont); \n\t\t\t\t$(viewid + \" #html_div\").css(\"font\", NoteFont); \n\t\t\t}\n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #html_chk\").change(function() {\n\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t$(viewid + \" #markdown_chk\").prop(\"checked\", false);\n\t\t\t\tthisView.setHtmlFirstLine(); // makes 1st line an html comment for use as note title\n\t\t\t} \n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #markdown_chk\").change(function() {\n\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t$(viewid + \" #html_chk\").prop(\"checked\", false);\n\t\t\t\tthisView.setHtmlFirstLine(); // makes 1st line an html comment for use as note title\n\t\t\t} \n\t\t});\n\t\t// --------------------------------------------\n\t\t$(viewid + \" #view_chk\").change(function() {\n\t\t\tif( !$(this).prop(\"checked\") ) {\n\t\t\t\t$(viewid + \" #html_div\").hide(); \n\t\t\t\t$(viewid + \" #note_div\").show(); \n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar htmlChecked = $(viewid + \" #html_chk\").prop(\"checked\");\n\t\t\tvar markdownChecked = $(viewid + \" #markdown_chk\").prop(\"checked\");\n\t\t\tif(htmlChecked) {\n\t\t\t\tvar html = $(viewid + \" #notetext\").val();\n\t\t\t\t$(viewid + \" #html_div\").html(html);\n\t\t\t\t$(viewid + \" #note_div\").hide(); \n\t\t\t\t$(viewid + \" #html_div\").show();\n\t\t\t} else if(markdownChecked) {\n\t\t\t\tvar markdown = $(viewid + \" #notetext\").val();\n\t\t\t\tvar html = marked(markdown);\n\t\t\t\t$(viewid + \" #html_div\").html(html);\n\t\t\t\t$(viewid + \" #note_div\").hide(); \n\t\t\t\t$(viewid + \" #html_div\").show();\n\t\t\t} \n\t\t});\n\t\t// --------------------------------------------\n\t\t// handle tab keys in note text\n\t\t// --------------------------------------------\n\t\t$(document).delegate('#notetext', 'keydown', function(e) {\n\t\t\tnoteChanged = true;\n\t\t\tvar keyCode = e.keyCode || e.which;\n\t\t\tif ( keyCode == 9 ) { // tab key\n\t\t\t\te.preventDefault();\n\t\t\t\tvar text = $(this).val();\n\t\t\t\tvar domElement = $(this).get(0);\n\t\t\t\tvar start = domElement.selectionStart; // if no selection, position before cursor\n\t\t\t\tvar end = domElement.selectionEnd; // if no selection, position after cursor\n\t\t\t\t// set textarea value to: text before caret + tab + text after caret\n\t\t\t\t$(this).val(text.substring(0, start) + \"\\t\" + text.substring(end));\n\t\t\t\t// put caret at right position\n\t\t\t\tdomElement.selectionStart = domElement.selectionEnd = start + 1;\n\t\t\t}\n\t\t});\n\t}\n\tthis.setHtmlFirstLine = function() {\n\t\tvar content = $(this.id + \" #notetext\").val();\n\t\tvar\tlineFeed = content.indexOf(\"\\n\");\n\t\tif( lineFeed == -1 ) {\n\t\t\tvar firstLine = content;\n\t\t} else {\n\t\t\tvar firstLine = content.substring(0, lineFeed);\n\t\t}\n\t\tif( firstLine.indexOf(\"<!--\") == -1 ) {\n\t\t\t$(this.id + \" #notetext\").val(\"<!-- Note Description Here -->\\n\" + content);\n\t\t}\n\t}\n\tthis.saveNote = function() {\n\t\tvar path, httpMethod;\n\t\tvar requestData = {\n\t\t\tContent: \t$(this.id + \" #notetext\").val(),\n\t\t\tMono: \t\t$(this.id + \" #mono_chk\").prop(\"checked\"),\n\t\t\tHtml: \t\t$(this.id + \" #html_chk\").prop(\"checked\"),\n\t\t\tMarkdown: \t$(this.id + \" #markdown_chk\").prop(\"checked\"),\n\t\t\tPrevid: \t'', // only used for add, position\n\t\t}\n\t\tif(DataNoteid) {\n\t\t\thttpMethod = \"PUT\";\t\t// change note\n\t\t\tpath = \"note/\" + DataToken + \"/\" + DataBookid + \"/\" + DataTabid + \"/\" + DataNoteid;\n\t\t} else {\n\t\t\thttpMethod = \"POST\";\t// add note\n\t\t\tpath = \"note/\" + DataToken + \"/\" + DataBookid + \"/\" + DataTabid;\n\t\t\trequestData.Previd = DataLastNoteid; // for now add as last note, can be changed later\n\t\t}\n\t\tvar settings = {\n\t\t\turl: UrlPrefix + path,\n\t\t\tmethod: httpMethod,\n\t\t\tdata: JSON.stringify(requestData),\n\t\t\tdataType: \"text\", // returned from server\n\t\t}\n\t\t$(this.id + \" button\").prop(\"disabled\",true);\n\n\t\tvar viewid = this.id;\n\t\t$.ajax(settings)\n\t\t\t.done(function(response) {\n\t\t\t\tnoteChanged = false;\n\t\t\t\tif(httpMethod == \"POST\") { // new note\n\t\t\t\t\tDataNoteid = response;\n\t\t\t\t\tDataNotes[DataNoteid] = {};\n\t\t\t\t\tDataAddPrevid(DataNoteid, requestData.Previd); // see data.js\n\t\t\t\t\tDataBuildNoteOrder();\n\t\t\t\t}\n\t\t\t\t// save screen values to Data\n\t\t\t\tDataNotes[DataNoteid].content = requestData.Content;\n\t\t\t\tDataNotes[DataNoteid].when = new Date();\n\t\t\t\tDataNotes[DataNoteid].mono = requestData.Mono;\n\t\t\t\tDataNotes[DataNoteid].html = requestData.Html;\n\t\t\t\tDataNotes[DataNoteid].markdown = requestData.Markdown;\n\t\t\t\tDataNotes[DataNoteid].title = DataNoteTitle(DataNoteid);\n\t\t\t\t$(viewid + \" #note_title\").text(DataNotes[DataNoteid].title);\n\n\t\t\t\tNotice(\"Note Saved Successfully\");\n\t\t\t})\n\t\t\t.fail(function(xhr) {\n\t\t\t\tErr(\"Note Save Failed \\n\" + xhr.responseText);\n\t\t\t})\n\t\t\t.always(function() {\n\t\t\t\t$(viewid + \" button\").prop(\"disabled\",false);\n\t\t\t})\n\t}\n\tthis.deleteNote = function(deleteid) {\n\t\tvar viewid = this.id;\n\t\tvar path = \"note/\" + DataToken + \"/\" + DataBookid + \"/\" + DataTabid + \"/\" + deleteid;\n\t\tvar settings = {\n\t\t\turl: UrlPrefix + path,\n\t\t\tmethod: \"DELETE\",\n\t\t\tdataType: \"text\", // returned from server\n\t\t}\n\t\t$(viewid + \" button\").prop(\"disabled\",true);\n\n\t\t$.ajax(settings)\n\t\t\t.done(function(response) {\n\t\t\t\tDataDeletePrevid(deleteid); // changes previd on note following deleteid\n\t\t\t\tdelete DataNotes[deleteid];\n\t\t\t\tDataBuildNoteOrder();\n\t\t\t\tNotice(response);\n\t\t\t\tHub.noteDeleted();\n\t\t\t})\n\t\t\t.fail(function(xhr) {\n\t\t\t\tErr(\"Note Delete Failed \\n\" + xhr.responseText);\n\t\t\t})\n\t\t\t.always(function() {\n\t\t\t\t$(viewid + \" button\").prop(\"disabled\",false);\n\t\t\t})\n\t}\n}", "function addButtonClick(){\n\t\tvar note = Note();\n\t\tstorage.push(note);\n\t\tdisplayNotes();\n\n\t}", "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 createNote(){\n\t// Single function to get value from any input\n\tvar getVal = function(param){\n\t\treturn $get(param).value;\n\t};\n/*\n\t// function to add index numbers - param for id/class/element to count\n\t// Over complicated\n\tvar count = function(param){\n\t\tif (!!$get(param)){ // if there already are notes\n\t\t\treturn ($getAll(param).length) +1; // count them\n\t\t}\n\t\telse { // else this is the first note\n\t\t\treturn 1;\n\t\t}\t\n\t}\n*/\n//\tvar count = 0; // too simple, what if we start with notes?\n\n\n\tvar count = function() {\n\t\treturn ($getAll('.box').length) +1;\n\t} \n\n\tif ( !!(getVal('#noteText')) && !!(getVal('#colourPick')) ){ // if input not empty\n\t\n\t\tvar noteNumber = document.createTextNode(count());\n\n\t\tvar noteNumberPar = document.createElement('span');\n\t\t\tnoteNumberPar.className = 'noteNumber';\n\t\t\tnoteNumberPar.id ='noteNumber'+count();\n\t\t\tnoteNumberPar.appendChild(noteNumber);\n\n\t\tvar stickyText = document.createTextNode(getVal('#noteText'));\n\t\t\n\t\t// div template for sticky note\n\t\tvar template = document.createElement('div');\n\t\t\ttemplate.className = 'box';\n\t\t\t// get value of selected colour from dropdown menu\n\t\t\ttemplate.style.backgroundColor = getVal('#colourPick');\n\t\t\t// Call count function and concatonate with input text\t\n\t\t\ttemplate.appendChild(noteNumberPar);\n\t\t\ttemplate.appendChild(stickyText);\n\n\t\t$get('.container').appendChild(template); // add sticky to div.container \n\n\t\t// create textNode to append text into the remove button\n\t\tvar removeID = 'removeButton' + (count()-1)\n\t\tvar x = document.createTextNode('X')\n\t\tvar removeButton = document.createElement('div');\n\t\t\tremoveButton.className = 'removeButton';\n\t\t\tremoveButton.id = removeID;\n\t\t\t// append textNode to rmove button div\n\t\t\tremoveButton.appendChild(x);\n\t\t\n\t\t$getAll('.box')[($getAll('.box').length)-1].appendChild(removeButton);\n\n\t\t// to add event listeners with dynamic element creation\n\t\t// the function to be called must be wrapped in a function declaration\n\t\t$get('#'+removeID).addEventListener('click', removeNote)\n\n\t\t// clear fields ready for next sticky\n\t\t$get('#noteText').value = '';\n\t\treturn false;\n\t} else { // else show alert input is empty\n\t\talert('No note!');\n\t\treturn false;\n\t}\t\n}", "function appendButtons(listItem){\n var buttonDiv = document.createElement('div');\n buttonDiv.classList.add('buttonsContainer');\n var editButton = document.createElement(\"button\");\n editButton.title=\"Edit Task\";\n editButton.classList.add(\"actionButtons\");\n editButton.innerHTML =editSVG;\n editButton.addEventListener('click', editTask);\n\n var deleteButton = document.createElement(\"button\");\n deleteButton.title=\"Delete Task\";\n deleteButton.classList.add(\"actionButtons\");\n deleteButton.innerHTML =deleteSVG;\n deleteButton.addEventListener('click',removeItem);\n\n var completeButton = document.createElement(\"button\");\n completeButton.title=\"(Un)Complete Task\";\n completeButton.classList.add(\"actionButtons\");\n completeButton.innerHTML =completeSVG;\n completeButton.id=\"completeButton\";\n completeButton.addEventListener('click', completeTask);\n \n buttonDiv.appendChild(editButton);\n buttonDiv.appendChild(completeButton);\n buttonDiv.appendChild(deleteButton);\n listItem.appendChild(buttonDiv);\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=\"gbl-kg-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Kurzgeschichte</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"<!-- INFORMATIONEN ZUR ANPASSUNG IST UNTEN\\n-->{{Geschichten-Info 2013/Kurzgeschichte\\n<!-- unter dieser Linie nichts verändern -->\\n|LastUpdateHack={{{LastUpdateHack|{{REVISIONDAY2}}.{{REVISIONMONTH}}.{{REVISIONYEAR}}}}}\\n|Portal={{{Portal|}}}\\n|Name=\"+ wgPageNameRegexedSplit +\"\\n}}<noinclude>{{Geschichten-Info/Autoren-Werkzeugkasten}}[[Kategorie:Angepasste Geschichtenbalken]]</noinclude>\";\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(\"Sollte alles mit 'OK' funktionieren. ###### ACHTUNG ##### geht nur in Geschichtenübersicht.\", 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 view_note_button(c_id, q_id){\n $(\".alert-notice\").hide();\n $('.view_comment_class').hide();\n $('.edit_comment_class').hide();\n $('.archive_comment_class').hide();\n $('#lastet_comment_div_'+ q_id).hide();\n $('#edit_comment_div_'+ c_id).hide();\n $('#archive_comment_div_'+ c_id).hide();\n $('#add_comment_block_div_'+ q_id).hide();\n $('#view_comment_div_'+ c_id).show();\n $('#add_comment_button_top_div_'+ q_id).show();\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 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=\"gbl-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Geschichtenbalken: normal</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"<!-- INFORMATIONEN ZUR ANPASSUNG IST UNTEN\\n-->{{Geschichten-Info 2013\\n<!-- unter dieser Linie nichts verändern -->\\n|LastUpdateHack={{{LastUpdateHack|{{REVISIONDAY2}}.{{REVISIONMONTH}}.{{REVISIONYEAR}}}}}\\n|Portal={{{Portal|}}}\\n|Name=\"+ wgPageNameRegexedSplit +\"\\n}}<noinclude>{{Geschichten-Info/Autoren-Werkzeugkasten}}[[Kategorie:Angepasste Geschichtenbalken]]</noinclude>\";\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(\"Sollte alles mit 'OK' funktionieren. ###### ACHTUNG ##### geht nur in Geschichtenübersicht.\", 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 createBtnDelete(obj) {\n let btnDelete = document.createElement(\"button\");\n btnDelete.id = \"delete-button\";\n btnDelete.className = \"note-button\";\n\n btnDelete.addEventListener(\"click\", function () {\n obj.removeNote();\n });\n btnDelete.appendChild(createImgDelete());\n return btnDelete;\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=\"thema-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Thema</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"One Piece\";\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(\"Thema der Geschichte 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}", "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=\"autor1-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Autor1</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Ersten Autor der Geschichte 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}", "function showDisplay(date, day) {\r\n\tlet titleDate = document.getElementById(\"dayMonthAndYear\");//header of calendar\r\n\tlet display = document.getElementById(\"display\"); // body of the calendar\r\n\r\n\t// clearing previous display\r\n\ttitleDate.innerHTML = \"\";\r\n\tdisplay.innerHTML = \"\";\r\n\r\n\ttitleDate.innerHTML = day + \" \" + months[currentMonth] + \" \" + currentYear;\r\n\tlet check = false;\r\n\r\n\r\n\r\n\tfor (let i = 0; i < projects.length; i++) {\r\n\t\tif (projects[i].dueDate == date) {\r\n\t\t\tlet node = document.createElement(\"LI\");\r\n\t\t\tconst link = document.createElement(\"a\");\r\n\t\t\tlink.href = \"/projects/\" + projects[i].id;\r\n\t\t\tlet textNode2 = document.createTextNode(projects[i].name);\r\n\t\t\tlink.appendChild(textNode2);\r\n\t\t\tlink.title = projects[i].name;\r\n\t\t\tlet textNode1 = document.createTextNode(\"Project: \");\r\n\t\t\tnode.appendChild(textNode1);\r\n\t\t\tnode.appendChild(link);\r\n\t\t\tdisplay.appendChild(node);\r\n\t\t\tcheck = true;\r\n\t\t}\r\n\t}\r\n\tfor (let i = 0; i < tasks.length; i++) {\r\n\t\tif (tasks[i].dueDate == date) {\r\n\t\t\tlet node = document.createElement(\"LI\");\r\n\t\t\tconst link = document.createElement(\"a\");\r\n\t\t\tlink.href = \"/tasks/\" + tasks[i].id;\r\n\t\t\tlet textNode2 = document.createTextNode(tasks[i].name);\r\n\t\t\tlink.appendChild(textNode2);\r\n\t\t\tlink.title = tasks[i].name;\r\n\t\t\tlet textNode1 = document.createTextNode(\"Task: \");\r\n\t\t\tnode.appendChild(textNode1);\r\n\t\t\tnode.appendChild(link);\r\n\t\t\tdisplay.appendChild(node);\r\n\t\t\tcheck = true;\r\n\r\n\t\t}\r\n\t}\r\n\taddButton1();//Add button through Dom for Creating Project\r\n\taddButton2();//Add button through Dom for Creating Task\r\n\tif (!check) {\r\n\t\tdisplay.innerHTML = \"None\";\r\n\t}\r\n}", "function noteTemplate() {\n this.i += 1;\n return `\n <div>\n <div id=\"secondarynotesdiv\" draggable=\"true\" {{dragstart}} {{dragend}} class=\"notes${i}\">\n <div class=\"eachnote\" >\n <div id=\"content\">\n <div class=\"notetitle${i}\" style=\"text-align:center;padding:10px 0px 20px;color:maroon;\" id=\"data\">\n {{title}}\n </div>\n <div class=\"notebody${i}\" id=\"data\" style=\"text-align:center;padding:10px 20px 20px;color:maroon;\">\n {{description}}\n </div>\n <div class=\"editbtn\">\n <span id=\"editbutton\">\n <i class=\"far fa-edit\"></i>\n </span>\n <span\n id=\"delete\"\n >\n <i class=\"far fa-trash-alt\" id=\"trash${i}\"></i>\n </span>\n </div>\n </div>\n <div\n id=\"colors\"\n style=\"display: flex; justify-content: space-around;\"\n >\n <div\n style=\"\n width: 10%;\n background-color: chartreuse;\n border-radius: 30px;\n height: 20px;\n border: 1px solid black;\n \"\n id=\"chartreuse\"\n class=\"color\"\n ></div>\n <div\n style=\"\n width: 10%;\n background-color: yellow;\n border-radius: 30px;\n height: 20px;\n border: 1px solid black;\n \"\n id=\"yellow\"\n class=\"color\"\n ></div>\n <div\n style=\"\n width: 10%;\n background-color: pink;\n border-radius: 30px;\n height: 20px;\n border: 1px solid black;\n \"\n id=\"pink\"\n class=\"color\"\n ></div>\n <div\n style=\"\n width: 10%;\n background-color: lightblue;\n border-radius: 30px;\n height: 20px;\n border: 1px solid black;\n \"\n id=\"lightblue\"\n class=\"color\"\n ></div>\n </div>\n </div>\n</div>\n</div>\n `;\n}", "function buttonMaker() {\n $(\"#buttonWrapper\").empty();\n for (i = 0; i < topics.length; i++) {\n $(\"#buttonWrapper\").append(\n $(\"<div/>\")\n .attr('id', topics[i])\n .addClass('x topicButtons')\n .text(topics[i])\n );\n\n }\n\n}", "function getRemoveBtn() {\n let div = document.createElement('div');\n div.innerHTML =\n '<img src=\"images/remove.png\" id=\"image\" style=\"width:30px;height:30px\"/>';\n div.setAttribute('style', 'display: inline;');\n div.addEventListener('click', removeNote, false);\n\n return div;\n }", "createExpensesDiv() {\n let sourcesDiv = document.createElement('div')\n this.data.forEach((source => {\n const header = document.createElement('h2')\n header.innerText = source.source\n const amount = document.createElement('p')\n amount.innerText = source.amount\n sourcesDiv.appendChild(header)\n sourcesDiv.appendChild(amount)\n this.createDeleteButton(sourcesDiv, source.source)\n }))\n this.div.appendChild(sourcesDiv)\n }", "function drawNotes(noteArray){\n\t $('.note-list tbody').html(\"\");\n\t noteArray.forEach(function(note){\n\t\t noteRow = '<tr id=\"execute\">';\n\t\t noteRow +='<td data-target=\"note\" class=\"getNoteText\">' + note + '</td>';\n\t\t noteRow +='<td><button class = \"btn btn-info edit\" id=\"editNote\">Edit</button></td>';\n\t\t noteRow +='<td><button type=\"button\" class=\"btn btn-warning remainder\" data-toggle=\"modal\" data-target=\"#myModal\" id=\"addTimeBtn\">Add remainder</button></td>';\n\t\t noteRow +='<td><button class=\"btn btn-success delete\" id=\"deleteNote\">Delete</button></td>';\n\t\t noteRow +='</tr>';\n\t\t $('.note-list tbody').append(noteRow);\n\t\t\n//delete btn's\n\t var deleteNoteBtns = document.querySelectorAll('#deleteNote');\n\t deleteNoteBtns.forEach(deleteNoteBtns=>{\n\t\tdeleteNoteBtns.addEventListener('click', deleteNoteFunc)\n\t });\n\t\n//edit btn's\n var editNoteBtns = document.querySelectorAll('#editNote');\n\t editNoteBtns.forEach(editNoteBtns=>{\n\t\teditNoteBtns.addEventListener('click', editNoteFunc);\n\t });\n\n//addTime btn's\t\n\t var addTimeBtns = document.querySelectorAll('#addTimeBtn');\n\t addTimeBtns.forEach(addTimeBtns=>{\n\t\taddTimeBtns.addEventListener('click', addRemainderFunc);\n\t });\n\t\t\n//save time on modal btn\n\t var saveTime = document.getElementById('saveT');\n saveTime.addEventListener('click', addTime);\t\n\t });\n}", "function createEventDOM(newEvent,index) {\n\t/*var time = [];\n\ttime = (newEvent.time).split(\":\");\n\tvar timeStr = time[0] + time[1];*/\n\n\n\tvar e = document.createElement('div');\n\te.setAttribute(\"id\",index+\"-\"+(newEvent.date.toString())+\"-\"+(newEvent.month.toString())+\"-\"+(newEvent.year.toString()) );\n\te.setAttribute(\"class\", \"eventElement\");\n\n\tvar deleteButton = document.createElement('button');\n\tdeleteButton.setAttribute(\"onclick\", \"deleteEvent(\"+index+\",\"+newEvent.date+\",\"+newEvent.month+\",\"+newEvent.year+\")\");\n\tdeleteButton.setAttribute(\"class\", \"deleteEventButton\");\n\n\te.appendChild(deleteButton);\n\n\tvar eventTime = document.createElement('div');\n\teventTime.setAttribute(\"class\", \"eventTime\");\n\tvar t = newEvent.time;\n\tvar hours = Math.floor( t/ 60); \n var minutes = t % 60;\n if(minutes < 10)\n \tminutes = \"0\" + minutes;\n \tif(hours < 10)\n \t\thours = \"0\" + hours;\n \ttimeStr = hours.toString() +\" : \"+ minutes.toString();\n\n\teventTime.innerHTML = timeStr;\n\n\te.appendChild(eventTime);\n\n\tvar title = document.createElement('div');\n\ttitle.setAttribute(\"class\", \"eventTitle\");\n\ttitle.innerHTML = newEvent.title;\n\n\te.appendChild(title);\n\n\tvar classId = document.createElement('div');\n\tclassId.setAttribute(\"class\", \"eventClass\");\n\tclassId.innerHTML = 'Class ID:' + newEvent.classId;\n\n\te.appendChild(classId);\n\n\treturn e;\n\n}", "function createDeleteButton(){\n var divTag = document.createElement(\"div\");\n var spanTag = document.createElement(\"span\");\n divTag.appendChild(spanTag);\n var btnTag = document.createElement(\"button\");\n btnTag.classList.add(\"btn-delete\");\n btnTag.appendChild(document.createTextNode(\"Delete\"));\n spanTag.appendChild(btnTag)\n btnTag.addEventListener(\"click\", deleteItem)\n\n return divTag;\n}", "function buildAnote(obj) {\n\n var myRow = document.getElementById('notesRow');\n\n for (let index = 0; index < obj.length; index++) {\n\n var myNoteDiv = document.createElement('div');\n myNoteDiv.setAttribute(\"class\", \"col-md-2 col-sm-6 col-xs-12\");\n var myNote = document.createElement('div');\n myNote.setAttribute(\"class\", \"note\");\n var noteTrash = document.createElement('div');\n noteTrash.setAttribute('class', \"glyphicon glyphicon-trash noteDelete fade-in\");\n noteTrash.setAttribute('slot', index);\n noteTrash.setAttribute('onclick', \"deleteNote(this)\");\n noteTrash.setAttribute('onclick', 'deleteNote(this);'); // for FF\n noteTrash.onclick = function () { deleteNote(this); }; // for IE\n var noteDesc = document.createElement('div');\n noteDesc.setAttribute(\"class\", 'noteInnerDescription');\n noteDesc.innerText = obj[index].desc;\n var noteDate = document.createElement('div');\n noteDate.setAttribute(\"class\", \"noteDateValue\");\n noteDate.innerText = obj[index].date;\n var noteTime = document.createElement('div');\n noteTime.setAttribute(\"class\", \"noteTimeValue\");\n noteTime.innerText = obj[index].time;\n ////\n myNote.appendChild(noteTrash);\n myNote.appendChild(noteDesc);\n myNote.appendChild(noteDate);\n myNote.appendChild(noteTime);\n ////\n myNoteDiv.appendChild(myNote);\n ////\n myRow.appendChild(myNoteDiv);\n }\n}", "function newList() {\n\t\"use strict\";\n\tvar newDate, newTime, newLoc, newDesc, newCont, inDate, inTime, inLoc, inDesc , idNum;\n\n\t/* Creating new elements */\n\tnewDate = document.createElement(\"P\");\n\tnewTime = document.createElement(\"P\");\n\tnewLoc = document.createElement(\"P\");\n\tnewDesc = document.createElement(\"P\");\n\tnewCont = document.createElement(\"DIV\");\n\tremoveBtn = document.createElement(\"BUTTON\");\n\t\n\t\n\t/* Assigning Div a new class */\n\tnewCont.className = \"schBox\";\n\n\t/* Creating new textNodes based on user input */\n\tinDate = document.createTextNode(\"Date: \" + document.getElementById(\"in1\").value);\n\tinTime = document.createTextNode(\"Time: \" + document.getElementById(\"in2\").value);\n\tinLoc = document.createTextNode(\"Loc: \" + document.getElementById(\"in3\").value);\n\tinDesc = document.createTextNode(\"Description: \" + document.getElementById(\"in4\").value);\n\n\t/* Appending user information to new elements */\n\tnewDate.appendChild(inDate);\n\tnewTime.appendChild(inTime);\n\tnewLoc.appendChild(inLoc);\n\tnewDesc.appendChild(inDesc);\n\n\t/* Adding Elements to new Div and pushing it to the list div in html */\n\tnewCont.appendChild(newDate);\n\tnewCont.appendChild(newTime);\n\tnewCont.appendChild(newLoc);\n\tnewCont.appendChild(newDesc);\n\tnewCont.appendChild(removeBtn);\n\tdocument.getElementById(\"list\").appendChild(newCont);\n\n\t/*Resetting Fields */\n\tdocument.getElementById(\"in1\").value = \"\";\n\tdocument.getElementById(\"in2\").value = \"\";\n\tdocument.getElementById(\"in3\").value = \"\";\n\tdocument.getElementById(\"in4\").value = \"\";\n\n}", "function createButtons() {\n\t\tvar buttonHTML = '<input id=\"CustomNextButton\" class=\"FakeButton Button\" title=\"→\" ' \n\t\t+ 'type=\"button\" name=\"CustomNextButton\" value=\"→\" aria-label=\"Next\">'\n\t\t+ '<input id=\"ShowAnswerButton\" style = \"display:none\" class=\"FakeButton Button\" title=\"Show Answer\" ' \n\t\t+ 'type=\"button\" name=\"ShowAnswerButton\" value=\"Show Answer\" aria-label=\"Show Answer\">'\n\t\t+ '<style>.Total {display: none !important;}</style>';\n\t\tjQuery('#showbuttons').append(buttonHTML);\n\t}", "function createTodoCard(id,enteredText){\r\n var paraDiv = $(\"#to_do_list_div\")\r\n var todoInfo = $(\"<p>\").text(enteredText)\r\n paraDiv.append(todoInfo)\r\n todoInfo.attr(\"class\",\"todo\")\r\n todoInfo.attr(\"id\",id)\r\n var todoOBJ = {\r\n emailid:localStorage.getItem(\"Login_id\"),\r\n uniqID: id,\r\n todos: enteredText\r\n };\r\n var delete_button = $(\"<button>\")\r\n delete_button.attr({\"id\":\"delete_button\",\"onclick\":\"onclickdeletebtn(this)\"})\r\n todoInfo.append(delete_button)\r\n\r\n var deleteBtn = $(\"<i>\").attr({\r\n \"class\":\"far fa-trash-alt\"\r\n })\r\n delete_button.append(deleteBtn)\r\n //-------------------------putting data fo api api ----------------------------\r\n post_action(todoOBJ)\r\n\r\n}", "function createNewRow(note) {\n // var formattedDate = new Date(note.createdAt);\n // formattedDate = moment(formattedDate).format(\"MMMM Do YYYY, h:mm:ss a\");\n var newnotePanel = $(\"<div class='note-panel' data-id='\"+note.id+\"'>\");\n newnotePanel.addClass(\"panel panel-default\");\n var newnotePanelHeading = $(\"<div>\");\n newnotePanelHeading.addClass(\"panel-heading\");\n var deleteBtn = $(\"<button>\");\n deleteBtn.text(\"Delete\");\n deleteBtn.addClass(\"delete btn btn-danger btn-sm\");\n var editBtn = $(\"<button>\");\n editBtn.text(\"Edit\");\n editBtn.addClass(\"edit btn btn-warning btn-sm\");\n var newnoteTitle = $(\"<h2>\");\n var newnotePanelBody = $(\"<div>\");\n newnotePanelBody.addClass(\"panel-body\");\n var newnoteBody = $(\"<div>\");\n newnoteTitle.text(note.beerName + \" | \" + note.beerType + \" | \" + note.rating);\n newnoteBody.html(\"<br>Comments: \" + note.notes);\n newnotePanelHeading.append(newnoteTitle);\n newnotePanelBody.append(newnoteBody);\n newnotePanelBody.append(editBtn);\n newnotePanelBody.append(deleteBtn);\n newnotePanel.append(newnotePanelHeading);\n newnotePanel.append(newnotePanelBody);\n return newnotePanel;\n }", "function bookDisplay(){\n checkData();\n var html = \"<tr><td>Title</td><td>Author</td><td>Number of Pages</td><td>Read?</td><td>Delete?</td></tr>\";\n for(var i = 0; i < myLibrary.length; i++){\n html+=\"<tr>\";\n html+=\"<td>\"+myLibrary[i].title+\"</td>\";\n html+=\"<td>\"+myLibrary[i].author+\"</td>\";\n html+=\"<td>\"+myLibrary[i].numPages+\"</td>\";\n html+=\"<td><button class=\\\"status_button\\\">\"+myLibrary[i].read+\"</button></td>\";\n html+=\"<td><button class=\\\"delete\\\">delete</button></td>\"\n html+=\"</tr>\"\n }\n //html += \"</table>\";\n document.getElementById(\"book_table\").innerHTML = html;\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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Autor3</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Dritten Autor der Geschichte 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}", "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 createDeleteButton(){\n // Creating the containers structure\n var divTag = document.createElement(\"div\");\n divTag.setAttribute(\"class\",\"deleteButton\");\n //Creating and setting the button tags.\n var buttonTag = document.createElement(\"button\");\n buttonTag.setAttribute(\"class\",\"btn btn-delete\");\n buttonTag.setAttribute(\"type\",\"button\");\n buttonTag.setAttribute(\"name\",\"button\");\n buttonTag.innerHTML = \"Delete\";\n // Adding an action for the propertio onclick\n buttonTag.onclick = deleteItem;\n // Adding the button to the containers div\n divTag.appendChild(buttonTag);\n var containerTag = document.getElementsByClassName(\"product\");\n containerTag[containerTag.length-1].appendChild(divTag);\n}", "function addBookToDOM(book) {\n const bookElement = document.createElement(\"div\");\n const remove = document.createElement(\"div\");\n const edit = document.createElement(\"div\");\n const title = document.createElement(\"div\");\n const author = document.createElement(\"div\");\n const pages = document.createElement(\"div\");\n const status = document.createElement(\"div\");\n\n bookElement.classList.add(\"book\");\n remove.classList.add(\"remove\");\n edit.classList.add(\"edit\");\n edit.classList.add(\"material-icons\")\n title.classList.add(\"title\");\n author.classList.add(\"author\");\n pages.classList.add(\"pages\");\n status.classList.add(\"status\");\n\n bookElement.appendChild(remove);\n bookElement.appendChild(edit);\n bookElement.appendChild(title);\n bookElement.appendChild(author);\n bookElement.appendChild(pages);\n bookElement.appendChild(status);\n\n document.querySelector(\".bookshelf\").appendChild(bookElement);\n bookElement.id = book.timestamp;\n\n remove.textContent = \"+\";\n edit.textContent = \"edit\";\n updateBookInDOM(book);\n\n remove.onclick = removeBook;\n edit.onclick = editBook;\n}", "function displayEvent(event) {\n var display = '<div class=\"box\">';\n display += \"<p class=\\\"subtitle is-5\\\">\" + event.name + \"</p>\";\n display += createButton(EVENT_NOTIFY_TEXT, \"showNotifyEvent\", event._id, \"button is-small\",\n \"event_notification_button\"+event._id);\n display += '<div id=\"eventNotifyText' + event._id + '\"></div>'\n display += \"<br>\"\n var showNumber = 1;\n //display = displayShowsForEvent(event, display)\n event.shows.forEach((show) => {\n var list = \"<ul id=\\\"\" + show._id + \"\\\"></ul>\";\n var name = \"Show #\" + showNumber + \" on \" + prettyDate(show.start_date) + \" at \" + prettyTime(show.start_time);\n var tickets = \"<br>Tickets sold: \" + show.tickets_sold;\n var btn1 = createButton(TOGGLE_ATTENDEES_TEXT, \"viewShow\", show._id, \"button is-small\",\"show_button\"+show._id);\n var btn2 = createButton(SHOW_NOTIFY_TEXT, \"showNotifyShow\", show._id, \"button is-small\",\n \"show_notification_button\" + show._id);\n var notificationBox = '<div id=\"showNotifyText' + show._id + '\"></div>';\n display += name + tickets + \"<br>\" + \n btn1 + btn2 + notificationBox + list + \"<br>\";\n showNumber += 1;\n }); \n var footer = '<footer class=\"card-footer\">';\n footer += '<a href=\"/edit_event/'+encodeURI(event.name)+'\" class=\"card-footer-item\">Edit Event</a>'\n footer += '<a href=\"/view_stats/'+encodeURI(event.name)+'\" class=\"card-footer-item\">Statistics</a>'\n footer += '</footer>';\n display += footer;\n display += ' </div>'\n return display;\n}", "function makeBtnDel(i) {\n let delBtn = document.createElement(\"input\");\n delBtn.style.setProperty(\"grid-column\", 2)\n delBtn.style.setProperty(\"width\",\"100px\")\n delBtn.style.setProperty(\"height\", \"40px\")\n delBtn.style.setProperty(\"margin\", \"5px\")\n delBtn.type = \"button\";\n delBtn.value = \"delete\";\n delBtn.onclick = function() {\n myLibrary.splice(i,1)\n let delBtn = document.getElementById(\"btnDel\" + i) \n container.removeChild(delBtn)\n let delBook = document.getElementById(\"book\" + i)\n container.removeChild(delBook)\n let delRead = document.getElementById(\"readBtn\" + i)\n container.removeChild(delRead);\n }\n container.appendChild(delBtn).id = \"btnDel\" + i;\n}", "function addtodo(e)\n{\n const todiv=document.createElement('div');\n todiv.classList.add(\"todo\");\n\n const newtodo=document.createElement('li');\n newtodo.innerText=todoinput.value;\n todiv.classList.add(\"todo-item\");\n todiv.appendChild(newtodo);\n saveLocalTodo(todoinput.value);\n \n const completedButton=document.createElement('button');\n \n completedButton.innerHTML=\"<i class='bx bx-check'></i>\";\n completedButton.classList.add(\"comp-butt\");\n todiv.appendChild(completedButton);\n\n \n const trashButton=document.createElement('button');\n \n trashButton.innerHTML=\"<i class='bx bx-trash'></i>\";\n trashButton.classList.add(\"trash-butt\");\n todiv.appendChild(trashButton);\n\n todolist.appendChild(todiv);\n todoinput.value=\" \";\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\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 displayNote(noteid, title, note, completed) {\n\tvar idTag, htmlTag;\n\tif (completed == \"0\" || completed == 0){\n\t\tidTag = \"#notCompletedList\";\n\t\thtmlTag = \"<button class='btn btn-info btn-xs' onclick='toggle(\\\"\"+noteid+\"\\\")'>Mark as Complete</button>\";\n\t}else if(completed == \"1\" || completed == 1){\n\t\tidTag = \"#completedList\";\n\t\thtmlTag = \"<button class='btn btn-info btn-xs' onclick='toggle(\\\"\"+noteid+\"\\\")'>Mark as Not Complete</button>\";\n\t}else\n\t\treturn;\n\n\t$(idTag).append(\n\t\t\"<tr id='\"+noteid+\"'>\"+\n\t\t\t\"<td id='title\"+noteid+\"'>\"+title+\"</td>\"+\n\t\t\t\"<td id='note\"+noteid+\"'>\"+note+\"</td>\"+\n\t\t\t\"<td id='completed\"+noteid+\"' value='\"+completed+\"' style='text-align:center;'>\"+\n\t\t\thtmlTag +\n\t\t\t\" <button class='btn btn-default btn-xs' onclick='editNote(\\\"\"+noteid+\"\\\")'><span title='Edit' class='glyphicon glyphicon-pencil' aria-hidden='true'></span></button>\"+\n\t\t\t\" <button class='btn btn-danger btn-xs' onclick='deleteNote(\\\"\"+noteid+\"\\\")'><span title='Remove' class='glyphicon glyphicon-remove' aria-hidden='true'></span></button></td>\"+\n\t\t\"</tr>\");\n}", "function logThisPractice(contents, cue, type){ // creates a new journal entry... \n\n //x= $(contents); // save the value of the input field\n // create a container for the comment\n var newPanel = document.createElement (\"DIV\"); // creates the div container\n newPanel.setAttribute(\"class\",'bt3 panel-body bt2Checkin journalItem'); // set class\n // create & append the input\n\n // set up for the cue\n var newCue = document.createElement(\"DIV\"); // create a P and name it t\n $(newCue).html(cue);\n newPanel.appendChild(newCue); // put the input field w value set in the input area\n \n var newParagraph = document.createElement(\"DIV\"); // create a P and name it t\n newParagraph.setAttribute(\"class\",\"inline commentaryItem \");\n $(newParagraph).html(contents);\n newPanel.appendChild(newParagraph); \n\n var f = document.createElement(\"BUTTON\"); // trigger button\n var input = document.createElement(\"TEXTAREA\"); // hidden edit field area ++\n input.setAttribute(\"style\",\"display:none\");\n input.setAttribute(\"class\",\"inline form-control editComment\");\n $(input).val(contents); // setting its values\n newPanel.appendChild(input);\n\n f.setAttribute(\"class\",\"btn btn-sm btn-link pull-right inline\");\n f.setAttribute(\"title\",\"hide this\");\n f.innerHTML = (\"-\");\n newPanel.appendChild(f); // text node to <div>\n \n var re = document.createElement(\"BUTTON\"); // trigger button\n re.setAttribute(\"class\",\"btn btn-sm btn-link pull-right inline deleteThisComment\");\n re.setAttribute(\"title\",\"Delete\");\n re.innerHTML = \"x\";\n newPanel.appendChild(re); // delete button to <div> \n\n\n// add something button obsolete, removed\n // var addButton = document.createElement(\"BUTTON\"); // trigger button\n // addButton.setAttribute(\"class\",\"btn btn-sm btn-link pull-right inline addButton\");\n // addButton.setAttribute(\"title\",\"Add Something\");\n // addButton.innerHTML = (\"+\");\n // newPanel.appendChild(addButton); // text node to <div>\n\n $(\".focus\").find(\".checkInArea\").find('textarea:last').before(newPanel); // focus back on the input field\n\n \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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Autor2</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Zweiten Autor der Geschichte 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}", "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}", "viewMe() {\n this.editFlag = true;\n this.descriptionInput.readOnly = true;\n this.dateInput.readOnly = true;\n this.descriptionInput.classList.remove(\"inputBox\");\n this.dateInput.classList.remove(\"inputBox\");\n this.descriptionInput.classList.add(\"notEditable\");\n this.dateInput.classList.add(\"notEditable\");\n this.save.remove();\n this.cancel.remove();\n this.cardFooter.appendChild(this.creationDateLabel);\n this.cardFooter.appendChild(this.creationDate);\n this.buttonContainer.appendChild(this.markAsDone);\n this.buttonContainer.appendChild(this.edit);\n this.buttonContainer.appendChild(this.delete);\n }", "function renderButtons(){\n //So we don't have repeating buttons\n $(\"#buttonDiv\").empty();\n for (holiday of topics){\n //make button\n var b = $(\"<button>\");\n b.addClass(\"btn btn-light\");\n b.attr(\"data-name\", holiday);\n b.text(holiday);\n $(\"#buttonDiv\").append(b); \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 addLittleButtonsAnswer() {\n \n //console.log(INSIDE addLittleButtonsAnswer, thisTopicID: \" + thisTopicId);\n //console.log(also inside addLittlebuttonsAnswer, thisTopicText: \" + thisTopicText);\n //console.log(also inside addLittlebuttonsAnswer, thisTopicAnswer: \" + thisTopicAnswer);\n // append the delete and edit buttons, with the id of the current topic as data\n thisBox.append(\n \"<button type='button' class='btn btn-default btn-xs littleXAnswer' data_idtopic=\" +\n thisTopicId + \">\" +\n \"<span class='glyphicon glyphicon-remove' aria-hidden='true'></span></button>\");\n var newEditButton = $(\"<span>\");\n newEditButton.attr(\"type\", \"button\");\n newEditButton.addClass(\"btn\");\n newEditButton.addClass(\"btn-default\");\n newEditButton.addClass(\"btn-xs\");\n newEditButton.addClass(\"littleEAnswer\");\n newEditButton.addClass(\"glyphicon\");\n newEditButton.addClass(\"glyphicon-pencil\");\n newEditButton.attr(\"aria-hidden\", \"true\");\n newEditButton.attr(\"data-idtopic\", thisTopicId);\n newEditButton.attr(\"data-texttopic\", thisTopicText);\n newEditButton.attr(\"data-textanswer\", thisTopicAnswer);\n thisBox.append(newEditButton);\n }", "function addMainButonsMultiple(){\n var obj = $(tdpersonnalised.mainButtonDiv);\n\n obj.append(\"<button disabled title='\"+tdpersonnalised.ToSavetitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.ToSaveclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.ToSaveglyph +\"\\\" aria-hidden=\\\"true\\\">\"+tdpersonnalised.ToSavetext+\"</span></button>\");\n\n\n }", "function addMainButonsUnique(){\n var obj = $(tdpersonnalised.mainButtonDiv);\n obj.append(\"<button title='\"+tdpersonnalised.modifiedtitle+\"' class=\\\"\"+ tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.modifiedclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.modifiedglyph +\"\\\" aria-hidden=\\\"true\\\">\"+tdpersonnalised.modifiedtext+\"</span></button>\");\n\n obj.append(\"<button title='\"+tdpersonnalised.savetitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.saveclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.saveglyph +\"\\\" aria-hidden=\\\"true\\\">\"+tdpersonnalised.savetext+\"</span></button>\");\n\n obj.append(\"<button title='\"+tdpersonnalised.canceltitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.cancelclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.cancelglyph +\"\\\" aria-hidden=\\\"true\\\">\"+tdpersonnalised.canceltext+\"</span></button>\");\n\n obj.append(\"<button disabled title='\"+tdpersonnalised.ToSavetitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.ToSaveclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.ToSaveglyph +\"\\\" aria-hidden=\\\"true\\\">\"+tdpersonnalised.ToSavetext+\"</span></button>\");\n\n obj.children(\"button:nth-child(2),button:nth-child(3)\").hide();\n\n }", "function createEntry(listTitle, entryName, urlStr, entryID, backGroundColor){\r\n let entry = mySubWindow.document.createElement(\"div\");\r\n let userList = mySubWindow.document.getElementById(\"userList\");\r\n entry.id = \"container\";\r\n let entryImage = mySubWindow.document.createElement(\"img\");\r\n if (urlStr == null || urlStr == \"null\") {\r\n entryImage.src = \"https://i.imgur.com/wiUoT13.png\"\r\n }else{\r\n entryImage.src = basePosterURL + \"w92\" + urlStr;\r\n }\r\n entryImage.className = \"center-img\";\r\n entry.appendChild(entryImage);\r\n \r\n let dText = mySubWindow.document.createElement(\"div\");\r\n let title = mySubWindow.document.createElement(\"h2\");\r\n entry.style.backgroundColor=backGroundColor\r\n let removeBtn = mySubWindow.document.createElement(\"button\");\r\n removeBtn.className = \"btn btn-outline-danger\"\r\n removeBtn.innerHTML = \"remove\"\r\n removeBtn.onclick = function() {\r\n removeEntry(listTitle, entryName, entryID)\r\n }\r\n\r\n let upArrCon = mySubWindow.document.createElement(\"p\");\r\n \r\n let downArrCon = mySubWindow.document.createElement(\"p\")\r\n let upArr = mySubWindow.document.createElement(\"i\")\r\n let downArr = mySubWindow.document.createElement(\"i\")\r\n let upBtn = mySubWindow.document.createElement(\"button\");\r\n let downBtn = mySubWindow.document.createElement(\"button\");\r\n\r\n \r\n upArrCon.id = \"arrOffset\";\r\n downArrCon.id = \"arrOffset\";\r\n upBtn.id = \"upArrow\"\r\n downBtn.id =\"downArrow\"\r\n\r\n upArr.className = \"arrow up\";\r\n \r\n upBtn.onclick = function() {\r\n changeOrder(listTitle, entryName, entryID,\"up\")\r\n }\r\n downBtn.onclick = function() {\r\n changeOrder(listTitle, entryName, entryID,\"down\")\r\n }\r\n\r\n downArr.className = \"arrow down\";\r\n upBtn.appendChild(upArr);\r\n downBtn.appendChild(downArr);\r\n upArrCon.appendChild(upBtn);\r\n downArrCon.appendChild(downBtn);\r\n\r\n dText.className = \"center-txt\";\r\n title.textContent = entryName;\r\n dText.appendChild(title);\r\n dText.append(removeBtn);\r\n dText.appendChild(upArrCon);\r\n dText.appendChild(downArrCon);\r\n \r\n entry.appendChild(dText);\r\n\r\n let tableRow = mySubWindow.document.createElement(\"tr\");\r\n let tableOrder = mySubWindow.document.createElement(\"td\");\r\n let orderText = mySubWindow.document.createElement(\"h1\");\r\n orderText.style.textAlign = \"center\";\r\n orderText.innerHTML = totalEntryCount + 1;\r\n orderText.className=\"tableElement\"\r\n tableOrder.appendChild(orderText);\r\n let tableTitle = mySubWindow.document.createElement(\"td\");\r\n tableTitle.appendChild(entry)\r\n tableTitle.style.width=\"100%\"\r\n tableRow.appendChild(tableOrder);\r\n tableRow.appendChild(tableTitle);\r\n userList.appendChild(tableRow);\r\n}", "function addList(e){\ne.preventDefault();\nconst toDoDiv=document.createElement('div');\ntoDoDiv.classList.add('todo');\n// add list li\nconst item=document.createElement(\"li\")\nitem.innerText=todoInput.value;\nitem.classList.add(\"list-style\")\ntoDoDiv.appendChild(item);\n// add check button\nconst checked=document.createElement(\"button\");\nchecked.innerHTML=\"<i class='bx bx-check-circle' ></i>\"\nchecked.classList.add(\"check-btn\");\ntoDoDiv.appendChild(checked);\n// add delete button\nconst remove=document.createElement(\"button\");\nremove.innerHTML=\"<i class='bx bx-trash' ></i>\"\nremove.classList.add(\"remove-btn\");\ntoDoDiv.appendChild(remove);\n\ntodolist.appendChild(toDoDiv);\ntodoInput.value=\"\";\n}", "function createModalHTML(data){ \n data.forEach(function(note){\n $(\".existing-note\").append(`\n <div class=\"panel panel-default\" id=\"${note._id}\">\n <div class=\"panel-body\">\n <div class=\"noteContent\">\n <p>${note.body}</p>\n <button class=\"btn btn-primary edit-note\" data-noteId=\"${note._id}\"\">Edit</button>\n <button class=\"btn btn-primary delete-note\" data-noteId=\"${note._id}\">Delete</button>\n </div>\n <div class=\"update-form\"></div>\n </div>\n </div>\n `)\n }); \n}", "function makeButtons(){ \n\t// empties the shows prior to adding new shows so there are no duplicate buttons\n\t$('#buttonsView').empty();\n\t// loops through the shows array\n\tfor (var i = 0; i < shows.length; i++){\n\t\t// dynamically create buttons for each show in the array\n\t\tvar a = $('<button>') \n\t\ta.addClass('show'); // add a class attribute\n\t\ta.attr('data-name', shows[i]); // add a data-attribute\n\t\ta.text(shows[i]); // add text to the buttons\n\t\t$('#buttonsView').append(a); // append the button to buttonsView div\n\t}\n}", "function renderButtons() {\n // Deletes the movies prior to adding new movies\n $('.buttons-view').empty();\n // Loops through the array of topics to create buttons for all topics\n for (var i = 0; i < topics.length; i++) {\n var createButtons = $('<button>');\n createButtons.addClass('topic btn btn-success');\n createButtons.attr('data-name', topics[i]);\n createButtons.text(topics[i]);\n $('.buttons-view').append(createButtons);\n }\n }", "buildJournalEntry(date, concepts, entry, mood, id) {\n //fragment the new elements are added to.\n const frag = document.createDocumentFragment();\n const section = document.createElement(\"section\");\n section.id = `journal--page--${id}`;\n section.appendChild(buildHTML(\"Date\", \"span\", date));\n section.appendChild(buildHTML(\"Concepts\", \"span\", concepts));\n section.appendChild(buildHTML(\"Entry\", \"p\", entry));\n section.appendChild(buildHTML(\"Mood\", \"span\", mood));\n //delete button\n const journalDelete = document.createElement(\"button\");\n journalDelete.setAttribute(\"id\", \"journalDelete\");\n journalDelete.textContent = \"Delete\";\n journalDelete.addEventListener(\"click\", event => {\n const id = event.target.parentNode.id\n console.log(id);\n const idArray = id.split(\"--\")\n const journalId = idArray[2];\n console.log(journalId);\n deleteJournal(journalId);\n })\n section.appendChild(journalDelete);\n //edit button\n const journalEdit = document.createElement(\"button\");\n journalEdit.setAttribute(\"id\", \"journalEdit\");\n journalEdit.textContent = \"Edit\";\n journalEdit.addEventListener(\"click\", event => {\n const id = event.target.parentNode.id\n const idArray = id.split(\"--\")\n const journalId = idArray[2];\n editJournal(id, date, entry, concepts, mood, journalId);\n })\n section.appendChild(journalEdit);\n frag.appendChild(section);\n //returns the fragment with all the elements contained within.\n return frag\n }", "function addnotes() {\n const check = document.querySelector(\".addnotes\")\n if (check == null){\n const main = document.getElementById(\"main\");\n const txtarea = document.createElement('textarea' );\n txtarea.className = \"addnotes\";\n const bintxt =document.createTextNode(\"your text goes here\");\n\n txtarea.appendChild(bintxt);\n main.appendChild(txtarea);\n\n const save = document.createElement('button' );\n save.className= \"txtbtn1\"\n const btntxt = document.createTextNode(\"save\");\n\n save.appendChild(btntxt);\n main.appendChild(save);\n\n const dltbtn = document.createElement('button' );\n dltbtn.className= \"txtbtn2\"\n const dlttxt = document.createTextNode(\"delete\");\n\n dltbtn.appendChild(dlttxt);\n main.appendChild(dltbtn);\n \n //removing text area and buttons\n const removetxt= document.querySelector(\".txtbtn2\")\n removetxt.addEventListener(\"click\",function(e){\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n })\n const savenote = document.querySelector(\".txtbtn1\")\n savenote.addEventListener(\"click\",function(s){\n\n if(txtarea.value!==\"your text goes here\"){\n var length = notesarr.length + 1\n var notenum = \"note\" + length.toString()\n notesarr.push({title:notenum,body: txtarea.value})\n \n //adding notes to navbar\n\n const titlebtn = document.createElement(\"button\")\n titlebtn.className= \"titlebtns\"\n const titlebtntxt = document.createTextNode(notenum)\n titlebtn.appendChild(titlebtntxt);\n sidebar.appendChild(titlebtn)\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n\n const display= document.querySelector(\".titlebtns\")\n\n display.addEventListener(\"click\",function(d){\n var notenum = display.innerHTML[4]\n var displaynum = parseInt(notenum)-1\n\n var displaytext =(notesarr[displaynum].body)\n\n var displaynote = document.createElement('textarea' );\n displaynote.className = \"addnotes\";\n var notetxt =document.createTextNode(displaytext);\n\n displaynote.appendChild(notetxt);\n main.appendChild(displaynote);\n\n var cancelbtn = document.createElement(\"button\");\n var cancelbtntxt = document.createTextNode(\"cancel\");\n cancelbtn.className= \"txtbtn2\";\n \n cancelbtn.appendChild(cancelbtntxt);\n main.appendChild(cancelbtn);\n\n //removing displayed note\n\n var removedisplay = document.querySelector(\".txtbtn2\")\n console.log(removedisplay)\n removedisplay.addEventListener(\"click\",function(remove){\n\n main.removeChild(displaynote)\n main.removeChild(cancelbtn)\n })\n\n })\n\n }\n })\n \n }\n\n\n}", "function makeButtons() {\n\t\t//remove comment wbelow\n // Delete the content inside the movies-view div prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons\").empty();\n\n\n // use a loop that appends a button for each string in the array\n for (var i = topics.length - 1; i >= 0; i--) { // or var i = 0; i < topics.length; i++\n console.log(topics[i]);\n $(\"#buttons\").append(\"<button>\" + topics[i] + \"</button>\");\n }\n }", "function createNewDeleteButton() {\n var newDeleteButtonDiv = document.createElement(\"div\");\n var newDeleteButton = document.createElement(\"button\");\n newDeleteButton.setAttribute(\"class\",\"btn btn-delete\");\n newDeleteButton.innerHTML = \"Delete\";\n newDeleteButtonDiv.appendChild(newDeleteButton);\n return newDeleteButtonDiv;\n }", "render() {\n items.innerHTML = myLibrary.map((book) => {\n return `\n <div id=\"book-item\">\n <p>${book.title}</p>\n <p>${book.author}</p>\n <p>${book.pages}</p>\n <div class=\"item-prop\">\n <button id=\"btnStatus\" class=\"${book.status}\"><i class=\"fas fa-check\"></i></button>\n <button id=\"btnDel\" data-id=\"${book.id}\"><i class=\"fas fa-trash\"></i></button>\n </div>\n </div>`;\n }).join('');\n\n let statusBtn = document.querySelectorAll('#btnStatus');\n let delBtn = document.querySelectorAll('#btnDel');\n\n let bookList = new BookList();\n statusBtn.forEach(btn => {\n btn.addEventListener('click', (e) => bookList.updateBook(e));\n });\n \n delBtn.forEach(btn => {\n btn.addEventListener('click', (e) => bookList.deleteBook(e));\n });\n }", "function listInit() {\n \n const node = document.createElement('DIV');\n \n buttonClass = 'visible';\n notesCaption = '';\n notesItems = '';\n\n notesCaption = `new TODO list\n <button id=\"editListCaption\">edit</button>`;\n \n reRenderDashboard();\n \n // assign event to button\n document.addEventListener('click', (e) => {\n \n if ((e.target) && (e.target.id === \n 'editListCaption')) {\n e.preventDefault();\n editListCaptions();\n }\n });\n }", "renderNewEventBtn() {\n eventContainer.innerHTML += eventHtml.makeNewEventBtn();\n }", "function divs(objeto) {\r\n\r\n var newDiv = $(\"<div class='noticia'></div>\")\r\n $(newDiv).html(\"<h3>\" + \" <a href=\" + objeto.url + \" target=_blank>\" + objeto.title + \"</a>\" + \"</h3>\" + \"<br>\" + \"<br>\" + \"<img src=\" + objeto.urlToImage + \">\" + \"<p>\" + objeto.description + \"</p>\" + \"<br>\");\r\n\r\n $(newDiv).append($('<button>').attr(\"class\", \"boton\").text(\"+info\").click(function () {\r\n info(objeto)\r\n }));\r\n\r\n $(\"#container\").append(newDiv)\r\n}", "function renderButtons() {\n\n // Deleting the divas prior to adding new divas\n $(\"#buttons-view\").empty();\n\n // Looping through the topics array\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each diva in the array\n var a = $(\"<button>\");\n // Adding a class of diva-btn to our button\n a.addClass(\"diva-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\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 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 archive_note(c_id, q_id){\n $('.edit_comment_class').hide();\n $('.view_comment_class').hide();\n $('.archive_comment_class').hide();\n $('#view_comment_div_'+ c_id).hide();\n $('#lastet_comment_div_'+ q_id).hide();\n $('#edit_comment_div_'+ c_id).hide();\n $('#add_comment_block_div_'+ q_id).hide();\n $('#archive_comment_div_'+ c_id).show()\n $('#add_comment_button_top_div_'+ q_id).show();\n}", "buildDatePicker() {\n // handle the case of not having a current date set\n if (self.datePicker.current === null) self.datePicker.current = new Date();\n // If the picker is already there, remove it\n if (document.getElementById(self.datePicker.id+'popup') != null) {\n self.hideDatePicker();\n } else {\n // Add a new div for eveything to live in\n var containerDiv = document.createElement('div');\n // Add a new div for the date picker\n var datePickerDiv = document.createElement('div');\n datePickerDiv.id = self.datePicker.id+'popup';\n // Style, should maybe be moved out\n datePickerDiv.style = 'position:absolute; z-index:100; background:#FFF; margin-top: 30px; margin-left: 15px;';\n // The main table holds the buttons and the current month/year\n var navButtons = self.buildButtons();\n // build the calendar part of the popup\n var calendar = self.buildCalendar();\n calendar.id = self.datePicker.id+'calendar';\n // Bottom button\n var calendarFooter = document.createElement('div');\n calendarFooter.style.textAlign = 'center';\n var todayBtn = document.createElement('div');\n todayBtn.style.width = '100%';\n todayBtn.style.borderColor = '#FFF';\n todayBtn.innerHTML = 'Today';\n todayBtn.style.cursor = 'pointer';\n todayBtn.setAttribute('date', new Date());\n todayBtn.onclick = self.setNewDate;\n calendarFooter.appendChild(todayBtn);\n // add everything to the div\n datePickerDiv.appendChild(navButtons);\n datePickerDiv.appendChild(calendar);\n datePickerDiv.appendChild(calendarFooter);\n var overlay = self.buildOverlay();\n containerDiv.appendChild(datePickerDiv);\n containerDiv.appendChild(overlay);\n document.getElementById(self.datePicker.id).parentElement.appendChild(containerDiv);\n // disable buttons if necessary\n self.disableButtons();\n }\n }", "function createTask(index, task, date) {\n var convertedDate = moment(date).format(\"MM/DD/YYYY HH:mm\");\n var taskCard = `<div id = 'task${index}'class='card task-inner'><div class='card-header cardHeadInner'>${convertedDate}<button type='button' index = '${index}'class='btn btn-outline-success btn-sm clearTask'> <i class='fas fa-clipboard-check'></i></button></div><div class='card-body'>${task}</div></div>`\n\n $(\".taskBody\").append(taskCard);\n\n }", "function posterButtonCreat(listPosters, divPosters) {\n for (let j = 0; j < listPosters.length; j++) {\n listPosters[j].forEach(element => {\n let title = $(`\n <div>\n <button id=\"${element.number}\" class=\"titleposters collapsible\"> \n <h4>#${element.number} ${element.tittle}</h4>\n </button>\n </div>\n `);\n title.appendTo($(divPosters[j]));\n });\n }\n}" ]
[ "0.66914386", "0.6580069", "0.65291834", "0.6502622", "0.64882445", "0.63981503", "0.6386426", "0.6343098", "0.63280344", "0.6309284", "0.6307025", "0.6292318", "0.6288135", "0.6271138", "0.6243464", "0.62407684", "0.6219146", "0.61958194", "0.6192781", "0.6188629", "0.61848545", "0.61810243", "0.61651707", "0.6154597", "0.611598", "0.60976535", "0.60954183", "0.6093516", "0.60916466", "0.60824883", "0.6072779", "0.6061715", "0.6059708", "0.6059672", "0.6059203", "0.6059047", "0.605101", "0.60502654", "0.60487074", "0.6043785", "0.6039108", "0.6030804", "0.6030021", "0.6018971", "0.60111344", "0.60100275", "0.5997188", "0.59970397", "0.59970224", "0.59850156", "0.5977744", "0.5965763", "0.59634835", "0.5962761", "0.5960893", "0.59512097", "0.5944932", "0.5944752", "0.59440076", "0.5934235", "0.5925429", "0.5902556", "0.5897898", "0.58975357", "0.5894074", "0.5892012", "0.5889369", "0.5886398", "0.5884896", "0.5880974", "0.5880655", "0.58786845", "0.58786243", "0.58744496", "0.58725905", "0.5867883", "0.58656484", "0.586471", "0.58645624", "0.5864475", "0.5863153", "0.58594984", "0.58540666", "0.5852111", "0.5848677", "0.5844702", "0.58409816", "0.5837272", "0.58273745", "0.58187616", "0.5817828", "0.5817449", "0.58147615", "0.5811956", "0.58115435", "0.5805073", "0.58045477", "0.580425", "0.5801461", "0.580128" ]
0.6631468
1
creates p element that displays the date
function createP(obj) { let p = document.createElement("p"); p.className = "date"; p.innerText = obj.date; return p; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeDate() {\n // write date\n var jumbo = document.querySelector('div.jumbotron');\n var myPara = document.createElement('p');\n myPara.textContent = \"Today's date: \" + month + ' - ' + date + ' - ' + year;\n jumbo.appendChild(myPara);\n\n}", "function renderDate() {\n dateDiv.text(todaysDate)\n}", "function date(){\n\tdocument.getElementById(\"dateAndTimeParagraph\").innerHTML = Date();\n}", "function displayDate() {\n\n\n var now = new Date();\n console.log(\"time is %s\", now)\n\n var yy = now.getFullYear();\n console.log(\"Year is %s\", yy)\n var e = document.getElementById(\"paragraph\");\n e.innerHTML = now + \". Year is \" + now.getFullYear();\n\n var months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\"]\n var mt = now.getMonth();\n console.log(\"Month is %d [%s]\", mt, months[mt])\n\n e.innerHTML += \"<p> The Month # is \" + mt + \" [ \" +months[mt] + \" ] \" + \"</p>\"\n\n\n}", "function addDate() {\n var $today = $(`\n <p>* Według średniego kursu NBP z dnia ${day}</p> \n `);\n $('.form-text').append($today);\n }", "function displayDate(){\n\tdocument.getElementById(\"demo\").innerHTML=Date();\n}", "function displayDate() {\n // variable for date formatted day, month, day, year\n var date = now.format(\"dddd, MMMM Do YYYY\");\n // update text to show date\n currentDayEl.text(date);\n}", "function dat(){\n var d = new Date();\n document.getElementById(\"date\").innerHTML = d;\n }", "function displayDate() {\n var currentDay = new Date();\n var month;\n var date = currentDay.getDate();\n var year = currentDay.getFullYear();\n \n switch (currentDay.getMonth()) {\n case 0:\n month = \"January\";\n break;\n case 1:\n month = \"February\";\n break;\n case 2:\n month = \"March\";\n break;\n case 3:\n month = \"April\";\n break;\n case 4:\n month = \"May\";\n break;\n case 5:\n month = \"June\";\n break;\n case 6:\n month = \"July\";\n break;\n case 7:\n month = \"August\";\n break;\n case 8:\n month = \"September\";\n break;\n case 9:\n month = \"October\";\n break;\n case 10:\n month = \"November\";\n break;\n case 11:\n month = \"December\";\n break;\n }\n var dateDiv = document.getElementById('date');\n dateDiv.innerText = month + \" \" + date + \", \" + year;\n }", "function printDate()\n\t{\n\t\tvar time = getTime();\n\n\t\t// Print time\n\t\ttaskline.obj.time_date.innerHTML = time.day + '.' + time.monthNameShort + ' ' + time.year;\n\t}", "function displayDate() {\n document.getElementById(\"o\").innerHTML = Date();\n}", "function runDate() {\n\t\tvar el = document.getElementsByClassName(\"date-span\");\n\t\t// var dateString = get_Date();\n\t\tvar dateString = getSmallDate();\n\t\tfor(var i in el) {\n\t\t\tel[i].innerHTML = \" \" + dateString;\n\t\t}\n\t}", "function displayDate() {\n document.getElementById(\"content\").innerHTML = Date();\n}", "function addDate() {\n dateArea.textContent = m;\n }", "get displayDate() {\n return this._dateEl.innerHTML;\n }", "function formatearFecha(fecha) {\r\n\tvar y = fecha.getFullYear();\r\n\tvar m = fecha.getMonth() + 1;\r\n\tvar d = fecha.getDate();\r\n\tif (d < 10) {\r\n\t\td = \"0\" + d;\r\n\t}\r\n\tif (m < 10) {\r\n\t\tm = \"0\" + m;\r\n\t}\r\n\treturn \"<p>\" + d + \"-\" + m + \"-\" + y + \"</p>\";\r\n}", "function currentDate() {\n let date = moment().format(\"dddd MMMM Do YYYY \");\n $(\"#date\").html(\"<h5>\" + date + \"</h5>\");\n }", "renderDate(value) {\n 'use strict';\n\n if (value) {\n return `<span title=\"${value.full}\">${value.shortest}</span>`;\n }\n return '-';\n }", "function displayDate(){\n //Get current date \n currentDateElement.text(moment().format('dddd, MMMM Do YYYY'));\n}", "function DateNow(){\n var today = new Date();\n var day = today.getDate();\n var month = today.getMonth() + 1;\n var year = today.getFullYear();\n if (day < 10){\n day = '0' + day;\n }\n if (month < 10){\n month = '0' + month;\n }\n //Final Date Output;\n var dateNow = day + '.' + month + '.' + year;\n document.getElementById('date').innerHTML = dateNow;\n document.getElementById('footer-year').innerHTML = year + ' Kash Pizzas. All rights reserved.';\n }", "function showDate() {\n return `The date is: '01.01.1990'`;\n }", "customDateHtml(date){\n\t\treturn moment(date).date(); //day of month\n\t}", "function mostrarFecha() {\n document.getElementById(\"fecha\").innerHTML = Date();\n }", "function setupDate() {\n const el = document.querySelector('.date')\n const date = new Date().toDateString()\n const day = date.slice(0, date.length - 4).trim()\n\n el.querySelector('.day').innerHTML = splitText(day)\n}", "function dateRendered() {\r\n \"use strict\";\r\n //define all variables\r\n var todaysDate;\r\n\r\n //get date and make pretty\r\n todaysDate = new Date();\r\n todaysDate = todaysDate.toDateString();\r\n\r\n //display date\r\n document.write(\"Rendered: \" + todaysDate);\r\n}", "function displayDate() {\n document.getElementById(\"dateandtime\").innerHTML = Date();\n}", "function myDate() \n\t\t{\n\t\t\tvar d = new Date();\n\t\t\t//The current date is saved to the date string\n\t\t\tdocument.getElementById(\"date\").innerHTML = d.toDateString();\n\t\t}", "function renderDate(){\n // Show current day\n var today = moment().format('Do MMMM YYYY');\n $(\".date0\").text(today);\n let dayArray = []\n for (i = 1 ; i < 5 ; i++){\n dayArray[i] = moment().add(i,'days').format('Do MMMM YYYY');\n $(\".date\"+i).text(dayArray[i]);\n }\n \n }", "function show_date() {\n let time = document.getElementById('time');\n time.innerHTML = Date();\n}", "function userDate() {\n const userCurrentDate = document.querySelector(\".current-date\");\n // Make a new date object\n const myDate = new Date();\n\n // Put the date into the DOM\n userCurrentDate.innerHTML = `<span>${myDate}</span>`;\n}", "function showDate(input){\n document.getElementById(\"questiondate\").innerHTML = `This question aired on: ${formatDate(input[0].airdate)}`\n\n}", "function dates() {\n var m = d.getMonth()+1;\n if(m<10) \n{\n m='0'+m;\n}\n var date = d.getDate();\n if(date<10) \n{\n date='0'+date;\n}\n var fy = d.getFullYear();\ndocument.getElementById(\"answer2\").innerHTML = m+\"-\"+date+\"-\"+fy;\nvar node = document.createElement(\"p\");\nnode.appendChild(document.createTextNode(m+\"/\"+date+\"/\"+fy));\ndocument.getElementById(\"answer2\").appendChild(node); \n\nvar node2 = document.createElement(\"p\");\nnode2.appendChild(document.createTextNode(date+\"/\"+m+\"/\"+fy));\ndocument.getElementById(\"answer2\").appendChild(node2); \n}", "function showdate() {\r\n \tdocument.getElementById(\"eventFunctions\").innerHTML = Date()\r\n }", "function date (){\n document.write( new Date())\n}", "render() {\n const formattedDate = getFormattedDate(this.props.date);\n return (\n <div className=\"formatted-date\">\n <h3 className=\"formatted-date-text\">{formattedDate}</h3>\n </div>\n );\n }", "function shortDateDescription(entryDate) {\n // zapisuję do zmiennej pobrany z obiektu z datą dzień/ miesiąc (miesiące są w obiekcie zapisane w zakresie 0..11, więc należy dodać 1)\n var dayMonth = `${entryDate.getDate()}/${entryDate.getMonth() + 1}`;\n chartDescription.innerHTML += `<span class=\"chart__barDescription\">${dayMonth}</span>`;\n}", "function dateDisplay() {\n\n let string = `${calendarData.dateDisplay[0]}/${calendarData.dateDisplay[1]}/${calendarData.dateDisplay[2]}<br>`;\n return string\n\n}", "function showDate() {\n nuevaFecha = new Date();\n y = nuevaFecha.getFullYear();\n m = nuevaFecha.getMonth() + 1;\n d = nuevaFecha.getDate();\n document.getElementById(\"fecha\").innerHTML = m + \"/\" + d + \"/\" + y;\n}", "function show_date(){\r\n\tvar date = new Date();\r\n\tvar get_date = date.getDate();\r\n\tvar get_month = date.getMonth();\r\n\tvar get_year = date.getFullYear();\r\n\tvar get_time = date.toLocaleTimeString();\r\n\tdocument.getElementById(\"date\").innerHTML = \"Date : \"+get_date+\"/\"+Number(get_month+1)+\"/\"+get_year;\r\n\tdocument.getElementById(\"time\").innerHTML = \"Time : \"+get_time;\r\n\r\n\r\n}", "function dateTime() {\n var dateTime = new Date();\n document.write(\"Current Date\", \" \" , dateTime , \"<br>\");\n }", "function displayDate() {\n var d = new Date();\n\n let month = String(d.getMonth() + 1);\n let day = String(d.getDate());\n const year = String(d.getFullYear());\n\n let hours = String(d.getHours());\n let minutes = String(d.getMinutes());\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n if (hours.length < 2) hours = '0' + hours;\n if (minutes.length < 2) minutes = '0' + minutes;\n\n return `${day}/${month}/${year} ${hours}:${minutes}`;\n}", "function showDate() {\n const d = new Date()\n const today = document.getElementById('today')\n\n today.innerHTML = d\n}", "function displayDate(p_oDate){\n const aMonths= ['janvier', 'fevrier', 'mars', 'avril', 'mai', 'juin', \n 'juillet','aout', 'septembre','octobre','novembre','decembre'];\n let day = p_oDate.getDate();\n let month = aMonths[p_oDate.getMonth()];\n return day + ' ' + month;\n\n // if ( realMonthNumber.toString().length <2){\n // return '0' + (realMonthNumber.toString());\n // }\n // return realMonthNumber.toString();\n }", "function myDate() {\n var date = Date();\n return document.getElementById('date').innerHTML = date;\n}", "function crP(){\n daysP.id = 'daysPid';\n document.getElementById('daysDiv').appendChild(daysP);\n daysP.innerHTML = `<span style='color:white;font-size:3.5em;'>${days}</span><span style='color:green;font-size:2.5em;'><br>DAYS</span>`; \n }", "function showTodaysDate() {\n var today = new Date();\n var dd = String(today.getDate()).padStart(2, '0');\n var mm = String(today.getMonth() + 1).padStart(2, '0');\n var yyyy = today.getFullYear();\n var date = dd + \"/\" + mm + \"/\" + yyyy;\n $('#dateDiv').html('Date : ' + date);\n }", "set displayDate(date) {\n this._dateEl.innerHTML = date;\n }", "render(){\n\n const {title, desc} = this.props\n const fullDate = new Date();\n const date = fullDate.getDate() + \"/\" + fullDate.getMonth() + \"/\"+ fullDate.getFullYear();\n\n return (\n <div>\n <div className=\"card-style\">\n {/* <h3>{this.props.title}</h3>\n <p>{this.props.desc}</p> */}\n <h3>{title}</h3>\n <p>{desc}</p>\n <p>{date}</p>\n </div> \n </div>\n )\n }", "getDate(){\n if(this.state.poem.date !== \"None\"){\n return <p><i>{this.state.poem.date}</i></p>\n }else{\n return null\n }\n }", "function executionDate(data){\n\t\n\tvar date = data.executionTime;\n\t\n\t$(\"#date\").append('<p class=\"date\">'+ date +'</p>');\n}", "function renderDateInfo(date) {\n // TODO: Implement getting and showing the weekday\n //const weekdayEl = document.querySelector(\"#timeinfo_weekday\");\n const dateEl = document.querySelector(\"#timeinfo_date\");\n\n const day = date.getDate();\n const month = date.getMonth() + 1;\n let monthString = \"\";\n switch (month) {\n case 1:\n monthString = \"January\";\n break;\n case 2:\n monthString = \"February\";\n break;\n case 3:\n monthString = \"March\";\n break;\n case 4:\n monthString = \"April\";\n break;\n case 5:\n monthString = \"May\";\n break;\n case 6:\n monthString = \"June\";\n break;\n case 7:\n monthString = \"July\";\n break;\n case 8:\n monthString = \"August\";\n break;\n case 9:\n monthString = \"September\";\n break;\n case 10:\n monthString = \"October\";\n break;\n case 11:\n monthString = \"November\";\n break;\n case 12:\n monthString = \"December\";\n break;\n default:\n monthString = \"UNDEFINED\";\n break;\n }\n const year = date.getFullYear();\n dateEl.textContent = `${monthString} ${day}, ${year}`;\n}", "function renderTimeStamp(date) {\n\tvar time = document.createElement('time')\n\tvar d = parseDate(date)\n\ttime.setAttribute('datetime',date)\n\ttime.setAttribute('title',timeString(d))\n\ttime.textContent = timeAgo(d)\n\ttime.className = \"textItem time\"\n\treturn time\n}", "function showDate()\r\n{\r\n\tvar today=new Date();\r\n\tvar displayDate = checkTime(today.getDate()) + '/' + checkTime(today.getMonth()+1) + '/' + today.getFullYear();\r\n\t$(\"#menu-date\").html(displayDate);\r\n}", "function printTime() {\n $(\"#currentDay\").text(todaysDate);\n }", "function displayDateAndTime() {\n return new Date();\n}", "function setDate() {\n\nvar today = new Date();\nvar year = today.getFullYear();\n\nvar rok = document.getElementById('mainfooter');\nrok.innerHTML = '<p>Copyright &copy;' + year + ' Adam Stasiun </p>';\n}", "function jour(){\n let date_actuelle = date.getDate();\n let mois = date.getMonth()+1;\n let annee = date.getFullYear();\n mois < 10 ? mois = `0${mois}` : mois\n document.getElementById(\"date\").innerHTML=\"\"+date_actuelle+\"/\"+mois+\"/\"+annee;\n console.log(date);\n}", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<h5>Local time: { this.state.date.toLocaleTimeString() }.</h5>\n\t\t\t</div>\n\t\t);\n\t}", "function dateTime() {\n $(\"#dateTime\").text(moment().format('MMMM Do YYYY, h:mm a'));\n }", "function getTime() {\n\tOutput('<span>It\\'s the 21st century man! Get a SmartWatch</span></br>');\n}", "function currentTime(el){\n\tvar date = new Date().toJSON().slice(0,10); \n\t\n\tel.html(date);\n}", "function showDate(ulList, liList, m, y){\n\tvar date = ulList.parentNode.firstChild.childNodes[0].nodeValue;\n\tvar dateUL = document.createElement(\"li\");\n\tvar dateTEXT = document.createTextNode(m+' '+date+','+' '+y);\n\tvar dateLink = document.createElement('a');\n\tdateUL.className=\"dateUL\";\n\tdateLink.href = ulList.parentNode.firstChild;\n\tdateLink.appendChild(dateTEXT);\n\tdateUL.appendChild(dateLink);\n\tulList.insertBefore(dateUL,liList[0]);\n}", "renderDateTitle(date) {\n return moment(date).format(\"dddd\") + \", \" + moment(date).format(\"MMMM Do\");\n }", "function displayDateTime(){\n var currentdate = new Date(); \nvar datetime = currentdate.getDate() + \"/\"\n + (currentdate.getMonth()+1) + \"/\" \n + currentdate.getFullYear() + \" @ \" \n + currentdate.getHours() + \":\" \n + currentdate.getMinutes() + \":\" \n + currentdate.getSeconds();\n document.getElementById(\"bonus\").innerHTML = datetime\n}", "function dateString() {\n recipe.forEach(date => {\n let dateStr = `${date.created_at.getFullYear()}-${date.created_at.getMonth()+1}-${date.created_at.getDate()}`\n date.display_date = dateStr\n });\n return recipe\n }", "function getDate() {\n function getSuffix(days) {\n return [\"st\", \"nd\", \"rd\"][((((days + 90) % 100) - 10) % 10) - 1] || \"th\";\n }\n getSuffix();\n let weekDay = weekDays[today.getDay()];\n let monthName = months[today.getMonth()];\n let date =\n \"Today is \" +\n weekDay +\n \" \" +\n today.getDate() +\n getSuffix() +\n \" \" +\n monthName +\n \" \" +\n today.getFullYear();\n let dateDiv = document.querySelector(\".date\");\n dateDiv.textContent = date;\n getTime();\n}", "function displayDate() {\r\n currentDate.innerHTML = daysInWeek[currentDayInWeek] + ', ' + currentDay + 'th';\r\n}", "function li_date_text(dte, seperator, append_text, no_date_text) {\n\tif(!seperator) {\n\t\tseperator = '/';\n\t}\n\tif(!append_text) {\n\t\tappend_text = '';\n\t}\n\tif(!no_date_text) {\n\t\tno_date_text = '';\n\t}\t\n\tvar dte_text = '';\n\tif(dte) {\t\t\t\t\n\t\tdte_text += (dte.day) ? dte.day + seperator : '';\n\t\tdte_text += (dte.month) ? dte.month + seperator : '';\n\t\tdte_text += (dte.year) ? dte.year : '';\n\t}\t\n\tif(dte_text && append_text) {\n\t\tdte_text += append_text;\n\t} else {\n\t\tdte_text = no_date_text;\n\t}\t\n\treturn dte_text;\n}", "function getDate(){\n\tvar currentdate = new Date(); \n\tvar datetime = currentdate.getDate() + \"/\"\n + (currentdate.getMonth()+1) + \"/\" \n + currentdate.getFullYear() + \" @ \" \n + currentdate.getHours() + \":\" \n + currentdate.getMinutes() + \":\" \n + currentdate.getSeconds();\n\n\t$('#datetime_display').html(datetime);\n}", "function displayTime() {\n var curr = moment().format(\"MM-DD-YYYY HH:mm:ss\");\n currentDayEl.text(curr);\n}", "function renderDate() {\n // The class name \"content\" does not have any relevance for our js file, and is only used for creating overview of the div section.\n\n dt.setDate(1);\n// set.Date is a javascript function we use so the date is equal to the weekday. We use the parameter (1) because (0) is equal to the first day of the last month, and we want to get the first day of this month.\n// (\"JavaScript setDate\" s.d)\n var day = dt.getDay();\n\n // this is consoled log, so we can see how many dates from last month we have.\n console.log(dt.getDay());\n\n var endDate = new Date(\n dt.getFullYear(),\n dt.getMonth()+1,0\n ).getDate();\n\n // Test, where we should get the last day of the month. That happens because we in getMonth use +1 besides the parameter, and furthermore use 0 which represents the last day of the last month.\n // This object constructor will also be relevant in a later for loop.\n console.log(endDate);\n\n var prevDate = new Date(\n dt.getFullYear(),\n dt.getMonth(),0).getDate();\n// This variable refers to the HTML arrow symbol and the function executes with an onClick. We use date:0; because that is the last month\n var today = new Date();\n console.log(today);\n // This console log consoles the date of today via a javascript method\n // We declare this variable because we want to use it in or for loop, that via HTML should print all the dates of the month.\n console.log(prevDate);\n // Here we test that the prevDate we just created is the last day of the last month.\n\n// But firstly an array of all the months.\n var months = [\"January\",\"February\",\"March\",\"April\",\"May\", \"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"];\n\n// We here use a object constructor function, which prints the date to our paragraph in html.\n// \"\"JaveScript | date.toDateString\" s.d)/\n document.getElementById(\"date_str\").innerHTML = 1 + \"/\" + (dt.getMonth() + 1) + \"/\" + dt.getFullYear();\n\n// We use our dt variable new date to get the month.\n document.getElementById(\"month\").innerHTML = months[dt.getMonth()];\n\n cells = \"\";\n\n for(x = day; x > 0; x--){\n cells += \"<div class='prev_date'>\" + (prevDate - x + 1) + \"</div>\";\n }\n\n// This for loop connects with our div class \"'prev_date\" it starts out by saying our previous date, which is the last day of the last month=30. Then it says - x = the days that is represented from last month. It then plus with 1 so we get 29, and the loop repeats.\n\n// This for loop is for all the days of the relevant month. We again use a for loop, ad break out of the loop when i is less than our equal to the last day of the month\n\n for (i = 1; i <= endDate; i++){\n if(i == today.getDate() && dt.getMonth() == today.getMonth()){\n //var newDate = \"day\" + i;\n cells += \"<div class='day' id ='\" + i + \"' value ='\" + i + \"'>\" + i + \"</div>\";\n\n } else{\n\n cells += \"<div class='day' id ='\" + i + \"' value ='\" + i + \"'>\" + i + \"</div>\";\n\n// If the date is not equal to today's date, we use the conditional else statement, until we hit todays date. Then the if statement will be used. The break happens at the endDate\n\n }\n }\n\n // Here we use innerHTML to print the cells we have declared above, in the user interface.\n document.getElementsByClassName(\"days\")[0].innerHTML = cells;\n one++;\n console.log( \"første tæller\" + one)\n // add onclick functions to every day with addDateChecker();\n addDateChecker();\n}", "function init (){\n todayEl.text(today.format(\"DD-MMM-YYYY\"));\n buildBody();\n buildList();\n}", "display_date_formate(date) {\n if (!date)\n return null;\n const [year, month, day] = date.split('-');\n let new_date = `${day}-${month}-${year}`;\n return new_date;\n }", "function dateMaker (){\n var d = new Date();\n var date = d.toString().split(\" \")\n var arrayDate = [];\n for(i = 0; i < 4; i ++){\n arrayDate.push(date[i]);\n }\n var dateSentence = arrayDate.join(\" \");\n return dateSentence;\n}", "function displayDOB() {\n \n // **FOR DEMONSTRATIVE PURPOSES (comment out or delete later)** // \n celebBirthYear = 1996;\n \n var celebDOB = celebBirthDate + \" \" + celebBirthMonth + \" \" + celebBirthYear;\n $(\"#celebDOB\").text(celebDOB);\n }", "function paintGridDate(){\r\n $('.futureDate').text(gridSimulatorVar.future_date.format(gridSimulatorCons.moment_format))\r\n}", "function displayTime() {\n var rightNow = moment().format(\"MMM DD, YYYY [:] hh:mm:ss a\");\n timeDisplayEl.text(rightNow);\n}", "function showNotificationDate(date) {\n\t$(\"#notifications\").children(\"#title\").children(\"h2\").html(date);\n}", "function injectDateToHTML(date) {\n const h2Elems = Array.from(\n document.querySelectorAll('.repository-content .BorderGrid-cell > h2')\n );\n\n const aboutElementContainer = h2Elems.find(\n (elem) => elem.textContent === 'About'\n ).parentElement;\n\n const dateHTML = `\n <div id=\"gdc\" class=\"mt-3\">\n <a class=\"muted-link\" href=\"#\">\n <svg height=\"16\" class=\"octicon octicon-calendar mr-2\" mr=\"2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M13 2h-1v1.5c0 .28-.22.5-.5.5h-2c-.28 0-.5-.22-.5-.5V2H6v1.5c0 .28-.22.5-.5.5h-2c-.28 0-.5-.22-.5-.5V2H2c-.55 0-1 .45-1 1v11c0 .55.45 1 1 1h11c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 12H2V5h11v9zM5 3H4V1h1v2zm6 0h-1V1h1v2zM6 7H5V6h1v1zm2 0H7V6h1v1zm2 0H9V6h1v1zm2 0h-1V6h1v1zM4 9H3V8h1v1zm2 0H5V8h1v1zm2 0H7V8h1v1zm2 0H9V8h1v1zm2 0h-1V8h1v1zm-8 2H3v-1h1v1zm2 0H5v-1h1v1zm2 0H7v-1h1v1zm2 0H9v-1h1v1zm2 0h-1v-1h1v1zm-8 2H3v-1h1v1zm2 0H5v-1h1v1zm2 0H7v-1h1v1zm2 0H9v-1h1v1z\"></path></svg>\n ${date}\n </a> \n </div>\n `;\n\n aboutElementContainer.insertAdjacentHTML('beforeend', dateHTML);\n}", "function printdate(iso8601) {\n var d = new Date(iso8601);\n var now = new Date;\n var a = '<span title=\"'+d+'\">', b = '</span>';\n if (d.getFullYear() != now.getFullYear() || d.getMonth() != now.getMonth() || d.getDate() != now.getDate()) {\n return a+'on '+d.toLocaleDateString()+b;\n }\n return a+'on '+d.toLocaleTimeString()+' '+tz+b;\n}", "function DateElement () {}", "function display() {\n var thisDay = today.getDay();// lấy thứ theo số thứ tự của mảng 0-6, lưu giá trị hiển thị\n var thisMonth = today.getMonth();// lấy tháng theo index 0-11, lưu giá trị hiển thị\n var thisYear = today.getFullYear();// lấy năm đủ 4 chữ số, lưu giá trị hiển thị\n var thisDate = today.getDate();// lấy ra ngày 1-31, lưu giá trị hiển thị\n var nowDate = now.getDate();// lay ngay\n console.log(nowDate);\n var nowMonth = now.getMonth();// lay thang\n var nowYear = now.getFullYear();// lay nam\n var text = \"\";\n\n if (nowYear % 4 == 0) month_day[1]=29;\n console.log(nowYear);\n var first_date = new Date(thisYear, thisMonth, 1);// trả về kết quả đầy đủ h, ngày 1 tháng năm ở thời điểm được trỏ tới\n var first_day = first_date.getDay();// trả về thứ của ngày mùng 1 = so\n console.log(first_day);\n title = month_name[thisMonth] + ' ' + thisYear;\n document.getElementById('title').innerHTML = title;\n text += '<table border = 2 style=\"height: 300px;width: 440px;\">';\n text += '<tr><td style=\"color: orangered;\">' + \"Sunday\" + '</td><td style=\"color: orangered;\">' + \"Monday\" + '</td><td style=\"color: orangered;\">' + \"Tuesday\" + '</td><td style=\"color: orangered;\">' + \"Wednesday\" + '</td><td style=\"color: orangered;\">' + \"Thursday\" + '</td><td style=\"color: orangered;\">' + \"Friday\" + '</td><td style=\"color: orangered;\">' + \"Saturday\" + '</td></tr>';\n text+='<tr>';\n for (i = 0; i < first_day; i++) {\n console.log(i);\n console.log(first_day);\n text += \"<td> </td>\";\n }\n date = 1;\n while (date <= month_day[nowMonth]){\n for (j = first_day; j < 7; j++) {\n if ( date <= month_day[thisMonth]){\n if (nowDate == date && nowMonth == thisMonth && nowYear == thisYear){\n text +='<td id = \"nowDate\"><b style=\"color: orangered;\">' + date + '</b></td>';\n }else {\n text +='<td class = \"date\">' + date + '</td>';\n }\n } else {\n text += \"&nbsp\";\n }\n date++;\n }\n text += '</tr>';\n first_day = 0;\n }\n text += '</table>';\n document.getElementById(\"display\").innerHTML = text;\n}", "function renderDate() {\n if (myStorage.getItem(\"use24hr\") == \"true\") {\n $(\"#currentDay\").text(moment().format(\"MMMM Do YYYY, H:mm:\"));\n } else {\n $(\"#currentDay\").text(moment().format(\"MMMM Do YYYY, h:mm:\"));\n }\n }", "function getDate() {\n let m = moment().format('YYYY-MM-DD');\n console.log('Generating PDF at: ', m)\n return m\n }", "function clock(){\n // Grab the clock selector\n var clock = document.querySelector('.time')\n // Output to the selector \n clock.innerHTML = Dates('MMMM Do YYYY, h:mm:ss A')\n }", "function getdate(){\n\n element = document.getElementById(\"date\");\n\n element.innerText=dateobj.getDate();\n}", "function showDate(){\r\n var today = new Date();\r\n var dd = today.getDate();\r\n var mm = today.getMonth()+1; //January is 0!\r\n var yyyy = today.getFullYear();\r\n\r\n if(dd<10) {\r\n dd = '0'+dd\r\n } \r\n\r\n if(mm<10) {\r\n mm = '0'+mm\r\n } \r\n\r\n today = dd + '/' + mm + '/' + yyyy;\r\n document.getElementById(\"date\").innerText = today;\r\n document.getElementById(\"date\").textContent = today;\r\n\r\n setTimeout(showTime, 1000);\r\n \r\n }", "function updateDate() {\n let current = new Date();\n let month = current.getMonth() + 1;\n let day = current.getDate();\n let year = current.getFullYear();\n let date = month + \"/\" + day + \"/\" + year;\n\n currentDateHeading.innerHTML = date;\n}", "function init() {\n \n // Want to be strict:\n 'use strict';\n\n // Create a Date object:\n var today = new Date();\n\n // Create a custom message:\n var message = 'Right now it is ' + today.toLocaleDateString();\n message += ' at ' + today.getHours() + ':' + today.getMinutes();\n \n // Get a reference to the paragraph:\n var output = document.getElementById('output');\n \n // Update the innerText or textContent property of the paragraph:\n\tif (output.textContent !== undefined) {\n\t\toutput.textContent = message;\n\t} else {\n\t\toutput.innerText = message;\n\t}\n \n} // End of init() function.", "setTitle2(date) {\n let currentDate = new Date();\n currentDate.setHours(0, 0, 0, 0);\n let cpd = new Date(date);\n cpd.setHours(0, 0, 0, 0);\n let diff = (currentDate.getTime() - cpd.getTime()) / (1000 * 3600 * 24);\n let t = '';\n if (diff == 0) t = \"Today\";else if (diff == 1) t = \"Yesterday\";else if (diff == -1) t = \"Tomorrow\";else t = cpd.toLocaleString('default', {\n weekday: 'long'\n }) + ', ' + cpd.toLocaleString('default', {\n month: 'long'\n }).substr(0, 3) + ' ' + cpd.getDate();\n return t;\n }", "function dateString() {\n posts.forEach(date => {\n let dateStr = `${date.created_at.getFullYear()}-${date.created_at.getMonth()+1}-${date.created_at.getDate()}`\n date.display_date = dateStr\n });\n return posts\n }", "function displayTime(){\r\n\tvar elt = \"#day\";\r\n\tvar now = new Date();\r\n\t$(elt).append(now.getDate()+\"/\"+(now.getMonth()+1) + \"/\"+now.getFullYear()+\" \"+(now.getHours())+\":\"+(now.getMinutes()+1)+\":\"+(now.getSeconds()+1));\r\n\r\n}", "function showDate(date) {\n let weekDays = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ];\n let weekDay = weekDays[currentDate.getDay()];\n let day = currentDate.getDate();\n let months = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ];\n let month = months[currentDate.getMonth()];\n\n return `${weekDay} ${day} ${month}`;\n}", "function myDate(){\r\n let today = new Date();\r\n let dd = String(today.getDate()).padStart(2, '0');\r\n let mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!const yyyy = today.getFullYear();\r\n let yyyy = today.getFullYear();\r\n \r\n let day = mm + '/' + dd + '/' + yyyy;\r\n document.getElementById(\"#date\").innerHTML = day;\r\n }", "get pubDate() {\n return this.getText('pubDate');\n }", "function displayTime() {\n var rightNow = moment().format('MMM DD, YYYY [at] hh:mm:ss a');\n timeDisplayEl.text(rightNow);\n}", "function displayDateTime() {\n $(\"#currentDay\").text(\"Today is: \" + moment().format(\"dddd, MMMM Do YYYY\"));\n $(\"#currentTime\").text(\"Time is now: \" + moment().format(\"h:mm:ss A\"));\n }", "constructext(item) {\r\n var returntext =\r\n item.day +\r\n \" \" +\r\n item.startTime +\r\n \" - \" +\r\n item.endTime +\r\n \" - Grade \" +\r\n item.grade +\r\n \" - \" +\r\n item.courseDescription;\r\n return returntext;\r\n }", "function ShowDate(dateJson) {\n return (\n <div className=\"content\">\n <h3 className=\"content__title\">{dateJson.title}</h3>\n <p className=\"content__userId\">\n <strong>{dateJson.userId} </strong>\n </p>\n <p className=\"content__body\">{dateJson.body}</p>\n </div>\n );\n}", "function handle5(){\n var d = new Date();\n document.getElementById(\"demo10\").innerHTML = d;\n }" ]
[ "0.737805", "0.73727024", "0.7317367", "0.6804612", "0.67985934", "0.6750046", "0.67458224", "0.671332", "0.6702229", "0.6698476", "0.66921663", "0.66776747", "0.6669386", "0.6647061", "0.66221535", "0.6616634", "0.65552646", "0.65515614", "0.6533203", "0.6515853", "0.651577", "0.6495353", "0.6451292", "0.6451085", "0.64496946", "0.6439987", "0.64224195", "0.6420056", "0.6399635", "0.63939714", "0.63871706", "0.6373552", "0.63459754", "0.6313703", "0.6306113", "0.6303954", "0.6300614", "0.6295555", "0.62847245", "0.6281575", "0.6275956", "0.6260098", "0.6259438", "0.62588227", "0.6257963", "0.6254496", "0.6249013", "0.6240909", "0.6214826", "0.6192933", "0.6185044", "0.61816466", "0.61619586", "0.61407864", "0.61368555", "0.6125752", "0.61231", "0.6104785", "0.60997015", "0.6087467", "0.60776436", "0.60748506", "0.60704917", "0.6064976", "0.6059625", "0.60539854", "0.6040867", "0.6027901", "0.6023922", "0.60167086", "0.60123134", "0.600905", "0.6006596", "0.60061353", "0.5992078", "0.59906226", "0.598853", "0.5986727", "0.5980576", "0.59779847", "0.59775525", "0.5970635", "0.5966812", "0.5965803", "0.5963687", "0.59611404", "0.59568065", "0.5953024", "0.5948618", "0.5947182", "0.59429747", "0.5938036", "0.5937747", "0.5934336", "0.5932282", "0.59312123", "0.59285593", "0.5926133", "0.59256274", "0.5918945" ]
0.7783231
0
Button for deleting note
function createBtnDelete(obj) { let btnDelete = document.createElement("button"); btnDelete.id = "delete-button"; btnDelete.className = "note-button"; btnDelete.addEventListener("click", function () { obj.removeNote(); }); btnDelete.appendChild(createImgDelete()); return btnDelete; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function note_delete()\n {\n // grab the .data element of note to delete\n var axe_it = $(this).data(\"_id\");\n $.ajax(\n {\n url: \"/api/notes/\" + axe_it,\n method: \"DELETE\"\n }).then(function()\n {\n // on success, hide the modal\n bootbox.hideAll();\n });\n }", "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", "function deleteNote() {\n if (oSelectedNote != null) {\n oData.jsFormula.removeNote(oSelectedNote.nuNote);\n oNotesTable.row('.selected').remove().draw( false );\n initNote();\n }\n}", "function deleteButtonPressed(todo) {\n db.remove(todo);\n}", "function deleteNote(event) {\n event.preventDefault();\n const element = event.target;\n\n const note = $(this).data('id');\n\n $.ajax({\n method: 'delete',\n url: `/api/notes/${note}`,\n headers: { 'X-CSRF-Token': token },\n }).done(() => {\n $(element).parents('.note').remove();\n });\n }", "function deleteButtonClick(){\n\t\tdisplayNotes();\n\t\tvar h = prompt(\"Wich one you want to delete? Example: 1, 2, 3\");\n\t\tstorage.splice(0,1);\n\t\t\n\t\tdisplayNotes();\t\n\t}", "function handlenoteDelete() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n deletenote(currentnote);\n }", "function deleteNote(noteID) {\n // Retrieve the object store for the notes.\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n console.log(noteID);\n \n // Remove the note from the database.\n objectStore.delete(noteID);\n\n // Remove the radio button for the note.\n var button = $('input[value=\"' + noteID + '\"]');\n $(button[0].parentElement).slideUp(\"fast\");\n}", "function deleteNote() {\n card_body = $(this).parent();\n card = $(this).parent().parent();\n\n text_delete_title = card_body.find($('textarea')).val();\n changeStatus(text_delete_title, \"binned\");\n\n localStorage.setItem(\"Notes\",JSON.stringify(notes));\n card.remove();\n \n $('.toast').toast(\"show\");\n}", "function delNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\ttr.deleteCell(tr.childElementCount-1);\r\n\tdelState();\r\n\t\r\n\trefreshNotes();\r\n}", "function deleteNote(note) {\n note.remove();\n borderedNote = null;\n}", "function deleteItem(e) {\n // retrieve the name of the task we want to delete. We need\n // to convert it to a number before trying it use it with IDB; IDB key\n // values are type-sensitive.\n let noteId = Number(e.target.parentNode.getAttribute('data-note-id'));\n\n // open a database transaction and delete the task, finding it using the id we retrieved above\n let transaction = db.transaction(['notes_os'], 'readwrite');\n let objectStore = transaction.objectStore('notes_os');\n let request = objectStore.delete(noteId);\n\n // report that the data item has been deleted\n transaction.oncomplete = function() {\n // delete the parent of the button\n // which is the list item, so it is no longer displayed\n e.target.parentNode.parentNode.removeChild(e.target.parentNode);\n console.log('Note ' + noteId + ' deleted.');\n\n // Again, if list item is empty, display a 'No notes stored' message\n if(!list.firstChild) {\n let listItem = document.createElement('li');\n listItem.textContent = 'No notes stored.';\n list.appendChild(listItem);\n }\n };\n}", "function deleteNote(noteEl) {\n fetch(url + '/' + `${noteEl.id} `, {\n method: 'DELETE'\n }).then(() => noteEl.parentElement.remove())\n}", "function deleteSingleNote() {\n $('.delete-note').each(function() {\n $(this).click(function() {\n note.delete(Number($(this).closest('.col-md-4').attr('id')));\n updateChromeNewTab();\n });\n });\n}", "function deleteNote() {\n const note_id = note.id;\n axios\n .delete(`/api/deleteNote/${note_id}`)\n .then((res) => {\n // console.log(res.data);\n })\n .catch((error) => console.log(error));\n }", "function deleteButtonPressed(todo) {\n localDB.remove(todo, function callback(err, result) {\n if (!err) {\n showStatus('good', 'Sucessfully deleted ToDo: '+todo.title);\n $.JSONView(result, $('#output-resp'));\n }else{\n showStatus('bad', 'Problem deleting ToDo: '+todo.title);\n }\n console.log(err || result); // Log error or result to the consule for debugging\n });\n }", "function deleteNote(noteId) {\n\tif (confirm('Are you sure?')) {\n\t\t// get branch of the specific note\n\t\tvar toDelete = notesdb.child(noteId);\n\t\t// remove\n\t\ttoDelete.remove();\n\t}\n}", "function deleteNote(d) {\n var selectedListItem = noteList.options[noteList.selectedIndex];\n if (d.keyCode == 46) {\n var j = selectedListItem.id;\n var deletedNode = document.getElementById(j);\n localStorage.removeItem(j);\n var sbq = document.getElementById(\"note-\" + j);\n sbq.innerText = \"\";\n sbq.removeAttribute(\"id\");\n while (noteList.lastChild) {\n noteList.removeChild(noteList.lastChild);\n }\n displayListNotes();\n }\n}", "function deleteNote() {\n\t$('.nota-delete').on('click', function(e) {\n\t\te.preventDefault();\n\t\tvar $this = $(this);\n\t\tvar note = $this.closest('.nota-thumb');\n\t\tnote.addClass('transparent');\n\t\tsetTimeout(function() {\n\t\t\tnote.remove();\n\t\t}, 500);\n\t\tvar key = note.attr('id');\n\t\tconsole.log(key);\n\t\tlocalStorage.removeItem(key);\n\t});\n}", "function deleteItem(e) {\r\n var btn = e.target;\r\n\r\n while (btn && (btn.tagName != \"A\" || !/\\bdelete\\b/.test(btn.className))) {\r\n btn = btn.parentNode;\r\n if (btn === this) {\r\n btn = null;\r\n }\r\n }\r\n if (btn) {\r\n var btnParent = btn.parentNode.parentNode.parentNode\r\n this.removeChild(btnParent);\r\n updateNotesListOnRemoveItem(btn);\r\n }\r\n}", "async function confirmClick(removeButton){\n //let noteId = $(removeButton).parent().attr('id');\n if (confirm('Are you sure?')){\n deleteNote (removeButton);\n } else {\n renderNotes ();\n }\n}", "function deleteNote(index) {\n let notes_check = localStorage.getItem(\"notes\");\n if (notes_check == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes_check);\n }\n\n /*we are deleting from the array notesObj the elemnt in which \"Delete Note\" has been clicked and the index of that element is passed here.1 indicates that we want to delete just one element from that index number.*/\n notesObj.splice(index, 1);\n\n //after deleting, we need to update the local storage and show the updated notes.\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n //showing the updated notes\n showNotes();\n\n}", "function makeNote(note) {\n let noteLi = document.createElement(\"li\")\n noteLi.innerText = note.title\n noteLi.className= 'note-li'\n noteLi.dataset.id = note.id\n noteList.append(noteLi)\n\n //How to crete delete button\n let delBtn = document.createElement(\"button\")\n delBtn.innerText = \"delete\"\n delBtn.className = \"del-btn\"\n delBtn.dataset.id = note.id\n noteLi.append(delBtn)\n }", "function deleteNote(index) {\n \n let confirmDel = confirm(\"Are you sure want to delete this note!!\");\n\n if(confirmDel == true)\n {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesobj = [];\n }\n else {\n notesobj = JSON.parse(notes);\n }\n notesobj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesobj));\n // deletemark(index);\n showNotes();\n }\n\n}", "function deleteNote(noteId) {\n Swal.fire({\n title: 'Eliminar Nota',\n text: `¿Estás seguro(a) que quieres eliminar la nota ${noteId}?, esta acción no se puede deshacer.`,\n icon: 'warning',\n showCancelButton: true,\n confirmButtonText: 'Sí, Eliminar',\n cancelButtonText: 'Cancelar'\n }).then((result) => {\n if (result.isConfirmed) {\n executeRequest('DELETE', 'notes/delete', { id: noteId }).then(r => {\n\n iziToast.success({\n message: 'Nota eliminada',\n close: true,\n timeout: 1500,\n });\n\n loadNotes();\n\n }).catch(() => {\n // Se maneja en la petición\n });\n }\n })\n}", "function deleteNote(index) {\r\n const uid = localStorage.getItem(\"uid\")\r\n var adaRef = firebase.database().ref('notes/' + uid + '/' + index);\r\n adaRef.remove()\r\n .then(function () {\r\n getNotesForThisUser().then(notes => display(notes)).catch(err => handleError(err))\r\n CKEDITOR.instances[\"addTxt\"].setData('');\r\n })\r\n .catch(function (error) {\r\n console.log(\"Remove failed: \" + error.message)\r\n });\r\n\r\n\r\n\r\n}", "function updateNotes (notesList) {\n const notesDisplayArea = document.getElementById('notesDisplayArea')\n notesDisplayArea.innerHTML = notesToHTML(notesList)\n notesDisplayArea.querySelectorAll('delete').forEach(button => {\n button.addEventListener('click', event => {\n const noteId = button.dataset.noteId\n console.log(button.dataset.noteId)\n deleteNote(noteId)\n })\n })\n}", "function deleteNote(index)\n{\n console.log(\"I am clicking\" , index)\n let notes = localStorage.getItem('notes');\n if (notes == null)\n {\n notesObj = [];\n }\n else\n {\n notesObj = JSON.parse(notes);\n \n }\n\n notesObj.splice(index,1)\n localStorage.setItem(\"notes\" , JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index){\n let confirmDel = confirm(\"Are you sure you want to delete this?\");\n if(confirmDel == true){\n let notes = localStorage.getItem(\"Notes\"+id);\n //if notes in localstorage is empty declare one\n if(notes == null){\n notesObj = [];\n } else{\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"Notes\"+id, JSON.stringify(notesObj));\n showNotes();\n }\n }", "function deleteNote(index) {\n// console.log(\"I am deleting\", index);\nlet confirmDel = confirm(\"Delete this note?\");\nif (confirmDel == true) {\n \n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}\n}", "function removeNote(){\n\tthis.parentNode.remove();\n\tupdateNoteNumbers();\n}", "deleteNote(privateNote) {\n privateNote.deleteRecord();\n privateNote.save();\n }", "deleteNote() {\n\n // Check if any board is selected before delete, else terminate\n var boardID = this.view.boardView.selectedBoardID;\n if (boardID !== -1) {\n\n // 1. Delete the note from the model\n var noteToBeDeleted = this.view.boardView.boardCollection[boardID].getNote();\n this.model.deleteNote(noteToBeDeleted.noteID);\n\n // 2. Delete the note from the view\n this.view.boardView.deleteNote(boardID);\n\n // 3. Update the startNoteID and endNoteID\n if (this.startNoteID === 0 && this.endNoteID === 0) {\n this.startNoteID = -1;\n this.endNoteID = -1;\n\n } else if (this.endNoteID <= this.model.noteCollection.length - 1) {\n // (a) Get the next note from the model to be displayed (if exists) from right\n var nextNote = this.model.noteCollection[this.endNoteID];\n this.view.boardView.displayNoteAtEnd(this.endNoteID, nextNote.name);\n\n } else if (this.startNoteID > 0) {\n // (a) Get the prev note from the mode to be displayed (if exists) from left\n var prevNote = this.model.noteCollection[this.startNoteID - 1];\n this.view.boardView.displayNoteAtStart(this.startNoteID - 1, prevNote.name);\n\n --this.startNoteID;\n --this.endNoteID;\n } else {\n // No note appended at start or end\n --this.endNoteID;\n }\n\n // 4. Unselect the board after delete\n this.view.boardView.unselectBoard();\n }\n }", "function deleteNote(index, id, date, label) {\n if (confirm(infoErrorObj.noteDeleteQ) == true) {\n CalendarService.deleteNote(id)\n .then(function (response) {\n if (response.data.message == 'deleteOk') {\n\n var currentYear = self.activeDayObj.year,\n currentMonth = toZeroBased(self.months.indexOf(self.activeDayObj.month) + 1),\n day = toZeroBased(self.activeDayObj.num.toString()),\n noteDate;\n\n if (!currentMonth && !currentYear && !day) {\n return toastr.error(infoErrorObj.noCurrentDate);\n }\n\n noteDate = currentYear + '-' + currentMonth + '-' + day;\n\n if (date == noteDate) {\n\n // Decrement note based on which one is removed\n if (label == 'Yellow') {\n self.activeDayObj.yellow--;\n }\n if (label == 'Green') {\n self.activeDayObj.green--;\n }\n if (label == 'Blue') {\n self.activeDayObj.blue--;\n }\n if (label == 'Red') {\n self.activeDayObj.red--;\n }\n\n // Remove note from active day notes\n self.activeDayObj.notes.splice(index, 1);\n }\n\n toastr.info(infoErrorObj.deleteOk);\n\n }\n })\n .catch(function (error) {\n // do some error handling\n })\n }\n\n }", "function deleteNote() {\n const note = notes.value;\n window.localStorage.removeItem(note);\n editor.value = '';\n for (let i = 0; i < notes.length; i++) {\n const option = notes[i];\n if (option.value === note) {\n notes.removeChild(option);\n }\n }\n}", "handler(argv) {\n notes.removeNote(argv.title)\n // console.log('Removing the note')\n }", "function deleteNote(note, bord) {\n var dragid = ($('#' + bord).attr('draggable') == 'true') ? 'true' : 'false';\n if (dragid == 'true') {\n delNote('https://localhost:44382/api/notes/', parseInt($('#link' + note.substring(4, 9)).val()));\n $('#' + note).remove();\n }\n else {\n alert('Column is locked. Please unlock Column before deleting note');\n }\n }", "function deleteNote(index) {\n// console.log(\"I am deleting\", index);\n let confirmDel = confirm(\"Delete this note?\");\n if (confirmDel == true) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n }\n \n}", "function handleClick() {\n // (21) tap into props.onDelete to trigger the function DeleteNote(id)\n // (28) pass in the props.id (index) to know which one to delete in onDelete\n props.onDelete(props.id);\n }", "deleteNote(event) {\n //testing purposes only\n console.log('deleteNote');\n //the preventDefault() option is added to stop the page from reloading upon submitting a note\n event.preventDefault();\n //we remove the note by deleting the respective id (note key)\n this.props.deleteNote(this.props.note.id);\n }", "function deleteNote(index) {\n let confirmDel = confirm(`Delete this note?`);\n if (confirmDel == true) {\n let notes = localStorage.getItem(\"notes\")\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n }\n\n}", "function deleteNote(username){\n if(db.get('posts').find({username: username}).value() !== undefined){\n // delete note\n db.get('posts').remove({username, username}).write()\n }\n else{\n // note does not exist\n }\n}", "function deleteNote(note) {\n setAllNotes(allNotes.filter(item => item !== note));\n const notesDataJson = JSON.stringify(allNotes);\n localStorage.setItem('notesData', notesDataJson);\n }", "function deleteNote(index){\n console.log(`I am deleting `,index);\n // let notes=localStorage.getItem(\"notes\");\n // if(notes==null){\n // notesobj=[];\n // }\n // else{\n // notesobj=JSON.parse(notes);\n // }\n notesobj.splice(index,1);\n localStorage.setItem(\"notes\",JSON.stringify(notesobj));\n showNotes();\n}", "remove() {\r\n if (this.deleted === false) {\r\n this.deleted = true;\r\n } else if (this.deleted === true && DOM.current === 'deleted') {\r\n let input;\r\n do {\r\n input = prompt(`Do you really wanna remove \"${this.title}\" completely? y/n`).toLowerCase();\r\n if (input === 'y') {\r\n console.log(this.id);\r\n database.nukeNote(this.id);\r\n break;\r\n }\r\n if (input === 'n') {\r\n alert('Okey, no deletion made');\r\n break;\r\n }\r\n } while (input === 'y' || input === 'n')\r\n }\r\n }", "function deleteNote(index){\r\n // console.log('I am deleting', index);\r\n titleObj.splice(index, 1);\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n localStorage.setItem(\"title\",JSON.stringify(titleObj));\r\n\r\n\r\n showNotes();\r\n}", "function deleteAnswer(deleteButton) {\n $(deleteButton).closest(\"span\").closest(\"div\").closest(\"span\").remove();\n\n if (newCommandIsOpen) {\n setCommitButton(true);\n } else {\n checkCommandInEditMode();\n setCommitButton(false);\n }\n}", "function removeNote(e) {\n div_id = e.path[2].id;\n if (div_id !== 'data') {\n // do not delete the entire data element accidentally due to html image glitches.\n document.getElementById(div_id).remove();\n save_notes();\n loadNotes();\n }\n }", "function deleteNote(index)\n{\n//console.log(\"deleting\",index);\nlet notes=localStorage.getItem(\"notes\");\nif (notes===null)\n{\nnotesObj=[];\n}\nelse\n{\nnotesObj=JSON.parse(notes);\n}\nnotesObj.splice(index,1);\nlocalStorage.setItem(\"notes\",JSON.stringify(notesObj));\nshowNotes();\n}", "function delNote(d)\n{\n // get key as id, then remove that object from DB\n var keyToDel = d.id\n loc.child(keyToDel).remove()\n\n // delete from web page\n var rowToBeDel = d.parentNode.parentNode\n var ch0 = rowToBeDel.childNodes[0]\n var ch1 = rowToBeDel.childNodes[1]\n var ch2 = rowToBeDel.childNodes[2]\n rowToBeDel.removeChild(ch0)\n rowToBeDel.removeChild(ch1)\n rowToBeDel.removeChild(ch2)\n}", "deleteNote(note) {\n this.notes = this.notes.filter(item => item !== note);\n }", "function deleteNote(index) {\r\n //console.log(\"Deleting Note\",index);\r\n let notes = localStorage.getItem(\"notes\");\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\r\n// console.log(\"I am deleting\", index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function removeNotes() {\n $(\".note\").remove();\n saveNotes();\n}", "function deleteNote(noteId) {\n $('#mainNoteDiv' + noteId).removeClass(\"note\")\n $('#deleted' + noteId).val(\"true\");\n $('#textarea' + noteId).hide();\n $('#goBackButton' + noteId).hide();\n $('#subNoteButton' + noteId).hide();\n $('#select' + noteId).hide();\n $('#delButton' + noteId).hide();\n $('#goBack' + noteId).remove();\n\n for (var i = 0; i < map.length; i++) {\n if (map[i] == noteId) {\n deleteNote(i)\n }\n }\n }", "function deleteNote(index) {\n if (confirm(\"Do you want to delete the note?\")) {\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 notesObj = notesObj.reverse();\n dateObj = dateObj.reverse();\n starObj = starObj.reverse();\n\n notesObj.splice(index, 1);\n dateObj.splice(index, 1);\n starObj.splice(index, 1);\n\n notesObj = notesObj.reverse();\n dateObj = dateObj.reverse();\n starObj = starObj.reverse();\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n localStorage.setItem(\"dateItem\", JSON.stringify(dateObj));\n localStorage.setItem(\"starItem\", JSON.stringify(starObj));\n }\n showNotes();\n showStarNode();\n}", "function deleteNote(index) {\n //console.log(\"Deleting : \", index);\n let noteField = localStorage.getItem(\"data\");\n if (noteField == null) {\n noteArray = [];\n } else {\n noteArray = JSON.parse(noteField);\n }\n\n noteArray.splice(index, 1); //Splice function to remove elements in array\n localStorage.setItem(\"data\", JSON.stringify(noteArray));\n //console.log(\"Deleted\");\n display();\n}", "function deleteNote(index) {\n // console.log(\"A node is being deleted\", index);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1); // Deleting the element from the array\n localStorage.setItem(\"notes\", JSON.stringify(notesObj)); //updating the local storage\n showNotes();\n}", "function deleteNote(index) {\n // console.log(`I am Deleating the notes no :${index}`);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesArr = [];\n }\n else {\n notesArr = JSON.parse(notes);\n }\n notesArr.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesArr));\n showNotes();\n}", "function deleteNote(index) {\n // console.log(\"I am deleting\", index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "_onDeleteClicked() {\n $('<p>')\n .text(_`\n This integration will be permanently removed. This cannot\n be undone.\n `)\n .modalBox({\n buttons: [\n $('<button>')\n .text(_`Cancel`),\n $('<button class=\"danger\">')\n .text(_`Delete Integration`)\n .click(() => this.model.destroy({\n beforeSend: xhr => {\n xhr.setRequestHeader(\n 'X-CSRFToken',\n this.model.collection.options.csrfToken);\n },\n })),\n ],\n title: _`Are you sure you want to delete this integration?`,\n });\n }", "removeNote(noteId) {\n //localizando el hijo y buscarlo por el id\n this.db.child(noteId).remove();\n\n }", "async function deleteNoteHandler(event) {\n event.preventDefault();\n\n const id = window.location.toString().split('/')[\n window.location.toString().split('/').length - 1\n ];\n const response = await fetch(`/api/notes/${id}`, {\n method: 'DELETE'\n });\n\n if (response.ok) {\n document.location.replace('/dashboard');\n } else {\n alert(response.statusText);\n }\n}", "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n };\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n \n \n let notesTitle = localStorage.getItem('notesTitle');\n if (notesTitle == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(notesTitle);\n };\n titleObj.splice(index, 1);\n localStorage.setItem('notesTitle', JSON.stringify(titleObj));\n // localStorage.removeItem('Name2');\n showNotes();\n}", "function deleteNote(index){\r\n // console.log(\"I am deleting\",index);\r\n let notes = localStorage.getItem('notes')\r\n if(notes==null){\r\n notesObj = [];\r\n }else{\r\n notesObj = JSON.parse(notes)\r\n\r\n }\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1)\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n console.log(\"One note deleted\",\"The id is : \",index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n //splice take the starting index from where to delete,and the number of the element\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteCurrentNote() {\n\n // console.log(window.currentNote);\n\n // Make a confirm message for delete of a note\n var onDeletePromise = deleteNotefunction(window.currentNote);\n document.getElementById('note-description-content').innerHTML = '';\n document.getElementById('note-description-editor').innerHTML = '';\n document.getElementById('note-description-editor').value = '';\n document.getElementById('remove-note-button').classList.add('hidden');\n document.getElementById('edit-note-title-box').classList.add('hidden');\n document.getElementById('edit-title-button').classList.add('hidden');\n document.getElementById('tab-nav').classList.add('hidden');\n\n window.currentNote = ''; // Now no note is in progress to be edited!\n}", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(worker, noteId) {\n if (noteId != null) {\n datastore.deleteNote(noteId);\n worker.port.emit(\"NoteDeleted\", noteId);\n }\n}", "function deleteNote(index){\r\n\r\nlet 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 \r\n notesObj.splice(index, 1);\r\n localStorage.setItem('notes', JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\r\n console.log(\"deleting this node.\", index);\r\n let notes = localStorage.getItem(\"notes\"); //take notes from localstorage.\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));//updating localstorage..\r\n showNotes();\r\n\r\n}", "function deleteClick(event) {\n // event.preventDefault();\n\n // read id from btn clicked\n const noteId = $(this).attr(\"data-id\");\n console.log(this);\n console.log(noteId);\n $.ajax({\n url: \"/api/notes/\" + noteId,\n method: \"DELETE\",\n }).then(() => {\n console.log(\"Notes erased!\");\n noteDataQuery();\n })\n\n\n\n}", "function updateView(e){\n let noteId = e.target.dataset.id\n document.querySelector(`li[data-id = '${noteId}']`).remove()\n noteCard.innerHTML = \"\"\n fetchDeleteNote(noteId)\n }", "function deleteNote(index) {\r\n // console.log(\"I am deleting\", index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n //for deleting use slice function.\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index){\n console.log(\"Something deleted\");\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 notesObj.splice(index,1);\n titlesObj.splice(index,1);\n notes=JSON.stringify(notesObj);\n titles=JSON.stringify(titlesObj);\n localStorage.setItem('notes',notes);\n localStorage.setItem('title',titles);\n showNotes();\n}", "function deleteItem() {\n console.log(\"\\ndeleteItem clicked\");\n}", "function deleteNote(index){\n // console.log('i am deleting' , index);\n let notes = localStorage.getItem(\"notes\");\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index , 1);\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\n shownotes();\n}", "function deleteNote(index) {\n\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n showNotes();\n}", "function note_delete(_noteindex){\r\n\tif(_noteindex>=0 & _noteindex<notes.length) {\r\n\t\tnotes.splice(_noteindex,1);\r\n\t\tnumnote--;\r\n\t}\r\n}", "function deleteItem(e){\n}", "function deleteNote (noteId) {\n request\n .delete(`https://notes-api.glitch.me/api/notes/${noteId}`)\n .auth('liz', 'dogsarebetterthancats')\n .then(response => {\n notesList = notesList.filter(note => note._id !== noteId)\n console.log(notesList)\n })\n}", "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n markedObj.splice(index, 1);\n titleObj.splice(index, 1);\n localStorage.setItem(\"marked\", JSON.stringify(markedObj));\n localStorage.setItem(\"title\", JSON.stringify(titleObj));\n showNotes();\n}", "delete(post) {\n if (confirm('Are you sure?')) {\n this.sendAction('destroyPost', post);\n }\n }", "function deleteNote(index) {\n let noteObj = {\n id: index,\n };\n\n var data = Object.keys(noteObj)\n .map(function (key) {\n return key + \"=\" + noteObj[key];\n })\n .join(\"&\");\n\n\n fetch(\"http://localhost:8081/php-notes-app/delete-note-by-id.php\", {\n body: data,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n }\n })\n .then(response => response.json())\n .then(data => {\n if (data.message === \"success\") {\n showAlert(\"Note Deleted!\", \"danger\");\n showNotesById(userid.value);\n }\n })\n .catch(error => {\n console.log('error: ', error);\n });\n}", "function DeleteNotePrompt(noteIndex) {\n Alert.alert(\"Are you sure you want to delete this note?\", \"\",\n [\n {\n text: \"Delete\",\n style: \"destructive\",\n onPress: () => DeleteNote(noteIndex)\n },\n {\n text: \"Cancel\",\n style: \"cancel\"\n }\n ]\n );\n }", "function deleteItem() {\n SidebarActions.deleteItem('Content', $scope.data.thisContent);\n}", "removeResource(evt) {\n evt.preventDefault();\n let button = $(evt.target);\n this.view.attr(\"hidden\", \"\"); // do not show the block\n this.destroyed = true\n this.registry.showSaveNote();\n }", "async function deleteNote(title) {\n setRemoveItem(title)\n setNotes(() => {\n return notes.filter(el => {\n return el.title !== title;\n })\n })\n await axios.delete(\"http://localhost:4000/api/delete\", {data: {item: title}});\n\n }", "function hideDelete(e) {\n let myTarget = e.target.parentElement.parentElement.parentElement;\n let deleteOption = myTarget.querySelector('.notes-list-item-delete');\n deleteOption.style.display = 'none';\n}", "function deleteAction(dl_row) {\r\n let dltBtn = document.createElement('button')\r\n dltBtn.innerHTML = 'Delete';\r\n dltBtn.className = 'dl-btn';\r\n dl_row.appendChild(dltBtn)\r\n dltBtn.addEventListener('click', function() {\r\n addBook.removeChild(dl_row);\r\n })\r\n }", "'click .delete'() {\n Meteor.call('reminders.remove', this._id);\n }", "function deletebut() {\r\n\r\n let delbut = document.createElement('button');\r\n let txt = document.createTextNode('DELETE');\r\n delbut.appendChild(txt);\r\n form.appendChild(delbut);\r\n\r\n delbut.addEventListener('click', deleteelement);\r\n\r\n function deleteelement(e) {\r\n let delli = e.target.closet();\r\n delli.remove();\r\n }\r\n}", "function delete_article(articleid)\n{\n change_article_state(articleid, \"delete\", \"deletebtn-a\" + articleid);\n}", "deleteNote(noteIndex) {\n const updatedNotes = this.state.notes;\n updatedNotes.splice(noteIndex, 1);\n\n this.setState({\n notes: updatedNotes,\n });\n }", "function deleteNote(index){\n console.log('I am deleting Note no ', index);\n const notes= localStorage.getItem('notes');\n if(notes==null){\n notesObj= [];\n }\n else{\n notesObj= JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n console.log(notesObj);\n}", "function deleteNote(index) {\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 notesObj.splice(index,1);//removes JS array elements and adds the existing elements back in place\r\n localStorage.setItem('notes', JSON.stringify(notesObj));//to update the local storage\r\n showNotes();\r\n\r\n}", "function DeleteNote(noteIndex) {\n var newNoteArray = [];\n if (stateVars.itemArray != null) {\n newNoteArray = stateVars.itemArray;\n }\n\n newNoteArray.splice(noteIndex, 1);\n\n setStateVars((prevState) => {\n return ({\n ...prevState,\n noteArray: newNoteArray,\n promptNewNote: false,\n editNoteIndex: -1,\n newNoteText: \"\",\n requireUpdate: true\n });\n });\n }", "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1); // first argument - to start from, second argument - number of elements to delete\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deletenote(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/notes/\" + id\n })\n .done(function() {\n getnotes(noteCategorySelect.val());\n });\n }", "deleteNote(id) {\n let index = this.jsonData().findIndex(element => parseInt(element.id) === parseInt(id));\n if (index !== -1) {\n let noteData = this.jsonData();\n noteData.splice(index, 1);\n this.storeData(noteData);\n }\n }" ]
[ "0.7804993", "0.7800597", "0.77716035", "0.77004653", "0.76611567", "0.76363426", "0.7614372", "0.75974613", "0.75554043", "0.753928", "0.7380739", "0.73229736", "0.72809994", "0.72732", "0.72609866", "0.72429264", "0.71927845", "0.71921134", "0.71888465", "0.71425974", "0.70863575", "0.7084904", "0.706915", "0.7064864", "0.7060678", "0.70254594", "0.7024857", "0.7008415", "0.69748133", "0.697302", "0.6971854", "0.69681513", "0.69658065", "0.6965211", "0.69632506", "0.694644", "0.6935425", "0.69208604", "0.69196016", "0.69101536", "0.6887964", "0.6873841", "0.68726844", "0.6803393", "0.680309", "0.6799802", "0.6796396", "0.6794292", "0.67879796", "0.67670137", "0.67582256", "0.6749892", "0.67462975", "0.6739801", "0.67381334", "0.6723929", "0.6715286", "0.67131877", "0.67130613", "0.67111635", "0.67048424", "0.66857", "0.66825396", "0.66817904", "0.66716725", "0.6671199", "0.6668679", "0.66674685", "0.66618997", "0.66614884", "0.6658284", "0.6651495", "0.66484857", "0.6645222", "0.6642261", "0.66417986", "0.66259784", "0.6617158", "0.661304", "0.6610993", "0.6609734", "0.65885174", "0.6588403", "0.6586156", "0.65816355", "0.6578208", "0.6570182", "0.6557119", "0.6555983", "0.65492475", "0.6548612", "0.65460205", "0.6535014", "0.65278673", "0.65245444", "0.6521499", "0.6519528", "0.6506502", "0.64990443", "0.6488831", "0.6481043" ]
0.0
-1
The image for createBtnDelete button
function createImgDelete() { let imgDelete = document.createElement("img"); imgDelete.id = "img-delete"; imgDelete.src = "media/x.svg"; imgDelete.alt = "delete button"; imgDelete.width = "32"; imgDelete.height = "32"; imgDelete.title = "Delete"; return imgDelete; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDeleteButton() {\n const deleteButtonElement = document.createElement('button');\n deleteButtonElement.className = \"btn bg-transparent delete-button\";\n\n const trashImgElement = document.createElement(\"img\");\n trashImgElement.src = \"images/recycle.png\";\n\n deleteButtonElement.appendChild(trashImgElement);\n return deleteButtonElement;\n}", "showDeleteBtn() {\n if (this.state.allowDelete) {\n return (\n <Image source={require('../img/deleteText.png')}></Image>\n );\n } else {\n return null;\n }\n }", "function createDeleteButton() {\n return $(\"<button>\").button({\n icons: {primary: \"ui-icon-close\"},\n text: false,\n type: \"button\"\n }).addClass(\"dd-delete-buttons\");\n }", "function newDeleteButton() {\n const deleteImage = document.createElement('button');\n deleteImage.type = 'button';\n deleteImage.className = 'delete';\n deleteImage.title = 'Delete';\n return deleteImage;\n}", "function createDeleteButton() {\r\n let deleteButton = document.createElement('button');\r\n deleteButton.dataset.index = [i];\r\n deleteButton.classList.add('delete');\r\n library.appendChild(deleteButton); \r\n let deleteIcon = document.createElement('i'); \r\n deleteIcon.classList = 'material-icons'; \r\n deleteIcon.innerHTML = 'delete';\r\n deleteButton.appendChild(deleteIcon);\r\n }", "function addDelButton(itemNo) { \t\t\t\t\t\t\t\t// itemNo targets specific list item\n\t\tvar delBut = document.createElement(\"img\");\t\t\t\t\t// create element\n\t\tdelBut.name = \"delBut\" + itemNo;\t\t\t\t\t\t\t// fill in element details\n\t\tdelBut.src = \"https://raw.github.com/WhatTheFunkNGC/colabhang/master/lister/img/deleteBtn.jpg\";\n\t\tdelBut.width = 25;\n\t\tdelBut.height = 25;\n\t\tdelBut.align = \"top\";\n\t\tdelBut.onclick = function() { \t\t\t\t\t\t\t\t// on click calls remove function with param targeting the specific line\n\t\t\t\tconsole.log(\"Delete Press\");\n\t\t\t\tremoveItemFromList(\"listTxt\",itemNo);\n\t\t}; \n\t\treturn delBut;\t\t\t\t\t\t\t\t\t\t\t\t// return button element\n\t}", "function add_delBttn (obj, text)\r\n {\r\n bttn = obj.add(\"button\", undefined, \"X\");\r\n //bttn = obj.add(\"image {helpTip:\\\"Remove asset\\\", image: \\\"\"+(icons_folder+\"delete_asset.png\")+\"\\\"}\");\r\n bttn.preferredSize = [20,20];\r\n bttn.helpTip = text;\r\n // give onClick\r\n bttn.onClick = function () { delete_BG_asset (this); };\r\n return bttn;\r\n }", "function genereateDeleteCircle() {\n let img = gen('img');\n img.src = TODOLISTURL + 'X.png';\n img.alt = 'Event delete box';\n img.classList.add('deleteBox');\n img.addEventListener('click', deleteTask)\n return img;\n }", "function generateDeleteButton() {\n return `<div class=\"delete-button\">\n <i class=\"fas fa-trash\"></i>\n </div>`;\n}", "function _init_delete_btn(){\n try{\n var delete_button_field = Ti.UI.createTableViewRow({\n className:'set_delete_button',\n filter_class:'set_delete_button',\n header:''\n });\n var delete_button = Ti.UI.createButton({\n title:'Delete',\n backgroundImage:self.get_file_path('image','BUTT_red_off.png'),\n textAlign:'center',\n height:self.default_table_view_row_height,\n width:(self.is_ipad())?self.screen_width-self.ipad_button_reduce_length_in_tableview:self.screen_width-self.iphone_button_reduce_length_in_tableview\n });\n delete_button_field.add(delete_button);\n self.data.push(delete_button_field);\n \n delete_button.addEventListener('click',function(e){\n _event_for_delete_btn();\n });\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _init_delete_btn');\n return;\n } \n }", "function makeDelBtn() {\n return `\n <span class=\"trash-can\">\n <i class=\"fas fa-trash-alt\"></i>\n </span>`;\n}", "function createBtnDelete(obj) {\n let btnDelete = document.createElement(\"button\");\n btnDelete.id = \"delete-button\";\n btnDelete.className = \"note-button\";\n\n btnDelete.addEventListener(\"click\", function () {\n obj.removeNote();\n });\n btnDelete.appendChild(createImgDelete());\n return btnDelete;\n}", "function deleteButton() {\n var delbtn = document.createElement(\"i\");\n delbtn.className = \"far fa-trash-alt float-right\";\n delbtn.setAttribute(\"id\", \"del\");\n var cbox = document.createElement(\"input\");\n cbox.setAttribute(\"type\", \"checkbox\");\n cbox.className = \"checkbox\";\n //Adds to existing list\n listItems[i].insertBefore(cbox, listItems[i].firstChild);\n listItems[i].appendChild(delbtn);\n delbtn.onclick = removeParent;\n}", "function getRemoveBtn() {\n let div = document.createElement('div');\n div.innerHTML =\n '<img src=\"images/remove.png\" id=\"image\" style=\"width:30px;height:30px\"/>';\n div.setAttribute('style', 'display: inline;');\n div.addEventListener('click', removeNote, false);\n\n return div;\n }", "function addIDDelButton(userID,itemNo) { \t\t\t\t\t\t// itemNo targets specific list item\n\t\tvar delIDBut = document.createElement(\"img\");\t\t\t\t// create element\n\t\tdelIDBut.name = \"delIDBut\" + itemNo;\t\t\t\t\t\t// fill in element details\n\t\tdelIDBut.src = \"https://raw.github.com/WhatTheFunkNGC/colabhang/master/lister/img/deleteBtn.jpg\";\n\t\tdelIDBut.width = 25;\n\t\tdelIDBut.height = 25;\n\t\tdelIDBut.align = \"top\";\n\t\tdelIDBut.onclick = function() { \t\t\t\t\t\t\t// on click calls remove function with param targeting the specific line\n\t\t\t\tconsole.log(\"Del ID Press\");\n\t\t\t\tremoveUserFromElement(userID,itemNo);\t\t\t\t// adds users ID to list element\n\t\t}; \n\t\treturn delIDBut;\t\t\t\t\t\t\t\t\t\t\t// return button element\n\t}", "function createDeleteButton(index) {\r\n // Delete from the Array a name on the specified index then update the page\r\n function deleteName() {\r\n globalNames.splice(index, 1);\r\n render();\r\n }\r\n\r\n // create a new button\r\n var button = document.createElement('button');\r\n // add a class from css file to the new button\r\n button.classList.add('deleteButton');\r\n // asign the textContent of the button with the value 'X'\r\n button.textContent = 'X';\r\n\r\n // Add eventListerner to the button, on click call the function deleteName\r\n button.addEventListener('click', deleteName);\r\n\r\n // return the new button;\r\n return button;\r\n }", "function deleteMenuDeleteClicked() {\n canvas.removeLabel(canvas.getCurrentLabel());\n oPublic.hideDeleteLabel();\n myActionStack.push('deleteLabel', canvas.getCurrentLabel());\n }", "function createDeleteButton(){\n // Creating the containers structure\n var divTag = document.createElement(\"div\");\n divTag.setAttribute(\"class\",\"deleteButton\");\n //Creating and setting the button tags.\n var buttonTag = document.createElement(\"button\");\n buttonTag.setAttribute(\"class\",\"btn btn-delete\");\n buttonTag.setAttribute(\"type\",\"button\");\n buttonTag.setAttribute(\"name\",\"button\");\n buttonTag.innerHTML = \"Delete\";\n // Adding an action for the propertio onclick\n buttonTag.onclick = deleteItem;\n // Adding the button to the containers div\n divTag.appendChild(buttonTag);\n var containerTag = document.getElementsByClassName(\"product\");\n containerTag[containerTag.length-1].appendChild(divTag);\n}", "function addDeleteBtn(card) {\r\n let deleteBtn = document.createElement(\"button\");\r\n deleteBtn.classList.add(\"delete-btn\");\r\n deleteBtn.innerHTML = '<i class=\"fas fa-trash-alt\"></i>';\r\n card.appendChild(deleteBtn);\r\n}", "function bindTrashButton() {\n $('.btn-delete').click(function() {\n $('#imageGroup').fadeOut(150, function() {\n $('#imageGroup').css('display', 'none');\n $('#imageContainer')[0].src = \"\";\n });\n $('.imageEditor').removeClass('disabled');\n $('.imageEditor').addClass('enabled');\n $('.imageEditor').attr(\"name\", \"Add Image\");\n document.getElementById('imagePicker').disabled = false;\n imgSrc = \"\";\n sendData();\n });\n }", "function createNewDeleteButton() {\n var newDeleteButtonDiv = document.createElement(\"div\");\n var newDeleteButton = document.createElement(\"button\");\n newDeleteButton.setAttribute(\"class\",\"btn btn-delete\");\n newDeleteButton.innerHTML = \"Delete\";\n newDeleteButtonDiv.appendChild(newDeleteButton);\n return newDeleteButtonDiv;\n }", "function labelDeleteIconClick () {\n // Deletes the current label\n if (!status.disableLabelDelete) {\n svl.tracker.push('Click_LabelDelete');\n var currLabel = self.getCurrentLabel();\n if (!currLabel) {\n //\n // Sometimes (especially during ground truth insertion if you force a delete icon to show up all the time),\n // currLabel would not be set properly. In such a case, find a label underneath the delete icon.\n var x = $divHolderLabelDeleteIcon.css('left');\n var y = $divHolderLabelDeleteIcon.css('top');\n x = x.replace(\"px\", \"\");\n y = y.replace(\"px\", \"\");\n x = parseInt(x, 10) + 5;\n y = parseInt(y, 10) + 5;\n var item = isOn(x, y);\n if (item && item.className === \"Point\") {\n var path = item.belongsTo();\n currLabel = path.belongsTo();\n } else if (item && item.className === \"Label\") {\n currLabel = item;\n } else if (item && item.className === \"Path\") {\n currLabel = item.belongsTo();\n }\n }\n\n if (currLabel) {\n svl.labelContainer.removeLabel(currLabel);\n svl.actionStack.push('deleteLabel', self.getCurrentLabel());\n $divHolderLabelDeleteIcon.css('visibility', 'hidden');\n // $divHolderLabelEditIcon.css('visibility', 'hidden');\n\n\n //\n // If showLabelTag is blocked by GoldenInsertion (or by any other object), unlock it as soon as\n // a label is deleted.\n if (lock.showLabelTag) {\n self.unlockShowLabelTag();\n }\n }\n }\n }", "function createDeleteButton() {\n let delButton = document.createElement(\"button\");\n delButton.setAttribute(\"class\", \"delete btn btn-secondary btn-sm\");\n delButton.innerHTML = \"Delete\";\n delButton.addEventListener(\"click\", function () {\n removeItem(delButton);\n });\n return delButton;\n}", "function makeDel(mount){\n var c = factory.newContainer({x:0,y:0,width:icsz,height:icsz,ignoreTheme:true,opacity:0.85,background:\"white\",style:\"text-align:center\",permissions:uiPerm},'link_dot',mount);\n var g = c.addPrimitive({type:\"span\",content:{class:\"glyphicon glyphicon-trash\"}});//<span class=\"glyphicon glyphicon-record\"></span>\n g.style.cssText = \"font-size:\"+(icsz-4)+\"px\";\n return c;\n }", "function makeButton(backgroundImage, title, type) {\n var button = L.DomUtil.create(\"a\", \"leaflet-control-view-\" + type);\n button.title = title;\n button.href = \"#\";\n button.setAttribute(\"role\", \"button\");\n button.setAttribute(\"aria-label\", title);\n button.style.backgroundImage = \"url(\" + backgroundImage + \")\";\n button.style.backgroundSize = \"contain\";\n\n return button;\n }", "GetTemplateActionImagesButton(){\n // Bouton Logout sous forme d'image\n const LogoutSvg = \"PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAwMCAxMDAwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8bWV0YWRhdGE+IFN2ZyBWZWN0b3IgSWNvbnMgOiBodHRwOi8vd3d3Lm9ubGluZXdlYmZvbnRzLmNvbS9pY29uIDwvbWV0YWRhdGE+CjxnPjxwYXRoIGQ9Ik03NTcuNSwxNTIuMWMzMC4xLDIyLDU2LjksNDYuOCw4MC4zLDc0LjZjMjMuNCwyNy44LDQzLjUsNTcuOCw2MC4yLDkwLjFjMTYuNywzMi4zLDI5LjQsNjYuNCwzOC4xLDEwMi40YzguNywzNiwxMy4xLDcyLjYsMTMuMSwxMDkuNmMwLDYzLjgtMTEuOSwxMjMuNy0zNS42LDE3OS42Yy0yMy43LDU1LjktNTUuOSwxMDQuNy05Ni40LDE0Ni4yYy00MC41LDQxLjUtODgsNzQuNS0xNDIuNSw5OC44QzYyMC4xLDk3Ny44LDU2MS43LDk5MCw0OTkuNSw5OTBjLTYxLjYsMC0xMTkuNi0xMi4yLTE3NC4xLTM2LjVjLTU0LjUtMjQuNC0xMDIuMi01Ny4zLTE0My05OC44Yy00MC44LTQxLjUtNzIuOS05MC4zLTk2LjQtMTQ2LjJjLTIzLjQtNTUuOS0zNS4xLTExNS44LTM1LjEtMTc5LjZjMC0zNi40LDQuMi03Mi4xLDEyLjYtMTA3LjFjOC40LTM1LDIwLjItNjguMywzNS42LTk5LjhjMTUuNC0zMS42LDM0LjUtNjEuMSw1Ny4yLTg4LjVjMjIuOC0yNy41LDQ4LjItNTIuMiw3Ni4zLTc0LjFjMTQuNy0xMSwzMC42LTE1LjEsNDcuNy0xMi40YzE3LjEsMi43LDMwLjksMTEuMyw0MS43LDI1LjdjMTAuNywxNC40LDE0LjcsMzAuNSwxMiw0OC40Yy0yLjcsMTcuOC0xMSwzMi4zLTI1LjEsNDMuMmMtNDIuMiwzMS42LTc0LjQsNzAuMy05Ni45LDExNi4zYy0yMi40LDQ2LTMzLjYsOTUuNC0zMy42LDE0OC4yYzAsNDUuMyw4LjQsODgsMjUuMSwxMjguMmMxNi43LDQwLjEsMzkuNiw3NS4xLDY4LjgsMTA1YzI5LjEsMjkuOSw2My4yLDUzLjUsMTAyLjQsNzFjMzkuMSwxNy41LDgwLjgsMjYuMywxMjUsMjYuM2M0NC4yLDAsODUuOC04LjgsMTI1LTI2LjNjMzkuMS0xNy41LDczLjMtNDEuMiwxMDIuNC03MWMyOS4xLTI5LjksNTIuMi02NC45LDY5LjMtMTA1YzE3LjEtNDAuMiwyNS42LTgyLjksMjUuNi0xMjguMmMwLTUzLjUtMTItMTA0LjEtMzYuMS0xNTEuOGMtMjQuMS00Ny43LTU3LjktODctMTAxLjQtMTE3LjljLTE0LjctMTAuMy0yMy42LTI0LjQtMjYuNi00Mi4yYy0zLTE3LjksMC41LTM0LjMsMTAuNS00OS40YzEwLTE0LjQsMjMuOC0yMy4yLDQxLjItMjYuMkM3MjYuNywxMzguMiw3NDIuNywxNDEuOCw3NTcuNSwxNTIuMUw3NTcuNSwxNTIuMXogTTQ5OS41LDUzMS45Yy0xNy40LDAtMzIuMy02LjMtNDQuNy0xOWMtMTIuNC0xMi43LTE4LjYtMjgtMTguNi00NS44Vjc1LjljMC0xNy44LDYuMi0zMy4zLDE4LjYtNDYuM2MxMi40LTEzLDI3LjMtMTkuNiw0NC43LTE5LjZjMTguMSwwLDMzLjMsNi41LDQ1LjcsMTkuNmMxMi40LDEzLDE4LjYsMjguNSwxOC42LDQ2LjN2MzkxLjJjMCwxNy44LTYuMiwzMy4xLTE4LjYsNDUuOEM1MzIuOCw1MjUuNiw1MTcuNiw1MzEuOSw0OTkuNSw1MzEuOUw0OTkuNSw1MzEuOXoiLz48L2c+Cjwvc3ZnPg==\"\n const UserConfigSvg = \"PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaWQ9IkxheWVyXzEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyOCAxMjg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAxMjggMTI4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM0RjRGNEY7fQoJLnN0MXtmaWxsOiNGRkZGRkY7fQo8L3N0eWxlPjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjY0IiBjeT0iNjQiIHI9IjY0Ii8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTc3LjQsNzUuM2MtMi0wLjMtMy40LTEuOS0zLjQtMy45di01LjhjMi4xLTIuMywzLjUtNS4zLDMuOC04LjdsMC4yLTMuMmMxLjEtMC42LDIuMi0yLDIuNy0zLjggIGMwLjctMi41LDAuMS00LjctMS41LTQuOWMtMC4yLDAtMC40LDAtMC43LDBsMC40LTUuOUM3OS42LDMwLjksNzMuMywyNCw2NS4zLDI0aC0yLjVjLTgsMC0xNC4zLDYuOS0xMy44LDE1LjFsMC40LDYgIEM0OS4yLDQ1LDQ5LDQ1LDQ4LjgsNDVjLTEuNiwwLjItMi4yLDIuNC0xLjUsNC45YzAuNSwxLjksMS43LDMuMywyLjgsMy45bDAuMiwzLjFjMC4yLDMuNCwxLjYsNi40LDMuNyw4Ljd2NS44YzAsMi0xLjQsMy42LTMuNCwzLjkgIEM0MS44LDc2LjgsMjcsODMuMiwyNyw5MHYxNGg3NFY5MEMxMDEsODMuMiw4Ni4yLDc2LjgsNzcuNCw3NS4zeiIvPjwvc3ZnPg==\"\n const GoToAppAdminSvg = \"PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMTIwMC4wMDAwMDBwdCIgaGVpZ2h0PSIxMjgwLjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMTIwMC4wMDAwMDAgMTI4MC4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KPG1ldGFkYXRhPgpDcmVhdGVkIGJ5IHBvdHJhY2UgMS4xNSwgd3JpdHRlbiBieSBQZXRlciBTZWxpbmdlciAyMDAxLTIwMTcKPC9tZXRhZGF0YT4KPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsMTI4MC4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiCmZpbGw9IiMwMDAwMDAiIHN0cm9rZT0ibm9uZSI+CjxwYXRoIGQ9Ik04NTAwIDEyNzkzIGMtMjAzIC0xOSAtMjUyIC0yNCAtMjY0IC0yOSAtMjEgLTggLTY3IC00MDEgLTg0IC03MTgKbC03IC0xMjkgLTExMCAtMjcgYy02MCAtMTUgLTE0NCAtNDEgLTE4NSAtNTggLTEwNSAtNDMgLTMzNyAtMTU0IC0zOTcgLTE5MQotMjggLTE3IC01MyAtMzEgLTU1IC0zMSAtMyAwIC0xNTEgMTIwIC0zMjkgMjY2IC0xNzggMTQ2IC0zMzAgMjY4IC0zMzYgMjcxCi0yNCAxMCAtMjI5IC0xNjQgLTM4MiAtMzIzIC0xNDcgLTE1MiAtMzE1IC0zNjIgLTMwMyAtMzc3IDQzIC01NyAyMDcgLTI1OQozNDcgLTQyNyA5NCAtMTEzIDE3NSAtMjExIDE3OSAtMjE4IDQgLTggLTkgLTM4IC0zNCAtNzggLTY3IC0xMDYgLTE0NSAtMjcxCi0xODAgLTM3OSAtMTggLTU1IC00MyAtMTMyIC01NiAtMTcyIC0xMyAtMzkgLTI0IC03OCAtMjQgLTg2IDAgLTExIC0xOSAtMTYKLTcyIC0yMSAtMzkwIC0zNiAtNzY1IC03OSAtNzc1IC05MCAtMzEgLTMwIC01MSAtNDMyIC0zNCAtNjQ5IDEyIC0xNTEgMzUKLTMxNSA0NiAtMzI1IDQgLTUgMjk5IC0zNCA3NTcgLTc3IGw3NyAtNyA2IC00MSBjNCAtMjMgMTUgLTYyIDI1IC04NyAxMCAtMjUKMzQgLTk3IDU0IC0xNjEgMzkgLTEyMSAxMjAgLTI5MyAxODcgLTM5MyAyMiAtMzMgMzggLTY1IDM1IC03MyAtMyAtNyAtODMKLTEwNiAtMTc5IC0yMjAgLTI2NCAtMzE2IC0zNDggLTQyMyAtMzQwIC00MzYgMzQgLTYwIDE5NSAtMjQ5IDMwOCAtMzYzIDE0OQotMTUwIDM4MiAtMzQ0IDM5MyAtMzI4IDQgNiA5OSA4NiAyMTIgMTc5IDExMyA5MyAyNTAgMjA3IDMwNSAyNTQgNTUgNDggMTA3CjkyIDExNyA5OSAxNCAxMSAzMyA0IDEzMCAtNTEgMTM0IC03NiAyOTkgLTE0NCA0NTkgLTE4NyA2MyAtMTcgMTIxIC0zNSAxMjcKLTM5IDggLTUgMjMgLTEwOSA0MiAtMzAyIDMwIC0yOTMgNTcgLTUyNCA2NCAtNTQ1IDggLTIxIDMxMCAtMzcgNTY5IC0zMSAyMDYKNSA0MDcgMjQgNDIzIDM5IDIgMyAyMCAxODAgMzkgMzk0IDIwIDIxNCAzOCA0MDQgNDEgNDIyIDYgMzggNCAzNyAxNzcgODggMTQ1CjQzIDMzOCAxMjggNDU1IDIwMSA0NyAzMCA5MCA1MiA5NiA0OSA2IC0yIDY3IC01MiAxMzYgLTExMSAyMzIgLTIwMCA1MjIgLTQyNgo1MzcgLTQyMSAyNyAxMSAxMzggOTYgMjAwIDE1MyAxMjkgMTIwIDQ4MyA1MjEgNDgzIDU0NyAwIDMgLTExNCAxNDEgLTI1MiAzMDcKLTEzOSAxNjUgLTI2MyAzMTMgLTI3NSAzMjggbC0yMiAyNyA1OSAxMTQgYzc5IDE1MSAxNTYgMzQ0IDE4OSA0NzEgbDI2IDEwNAoxODUgMTcgYzEwMiA5IDI5NCAyNyA0MjcgMzkgbDI0MiAyMyA2IDI2IGMxMyA2MyAyNiAyMTkgMzEgMzgwIDkgMjM3IC0xNyA1ODIKLTQ0IDU5OSAtNyA0IC0xOTcgMjQgLTQyNCA0NSAtMjI3IDIxIC00MTYgNDAgLTQyMCA0MiAtNCAyIC0xMiAzMCAtMTggNjIgLTI3CjEzNyAtMTE1IDM2NCAtMjA2IDUzMyBsLTY1IDEyMSAzOCA0NiBjMjEgMjYgMTM5IDE3MSAyNjQgMzIzIDEyNCAxNTIgMjI5IDI4MQoyMzMgMjg4IDggMTIgLTcxIDExMyAtMjAzIDI2MCAtMTQ2IDE2MiAtNDgxIDQ1MSAtNTA0IDQzNCAtODMgLTYzIC0zODIgLTMwNQotNDg3IC0zOTQgLTc1IC02MiAtMTQyIC0xMTkgLTE1MSAtMTI2IC0xMiAtMTAgLTU0IDcgLTIyOSA5NiAtMTUzIDc2IC0yNDcKMTE2IC0zMjUgMTM5IC02MCAxOCAtMTIwIDMyIC0xMzIgMzIgLTI1IDAgLTI1IC0zIC00OSAyNTUgLTE3IDE5MSAtNjQgNjA4Ci02OCA2MTIgLTggOCAtMTI2IDIzIC0yNTIgMzIgLTEzMCAxMCAtMzcyIDEyIC00NTQgNHogbTQ1NSAtMjA5NCBjMjE3IC0zNgo0MjcgLTE1MSA2MTAgLTMzMyAxNzkgLTE3OCAyODkgLTM3NCAzMzUgLTYwMSAxMDQgLTUwMSAtOTkgLTk5OCAtNTIwIC0xMjc2Ci0xOTIgLTEyNyAtMzc4IC0xODYgLTYxNiAtMTk2IC0yMjIgLTEwIC0zODggMjQgLTU3OSAxMTcgLTIzOSAxMTcgLTQxOSAyOTMKLTU0NiA1MzQgLTk2IDE4MyAtMTM0IDM0MyAtMTMzIDU3MSAxIDI4MSA3NyA1MDcgMjQ0IDcyMyAyMTIgMjc1IDUwMCA0NDYgNzk1CjQ3MSAxMTEgOSAzMjkgNCA0MTAgLTEweiIvPgo8cGF0aCBkPSJNODUwMCAxMDUyMSBjLTM2NSAtODAgLTY2MyAtMzU5IC03NzcgLTcyNyAtMjUgLTgzIC0yNyAtMTAxIC0yNwotMjc5IC0xIC0yMDcgNCAtMjM4IDY1IC0zOTYgNjUgLTE2OSAyMzUgLTM3OCAzOTggLTQ4OCA5MCAtNjEgMjE0IC0xMTcgMzE3Ci0xNDMgMTI4IC0zMiAzNzIgLTMyIDQ5MCAwIDE0MCAzOCAyNDEgODYgMzU0IDE3MCAzMjAgMjM4IDQ3MyA1ODMgNDMwIDk3MAotMjcgMjUwIC0xMjQgNDQ4IC0zMDEgNjE3IC0xMzQgMTI4IC0yNzQgMjEwIC00NDggMjYyIC0xMTkgMzUgLTM3MSA0MyAtNTAxCjE0eiBtMzgyIC0yNTYgYzIyOCAtNDggNDQwIC0yMDkgNTM3IC00MDcgMTcgLTM1IDQxIC0xMDEgNTIgLTE0NyAxOCAtNzMgMjEKLTEwNSAxNyAtMjM1IC00IC0xMzIgLTggLTE2MSAtMzQgLTIzNiAtNzYgLTIyNyAtMjk4IC00MjkgLTU0NiAtNDk2IC03NiAtMjEKLTI5MCAtMjQgLTM1OCAtNSAtMTQ3IDQwIC0yNjcgMTEwIC0zNzQgMjE3IC00NSA0NCAtOTYgMTA2IC0xMTUgMTM3IC0yMjIgMzczCi0xMDUgODYyIDI1OSAxMDc4IDc0IDQzIDE4NiA4NyAyNjAgOTkgNzUgMTMgMjMxIDEwIDMwMiAtNXoiLz4KPHBhdGggZD0iTTQ3MTYgODQ0OCBjLTc1IC0xOTEgLTE2MiAtNDI4IC0yNTEgLTY4MCBsLTk4IC0yNzggLTEyMiAwIGMtMjMxIDAKLTU4MyAtNDcgLTc4OCAtMTA2IC03MCAtMjAgLTEyOSAtMzUgLTEzMSAtMzMgLTEgMiAtMzYgNTEgLTc3IDEwOSAtMTQwIDIwMAotNTcwIDc5MCAtNTc1IDc5MCAtMTAgMCAtMTgxIC02OCAtMjE5IC04OCAtMjIgLTExIC03NCAtMzYgLTExNSAtNTYgLTQxIC0xOQotMTIwIC02MSAtMTc1IC05NCAtNTUgLTMyIC0xNDggLTg3IC0yMDcgLTEyMiAtMTA1IC02MiAtMjUwIC0xNjYgLTM0MiAtMjQ1CmwtNDYgLTQxIDEyMCAtMjU5IGM2NyAtMTQzIDE3MSAtMzY3IDIzMiAtNDk4IGwxMTEgLTIzOCAtNzYgLTc3IGMtMTk2IC0yMDAKLTQzMyAtNTExIC01MTMgLTY3NSAtMTYgLTMyIC0zMiAtNTcgLTM3IC01NyAtNCAwIC0xNDYgMjQgLTMxNSA1NCAtMzI5IDU4Ci03NzMgMTI5IC03NzcgMTI0IC04IC04IC0xMDMgLTI0OCAtMTQwIC0zNTMgLTUxIC0xNDYgLTEzNSAtNTU4IC0xNzAgLTg0MApsLTYgLTUwIDUwOCAtMTk1IDUwOCAtMTk1IDIgLTk1IGM0IC0xNzEgMjMgLTM4MSA0NCAtNDg5IDExIC01OCAyNyAtMTQxIDM1Ci0xODMgOCAtNDMgMjYgLTExNiAzOSAtMTYzIDE0IC00NyAyNSAtOTIgMjUgLTEwMCAwIC03IC05MyAtODAgLTIwNyAtMTYxCi0xMTUgLTgxIC0zMTMgLTIyNCAtNDQxIC0zMTggLTIwOCAtMTUyIC0yMzIgLTE3MyAtMjI3IC0xOTMgMjIgLTg4IDIxNiAtNDY0CjM0NiAtNjcyIDc0IC0xMTYgMjIzIC0zMzAgMjY0IC0zNzggbDMwIC0zNCAxNzUgODEgYzE3MiA4MSA3MzYgMzM5IDc5NiAzNjUKbDMwIDE0IDEzNSAtMTI1IGMxNjkgLTE1OCAyNTMgLTIyMSA0ODIgLTM2MSAxMzggLTg0IDE4MiAtMTE2IDE4MCAtMTMwIC0xCi0xMCAtMjIgLTE0MiAtNDcgLTI5MyAtNDQgLTI2NiAtMTE2IC03NDggLTExNiAtNzczIDAgLTcgMTUgLTE4IDMzIC0yNiAyMjUKLTkwIDQyNiAtMTUyIDcxNSAtMjIwIDE5MyAtNDYgNDczIC05NCA0ODMgLTgzIDE4IDIwIDI2MSA2NTkgMzU1IDkyOSBsMzggMTEzCjE1MiAwIGMyNjIgMCA0NDcgMjYgNzEyIDEwMiAxMjIgMzQgMTQ2IDM4IDE1NyAyNyA3IC04IDE1MyAtMjEyIDMyNSAtNDU0IDE3MgotMjQyIDMxNCAtNDQyIDMxNiAtNDQzIDMgLTQgOTEgMzcgMzYxIDE3MCAxMTIgNTUgMjQzIDEzMCAzNDUgMTk3IDE0NSA5NiAzMzEKMjMzIDM4MSAyODEgMTggMTYgMTUgMjUgLTgxIDI0MSAtNTUgMTIzIC0xNTkgMzUwIC0yMzAgNTA0IGwtMTMwIDI3OSAxMTcgMTI2CmMxNjAgMTcwIDMwNSAzNjggNDA1IDU1MiAyNSA0OCA1MCA4OSA1NCA5MSA0IDIgOTUgLTExIDIwMiAtMjkgNTU5IC05NCA4ODMKLTE0NSA4OTQgLTE0MSAyMiA5IDE3OCA0NTMgMjIxIDYyNyA4IDM2IDIwIDc1IDI1IDg3IDkgMjEgNzMgMzgyIDg0IDQ3NSBsNgo0NyAtNDggMjEgYy02MiAyOCAtNDgwIDE4NiAtNzY0IDI5MCBsLTIyOCA4MyAwIDE1NiBjMCAxNzkgLTEwIDI4MSAtNDEgNDQ4Ci0xOCA5OSAtNjcgMzE0IC04NSAzNzUgLTQgMTIgNDQgNTEgMTg4IDE1NCAyMTcgMTU1IDY5NSA1MTEgNzAzIDUyNSA3IDExIC02MQoxNzEgLTE0MyAzMzQgLTExNiAyMzMgLTI2NiA0NjggLTQyNCA2NjcgbC03NyA5NyAtMTMzIC01OCBjLTE4NCAtODEgLTQ4MAotMjE3IC02ODcgLTMxNyBsLTE3MyAtODQgLTEzNCAxMjcgYy0xNDIgMTM0IC0zMTQgMjY4IC00MjkgMzM2IC02MCAzNSAtMTgzCjExNiAtMjA4IDEzNyAtNCA0IDExIDEyMyAzMyAyNjYgMTEyIDcxNCAxMzEgODM2IDEyOCA4MzkgLTIgMSAtNzMgMjkgLTE1OCA2MgotMTgwIDcwIC0zOTkgMTQzIC00MzEgMTQzIC0xMiAwIC00NyA5IC03OCAxOSAtODAgMjggLTQ4OCAxMTAgLTU0NiAxMTEgLTE2IDAKLTI2IC0xNiAtNDkgLTcyeiBtLTE4MSAtMjYyMyBjMjc2IC00OSA1NjQgLTE4NCA3NzIgLTM2MyAyNDYgLTIxMiA0NjAgLTU5OQo1MTggLTkzNiAyMiAtMTI3IDIwIC0zNDcgLTQgLTQ4OCAtNDQgLTI1NSAtMTU0IC01MjUgLTI4NSAtNjk4IC0yMzEgLTMwNwotNjMxIC01NDggLTEwMjAgLTYxNSAtMTE0IC0xOSAtMzM0IC0xOSAtNDU0IDAgLTIyOCAzNyAtNDg2IDEzMCAtNjQ2IDIzMwotMzU2IDIzMCAtNjIwIDYyNSAtNzAyIDEwNTIgLTI0IDEyNyAtMjQgMzU4IDAgNDk1IDkwIDUwOSAzMjkgODYyIDc2MSAxMTI2CjExNCA3MCAyOTMgMTQyIDQzMCAxNzUgMTkzIDQ2IDQzOSA1MyA2MzAgMTl6Ii8+CjxwYXRoIGQ9Ik00MTc1IDU2MjMgYy0yMTUgLTI1IC0zMzcgLTYyIC01MTUgLTE1NCAtMzUwIC0xODEgLTU1OSAtNDQ0IC02NjUKLTgzOCAtNTAgLTE4NCAtNTggLTI0MSAtNTkgLTM5MSAwIC0xNDIgMTYgLTI1MiA1NSAtMzcxIDI0IC03NCAxMDkgLTI1OSAxMTkKLTI1OSAzIDAgMzQgLTQyIDY3IC05MiAxNDggLTIyMyAzNTUgLTM4OSA2MDkgLTQ4OCA1MDYgLTE5OCAxMDM3IC05NCAxNDM3CjI4MCAxODAgMTY4IDMyOCA0MzYgMzc4IDY4MiA2OSAzNDMgMTIgNjY0IC0xNzMgOTc0IC0xOTkgMzM1IC00NTkgNTI0IC04NTgKNjIzIC0xMzQgMzMgLTI5MiA0NyAtMzk1IDM0eiBtMzQ1IC0zNzQgYzMxMiAtNzggNTMyIC0yNjEgNjgxIC01NjUgNjggLTE0MQo4MyAtMjE0IDgzIC00MDkgMCAtMTk5IC0xNSAtMjcwIC05MCAtNDI0IC01NSAtMTE1IC0xMTIgLTE5NiAtMTk1IC0yNzkgLTI5MAotMjg1IC02MjcgLTM2OCAtMTAyNCAtMjUyIC0yNTggNzUgLTQ2MiAyNTMgLTU5NSA1MTkgLTEyNyAyNTQgLTEzOSA1NzMgLTMzCjgxNiAxMDUgMjM2IDI4OSA0MjQgNTI1IDUzNSAyMTcgMTAyIDQwOCAxMTkgNjQ4IDU5eiIvPgo8L2c+Cjwvc3ZnPgo=\"\n const GoToHomeSvg = \"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE4LjEuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMjcuMDIgMjcuMDIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI3LjAyIDI3LjAyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBzdHlsZT0iZmlsbDojMDMwMTA0OyIgZD0iTTMuNjc0LDI0Ljg3NmMwLDAtMC4wMjQsMC42MDQsMC41NjYsMC42MDRjMC43MzQsMCw2LjgxMS0wLjAwOCw2LjgxMS0wLjAwOGwwLjAxLTUuNTgxDQoJCWMwLDAtMC4wOTYtMC45MiwwLjc5Ny0wLjkyaDIuODI2YzEuMDU2LDAsMC45OTEsMC45MiwwLjk5MSwwLjkybC0wLjAxMiw1LjU2M2MwLDAsNS43NjIsMCw2LjY2NywwDQoJCWMwLjc0OSwwLDAuNzE1LTAuNzUyLDAuNzE1LTAuNzUyVjE0LjQxM2wtOS4zOTYtOC4zNThsLTkuOTc1LDguMzU4QzMuNjc0LDE0LjQxMywzLjY3NCwyNC44NzYsMy42NzQsMjQuODc2eiIvPg0KCTxwYXRoIHN0eWxlPSJmaWxsOiMwMzAxMDQ7IiBkPSJNMCwxMy42MzVjMCwwLDAuODQ3LDEuNTYxLDIuNjk0LDBsMTEuMDM4LTkuMzM4bDEwLjM0OSw5LjI4YzIuMTM4LDEuNTQyLDIuOTM5LDAsMi45MzksMA0KCQlMMTMuNzMyLDEuNTRMMCwxMy42MzV6Ii8+DQoJPHBvbHlnb24gc3R5bGU9ImZpbGw6IzAzMDEwNDsiIHBvaW50cz0iMjMuODMsNC4yNzUgMjEuMTY4LDQuMjc1IDIxLjE3OSw3LjUwMyAyMy44Myw5Ljc1MiAJIi8+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8L3N2Zz4NCg==\"\n const GoToAppSvg =\"PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCAxNzIgMTcyIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0iYnV0dCIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2UtZGFzaGFycmF5PSIiIHN0cm9rZS1kYXNob2Zmc2V0PSIwIiBmb250LWZhbWlseT0ibm9uZSIgZm9udC13ZWlnaHQ9Im5vbmUiIGZvbnQtc2l6ZT0ibm9uZSIgdGV4dC1hbmNob3I9Im5vbmUiIHN0eWxlPSJtaXgtYmxlbmQtbW9kZTogbm9ybWFsIj48cGF0aCBkPSJNMCwxNzJ2LTE3MmgxNzJ2MTcyeiIgZmlsbD0ibm9uZSI+PC9wYXRoPjxnIGZpbGw9IiMwMDAwMDAiPjxwYXRoIGQ9Ik04NiwxNC4zMzMzM2MtMzkuNDk1NTIsMCAtNzEuNjY2NjcsMzIuMTcxMTUgLTcxLjY2NjY3LDcxLjY2NjY3YzAsMzkuNDk1NTIgMzIuMTcxMTUsNzEuNjY2NjcgNzEuNjY2NjcsNzEuNjY2NjdjMzkuNDk1NTIsMCA3MS42NjY2NywtMzIuMTcxMTUgNzEuNjY2NjcsLTcxLjY2NjY3YzAsLTM5LjQ5NTUyIC0zMi4xNzExNSwtNzEuNjY2NjcgLTcxLjY2NjY3LC03MS42NjY2N3pNODYsMjguNjY2NjdjMzEuNzQ5MjEsMCA1Ny4zMzMzMywyNS41ODQxMiA1Ny4zMzMzMyw1Ny4zMzMzM2MwLDMxLjc0OTIxIC0yNS41ODQxMiw1Ny4zMzMzMyAtNTcuMzMzMzMsNTcuMzMzMzNjLTMxLjc0OTIxLDAgLTU3LjMzMzMzLC0yNS41ODQxMiAtNTcuMzMzMzMsLTU3LjMzMzMzYzAsLTMxLjc0OTIxIDI1LjU4NDEyLC01Ny4zMzMzMyA1Ny4zMzMzMywtNTcuMzMzMzN6TTcxLjY2NjY3LDYxLjE2ODYydjQ5LjY2Mjc2bDQzLC0yNC44MzEzOHoiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==\"\n \n var Div = document.createElement(\"div\")\n Div.setAttribute(\"style\",\"display: flex; flex-direction: row; align-items: center; justify-content: space-around; align-content: center;\")\n var ButtonLogout = document.createElement(\"button\")\n ButtonLogout.setAttribute(\"title\", \"Logout\")\n ButtonLogout.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n ButtonLogout.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); GlobalLogout()})\n ButtonLogout.innerHTML = '<img src=\"data:image/svg+xml;base64,' + LogoutSvg + '\" height=\"100%\" width=\"100%\">'\n Div.appendChild(ButtonLogout)\n\n var ButtonUserConfig = document.createElement(\"button\")\n ButtonUserConfig.setAttribute(\"title\", \"User\")\n ButtonUserConfig.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n ButtonUserConfig.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); CoreXWindowUserConfig.BuildWindow()})\n ButtonUserConfig.innerHTML = '<img src=\"data:image/svg+xml;base64,' + UserConfigSvg + '\" height=\"100%\" width=\"100%\">'\n Div.appendChild(ButtonUserConfig)\n\n var ButtonHome = document.createElement(\"button\")\n ButtonHome.setAttribute(\"title\", \"Home\")\n ButtonHome.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n ButtonHome.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); this._ClickOnHomeFct()})\n ButtonHome.innerHTML = '<img src=\"data:image/svg+xml;base64,' + GoToHomeSvg + '\" height=\"100%\" width=\"100%\">'\n Div.appendChild(ButtonHome)\n\n if(GlobalIsAdminUser()){\n var ButtonGoToApp = document.createElement(\"button\")\n ButtonGoToApp.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n let LocalStorageApp = localStorage.getItem(\"CoreXApp\")\n if(LocalStorageApp == \"App\"){\n ButtonGoToApp.setAttribute(\"title\", \"Go to Admin App\")\n ButtonGoToApp.addEventListener(\"click\", ()=>{this.GoToApp.bind(this, false)()})\n ButtonGoToApp.innerHTML = '<img src=\"data:image/svg+xml;base64,' + GoToAppAdminSvg + '\" height=\"100%\" width=\"100%\">'\n } else {\n ButtonGoToApp.setAttribute(\"title\", \"Go to App\")\n ButtonGoToApp.addEventListener(\"click\", ()=>{this.GoToApp.bind(this, true)()})\n ButtonGoToApp.innerHTML = '<img src=\"data:image/svg+xml;base64,' + GoToAppSvg + '\" height=\"100%\" width=\"100%\">'\n }\n Div.appendChild(ButtonGoToApp)\n }\n return Div\n }", "get unlinkButton() {\n return {\n icon: \"mdextra:unlink\",\n label: \"Remove Link\",\n type: \"rich-text-editor-unlink\",\n };\n }", "function createDeleteButton(){\n var divTag = document.createElement(\"div\");\n var spanTag = document.createElement(\"span\");\n divTag.appendChild(spanTag);\n var btnTag = document.createElement(\"button\");\n btnTag.classList.add(\"btn-delete\");\n btnTag.appendChild(document.createTextNode(\"Delete\"));\n spanTag.appendChild(btnTag)\n btnTag.addEventListener(\"click\", deleteItem)\n\n return divTag;\n}", "function confirmDelete(){\r\n\t\tvar links = find(\"//img[contains(@src, 'del.gif')]\", XPList);\r\n\t\tfor (var i = 0; i < links.snapshotLength; i++){\r\n\t\t\tlinks.snapshotItem(i).setAttribute('onClick', 'javascript:return confirm(\"' + T('SEGURO') + '\");');\r\n\t\t}\r\n\t}", "function click_delete_btn(e) {\n let key = $(e.data.target).attr(\"key\");\n let row = $(\"#\" + key);\n let span = $(\"#\" + key + \" td:nth-child(1) span\")[0];\n\n // disabled\n if ($(e.data.target).hasClass(\"disabled\"))\n return;\n\n // delete line\n if ($(row).css(\"text-decoration-line\") === \"none\")\n $(row).css(\"text-decoration-line\", \"line-through\");\n else\n $(row).css(\"text-decoration-line\", \"none\");\n\n // row status\n $(row).attr(\"status\", ((parseInt($(row).attr(\"status\")) + 2) % 4).toString());\n\n // status sign\n if ($(row).attr(\"status\") === \"0\") {\n $(span).removeClass();\n $(span).addClass(\"glyphicon glyphicon-ok\");\n $(span).css(\"color\", \"green\");\n } else if ($(row).attr(\"status\") !== \"4\") {\n $(span).removeClass();\n $(span).addClass(\"glyphicon glyphicon-hourglass\");\n $(span).css(\"color\", \"black\");\n }\n}", "function initDeleteButton(){\n var deleteButton = document.createElement('a');\n var deleteButtonText = document.createTextNode('x');\n deleteButton.appendChild(deleteButtonText);\n deleteButton.className='hidden';\n deleteButton.id = 'todoClose';\n\n deleteButton.addEventListener('click',function(){\n var parentLi = this.parentNode;\n var parentUl = parentLi.parentNode;\n parentUl.removeChild(parentLi);\n var component = parentUl.parentNode.parentNode;\n \n //Check if there are no items in list and hide submit button\n if(parentUl.getElementsByTagName('li').length === 0){\n var submitButton = component.getElementsByClassName('todoSubmitButton')[0];\n submitButton.style.visibility = 'hidden';\n }\n\n });\n\n return deleteButton;\n }", "function CreatingButton(){\n var createButton = document.createElement(\"button\");\n createButton.appendChild(document.createTextNode(\"Delete\"));\n list[i].appendChild(createButton);\n createButton.onclick = removeParent;\n}", "function hideDefaultDeleteIcon(index) {\n let selectedDefaultDeleteBtn = document.querySelector(`#deleteDefaultBtn${index}`);\n selectedDefaultDeleteBtn.style.display = 'none';\n}", "function captionButton(btnAdd, btnDelete)\n\t{\n\t\tcaption = \"\";\n\n\t\tif (btnAdd == true && permissionsMember[currentModule['control_name']][2] == 1) {\n\t\t\tcaption += '<a id=\"btnAdd\" href=\"'+bUrl+currentModule['url']+'/add\" class=\"btnTop btn btn-success\"><i class=\"fa fa-plus\"></i> Add</a>';\n\t\t}\n\t\tif (btnDelete == true && permissionsMember[currentModule['control_name']][4] == 1) {\n\t\t\tcaption += '<a id=\"btnMultiDelete\" href=\"#\" class=\"btnTop btn btn-danger\"><i class=\"fa fa-trash-o\"></i> Delete</a>';\n\t\t}\n\n\t\treturn caption;\n\t}", "deleteModeButtonOnClick(e) {\n let target = e.target;\n // If button is not target, but icon is, set target to button\n if(target.tagName === 'I')\n target = target.parentNode;\n let isDeleteModeOn = target.classList.contains('deleteModeOn');\n // Switch for both modes(Delete on| Delete off)\n if(isDeleteModeOn){\n d3.select(target)\n .html('<i class=\"fas fa-trash\"></i>&nbsp;Delete zooms mode')\n .classed('deleteModeOn', false);\n d3.selectAll('.zoomButton')\n .classed('deleteMode', false)\n .classed('danger', false);\n d3.selectAll('.deleteModeCross')\n .remove();\n } else {\n d3.select(target)\n .html('<i class=\"fas fa-trash\"></i>&nbsp;Turn off delete mode')\n .classed('deleteModeOn', true);\n d3.selectAll('.zoomButton')\n .classed('deleteMode', true)\n .classed('danger', true)\n .insert('i', ':first-child')\n .classed('deleteModeCross', true)\n .classed('fas', true)\n .classed('fa-times', true);\n }\n }", "function createDeleteGarageButton(garage) {\n let btn = document.createElement(\"button\");\n btn.className = \"btn btn-danger btn-custom\";\n btn.innerHTML = \"Remove Garage\";\n btn.onclick = () => {\n let index = garages.indexOf(garage);\n garages.splice(index, 1);\n drawDOM();\n };\n return btn;\n}", "get imageButton() {\n return {\n type: \"rich-text-editor-image\",\n };\n }", "function DeleteBtn({ type = \"default\", className, children, onClick }) {\n return (\n <button\n onClick={onClick}\n className={[\"btn btn-secondary btn-m\", `btn-${type}`, className].join(\n \" \"\n )}\n >\n {children}\n </button>\n );\n}", "function addDeleteButton(prototype) {\n // First, create the button\n var $deleteButton = $('<div class=\"col-sm-1\"><a href=\"#\" class=\"btn btn-danger btn-sm\"><span class=\"fas fa-trash-alt\"></span></a></div>');\n\n // Add the button on the field\n $('.col-sm-10', prototype).removeClass('col-sm-10').addClass('col-sm-9');\n prototype.append($deleteButton);\n\n // Create a listener on the click event\n $deleteButton.click(function(e) {\n e.preventDefault();\n // Remove the field\n prototype.remove();\n return false;\n });\n }", "function DeleteBtn(props) {\n return (\n <span className=\"delete-btn\" {...props} role=\"button\" tabIndex=\"0\">\n ✗\n </span>\n );\n}", "function addButtonforDelete(listItem) {\n var btn = document.createElement(\"button\");\n btn.appendChild(document.createTextNode(\"Delete\"));\n btn.addEventListener(\"click\", function () {\n // many ways of doing this but since we learnt parentElement from past lectures\n btn.parentElement.remove();\n });\n listItem.appendChild(btn);\n}", "function getDeleteButton(targetTable) {\n\t\tvar button;\n\t\tbutton = document.createElement(\"button\");\n\t//set function for the onclick event\n\t\tbutton.onclick = new Function(\"deleteRow(this, '\"+targetTable+\"');\");\n\t\treturn button;\n\t}", "getBoxRemoveButton()\n {\n return this.physicalCrossButton;\n }", "function deletebut() {\r\n\r\n let delbut = document.createElement('button');\r\n let txt = document.createTextNode('DELETE');\r\n delbut.appendChild(txt);\r\n form.appendChild(delbut);\r\n\r\n delbut.addEventListener('click', deleteelement);\r\n\r\n function deleteelement(e) {\r\n let delli = e.target.closet();\r\n delli.remove();\r\n }\r\n}", "function addDeleteButtonForListItem(listItems) {\n\tvar delButton = document.createElement(\"button\");\n\t// added delButtons class to all Delete buttons\n\tdelButton.classList.add(\"delButtons\");\n\t/* append text to delButton */\n\tdelButton.appendChild(document.createTextNode(\"Delete\"));\n\t/* append button to listItems */\n\tlistItems.appendChild(delButton);\n\n\tdelButton.addEventListener(\"click\", function() {\n\t\tlistItems.parentNode.removeChild(listItems); \n\n\t});\n\n\t/* immediately hide the delete buttons when they're created - \n\tonly display when list item is toggled */\n\tdelButton.style.visibility = \"hidden\";\n}", "_createButtonIcon(type, parent, onClick) {\n var button = this._createElementUnder('button', parent);\n var span = this._createElementUnder('span', button);\n span.classList.add('material-icons-round');\n span.classList.add('md-24');\n span.innerText = type;\n button.addEventListener(\"click\", onClick);\n return button;\n }", "_addActionDelete() {\n let btn = this._actions.getElementsByClassName('delete')[0];\n if (btn === undefined) {\n return;\n }\n\n btn.onclick = ((event) => {\n\n let confirm = (() => {\n this._api.removeService(this._api.getSlug());\n this._dialog.hide();\n }).bind(this);\n\n const params = {\n title: this._i18n('actions.delete.item'),\n content: this._i18n('actions.delete.info'),\n actions: [\n {title: this._i18n('dialog.cancel'), attrs: null, className: 'btn-default abort'},\n {title: this._i18n('dialog.confirm'), attrs: [['onclick', confirm]], className: 'btn btn-outline-danger confirm'}\n ],\n _class: 'confirmation-dialog delete'\n };\n\n this._dialog = new Dialog(params);\n this._dialog.show();\n\n }).bind(this);\n\n this._btns.delete = btn;\n }", "createButtons() {\n this.settingsButton = this._createConnectionButton(TEXTURE_NAME_SETTINGS);\n this.deleteButton = this._createConnectionButton(TEXTURE_NAME_DELETE);\n }", "function showImageOnButton(uri) {\n //me.getAddImageButtonRef().setHtml('<div class=\"addPhotoButtonHolder\"><img src=\"' + uri + '\" class=\"addPhotoButtonImage\"/></div>');\n\t\t me.getAddImageButtonRef().setHtml('<div class=\"addPhotoButtonHolder\" style=\"background:url(' + uri + '); background-size:cover; background-repeat:no-repeat; background-position:center;\">&nbsp;</div>');\n\t\t}", "function generateDelBtn(url, caption, ownerId, needsLeft) {\n return `${needsLeft ? '<span class=\"left\">' : ''}<a class=\"tooltipped\" data-caption=\"${caption}\" data-owner=\"${ownerId}\" data-url=\"${url}\" onclick=\"deletePin(this)\" data-tooltip=\"Delete this pin\"><i class=\"fa fa-minus-square-o\"></i></a>${needsLeft ? '</span>' : ''}`;\n}", "function deleteButton(li) {\n\n var delBtn = document.createElement(\"BUTTON\");\n var delTxt = document.createTextNode(\"Delete\");\n delBtn.appendChild(delTxt);\n delBtn.id = \"btnDelete\";\n li.appendChild(delBtn);\n delBtn.addEventListener(\"click\", deleteTask);\n\n}", "function createDeleteRowButton(garage, car) {\n let btn = document.createElement(\"button\");\n btn.className = \"btn btn-danger\";\n btn.innerHTML = \"Remove Car\";\n btn.onclick = () => {\n let index = garage.cars.indexOf(car);\n garage.cars.splice(index, 1);\n drawDOM();\n };\n return btn;\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=\"gbl-kg-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Kurzgeschichte</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"<!-- INFORMATIONEN ZUR ANPASSUNG IST UNTEN\\n-->{{Geschichten-Info 2013/Kurzgeschichte\\n<!-- unter dieser Linie nichts verändern -->\\n|LastUpdateHack={{{LastUpdateHack|{{REVISIONDAY2}}.{{REVISIONMONTH}}.{{REVISIONYEAR}}}}}\\n|Portal={{{Portal|}}}\\n|Name=\"+ wgPageNameRegexedSplit +\"\\n}}<noinclude>{{Geschichten-Info/Autoren-Werkzeugkasten}}[[Kategorie:Angepasste Geschichtenbalken]]</noinclude>\";\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(\"Sollte alles mit 'OK' funktionieren. ###### ACHTUNG ##### geht nur in Geschichtenübersicht.\", 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 deleteAction(dl_row) {\r\n let dltBtn = document.createElement('button')\r\n dltBtn.innerHTML = 'Delete';\r\n dltBtn.className = 'dl-btn';\r\n dl_row.appendChild(dltBtn)\r\n dltBtn.addEventListener('click', function() {\r\n addBook.removeChild(dl_row);\r\n })\r\n }", "function button(refObject) {\n\trefObject.parentNode.style.background=\"url(/img/welcome/button3.gif) no-repeat 0 0 \";\n}", "function createButton(icon) {\n const image = document.createElement('img')\n image.src = icon.src\n image.classList.add(CLASSES.ICON_IMG)\n if (icon.spinning) {\n image.classList.add(CLASSES.ICON_IMG_SPINNING)\n }\n const container = document.createElement('div')\n container.title = icon.title\n container.classList.add(CLASSES.ICON_CONTAINER)\n container.classList.add(CLASSES.ICON_CONTAINER_BUTTON)\n container.appendChild(image)\n return container\n}", "function DeleteBtn(props) {\n const { classes, ...custom } = props;\n return (\n <Fab\n color=\"secondary\"\n size=\"small\"\n classes={{ root: classes.conditionButton }}\n {...custom}\n >\n <DeleteIcon />\n </Fab>\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 initDeleteButton() {\n // Create a div that holds the delete message button.\n deleteContainer = document.createElement('div');\n deleteContainer.style.padding = \"0px 0px 10px 10px\";\n deleteContainer.className = \"options\";\n\n // Set the CSS for the button's border.\n var deleteBorder = document.createElement('div');\n //deleteBorder.style.backgroundColor = 'rgba(43, 132, 237, 1.0)';\n deleteBorder.style.cursor = 'pointer';\n deleteBorder.style.textAlign = 'center';\n deleteContainer.appendChild(deleteBorder);\n\n // Set the CSS for the button's interior content.\n var deleteImg = document.createElement('img');\n deleteImg.className = \"mapBtn\";\n deleteImg.style.boxShadow = '0 2px 6px rgba(0, 0, 0, 0.3)';\n deleteImg.style.borderRadius = '35%';\n deleteImg.setAttribute('src', 'img/trash.png');\n deleteImg.style.height = '57.6px';\n deleteImg.style.width = '47px';\n deleteImg.style.padding = \"6px 6px 6px 6px\";\n deleteBorder.appendChild(deleteImg);\n\n // Inserts the finished button to the right-bottom area of the map.\n googleMapObject.controls[google.maps.ControlPosition.LEFT_BOTTOM].push(deleteContainer);\n\n // Setup the map listener for the button.\n google.maps.event.addDomListener(deleteContainer, 'click', function(event) {\n //Checks if cow was created by user\n if (currCow.infoBox != null && currCow.previewBox != null && currCow.marker != null) {\n $.post(\"getMarker\", {\n lat: currCow.marker.getPosition().lat(),\n lng: currCow.marker.getPosition().lng(),\n }, function(marker) {\n //Only deletes if marker was created by user\n if (marker[0].userID == username) {\n swal({\n title: 'Are you sure you want to delete the \"' + marker[0].topic + '\" cow?',\n text: \"You won't be able to revert this!\",\n type: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Yes, delete it!'\n }).then(function() {\n swal(\n 'Deleted!',\n '\"' + marker[0].topic + '\"' + \" has been deleted\",\n 'success'\n )\n deleteMessage();\n })\n }\n });\n }\n // Otherwise raise an error.\n else {\n swal(\n 'Oops...',\n 'You can only delete your own cow!',\n 'error'\n )\n }\n });\n}", "onBrushDeleteButtonOver() {\n this.mouseOverDeleteButton = true;\n }", "get removeFormatButton() {\n return {\n command: \"removeFormat\",\n icon: \"editor:format-clear\",\n label: \"Erase Format\",\n type: \"rich-text-editor-button\",\n };\n }", "function getSubTaskBtn() {\n let div = document.createElement('div');\n div.innerHTML =\n '<img src=\"images/subtask.png\" id=\"image\" style=\"margin-left: 30px;width:30px;height:30px\"/>';\n div.setAttribute('style', 'display: inline;');\n div.addEventListener('click', createSubTask, false);\n\n return div;\n }", "function removeClicked()\n\t{\n\t\tvar i, els = getSelectedImages();\n\n\t\tfor (i = 0; i < els.length; i++) {\n\t\t\tremoveImageConstruct(els[i].id);\n\t\t\tdelete ImageStore[els[i].id];\n\n\t\t}\n\n\t\tif (els.length > 0) {\n\t\t\tenableImageButtons([Ids.DeleteAction, Ids.RotateLeftAction, Ids.RotateRightAction, Ids.CropAction, Ids.ClearAction], false);\n\t\t\tloadData(EmptyImageData);\n\t\t\tdisableAllImageControls();\n\t\t\tImageCount -= els.length;\n\t\t}\n\t\t\n\t\tif (ImageCount === 0) {\n\t\t\tYD.setStyle(Ids.DropHelp, 'display', 'block');\n\t\t\tYD.get(Ids.DropHelp).innerHTML = MsgDragPhotos;\n\t\t}\n\n\t\tdisplayImageDimensions();\n\t}", "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=\"gbl-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Geschichtenbalken: normal</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"<!-- INFORMATIONEN ZUR ANPASSUNG IST UNTEN\\n-->{{Geschichten-Info 2013\\n<!-- unter dieser Linie nichts verändern -->\\n|LastUpdateHack={{{LastUpdateHack|{{REVISIONDAY2}}.{{REVISIONMONTH}}.{{REVISIONYEAR}}}}}\\n|Portal={{{Portal|}}}\\n|Name=\"+ wgPageNameRegexedSplit +\"\\n}}<noinclude>{{Geschichten-Info/Autoren-Werkzeugkasten}}[[Kategorie:Angepasste Geschichtenbalken]]</noinclude>\";\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(\"Sollte alles mit 'OK' funktionieren. ###### ACHTUNG ##### geht nur in Geschichtenübersicht.\", 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 addRemoveButtons() {\n\t\t\t\tvar dl = $(this),\n\t\t\t\tguzik = $('<div class=\"miniButton\">remove</div>');\n\t\t\t\t// remove old buttons\n\t\t\t\tdl.remove('div.miniButton');\n\t\t\t\tguzik.css('float', 'right');\n\t\t\t\tguzik.click(removeListItem);\n\t\t\t\tdl.append(guzik);\n\t\t\t}", "function myRemoveButton(){\n\t\t\n\t\t\tvar rmv = document.createElement(\"BUTTON\");\n\t\t\tvar rmvt = document.createTextNode(\"Remove\");\n\t\t\trmv.setAttribute(\"id\",\"removeg\");\n\t\t\trmv.addEventListener(\"click\",remove);\n\t\t\trmv.appendChild(rmvt);\n\t\t\t\n\t\t\t$(element).find(\"#hello\").get(0).appendChild(rmv);\n\t\n\t\t}", "function cancelDeleteButton() {\n document.getElementById(\"sensitiveAccountsData\").style.display = \"block\";\n document.getElementById(\"addNewButton\").style.display = \"none\";\n }", "onBrushDeleteButtonOut() {\n this.mouseOverDeleteButton = false;\n }", "get orderedListButton() {\n return {\n command: \"insertOrderedList\",\n icon: \"editor:format-list-numbered\",\n label: \"Ordered List\",\n radio: true,\n type: \"rich-text-editor-button\",\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}", "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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Kategorie3</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Dritte Kategorie der Geschichte 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}", "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=\"thema-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Thema</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"One Piece\";\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(\"Thema der Geschichte 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}", "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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">FSK</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"FSK der Geschichte angeben. Mögliche Eingaben:\\n0, 6, 8, 12, 16, 18\", 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 VButton(columnName, mandatory, isReadOnly, isUpdateable, text, description, help, AD_Process_ID, isLink, isRightLink, AD_Form_ID, isBGProcess, isAskUserBGProcess) {\n\n this.actionListner;\n this.AD_Process_ID = AD_Process_ID;\n this.AD_Form_ID = AD_Form_ID;\n this.description = description;\n this.help = help;\n this.text = text;\n this.isLink = isLink;\n this.isRightLink = isRightLink;\n this.actionLink = null;\n this.isCsv = false;\n this.isPdf = false;\n this.askUserBGProcess = isAskUserBGProcess;\n this.isBackgroundProcess = isBGProcess;\n\n this.values = null;\n\n var $img = $(\"<i title='\" + text + \"'>\");\n\n var $txt = $(\"<span>\").text(text);\n var rootPath = VIS.Application.contextUrl + \"Areas/VIS/Images/base/\";\n\n var $ctrl = null;\n //Init Control\n if (!isLink) {\n $ctrl = $('<button>', { type: 'button', name: columnName });\n $img.css(\"margin-right\", \"8px\");\n $ctrl.append($img).append($txt);\n }\n else {\n $ctrl = $('<li>');\n $ctrl.append($txt).append($img);\n }\n\n //\tSpecial Buttons\n if (columnName.equals(\"PaymentRule\")) {\n this.readReference(195);\n $ctrl.css(\"color\", \"blue\"); //\n setIcon(\"vis vis-payment\"); // 29*14\n }\n else if (columnName.equals(\"DocAction\")) {\n this.readReference(135);\n $ctrl.css(\"color\", \"blue\"); //\n setIcon(\"vis vis-cog\"); // 16*16\n }\n else if (columnName.equals(\"CreateFrom\")) {\n setIcon(\"vis vis-copy\"); // 16*16\n }\n else if (columnName.equals(\"Record_ID\")) {\n setIcon(\"vis vis-find\"); // 16*16\n $ctrl.text(VIS.Msg.getMsg(\"ZoomDocument\"));\n }\n else if (columnName.equals(\"Posted\")) {\n this.readReference(234);\n $ctrl.css(\"color\", \"magenta\"); //\n setIcon(\"fa fa-line-chart\"); // 16*16\n }\n else if (isLink) {\n setIcon(\"vis vis-action\");\n }\n\n function setIcon(img) {\n $img.addClass(img);\n };\n\n IControl.call(this, $ctrl, VIS.DisplayType.Button, isReadOnly, columnName, mandatory);\n\n if (isReadOnly || !isUpdateable) {\n this.setReadOnly(true);\n //this.Enabled = false;\n }\n else {\n this.setReadOnly(false);\n }\n\n var self = this; //self pointer\n var $ulPopup = null;\n\n $ulPopup = getPopupList();\n function getPopupList() {\n var ullst = $(\"<ul class='vis-apanel-rb-ul'>\");\n //ullst.append($(\"<li data-action='D'>\").text(VIS.Msg.getMsg(\"Default\")));\n ullst.append($(\"<li data-action='C'>\").text(VIS.Msg.getMsg(\"OpenCSV\")));\n ullst.append($(\"<li data-action='P'>\").text(VIS.Msg.getMsg(\"OpenPDF\")));\n return ullst;\n };\n\n\n $ctrl.on(VIS.Events.onClick, function (evt) { //click handler\n evt.stopPropagation();\n\n var isReport = null;\n // self.invokeActionPerformed({ source: self });\n if (!self.isReadOnly) {\n var sqlQry = \"VIS_81\";\n var param = [];\n param[0] = new VIS.DB.SqlParam(\"@AD_Process_ID\", AD_Process_ID);\n isReport = executeScalar(sqlQry, param);\n\n\n sqlQry = \"VIS_149\";\n param = [];\n param[0] = new VIS.DB.SqlParam(\"@AD_Process_ID\", AD_Process_ID);\n var isCrystalReport = executeScalar(sqlQry, param);\n\n if (isCrystalReport == \"Y\" && VIS.context.getIsUseCrystalReportViewer()) {\n self.invokeActionPerformed({ source: self });\n }\n else {\n if (isReport == 'Y') {\n $img.w2overlay($ulPopup.clone(true));\n }\n else {\n self.invokeActionPerformed({ source: self });\n }\n }\n }\n });\n\n if ($ulPopup) {\n $ulPopup.on(\"click\", \"LI\", function (e) {\n var target = $(e.target);\n\n if (target.data(\"action\") == \"P\") {\n self.isPdf = true;\n self.isCsv = false;\n }\n else if (target.data(\"action\") == \"C\") {\n self.isCsv = true;\n self.isPdf = false;\n }\n self.invokeActionPerformed({ source: self });\n });\n }\n\n\n this.setText = function (text) {\n if (text == null) {\n $txt.text(\"\");\n return;\n }\n var pos = text.indexOf('&');\n if (pos != -1)\t\t\t\t\t//\tWe have a nemonic - creates ALT-_\n {\n var mnemonic = text.toUpperCase().charAt(pos + 1);\n if (mnemonic != ' ') {\n //setMnemonic(mnemonic);\n text = text.substring(0, pos) + text.substring(pos + 1);\n }\n }\n $txt.text(text);\n\n };\n\n this.disposeComponent = function () {\n $ctrl.off(VIS.Events.onClick);\n $ctrl = null;\n self = null;\n //this.actionListner = null;\n this.AD_Process_ID = null;\n this.description = null;\n this.help = null;\n this.setText = null;\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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Autor3</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Dritten Autor der Geschichte 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}", "function showDeleteButton() {\n if (deleteButton.classList.contains('invisible')) {\n deleteButton.classList.remove('invisible');\n }\n}", "function deleteButton(buttonName){\n buttonName.parentElement.parentElement.remove();\n}", "function newRenameButton() {\n const renameImage = document.createElement('button');\n renameImage.type = 'button';\n renameImage.className = 'rename';\n renameImage.title = 'Rename';\n return renameImage;\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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Kategorie1</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Erste Kategorie der Geschichte 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}", "actionIcons() {\n const componentName = this.breakdownPathComponents()[1];\n return {\n header: \"\",\n key: \"id\",\n render: (id) => <span className=\"icons\" style={{display: this.state.isAdmin ? \"inherit\" : \"none\"}}>\n <Link to={\"/\" + componentName + \"/\" + id}><img className=\"smallicon\" src=\"/assets/images/edit.png\"/></Link>\n <Link to={\"/\" + componentName + \"/\" + id + \"/delete\"}><img className=\"smallicon\" src=\"/assets/images/delete.png\"/></Link>\n </span>\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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Autor2</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Zweiten Autor der Geschichte 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}", "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=\"autor1-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Autor1</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Ersten Autor der Geschichte 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}", "function setupUserInterfaceDeleteBtn($, removeBrush) {\n\n // Deleting a brush\n $(\".delete-btn\").click(function(clickEvent) {\n let removeBrushId = parseInt( clickEvent.currentTarget.id ); cl(removeBrushId);\n removeBrush(removeBrushId); \n });\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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Kategorie2</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Zweite Kategorie der Geschichte 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}", "function newDeleteButtonOnClick (e) {\n if (!e.target.classList.contains('new-delete')) {\n return;\n }\n else {\n // e.preventDefault();\n const newTicketDelete = e.target;\n newTicketDelete.style.display = 'none';\n e.target.closest('tr').querySelector('.new-delete-confirm').style.display = 'inline';\n e.target.closest('tr').querySelector('.new-delete-yes').style.display = 'inline';\n e.target.closest('tr').querySelector('.new-delete-no').style.display = 'inline';\n }\n}", "function makeBtnDel(i) {\n let delBtn = document.createElement(\"input\");\n delBtn.style.setProperty(\"grid-column\", 2)\n delBtn.style.setProperty(\"width\",\"100px\")\n delBtn.style.setProperty(\"height\", \"40px\")\n delBtn.style.setProperty(\"margin\", \"5px\")\n delBtn.type = \"button\";\n delBtn.value = \"delete\";\n delBtn.onclick = function() {\n myLibrary.splice(i,1)\n let delBtn = document.getElementById(\"btnDel\" + i) \n container.removeChild(delBtn)\n let delBook = document.getElementById(\"book\" + i)\n container.removeChild(delBook)\n let delRead = document.getElementById(\"readBtn\" + i)\n container.removeChild(delRead);\n }\n container.appendChild(delBtn).id = \"btnDel\" + i;\n}", "function createBtnConfirm() {\n let btnConfirm = document.createElement(\"button\");\n btnConfirm.className = \"note-button note-button-bottom\";\n btnConfirm.addEventListener(\"click\", function () {\n saveNotesToLocalStorage();\n });\n btnConfirm.appendChild(createImgConfirm());\n return btnConfirm;\n}", "generateDeleteBtn(isOpen) {\n const deleteTooltip = <Tooltip id={\"delete-petition-tooltip\"}>Permanently delete this petition.</Tooltip>;\n const innerElement = isOpen\n ? <MenuItem onClick={this.handleDeleteRequest.bind(this)}>Delete</MenuItem>\n : <Button bsStyle=\"danger\" onClick={this.handleDeleteRequest.bind(this)}>Delete</Button>;\n\n return (\n <OverlayTrigger placement={\"top\"} overlay={deleteTooltip}>\n { innerElement }\n </OverlayTrigger>\n )\n }", "function deleteImg() {\r\n let createImage = document.createElement('IMG');\r\n let el = document.getElementById('artist-img');\r\n el.parentNode.removeChild(el);\r\n console.log('img deleted');\r\n}", "function makeNote(note) {\n let noteLi = document.createElement(\"li\")\n noteLi.innerText = note.title\n noteLi.className= 'note-li'\n noteLi.dataset.id = note.id\n noteList.append(noteLi)\n\n //How to crete delete button\n let delBtn = document.createElement(\"button\")\n delBtn.innerText = \"delete\"\n delBtn.className = \"del-btn\"\n delBtn.dataset.id = note.id\n noteLi.append(delBtn)\n }", "get undoButton() {\n return {\n command: \"undo\",\n icon: \"undo\",\n label: \"Undo\",\n shortcutKeys: \"ctrl+z\",\n type: \"rich-text-editor-button\",\n };\n }", "function createWishList(index){\r\n\tvar wishTable = document.getElementById(\"wishTable\");\r\n\tvar wishRow = wishTable.insertRow(index+1);\r\n\tvar itemImage = document.createElement('img');\r\n\tvar deleteButton = document.createElement('button');\r\n\tdeleteButton.setAttribute('content', 'test content');\r\n\tdeleteButton.setAttribute('class', 'btn');\r\n\tdeleteButton.innerHTML = 'X';\r\n\tdeleteButton.style.color = \"#FF8D48\";\r\n\tdeleteButton.style.fontSize = \"20px\";\r\n\tdeleteButton.style.border = \"none\";\r\n\tdeleteButton.style.width = \"100px\";\r\n\tdeleteButton.style.height = \"100px\";\r\n\tdeleteButton.style.backgroundColor = \"white\";\r\n\r\n\tdeleteButton.onclick = function(){deleteWishItems(index, wishTable)};\r\n\r\n\titemImage.src = \"images/\"+ wishItems[index].color + \".png\"\r\n\titemImage.style.height = '150px';\r\n\titemImage.style.width = '150px';\r\n\r\n\tvar itemI = wishRow.insertCell(0);\r\n\tvar itemN = wishRow.insertCell(1);\r\n\tvar itemS = wishRow.insertCell(2);\r\n\tvar itemC = wishRow.insertCell(3);\r\n\tvar itemP = wishRow.insertCell(4);\r\n\tvar itemD = wishRow.insertCell(5);\r\n\r\n\titemI.appendChild(itemImage);\r\n\titemN.innerHTML = wishItems[index].itemName;\r\n\titemS.innerHTML = wishItems[index].size;\r\n\titemC.innerHTML = wishItems[index].color;\r\n\titemP.innerHTML = \"$\" + itemPrice;\r\n\titemD.appendChild(deleteButton);\r\n\titemD.style.textAlign = \"right\";\r\n\r\n}", "function createDeleteBtn(taskid) {\n\n //Get projectID so close button references ID in query string upon refresh \n var urlString = window.location.search\n var uid = urlString.slice(1, urlString.length).split('&')[1].split('=')[1]\n var projectId = window.location.search.slice(1, urlString.length).split('&')[0].split('=')[1]\n var taskID = taskid\n\n if(!projectId) {\n console.log(\"ProjectID not set for task popup delete button\")\n } else {\n var loc = \"/kanban.html?id=\" + projectId + \"&uid=\" + uid\n //console.log(\"Link: \" + loc)\n }\n\n console.log(taskID)\n\n var del = document.createElement(\"input\");\n\n del.setAttribute(\"type\", \"button\");\n del.setAttribute(\"class\", \"deleteBtn\");\n del.setAttribute(\"id\", taskID);\n del.setAttribute(\"value\", \"X\");\n del.setAttribute(\"title\", \"Delete Task\");\n //del.setAttribute(\"onClick\", deleteTask(taskID));\n\n return del;\n}", "function addButton(){ \n text = document.createTextNode(\"Delete Task\");\n buttn = document.createElement(\"Button\");\n buttn.className = classNames[\"TODO_DELETE\"];\n buttn.setAttribute(\"onClick\",\"deleteTask(event)\")\n buttn.appendChild(text);\n return buttn;\n}", "function addDeleteButton(row) {\n let deleteBtnCell = row.insertCell(-1);\n const deleteButton = document.createElement(\"input\");\n deleteButton.setAttribute(\"type\", \"button\");\n deleteButton.setAttribute(\"value\", \"x\");\n deleteButton.setAttribute(\"onclick\", \"deleteRow(this)\"); \n deleteBtnCell.appendChild(deleteButton);\n row.appendChild(deleteBtnCell);\n}", "function deleteQuote() {\n deleteBtn.parentElement.remove();\n showFav();\n }", "function deletePhoto() {\n $scope.work.email = $rootScope.email;\n $scope.menuOpened = 'closed';\n if(confirm('Delete this photo?')){\n $scope.work.src = ''; \n }\n //$state.reload();\n }", "function createCart(index){\r\n\tvar cartTable = document.getElementById(\"cartTable\");\r\n\tvar cartRow = cartTable.insertRow(index+1);\r\n\tvar itemImage = document.createElement('img');\r\n\tvar deleteButton = document.createElement('button');\r\n\tdeleteButton.setAttribute('content', 'test content');\r\n\tdeleteButton.setAttribute('class', 'btn');\r\n\tdeleteButton.innerHTML = 'X';\r\n\tdeleteButton.style.color = \"#FF8D48\";\r\n\tdeleteButton.style.fontSize = \"20px\";\r\n\tdeleteButton.style.border = \"none\";\r\n\tdeleteButton.style.width = \"100px\";\r\n\tdeleteButton.style.height = \"100px\";\r\n\tdeleteButton.style.backgroundColor = \"white\";\r\n\r\n\t/* Add delete button for each item */\r\n\r\n\tdeleteButton.onclick = function(){deleteItems(index, cartTable)};\r\n\r\n\titemImage.src = \"images/\"+ cartItems[index].color + \".png\"\r\n\titemImage.style.height = '150px';\r\n\titemImage.style.width = '150px';\r\n\r\n\tvar itemI = cartRow.insertCell(0);\r\n\tvar itemN = cartRow.insertCell(1);\r\n\tvar itemS = cartRow.insertCell(2);\r\n\tvar itemC = cartRow.insertCell(3);\r\n\tvar itemQ = cartRow.insertCell(4);\r\n\tvar itemP = cartRow.insertCell(5);\r\n\tvar itemD = cartRow.insertCell(6);\r\n\r\n\titemI.appendChild(itemImage);\r\n\titemN.innerHTML = cartItems[index].itemName;\r\n\titemS.innerHTML = cartItems[index].size;\r\n\titemC.innerHTML = cartItems[index].color;\r\n\titemP.innerHTML = \"$\" + itemPrice;\r\n\titemQ.innerHTML = cartItems[index].quantity;\r\n\titemD.appendChild(deleteButton);\r\n\titemD.style.textAlign = \"right\";\r\n\r\n}", "deletePainting(target){\n if(target.className === 'delete'){\n target.parentElement.parentElement.remove();\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=\"tw-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">TW</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"http://twitter.com/MeerUndMehrWiki\";\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(\"Twitter-Link 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}" ]
[ "0.74276906", "0.73468417", "0.7216054", "0.7010174", "0.69134593", "0.6860244", "0.68346804", "0.68064064", "0.66736424", "0.6556267", "0.6517153", "0.65078956", "0.6504571", "0.6424006", "0.6243887", "0.6184515", "0.6145393", "0.61420864", "0.6139848", "0.61227655", "0.60790306", "0.6051223", "0.6036151", "0.6019344", "0.6015942", "0.60123193", "0.5992764", "0.5982395", "0.58999425", "0.58689564", "0.5867831", "0.5864654", "0.5860196", "0.58415264", "0.5834694", "0.5829591", "0.5817487", "0.5790861", "0.5786281", "0.57619184", "0.5758813", "0.57568055", "0.5737183", "0.57364804", "0.57313484", "0.57301074", "0.5728279", "0.5725645", "0.572136", "0.57142735", "0.5705967", "0.57057846", "0.5704117", "0.5699337", "0.569277", "0.56860054", "0.5676261", "0.56761867", "0.56751394", "0.5664367", "0.5663394", "0.5662703", "0.5645671", "0.56339395", "0.5631954", "0.5620036", "0.5616054", "0.5598246", "0.55967176", "0.55943334", "0.55912805", "0.5590557", "0.55727714", "0.5562399", "0.5562296", "0.55575955", "0.55566794", "0.55542046", "0.55528605", "0.5552447", "0.5550263", "0.5549387", "0.5549141", "0.55437773", "0.5543753", "0.55395055", "0.5535044", "0.55315095", "0.55310315", "0.55249554", "0.5524426", "0.55222994", "0.5520033", "0.551954", "0.5514724", "0.55141664", "0.55126756", "0.54888487", "0.5487062", "0.5477765" ]
0.69267356
4
Create div that holds the content for the note
function createDiv2(type, article) { let div2 = document.createElement("div"); div2.className = "content"; if (type == 1) { let textarea = document.createElement("div"); textarea.className = "textArea"; textarea.contentEditable = "true"; div2.appendChild(textarea); } if (type == 2) { article.className = "note note-list shadow-sm"; let inputContainer = document.createElement("div"); inputContainer.className = "input-container"; let input = document.createElement("input"); input.type = "text"; input.className = "list-input"; input.placeholder = "Add to list"; let button = document.createElement("button"); button.className = "list-btn note-button"; let imgAddList = document.createElement("img"); imgAddList.src = "media/plus.svg"; imgAddList.alt = "Add"; imgAddList.width = "28"; imgAddList.height = "28"; imgAddList.title = "Add to list"; button.appendChild(imgAddList); let node = document.createElement("ul"); node.className = "list"; inputContainer.appendChild(input); inputContainer.appendChild(button); div2.appendChild(inputContainer); div2.appendChild(node); input.addEventListener("keypress", function (event) { let e = event; if ( e.code === "Enter" && document.getElementsByClassName("list-input")[0].value != "" ) { addListItemOnClick(); } }); function addListItemOnClick() { if (input.value.length > 0) { let listItemContainer = document.createElement("div"); listItemContainer.className = "list-item-container"; let node_li = document.createElement("li"); node_li.contentEditable = "true"; node_li.className = "itemOfList"; let textnode = document.createTextNode(input.value); let span = document.createElement("SPAN"); let txt = document.createTextNode("\u00D7"); span.className = "remove-list-item"; span.addEventListener("click", () => { listItemContainer.remove(); saveNotesToLocalStorage(); }); span.appendChild(txt); node_li.appendChild(textnode); listItemContainer.appendChild(node_li); listItemContainer.appendChild(span); node.prepend(listItemContainer); div2.appendChild(node); document.getElementsByClassName("list-input")[0].value = ""; saveNotesToLocalStorage(); } } button.addEventListener("click", addListItemOnClick); } return div2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNote() {\n return '<div class=\"note\"> </div> \\n';\n}", "function addNotes(){\n //i++;\n //var textfield=document.querySelector('.textfield');\n var noteslist=document.querySelector('.notesList');\n var textarea=document.querySelector('.textarea').value;\n var note=document.createElement('div');\n \n // note.id=\"div\"+i;\n var content=document.createTextNode(textarea);\n console.log(content)\n note.appendChild(content);\n note.style.display=\"inline-block\";\n note.style.width='50%';\n note.style.background=\"lightblue\";\n noteslist.appendChild(note);\n //console\n \n\n }", "function createNoteDiv(note) {\r\n\r\n note.tags.forEach((item) => {\r\n //changed to handle image tags\r\n switch (item) {\r\n case \"F\":\r\n xTagFunTrue = true;\r\n break;\r\n case \"M\":\r\n xTagMetaTrue = true;\r\n break;\r\n case \"U\":\r\n xTagUrgentTrue = true;\r\n break;\r\n }\r\n });\r\n\r\n var dateString = note.date.toLocaleDateString();\r\n\r\n /**number means level of div child from main-parent */\r\n //0. new element: main div wrapper\r\n var newMainDiv = document.createElement(\"DIV\");\r\n newMainDiv.setAttribute(\"class\", \"individualNote\");\r\n newMainDiv.setAttribute(\"id\", \"new-main-div\" + note.number);\r\n newMainDiv.setAttribute(\"js-noteDiv\", note.number)\r\n document.getElementById(\"main-parent\").appendChild(newMainDiv);\r\n\r\n // 1. new element changed innerhtml to createElement for security \r\n var xTitle = document.createElement(\"div\");\r\n xTitle.setAttribute(\"id\", \"new-title-div\" + note.number);\r\n xTitle.setAttribute(\"class\", \"newNoteTopTitle\");\r\n xTitle.textContent = note.title;\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xTitle);\r\n\r\n // 1. first element inside note: subject\r\n var xSubject = document.createElement(\"div\");\r\n xSubject.setAttribute(\"id\", \"new-subject-div\" + note.number);\r\n xSubject.setAttribute(\"class\", \"subjectInNote\");\r\n xSubject.textContent = note.subject;\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xSubject);\r\n\r\n // 1. new vote div\r\n var newVoteDiv = document.createElement(\"DIV\");\r\n newVoteDiv.setAttribute(\"id\", \"new-vote-div\" + note.number);\r\n newVoteDiv.setAttribute(\"class\", \"voteDiv\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(newVoteDiv);\r\n\r\n // 2. vote number\r\n var newVotetext = document.createElement(\"p\");\r\n newVotetext.innerHTML = note.voteNumber;\r\n newVotetext.setAttribute(\"id\", \"vote-n-\" + note.number);\r\n newVotetext.setAttribute(\"class\", \"voteNumber\");\r\n newVotetext.setAttribute(\"js-noteVote\", \"\")\r\n document.getElementById(\"new-vote-div\" + note.number).appendChild(newVotetext);\r\n\r\n // 2. vote button\r\n var newVoteButton = document.createElement(\"input\");\r\n newVoteButton.setAttribute(\"id\", \"vote-b-\" + note.number);\r\n newVoteButton.setAttribute(\"js-access\", \"\");\r\n newVoteButton.src = \"upvote3.png\";\r\n newVoteButton.type = \"image\";\r\n newVoteButton.setAttribute(\"class\", \"voteButton\");\r\n document.getElementById(\"new-vote-div\" + note.number).appendChild(newVoteButton);\r\n\r\n // 1. second element inside note: noteinfo wrapper div\r\n var xNoteinfo = document.createElement(\"div\");\r\n xNoteinfo.setAttribute(\"id\", \"new-note-info-div\" + note.number);\r\n xNoteinfo.setAttribute(\"class\", \"noteInfo\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xNoteinfo);\r\n\r\n // 2. NAME\r\n var xName = document.createElement(\"div\");\r\n xName.setAttribute(\"id\", \"new-tags-div\" + note.number);\r\n xName.setAttribute(\"class\", \"usernameMadenote\");\r\n xName.textContent = xName2;\r\n document.getElementById(\"new-note-info-div\" + note.number).appendChild(xName);\r\n\r\n // 2. DATE element inside noteinfo wrapper div\r\n var xDate = document.createElement(\"div\");\r\n xDate.setAttribute(\"id\", \"new-date-div\" + note.number);\r\n xDate.setAttribute(\"class\", \"dateInNote\");\r\n xDate.textContent = dateString;\r\n document.getElementById(\"new-note-info-div\" + note.number).appendChild(xDate);\r\n\r\n // 1. TAG element tagwrapper\r\n var tagWrapper = document.createElement(\"div\");\r\n tagWrapper.setAttribute(\"id\", \"tagwrapper\" + note.number);\r\n tagWrapper.setAttribute(\"class\", \"tagwrapper\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(tagWrapper);\r\n\r\n // 2.TagFun\r\n var xTagFun = document.createElement(\"img\");\r\n xTagFun.setAttribute(\"src\", \"fun10.png\");\r\n xTagFun.setAttribute(\"class\", \"funloggaInNote\");\r\n if (xTagFunTrue) {\r\n document.getElementById(\"tagwrapper\" + note.number).appendChild(xTagFun);\r\n xTagFunTrue = false;\r\n dontJudgeMe = true;\r\n };\r\n\r\n // 2.TagMeta\r\n var xTagMeta = document.createElement(\"img\");\r\n xTagMeta.setAttribute(\"src\", \"meta10.png\");\r\n xTagMeta.setAttribute(\"class\", \"metaloggaInNote\");\r\n if (xTagMetaTrue) {\r\n document.getElementById(\"tagwrapper\" + note.number).appendChild(xTagMeta);\r\n xTagMetaTrue = false;\r\n dontJudgeMe = true;\r\n };\r\n\r\n // 2.TagUrgent\r\n var xTagUrgent = document.createElement(\"img\");\r\n xTagUrgent.setAttribute(\"src\", \"urgent10.png\");\r\n xTagUrgent.setAttribute(\"class\", \"urgentloggaInNote\");\r\n if (xTagUrgentTrue) {\r\n document.getElementById(\"tagwrapper\" + note.number).appendChild(xTagUrgent);\r\n xTagUrgentTrue = false;\r\n dontJudgeMe = true;\r\n };\r\n\r\n // 2. show Replys \r\n var showReplyButton = document.createElement(\"input\");\r\n showReplyButton.setAttribute(\"id\", \"ReplyButton\" + note.number);\r\n showReplyButton.setAttribute(\"js-access\", \"\");\r\n showReplyButton.src = \"omegapog2.png\";\r\n showReplyButton.type = \"image\";\r\n showReplyButton.setAttribute(\"class\", \"showReplyButton\");\r\n document.getElementById(\"new-date-div\" + note.number).appendChild(showReplyButton);\r\n\r\n // 2. comment numbers \r\n var showCommentsNumbers = document.createElement(\"b\");\r\n showCommentsNumbers.setAttribute(\"id\", \"commentNumbers\" + note.number);\r\n showCommentsNumbers.setAttribute(\"class\", \"commentNumbers\");\r\n showCommentsNumbers.innerText = \"0 comments\";\r\n document.getElementById(\"new-date-div\" + note.number).appendChild(showCommentsNumbers);\r\n\r\n // 1. third element inside note: replay wrapper div\r\n var xReplyParent = document.createElement(\"div\");\r\n xReplyParent.setAttribute(\"id\", \"new-reply-parent-div\" + note.number);\r\n xReplyParent.setAttribute(\"class\", \"replyParent hidden\");\r\n document.getElementById(\"new-main-div\" + note.number).appendChild(xReplyParent);\r\n\r\n // 2. Reply button element\r\n var xReplyButton = document.createElement(\"button\");\r\n xReplyButton.setAttribute(\"id\", \"new-title-reply-button\" + note.number);\r\n xReplyButton.setAttribute(\"class\", \"replyButton\");\r\n xReplyButton.innerText = \"Reply\";\r\n document.getElementById(\"new-reply-parent-div\" + note.number).appendChild(xReplyButton);\r\n\r\n // 2. Reply textarea element\r\n var xReplyTextarea = document.createElement(\"textarea\");\r\n xReplyTextarea.setAttribute(\"id\", \"new-title-reply-textarea\" + note.number);\r\n xReplyTextarea.setAttribute(\"class\", \"replyTextarea\");\r\n xReplyTextarea.setAttribute(\"maxlength\", \"100\");\r\n document.getElementById(\"new-reply-parent-div\" + note.number).appendChild(xReplyTextarea);\r\n\r\n // 2. Replay child element wrapper\r\n var xReplyChild = document.createElement(\"div\");\r\n xReplyChild.setAttribute(\"id\", \"new-reply-child-div\" + note.number);\r\n xReplyChild.setAttribute(\"class\", \"replyChild\");\r\n document.getElementById(\"new-reply-parent-div\" + note.number).appendChild(xReplyChild);\r\n\r\n // 2. Top Secret Eyes Closed\r\n if (dontJudgeMe) {\r\n document.getElementById(\"new-reply-parent-div\" + note.number).style.top = \"-220px\";\r\n dontJudgeMe = false;\r\n }\r\n\r\n // create theme color \r\n colorSnumber = note.number;\r\n colorS();\r\n note.colorReplyTheme = colorSaver;\r\n \r\n\r\n // animation note creation\r\n document.getElementById(\"new-main-div\" + colorSnumber).style.opacity = 0.0\r\n let b = 0;\r\n let z = 0;\r\n let ani = 0; \r\n\r\n function aniMation() {\r\n ani = setInterval(function() { \r\n document.getElementById(\"new-main-div\" + colorSnumber).style.opacity = b; \r\n b = z*5*0.01; \r\n z++;\r\n }, 25);\r\n }\r\n\r\n aniMation();\r\n setTimeout(function(){ \r\n clearTimeout(ani);\r\n }, 550);\r\n\r\n\r\n\r\n\r\n // setting eventlistener to reply button. Adds data from textfield to new div in reply parent div\r\n document.getElementById(\"new-title-reply-button\" + note.number)\r\n .addEventListener(\"click\", function () {\r\n var newReply = document.createElement(\"DIV\");\r\n var userReplyText = document.getElementById(\"new-title-reply-textarea\" + note.number).value;\r\n if (userReplyText == \"\") { } else {\r\n newReply.innerText = xName2 + \" \" + \"said: \" + userReplyText;\r\n document\r\n .getElementById(\"new-reply-child-div\" + note.number)\r\n .prepend(newReply);\r\n //changed order tp push newest reply first \r\n newReply.setAttribute(\"id\", \"reply-div\" + note.number); \r\n document.getElementById(\"reply-div\" + note.number).style.backgroundColor = colorSarray[note.colorReplyTheme].replyDiv;\r\n newReply.setAttribute(\"class\", \"reply\");\r\n document.getElementById(\"new-title-reply-textarea\" + note.number).value = \"\";\r\n note.replies.push(userReplyText);\r\n //added comment counter\r\n document.getElementById(\"commentNumbers\" + note.number).innerText = note.replies.length + \" comments\";\r\n }\r\n });\r\n\r\n //open replay window up or close..\r\n document.getElementById(\"ReplyButton\" + note.number).addEventListener(\"click\", function () {\r\n toggleDisplay(document.getElementById(\"new-reply-parent-div\" + note.number));\r\n });\r\n\r\n //vote function\r\n document.getElementById(\"vote-b-\" + note.number).addEventListener(\"click\", () => {\r\n note.voteNumber++;\r\n document.getElementById(\"vote-n-\" + note.number).innerHTML = note.voteNumber;\r\n });\r\n}", "function createNotes() {\n\tsetClef('treble-clef');\n\t\n\t/* Creates Empty Div Element for Each Possible Note Location */\n\tfor (var i=1; i <= totalDivs; i++) {\n\t\tvar noteDiv = document.createElement('div');\n\t\tnoteDiv.id = String(i);\n\t\tnoteDiv.classList.add('note-item');\n\t\tnoteDiv.onclick = placeNote;\n\t\t\n\t\tvar parentDiv = document.getElementById('notes-div');\n\t\tparentDiv.appendChild(noteDiv);\n\t\t\n\t\tvar rowNum = getRowNumber(i);\n\t\tif (rowNum >= topRow && rowNum <= bottomRow) {\n\t\t\taddStaffLines(i);\n\t\t}\n\t}\n\n\t/* Establish 1st Note Column and Measure */\n\tlastEmptyCol = 1;\n\tmeasureNum = 1;\n}", "function createNote(message){\n let noteDiv = document.getElementById('note-container')\n \n let note = `\n <div class=\"callout\">\n <span class=\"callout-closebtn\">&times;</span>\n <div class=\"callout-container\">\n <img src=\"./animations/corgigoingoff.gif\">\n <p>${message}</p>\n </div>\n </div>\n `\n noteDiv.innerHTML += note\n noteDiv.hidden = false\n noteDiv.addEventListener('click', removeNote)\n\n}", "function createNote(note) {\n //the note\n codeOfNote = ` <div id=\"${note.noteNum}note\" class=\"ml-xl-5 mr-xl-5 mt-xl-4 mb-xl-4 col-xl-2 m-lg-4 col-lg-3 m-md-5 col-md-4 m-sm-5 col-sm-6 ml-5 col-5 note\">`\n //row of icons \n codeOfNote += `<div class=\"mt-4 row\">`\n // number of note\n codeOfNote += `<div class=\"mb-2 ml-2 col-10 number\">${note.noteNum + 1}</div>`\n // col of icons\n codeOfNote += `<div class=\"p-3 m-1 col-xl-12 col-md-12\">`\n // close icon \n codeOfNote += `<span type=\"button\" id=\"icon\" class=\"glyphicon glyphicon-remove\" onclick=\"deleteNote(${note.noteNum})\"></span>`\n // close divs for row and col of icons\n codeOfNote += `</div> </div>`\n //row of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 md-form row\">`\n // col of notes text area\n codeOfNote += ` <div class=\"p-0 m-0 col-xl-11 col-xl-10 col-md-11 col-sm-10 col-11\">`\n //the text area (i used text area inside the note and not p)\n codeOfNote += `<textarea type=\"text\" id=\"${note.noteNum}Notetextarea\" class=\"Notetextarea\" rows=\"5\" readonly>${note.InputOfNote}</textarea>`\n //scroll bar\n codeOfNote += `<div class=\"scrollbar\" id=\"style-9\"> <div class=\"force-overflow\"></div> </div>`\n // date and time\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.dateOfNote}</small>`\n codeOfNote += `<small id=\"dateAndTimeHelp\" class=\"form-text text-muted\">${note.timeOfNote}</small>`\n //closing divs\n codeOfNote += `</div> </div> </div> </div> </div>`\n\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 createNoteDOM(title, content)\n{\n var div = document.createElement(\"div\");\n div.classList.add(\"note\");\n var noteId = notes.length;\n div.draggable = true;\n div.onmousedown = function(ev){\n openNote(noteId);\n if(!ev.target.classList.contains(\"note-delete\"))\n clearDelete();\n }\n div.ondragstart = drag;\n div.innerHTML = '<div class=\"note-title\">'+title+'</div><div class=\"note-delete\">x</div><div class=\"note-content\">'+content+'</div>';\n div.getElementsByClassName(\"note-delete\")[0].onclick = function(){var id = noteId; deleteNote(id);}\n return div;\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 displayNote(noteDataObj) {\r\n\r\n\tvar notes_c = document.getElementById(\"notes-container\"); // the notes container\t\r\n\t\r\n\tvar note_div = document.createElement(\"div\"); // create a new div element, of a single note\r\n\r\n\tnotes_c.appendChild(note_div); // apply note div on the notes container\r\n\t\r\n\tnote_div.className = \"note\"; // adding class of css properties to note div\r\n\tnote_div.id = noteDataObj.id; // adding identification for the note div\r\n\t\r\n\t/* image originally taken from: */ // nt_img.src = \"http://www.clker.com/cliparts/d/R/v/M/J/N/posted-not-with-pin-th.png\";\r\n\tnote_div.style.backgroundImage = \"url('http://www.clker.com/cliparts/d/R/v/M/J/N/posted-not-with-pin-th.png')\";\r\n\tnote_div.style.backgroundSize = \"cover\";\r\n\tnote_div.classList.add(\"fade-in\"); // by applying this class the note will be added with fade-in css3 effect properties\r\n\t\t\r\n\tvar icon = document.createElement(\"span\"); // creating bootstrap's glyphicon remove span element\r\n\ticon.className = \"glyphicon glyphicon-remove\";\r\n\ticon.classList.add(\"delete-note-icon\");\r\n\ticon.classList.add(\"hidden\"); // hidden class by default\r\n\t\r\n\tnote_div.addEventListener(\"mouseover\", function() { // change properties upon mouseover event on note\r\n\t\ticon.classList.remove(\"hidden\");\r\n\t\ticon.classList.add(\"visible\");\r\n\t\ticon.style.cursor = \"pointer\";\r\n\t});\r\n\t\r\n\tnote_div.addEventListener(\"mouseout\", function() { // change properties upon mouseout event on note\r\n\t\ticon.classList.remove(\"visible\");\r\n\t\ticon.classList.add(\"hidden\");\r\n\t\ticon.style.cursor = \"default\";\r\n\t});\r\n\t\r\n\tnote_div.appendChild(icon); // apply icon on note div\r\n\r\n\tvar txt_area = document.createElement(\"textarea\"); // create textarea element for note textual content (task)\r\n\ttxt_area.innerHTML = noteDataObj.txt; // get text property from note object into the textarea element\r\n\ttxt_area.className = \"note-txtarea fade-in\";\r\n\ttxt_area.readOnly = \"true\";\r\n\ttxt_area.rows = 7;\t\r\n\tnote_div.appendChild(txt_area); // apply textarea on note div\r\n\t\r\n\tvar timestamp_str = document.createElement(\"p\"); // create p element for date and time\r\n\ttimestamp_str.className = \"timestamp\";\r\n\ttimestamp_str.classList.add(\"fade-in\");\r\n\t\r\n\t// call function to reformat date to the requested DD/MM/YYYY format (date property of note object is a parameter to the function)\r\n\tvar formatted_date = reformatDate(noteDataObj.date);\r\n\ttimestamp_str.innerHTML = formatted_date + \"<br/>\" + noteDataObj.time;\r\n\t\r\n\tnote_div.appendChild(timestamp_str); // apply timestamp (date+time) on note div\r\n\t\r\n\ticon.addEventListener(\"click\", function() {\r\n\t\t// upon clicking on the glyphicon a comparison is being made between the note to be removed (has its glyphicon clicked) \r\n\t\t// to each of the notes elements exist in the notes array, till it's being found. the comparison is between id-s \r\n\t\t// represented by timestamp saved upon note creation. once a match is found, that note element will be removed from the \r\n\t\t// notes array. then, the corresponding note div element will also be removed, from the notes container. finally, the \r\n\t\t// local storage will be updated as well\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tvar idOfNoteToBeRemoved = note_div.id;\r\n\t\t\t\t\t\t\t\t\t\tvar found = false;\r\n\t\t\t\t\t\t\t\t\t\tfor (var k=0; k < notesObj.notes.length && !found; k++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar curr_note_id = notesObj.notes[k].id;\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** current checked: \" + curr_note_id + \" ***\");\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** looking for: \" + idOfNoteToBeRemoved + \" ***\");\r\n\t\t\t\t\t\t\t\t\t\t\tif (curr_note_id === idOfNoteToBeRemoved) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** found it! ***\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tnotesObj.notes.splice(k,1); // once found, remove the \"k\"-th note from the array\r\n\t\t\t\t\t\t\t\t\t\t\t\tfound = true; // stop looking for it, found already\r\n\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\tdocument.getElementById(\"notes-container\").removeChild(note_div);\r\n\t\t\t\t\t\t\t\t\t\t// remove the corresponding note div element from the notes container\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** removed note! ***\");\r\n\t\t\t\t\t\t\t\t\t\tlocalStorage.setItem(\"notes\", JSON.stringify(notesObj)); // save updated json to local storage\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** updated local storage! ***\");\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n}", "function createNote() {\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //set content for note\n $note.html($note_text.val());\n //append note text to note-output\n $(\".note-output\").append($note);\n $note_text.val(\"\");\n }\n }", "function displayNotesDetails(note){\n return `<p>title: ${note.title}</p><p style=\"display:block\">note: ${note.body}</p>`\n }", "function displayNotes(note){\n return `<p>title: ${note.title}</p><p style=\"display:none\">note: ${note.body}</p>`\n }", "function renderNote(newNote) {\n var div = document.createElement(\"div\"),\n remove = document.createElement(\"span\"),\n title = document.createElement(\"h6\"),\n text = document.createElement(\"p\"),\n favorite = document.createElement(\"span\"),\n tags = document.createElement(\"span\");\n\n div.className = \"note-list__item\";\n remove.className = \"note-list__del\";\n favorite.className = \"note-list__pin\";\n tags.className = \"note-list-tags\";\n text.className = \"note-list__text\";\n title.className = \"note-list__head\";\n\n \n remove.innerHTML =\"<img class='icon-cancel' src='./img/icons8-cancel-50.png' width='25px' height='auto'/>\"\n text.innerHTML = newNote.noteText;\n title.innerHTML = newNote.noteHead;\n\n addRemoveListner(remove, newNote);\n div.setAttribute(\"data-item-number\", (newNote.noteId));\n div.appendChild(remove);\n div.appendChild(title);\n if (noteHead.value.length > 0) {\n title.style.marginBottom = \"10px\"\n }\n div.appendChild(text);\n div.appendChild(favorite);\n div.appendChild(tags);\n mainDiv.insertBefore(div, mainDiv.firstChild);\n headVisible(mainDiv, document.querySelector(\".note-list__main-head\"));\n div.style.background = newNote.colorBg; \n // Knocking down the background of the main unit\n if (text.innerHTML.length < 51) {\n text.style.lineHeight = \"30px\";\n text.style.fontSize = \"27px\";\n } else if (text.innerHTML.length < 81) {\n text.style.lineHeight = \"25px\";\n text.style.fontSize = \"20px\";\n }\n if (!title.innerHTML) {\n title.style.marginBottom = \"0px\";\n } else {\n title.style.marginBottom = \"10px\";\n }\n\n addTag(); // Tag add function\n }", "function getNoteElement(id) {\n let div = document.createElement('div');\n div.setAttribute('id', id);\n div.setAttribute('contentEditable', true);\n div.setAttribute('class', 'note');\n // set event listeners for 'Enter' key, 'Backspace' key and'Blur'\n div.addEventListener('keypress', keypressEvent, false);\n div.addEventListener('keydown', keydownEvent, false);\n div.addEventListener('blur', onblur, false);\n div.setAttribute('style', 'display: inline;');\n\n return div;\n }", "makeNote (note) {\n const el = this.page.noteTemplate.cloneNode(true)\n if (note.severity > ntfn.POKE) {\n const cls = note.severity === ntfn.SUCCESS ? 'good' : note.severity === ntfn.WARNING ? 'warn' : 'bad'\n el.querySelector('div.note-indicator').classList.add(cls)\n }\n\n el.querySelector('div.note-subject').textContent = note.subject\n el.querySelector('div.note-details').textContent = note.details\n return el\n }", "function createNote(obj, type ) {\n let article = document.createElement(\"article\");\n article = articleAttributes(article);\n article.appendChild(createDiv1(obj));\n article.appendChild(createDiv2(type, article));\n article.appendChild(createBtnConfirm());\n return article;\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}", "function renderNoteInfo(aNote) {\n while(noteTitle.firstChild){\n noteTitle.removeChild(noteTitle.firstChild)\n }\n noteTitle.innerHTML = `<h2>${aNote.title}</h2>`\n let n = document.createElement('p')\n n.innerHTML = `<a>${aNote.content}</a>\n <br>\n <br>\n <button data-id=${aNote.id} id=\"editNoteBtn\">Edit this note</button>\n <button data-id=${aNote.id} id=\"deleteNoteBtn\">Delete this note</button>\n `\n noteTitle.appendChild(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}", "function Note(){\n let title = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n let content = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\"\n return <div className=\"note\"><h1>{title}</h1><p>{content}</p></div>\n}", "function noteTemplate() {\n this.i += 1;\n return `\n <div>\n <div id=\"secondarynotesdiv\" draggable=\"true\" {{dragstart}} {{dragend}} class=\"notes${i}\">\n <div class=\"eachnote\" >\n <div id=\"content\">\n <div class=\"notetitle${i}\" style=\"text-align:center;padding:10px 0px 20px;color:maroon;\" id=\"data\">\n {{title}}\n </div>\n <div class=\"notebody${i}\" id=\"data\" style=\"text-align:center;padding:10px 20px 20px;color:maroon;\">\n {{description}}\n </div>\n <div class=\"editbtn\">\n <span id=\"editbutton\">\n <i class=\"far fa-edit\"></i>\n </span>\n <span\n id=\"delete\"\n >\n <i class=\"far fa-trash-alt\" id=\"trash${i}\"></i>\n </span>\n </div>\n </div>\n <div\n id=\"colors\"\n style=\"display: flex; justify-content: space-around;\"\n >\n <div\n style=\"\n width: 10%;\n background-color: chartreuse;\n border-radius: 30px;\n height: 20px;\n border: 1px solid black;\n \"\n id=\"chartreuse\"\n class=\"color\"\n ></div>\n <div\n style=\"\n width: 10%;\n background-color: yellow;\n border-radius: 30px;\n height: 20px;\n border: 1px solid black;\n \"\n id=\"yellow\"\n class=\"color\"\n ></div>\n <div\n style=\"\n width: 10%;\n background-color: pink;\n border-radius: 30px;\n height: 20px;\n border: 1px solid black;\n \"\n id=\"pink\"\n class=\"color\"\n ></div>\n <div\n style=\"\n width: 10%;\n background-color: lightblue;\n border-radius: 30px;\n height: 20px;\n border: 1px solid black;\n \"\n id=\"lightblue\"\n class=\"color\"\n ></div>\n </div>\n </div>\n</div>\n</div>\n `;\n}", "function addNote() {\n\t\t\n\t\tid++;\n\t\tzIndex++;\n\t\t\n\t\tvar body = document.querySelector('body');\n\t\t\n\t\tvar note = document.createElement('div');\n\t\tvar close = document.createElement('div');\n\t\tvar field = document.createElement('div');\n\t\tvar footer = document.createElement('div');\n \t\t\n\t\tnote.setAttribute('id', 'note' + id);\n\t\tclose.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('contenteditable', true);\n\t\t\t\n\t\tnote.classList.add('note');\n\t\tclose.classList.add('close');\n\t\tfield.classList.add('field');\n\t\tfooter.classList.add('footer');\n\t\t\n\t\tnote.style.zIndex = zIndex;\n\t\t\t\n\t\tnote.appendChild(close);\n\t\tnote.appendChild(field);\n\t\tnote.appendChild(footer);\n\t\tbody.appendChild(note);\n\t\t\n\t\tattachListeners(note, close, field, footer);\n\t\t\n\t\tvar data = JSON.parse(localStorage['data']);\n\t\t\n\t\t// Save the current note's data\n\t\tdata.push({\n\t\t\n\t\t\tid: id,\n\t\t\ttext: '',\n\t\t\tposition: { x: 20, y: 20 },\n\t\t\tzIndex: zIndex,\n\t\t\t\n\t\t\ttime: { \n\t\t\t\n\t\t\t\tday: new Date().getDate(), \n\t\t\t\tmonth: new Date().getMonth() + 1, \n\t\t\t\tyear: new Date().getFullYear(), \n\t\t\t\th: new Date().getHours(), \n\t\t\t\tm: new Date().getMinutes(), \n\t\t\t\ts: new Date().getSeconds() \n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t});\n\t\t\n\t\tlocalStorage['data'] = JSON.stringify(data);\n\t\t\n\t}", "function makeNote(noteLine){\n\tvar note_div = document.getElementById(\"note_div\");\n\tvar customizedWidth = computeCustomizedWidth(numOfKey);\n\tfor(var i=1; i<=numOfKey; i++)\n\t{\n\t\tvar note= document.createElement('div');\n\t\tnote.style.width = customizedWidth + \"px\";\n\t\tnote.style.margin = NOTE_MARGIN + \"px\";\n\t\tnote_div.appendChild(note);\n\t\tfirstNote.push(note);\n\t\tif(noteLine[i])\n\t\t\tnote.classList.add(\"note\");\n\t\telse\n\t\t\tnote.classList.add(\"note_none\");\n\t}\n}", "function createCardElement(id, title, content, date) {\r\n // Create the element that will hold the text\r\n var element = document.createElement('div')\r\n // Add all the classes\r\n element.setAttribute('class', 'shadow-md rounded p-4 bg-green-lightest mb-4');\r\n // Add the id so that it can be called apon later\r\n element.setAttribute('id', id);\r\n // Set the innerHTML\r\n content = content.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\r\n var data = `<button class=\"text-red float-right\" onclick=\"deleteNote('${id}')\"><i class=\"fas fa-2x fa-times\"></i></button><h1>${title}</h1><p>${content}</p>`\r\n element.innerHTML = data;\r\n // Add the element to the page\r\n findIdentifier('lessonNotes').prepend(element)\r\n}", "function addNote(note){\n let noteElement = document.createElement(\"div\");\n noteElement.addEventListener(\"change\",updateNote);\n noteElement.classList.add(\"noteid\"+notes.indexOf(note));\n noteElement.classList.add(\"note\");\n noteElement.style.backgroundColor = note.color;\n let pinElement = document.createElement(\"div\");\n pinElement.classList.add(\"pin\");\n if(note.pinned)\n pinElement.classList.add(\"pinoff\");\n else\n pinElement.classList.add(\"pinon\");\n pinElement.addEventListener(\"click\",pinSwitch);\n noteElement.appendChild(pinElement);\n let titleElement = document.createElement(\"input\");\n titleElement.type = \"text\";\n titleElement.name = \"title\";\n titleElement.value = note.title;\n noteElement.appendChild(titleElement);\n let contentElement = document.createElement(\"textarea\");\n contentElement.value = note.content;\n contentElement.name = \"content\";\n noteElement.appendChild(contentElement);\n let colorElement = document.createElement(\"input\");\n colorElement.type = \"color\";\n colorElement.name = \"color\";\n colorElement.value = note.color;\n noteElement.appendChild(colorElement);\n let created = document.createElement(\"p\");\n let time = new Date(note.created);\n created.innerHTML = \"Created: \" + time.toLocaleString();\n noteElement.appendChild(created);\n if(note.pinned)\n document.querySelector(\".pinned\").appendChild(noteElement);\n else\n document.querySelector(\".notes\").appendChild(noteElement);\n}", "function createNote(number_of_note, notesArray, tagsArray) {\n for(var i = 0; i < number_of_note; i++) {\n $(\".notes\").append(\"<div class='note'><div class='notetext'>\" + notesArray[i] + \"</div><div class='notetag'>#\" + tagsArray[i] + \"</div><div class='notecontrol'><div class='highlight'>Highlight</div><div class='addtocanvas'>Add to Canvas</div><div class='deletenote'>Delete</div></div></div>\");\n }\n}", "addMarkdownDiv() {\n var t_a = document.getElementById('actual_text_area');\n socket.emit('text-addition', new Markdown(Date.now(), t_a.value, 641, 210));\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 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 printNote(note) {\n for (var i = 0; i < 1; i++) {\n printedNotes += `<div class=\"note-container\">\n <p class=\"note-title\" value=\"${note.title}\" id=\"prod-name\">${note.title}</p>\n <p class=\"details\" value=\"${note.details}\" id=\"product-cost\">${note.details}</p>\n </div>`\n }\n document.getElementById(\"printed-notes\").innerHTML = printedNotes\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 createModalHTML(data){ \n data.forEach(function(note){\n $(\".existing-note\").append(`\n <div class=\"panel panel-default\" id=\"${note._id}\">\n <div class=\"panel-body\">\n <div class=\"noteContent\">\n <p>${note.body}</p>\n <button class=\"btn btn-primary edit-note\" data-noteId=\"${note._id}\"\">Edit</button>\n <button class=\"btn btn-primary delete-note\" data-noteId=\"${note._id}\">Delete</button>\n </div>\n <div class=\"update-form\"></div>\n </div>\n </div>\n `)\n }); \n}", "function createContentDiv() {\n var contentDiv = document.createElement('div');\n contentDiv.id = 'content';\n return contentDiv;\n}", "displayNote() {\n return converter.makeHtml(this.note);\n }", "function noteToHTML (note) {\n return `\n <div class = \"listedNote\" data-note-id=\"${note._id}\">\n <h2>${note.title}</h2>\n <p>${note.text}</p>\n <p>${note.tags.join(', ')}</p>\n <button type = \"button\" class = \"edit\" data-note-id=\"${note._id}\">Edit</button>\n <button type = \"button\" class = \"delete\" data-note-id=\"${note._id}\">Delete</button>\n </div>`\n}", "function Note(content) {\n this.content = content;\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 create_note() {\r\n\tvar offset = $('#drag_resize').offset();\r\n\tvar top_pos =offset.top;\r\n\tvar left_pos =offset.left;\r\n\tvar notepaper_top =top_pos + $('#drag_resize').height()/2;\r\n\tvar notepaper_left =left_pos + $('#drag_resize').width()/2;\r\n\t$('.note').css({\"display\":\"block\", 'top' : notepaper_top+'px', 'left' : notepaper_left+'px'});\r\n\t$('#drag_resize').draggable( \"disable\"); \r\n\t$('#choose_area').css({\"display\":\"none\"});\r\n\t$('#delete_circle').css({\"display\":\"none\"});\r\n}", "function renderNotes() {\r\n for (var i = 0; i < notesListLS.length; i++) {\r\n createMarkup(i);\r\n }\r\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 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 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 buildAnote(obj) {\n\n var myRow = document.getElementById('notesRow');\n\n for (let index = 0; index < obj.length; index++) {\n\n var myNoteDiv = document.createElement('div');\n myNoteDiv.setAttribute(\"class\", \"col-md-2 col-sm-6 col-xs-12\");\n var myNote = document.createElement('div');\n myNote.setAttribute(\"class\", \"note\");\n var noteTrash = document.createElement('div');\n noteTrash.setAttribute('class', \"glyphicon glyphicon-trash noteDelete fade-in\");\n noteTrash.setAttribute('slot', index);\n noteTrash.setAttribute('onclick', \"deleteNote(this)\");\n noteTrash.setAttribute('onclick', 'deleteNote(this);'); // for FF\n noteTrash.onclick = function () { deleteNote(this); }; // for IE\n var noteDesc = document.createElement('div');\n noteDesc.setAttribute(\"class\", 'noteInnerDescription');\n noteDesc.innerText = obj[index].desc;\n var noteDate = document.createElement('div');\n noteDate.setAttribute(\"class\", \"noteDateValue\");\n noteDate.innerText = obj[index].date;\n var noteTime = document.createElement('div');\n noteTime.setAttribute(\"class\", \"noteTimeValue\");\n noteTime.innerText = obj[index].time;\n ////\n myNote.appendChild(noteTrash);\n myNote.appendChild(noteDesc);\n myNote.appendChild(noteDate);\n myNote.appendChild(noteTime);\n ////\n myNoteDiv.appendChild(myNote);\n ////\n myRow.appendChild(myNoteDiv);\n }\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 }", "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 displayNotes(notes) {\n\tvar el = document.getElementById('notes-played');\n\tel.innerHTML = notes; \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 } 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 loadDescription(description, notes) {\n let div = document.getElementById(\"description\");\n cleanDiv(div);\n\n let notebook = document.createElement(\"div\");\n notebook.classList.add(\"notebook\");\n let contentP = document.createElement(\"p\");\n contentP.classList.add(\"content\");\n contentP.textContent = description;\n notebook.appendChild(contentP);\n div.appendChild(notebook);\n\n let addDescripDiv = document.getElementById(\"add-description\");\n addDescripDiv.onclick = function() {\n addNote();\n };\n}", "function renderNote(data) {\n // Create elements\n const li = document.createElement(\"li\");\n const title = document.createElement(\"span\");\n const body = document.createElement(\"span\");\n const cross = document.createElement(\"div\");\n const plus = document.createElement(\"div\");\n\n // Add attributes to elements\n title.setAttribute(\"class\", \"note-title\");\n body.setAttribute(\"class\", \"note-body\");\n cross.setAttribute(\"class\", \"cross\");\n plus.setAttribute(\"class\", \"plus\");\n\n // Add data to elements\n li.id = data.id;\n title.textContent = data.data().title;\n body.textContent = `${data.data().body.toString().substring(0, 100)}...`;\n cross.textContent = \"x\";\n plus.textContent = \"+\";\n\n // Add elements to DOM\n li.appendChild(title);\n li.appendChild(body);\n li.appendChild(cross);\n li.appendChild(plus);\n notes.appendChild(li);\n\n // Let cross delete not on click\n cross.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n const id = e.target.parentElement.getAttribute(\"id\");\n\n // Delete from collection\n db.collection(\"notes\").doc(id).delete();\n });\n\n // Update note\n plus.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n const id = e.target.parentElement.getAttribute(\"id\");\n console.log(\"Note will be updated...\");\n });\n}", "function renderNote(note)\n {\n var curNote = document.createElement('li');\n var noteTextBox = note.textBox;\n noteTextBox.setAttribute('class', 'noteTextBox');\n noteTextBox.setAttribute('type', 'text');\n noteTextBox.setAttribute.disabled = true;\n noteTextBox.value = note.msg;\n console.log('Note is active: ', note.active);\n if(!note.active)\n noteTextBox.style.textDecoration = 'line-through';\n else\n noteTextBox.style.textDecoration = 'none';\n curNote.appendChild(noteTextBox);\n curNote.appendChild(note.deleteButton);\n curNote.appendChild(note.editButton);\n curNote.appendChild(note.saveButton);\n curNote.appendChild(note.doneButton);\n curNote.appendChild(note.notDoneButton);\n curNote.appendChild(note.addButton);\n if(note.subNotes.length > 0)\n {\n var newNote = document.createElement('ol');\n for(var i = 0; i < note.subNotes.length; i++)\n newNote.appendChild(renderNote(note.subNotes[i]));\n curNote.appendChild(newNote);\n }\n return curNote;\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 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 createDiv1(obj) {\n let div1 = document.createElement(\"div\");\n div1.className = \"note-buttons-top\";\n div1.appendChild(addBooksToNote(obj));\n div1.appendChild(createP(obj));\n div1.appendChild(createBtnDelete(obj));\n return div1;\n}", "function writeNotes(notes) {\n const notesDiv = document.querySelector('#notes');\n // clear the div\n notesDiv.innerHTML = '';\n // add all items as Ps to the div\n notes.forEach(function(note) {\n const newItem = document.createElement('p');\n const span1 = document.createElement('span');\n const newButton = document.createElement('button');\n span1.textContent = note.body;\n newButton.textContent = \"x\";\n newButton.addEventListener('click', function() {\n removeNote(note.id);\n localStorage.setItem( 'notes', JSON.stringify(notes) );\n writeNotes(notes);\n });\n // construct the p and append it\n newItem.appendChild(newButton);\n newItem.appendChild(span1);\n notesDiv.appendChild(newItem);\n });\n}", "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 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() {\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 create_notes( nid, x, y, store_name, icondata )\n {\n var divId = \"ikanotes_\" + nid + \"div\";\n var taId = \"ikanotes_\" + nid + \"textarea\";\n var iconDivId = \"ikanotes_\" + nid + \"icon_div\";\n var iconId = \"ikanotes_\" + nid + \"icon\";\n\n var cssDivId = \"#\" + divId;\n var cssTaId = \"#\" + taId;\n var cssIconDivId = \"#\" + iconDivId;\n var cssIconId = \"#\" + iconId;\n\n var notes_html = \n\t \"<div id='\" + divId + \"'> \\\n <center>\t\t\t\t\t\t\t\\\n <textarea id='\" + taId + \"' rows='15' cols='45'></textarea> \\\n </center>\t\t\t\t\t\t\t\\\n </div>\";\n\n var link_html =\n\t \"<div id='\" + iconDivId + \"'>\\\n <img id='\" + iconId + \"'/> \\\n\t </div>\";\n\n\n\n $( notes_html ).appendTo( \"body\" );\n $( cssDivId ).css( \"border\", \"1px solid black\" );\n var textVal = GM_getValue( store_name, \"\" );\n if( textVal == \"\" )\n {\n if( store_name == gm_global_name )\n textVal = \"<Global Notes>\";\n else\n textVal = \"<This World Only Notes>\";\n }\n $( cssTaId ).val( textVal );\n\n\n var icon_width = 50;\n var icon_height = 50;\n\n $( link_html ).appendTo( \"body\" );\n $( cssIconId ).attr( \"src\", icondata );\n $( cssIconId ).attr( \"title\", \"Show/Hide notes\" );\n $( cssIconId ).css( \"width\", icon_width + \"px\" );\n $( cssIconId ).css( \"height\", icon_height + \"px\" );\n\n $( cssIconId ).click( function()\n {\n\t var div = $( cssDivId );\n\t if( div.css( \"visibility\" ) == 'hidden' )\n\t div.css( \"visibility\", 'visible' );\n\t else\n\t {\n\t var txt = $( cssTaId ).val();\n\t GM_setValue( store_name, txt );\n\t div.css( \"visibility\", 'hidden' );\n\t }\n });\n \n var notes_width = $( cssTaId ).width() + 10;\n\n var icon_left = x;\n var icon_top = y;\n\n // put icon in upper-right corner\n $( cssIconDivId ).css( \"position\", \"absolute\" );\n $( cssIconDivId ).css( \"zIndex\", 100 );\n $( cssIconDivId ).css( \"left\", icon_left + \"px\" );\n $( cssIconDivId ).css( \"top\" , icon_top + \"px\" );\n\n var notes_left = icon_width + 5;\n var notes_top = icon_top;\n $( cssDivId ).css( \"position\", \"absolute\" );\n $( cssDivId ).css( \"left\", notes_left + \"px\" );\n $( cssDivId ).css( \"top\", notes_top + \"px\" );\n \n // set notes_div hidden\n $( cssDivId ).css( \"visibility\", \"hidden\" );\n $( cssDivId ).css( \"zIndex\", 150 );\n $( cssDivId ).css( \"width\", notes_width + \"px\" );\n }// end create_notes function", "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 newNote() {\n var csrftoken = $.cookie('csrftoken'),\n folder_id = $('.folder-list>.active>a').attr(\"data-folderid\"),\n data = {\n title: \"Untitled note\",\n body: \"<br>\",\n folder_id: folder_id,\n csrfmiddlewaretoken: csrftoken\n };\n $.post(\"/notes/addnote/\", data, function (data) {\n $('#notelist').children().prepend(data).children().first().trigger('click');\n $('#title').empty();\n });\n }", "function createNoteTextarea(editNode, file)\n{\n editNode.append('<span class=\"displaySubheader\">Notes:</span><br />');\n notesBox = $('<textarea rows=\"6\" class=\"notesBox\"></textarea>');\n noteText = file.find(\".noteContainer > .displayText\").html();\n if (typeof noteText !== \"undefined\")\n {\n noteText = noteText.replace(/<br( \\/)?>/g, \"\\n\");\n notesBox.val(noteText);\n }\n editNode.append(notesBox);\n}", "function createQuestionArea(){\n questionArea = '<div class=\"panel-default text-center\" id=\"questionArea\"><h2 id=\"title\"></h2><div class=\"row text-center\"><div class=\"col-xs-offset-1 col-xs-10\"><h3 id=\"questiontext\">' + questions[questionCount] + '</h3></div></div></div>';\n $('.questionDiv').html(questionArea);\n $('#title').text('Question ' + (questionCount+1) +':');\n}", "function createQuestionArea(){\n questionArea = '<div class=\"panel-default text-center\" id=\"questionArea\"><h2 id=\"title\"></h2><div class=\"row text-center\"><div class=\"col-xs-offset-1 col-xs-10\"><h3 id=\"questiontext\">' + questions[questionCount] + '</h3></div></div></div>';\n $('.questionDiv').html(questionArea);\n $('#title').text('Question ' + (questionCount+1) +':');\n}", "function createDiv(className, content) {\n let pTag = document.createElement('p');\n let divTag = document.createElement('div');\n pTag.textContent = content;\n divTag.classList.add(className);\n divTag.appendChild(pTag);\n // console.log(divTag);\n return divTag;\n }", "function createDiv(className, content) {\n let pTag = document.createElement('p');\n let divTag = document.createElement('div');\n pTag.textContent = content;\n divTag.classList.add(className);\n divTag.appendChild(pTag);\n // console.log(divTag);\n return divTag;\n }", "function addNote(text = '') {\n const date = new Date();\n const nowDate = `${date.getMonth()}.${date.getDate()}.${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;\n\n const noteHTML = `\n <div class=\"note\">\n <div class=\"note__control\">\n <span class='date'>${nowDate}</span>\n <i class=\"fas fa-check-circle done\" onclick='addNoteTextStorage(event)'></i>\n <i class='fas fa-times-circle delete' onclick='deleteNote(event)'></i>\n </div>\n <div class=\"note__text\" contenteditable=\"true\">${text}</div>\n </div>`\n notesList.insertAdjacentHTML('beforeend', noteHTML);\n}", "function loadNotes (data) {\r\n for (var n in data) {\r\n var i = data[n];\r\n if (data.hasOwnProperty(n)) {\r\n var note = $('<div class=\"note\" id=\"'+i[\"id\"]+'\"><p>'+i[\"text\"]+'</p><div class=\"d\">x</div></div>');\r\n note.css({\r\n top: i[\"y\"] + \"px\",\r\n left: i[\"x\"] + \"px\"\r\n }).show();\r\n addToPage(note);\r\n } \r\n }\r\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 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 createNote() {\n //object that wraps each note and its delete link\n var $note_div = $(\"<div/>\")\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //select the delete-all button\n var $deleteAllButton = $(\"#delete-all\")\n //create a delete link for each added note\n var $delLink = $('<a>delete</a>').attr({ \n href: \"#\",\n class: \"del-link\"\n });\n //adds a click listener to the delete link\n $delLink.on(\"click\", function () {\n deleteNote(this); \n });\n\n //set content for note\n $note.html($note_text.val());\n //append note and delete link to note_div\n $note_div.append($note);\n $note_div.append($delLink);\n //hide new note_div to setup fadeIn...\n $note_div.hide();\n //append note_div to note-output\n $(\".note-output\").append($note_div);\n\n //fadeIn hidden new note_div and conditionally \n // the deleteAllButton\n if ($deleteAllButton.is(\":hidden\"))\n $deleteAllButton.fadeIn(\"slow\");\n $note_div.fadeIn(\"slow\");\n $note_text.val(\"\");\n }\n }", "function createNewRow(note) {\n // var formattedDate = new Date(note.createdAt);\n // formattedDate = moment(formattedDate).format(\"MMMM Do YYYY, h:mm:ss a\");\n var newnotePanel = $(\"<div class='note-panel' data-id='\"+note.id+\"'>\");\n newnotePanel.addClass(\"panel panel-default\");\n var newnotePanelHeading = $(\"<div>\");\n newnotePanelHeading.addClass(\"panel-heading\");\n var deleteBtn = $(\"<button>\");\n deleteBtn.text(\"Delete\");\n deleteBtn.addClass(\"delete btn btn-danger btn-sm\");\n var editBtn = $(\"<button>\");\n editBtn.text(\"Edit\");\n editBtn.addClass(\"edit btn btn-warning btn-sm\");\n var newnoteTitle = $(\"<h2>\");\n var newnotePanelBody = $(\"<div>\");\n newnotePanelBody.addClass(\"panel-body\");\n var newnoteBody = $(\"<div>\");\n newnoteTitle.text(note.beerName + \" | \" + note.beerType + \" | \" + note.rating);\n newnoteBody.html(\"<br>Comments: \" + note.notes);\n newnotePanelHeading.append(newnoteTitle);\n newnotePanelBody.append(newnoteBody);\n newnotePanelBody.append(editBtn);\n newnotePanelBody.append(deleteBtn);\n newnotePanel.append(newnotePanelHeading);\n newnotePanel.append(newnotePanelBody);\n return newnotePanel;\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 renderNoteOnColorShowPage(note) {\n const oneColorsNotesContainer = document.querySelector(\".color-has-many-notes\")\n const newNote = document.createElement(\"div\")\n newNote.className = \"note-cell\"\n\n const noteTitle = document.createElement(\"span\")\n noteTitle.className = \"note-title\"\n noteTitle.innerText = note.title\n\n const deleteButton = document.createElement(\"span\")\n deleteButton.className = \"delete-button\"\n deleteButton.innerText = \"–DELETE\"\n deleteButton.style.color = \"white\"\n deleteButton.addEventListener(\"click\", (event) => deleteNoteFromDB(event, newNote))\n\n const br = document.createElement(\"br\")\n const br2 = document.createElement(\"br\")\n\n const noteContent = document.createElement(\"span\")\n noteContent.className = \"note-content\"\n noteContent.innerText = note.content\n\n newNote.id = note.id\n\n newNote.appendChild(noteTitle)\n newNote.appendChild(deleteButton)\n newNote.appendChild(br)\n newNote.appendChild(br2)\n newNote.appendChild(noteContent)\n\n oneColorsNotesContainer.appendChild(newNote)\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 addNote() {\r\n const newNote = document.createElement('div')\r\n newNote.classList.add('note--new')\r\n\r\n const noteText = document.createElement('li')\r\n noteText.innerText = inputText.value\r\n noteText.classList.add('note--text')\r\n newNote.appendChild(noteText)\r\n\r\n const noteView = document.createElement('button')\r\n noteView.innerHTML = '<i class=\"far fa-eye\"></i>'\r\n noteView.classList.add('note--view-btn')\r\n newNote.appendChild(noteView)\r\n\r\n const noteDelete = document.createElement('button')\r\n noteDelete.innerHTML = '<i class=\"fas fa-trash\"></i>'\r\n noteDelete.classList.add('note--delete-btn')\r\n newNote.appendChild(noteDelete)\r\n\r\n noteContainer.appendChild(newNote)\r\n\r\n console.log(noteText.innerText)\r\n\r\n inputText.value = ''\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 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 createNoteGenerator() {\n // Create note generator elements\n const form = document.createElement(\"form\");\n form.classList.add(\"form-note-add\");\n form.action = \"\";\n form.method = \"post\";\n\n const noteTitle = document.createElement(\"input\");\n noteTitle.classList.add(\"note-title\");\n noteTitle.placeholder = \"Title\";\n noteTitle.name = \"noteTitle\";\n noteTitle.autocomplete = \"off\";\n\n const noteContent = document.createElement(\"textarea\");\n noteContent.classList.add(\"note-content\");\n noteContent.placeholder = \"Take a note...\";\n noteContent.name = \"noteContent\";\n noteContent.autocomplete = \"off\";\n\n\n // Focus note content when the thread becomes idle\n window.setTimeout(function () {\n noteContent.focus();\n }, 0);\n\n noteContent.addEventListener(\"keydown\", () => {\n autoGrow(noteContent);\n });\n\n const buttons = document.createElement(\"div\");\n buttons.classList.add(\"overlay-buttons\");\n\n const inputAddNote = document.createElement(\"input\");\n inputAddNote.type = \"hidden\";\n inputAddNote.name = \"inputAddNote\";\n inputAddNote.value = \"AddNote\";\n\n const buttonCreatorNote = document.createElement(\"button\");\n buttonCreatorNote.classList.add(\"btn-creator-add-note\");\n buttonCreatorNote.innerText = \"Add note\";\n buttonCreatorNote.type = \"submit\";\n buttonCreatorNote.name = \"buttonAddNote\";\n buttonCreatorNote.value = \"AddNote\";\n // Form submit post when adding a node card\n buttonCreatorNote.addEventListener(\"click\", () => {\n document.querySelector(\".form-note-add\").submit();\n });\n\n const buttonCancel = document.createElement(\"button\");\n buttonCancel.classList.add(\"btn-creator-cancel\");\n buttonCancel.innerText = \"Cancel\";\n buttonCancel.type = \"button\";\n\n listenAddCancelButton(buttonCreatorNote, buttonCancel);\n\n buttons.appendChild(buttonCreatorNote);\n buttons.appendChild(buttonCancel);\n\n\n const overlayNoteCreator = document.createElement(\"div\");\n overlayNoteCreator.classList.add(\"overlay-note-creator\");\n form.appendChild(noteTitle);\n form.appendChild(noteContent);\n form.appendChild(buttons);\n form.appendChild(inputAddNote);\n overlayNoteCreator.appendChild(form);\n\n addBgBlur();\n\n const body = document.querySelector(\"body\");\n body.appendChild(overlayNoteCreator);\n}", "createIntroTextContainer() {\n const introTextContainer = document.createElement(\"p\");\n introTextContainer.id = \"intro_text\";\n introTextContainer.innerHTML = this.intro_text;\n return introTextContainer;\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 getNote() {\n const li = document.createElement('LI')\n li.className = 'fill'\n li.id = 'list-tag'\n li.setAttribute('draggable', 'true')\n\n // I am creating a div element that will wrap the text coming from textarea input.\n let divTag = document.createElement('div')\n divTag.className = 'div-tag';\n divTag.setAttribute('id', lastid)\n divTag.innerText = textInput.value\n li.appendChild(divTag)\n\n // I am creating a button element that will be a sibling to the div element created earlier. And they will get appended to the same parent element. \n const edit = document.createElement('button')\n edit.className = 'modify';\n edit.setAttribute('id', lastid)\n edit.innerText = 'EDIT';\n li.appendChild(edit)\n \n // Same as above in line 71\n const deleteBtn = document.createElement('button');\n deleteBtn.className = 'erase';\n deleteBtn.setAttribute('id', lastid)\n deleteBtn.appendChild(document.createTextNode('DELETE'));\n li.appendChild(deleteBtn)\n \n lastid += 1;\n orderList.appendChild(li)\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 createContent() {\n var bCSS = \"font: bolder 12px Arial\";\n return '<b style=\"' + bCSS + '\">Tag Legend</b>' +\n '<ul style=\"margin-left: 10px\">' +\n '<li>@location</li>' +\n '<li>+project</li>' +\n '<li>general category</li>' +\n '</ul>'\n ;\n }", "function showCreateNoteModal() {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalBody = $('<div >');\n var noteNameInput = $('<input type=\"text\" class=\"form-control form-control-lg\" />');\n var noteNameInputContainer = $('<div class=\"pull-left\"><div class=\"form-group col-sm-12\">');\n var modalFooter = $('<div class=\"pull-right\">');\n var createButton = $('<button type=\"button\" class=\"btn btn-primary\">Create</button>');\n\n // Appending to create the modal content structure\n noteNameInputContainer.append(noteNameInput);\n modalBody.append(noteNameInputContainer);\n modalFooter.append(createButton);\n\n var modal = utils.showModalPopup('Enter a name for your new note', modalBody, modalFooter);\n\n // Registering event listeners for the modal window\n createButton.click(function() {\n createNote(noteNameInput.val());\n modal.modal('hide');\n });\n }", "function render_notes(data)\n {\n var note_list = [];\n var note;\n if (!data.notes.length)\n {\n // no notes\n note = [\"<li class='list-group-item'>\", \"No notes for this headline yet.\", \"</li>\"].join(\"\");\n note_list.push(note);\n } else {\n // have notes\n for (var i = 0; i < data.notes.length; i++)\n {\n // create the HTML note object\n note = $(\n [\n \"<li class='list-group-item note'>\",\n data.notes[i].text,\n \"<button class='btn btn-danger note-delete'>x</button>\",\n \"</li>\"\n ].join(\"\")\n );\n // attach the note's id to the jQuery element, to be used to figure out which note to delete\n note.children(\"button\").data(\"_id\", data.notes[i]._id);\n note_list.push(note);\n }\n }\n $(\".note-container\").append(note_list);\n }", "function addNote(e) {\n e.preventDefault();\n let newNote = document.createElement(\"div\");\n newNote.className = \"parent-note\";\n newNote.innerHTML = `<div class=\"my-note\" onclick=swapNotes(this)>\n <div class=\"x-btn-container\">\n <button type=\"button\" class=\"x-button\" onclick=deleteNote(this.parentNode.parentNode)>X</button>\n </div>\n <p> ${input.value} </p>\n <button type=\"button\" onclick=editNote(this.parentNode.parentNode)>Edit</button>\n </div>\n `;\n myNotes.appendChild(newNote);\n input.value = \"\";\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 data() {\n const div = document.createElement( 'div' );\n const title = document.createElement( 'title' );\n const content = document.createElement( 'content' );\n const p = document.createElement( 'p' );\n\n my.data.entries.map( entry => {\n const title_clone = title.cloneNode( true );\n const content_clone = content.cloneNode( true );\n const p_clone = p.cloneNode( true );\n title_clone.innerHTML = entry.title;\n $.setContent( p_clone, $.html( entry.content ) );\n content_clone.appendChild( p_clone );\n div.appendChild( title_clone );\n div.appendChild( content_clone );\n } );\n\n return div;\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 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 creatNote(tex,priority) {\n const notesContainer = document.getElementById('notes-container');\n const newP = document.createElement('p');\n newP.className = `note ${priority}`;\n newP.innerText = tex;\n\n const deletBtn = document.createElement('button');\n deletBtn.className = 'remove-btn';\n deletBtn.innerText = 'X'; \n deletBtn.onclick = removeNote;\n newP.appendChild(deletBtn);\n\n\n notesContainer.appendChild(newP);\n}", "function constructHTMLgrid(note) {\n let category_color;\n // prepare category color for html card column\n if (note.category_id == '1') {\n category_color = 'blue';\n } else if (note.category_id == '2') {\n category_color = 'purple';\n } else {\n category_color = 'orange';\n }\n\n // setup for date to be like 12 December, 2020 - 12:00 AM\n const date = note.created;\n\n const monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n\n const dateObj = new Date(date);\n const monthName = monthNames[dateObj.getMonth()]; // \"July\" (or current month)\n const dateTime = `${dateObj.getDate()} ${monthName}, ${dateObj.getFullYear()} - ${dateObj.getHours()}:${\n dateObj.getMinutes() < 10 ? `0${dateObj.getMinutes()}` : dateObj.getMinutes()\n }`;\n\n //create string with html for append function\n let html = '<div class=\"col mb-4\">';\n html += '<div class=\"card h-100\" style=\"border-radius: 5%\">';\n html += `<div class=\"card-body\" id=\"${note.id}\">`;\n html += `<div class=\"row align-items-end\">`;\n html += `<p class=\"text-muted ml-2\">${dateTime}</p>`;\n html += `<button class=\"btn btn-edit ml-auto mr-2 mb-2\" id=\"${note.id}\" data-toggle=\"modal\" data-target=\"#editNoteModal\"><i class=\"fa fa-edit\"></i></button>`;\n html += '</div>';\n html += `<h5 class=\"card-title\"><i class=\"fa fa-circle mr-1\" style=\"color: ${category_color}; font-size: 15px vertical-align: top\"></i>${note.title}</h5>`;\n html += `<p class=\"card-text\">${note.body}</p>`;\n html += '</div>';\n html += '</div>';\n html += '</div>';\n\n return html;\n}", "function addNote() {\n let titleEl = document.getElementById(\"title\")\n let detailsEl = document.getElementById(\"details\")\n\n newNote = new Note(titleEl.value, detailsEl.value)\n allNotes.push(newNote)\n\n printNote(newNote)\n resetFields(titleEl, detailsEl)\n checkBadWords(newNote)\n // changeBackground()\n}", "function addNoteButton(note) {\n var li = $(\"<div />\", slide.contentDocument);\n li.addClass(\"noteButton\");\n var time = $(\"<div />\", slide.contentDocument);\n time.addClass(\"noteButtonTime\");\n time.text(new Date(note.time).toLocaleString());\n li.append(time);\n var summary = $(\"<div />\", slide.contentDocument);\n summary.addClass(\"noteButtonSummary\");\n summary.text(noteSummary(note));\n li.append(summary);\n li.click(function () showNote(note, li));\n $(\"#noteList\", slide.contentDocument).append(li);\n return li;\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 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}", "create($parent) {\n let html =\n `<div id=\"comment-${this.config['id']}\" class=\"comment ${this.modifier ? `comment-${this.modifier}` : ''}\">` +\n `<div class=\"comment-header\">` +\n `<span class=\"comment-author\">${this.config['author']}</span>` +\n `<span class=\"comment-date\">${this.config['date']}</span>` +\n `</div>` +\n `<div class=\"comment-text\">${this.config['text']}</div>` +\n `</div>`;\n this.modifier ? $(html).prependTo($parent) : $(html).appendTo($parent);\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 create_message(){\n\t\tvar message = document.createElement(\"div\");\n\t\tvar comment = document.getElementById(\"textarea\").value;\n\t\tmessage.textContent = comment;\n\t\tmessage.setAttribute(\"class\", \"commentscreating\");\n\t\tdiv.appendChild(message);\n\t\t// clear comment-field \n\t\tdocument.getElementById('textarea').value = '';\n\t\tdiv.scrollTop += 10000000; \n\t}" ]
[ "0.8029147", "0.7413453", "0.7412704", "0.73533064", "0.72985595", "0.7111789", "0.70715487", "0.70291734", "0.69987756", "0.69801277", "0.6971854", "0.69408023", "0.6901174", "0.689776", "0.6867155", "0.68218684", "0.68079746", "0.6802814", "0.67715585", "0.6771208", "0.6734211", "0.6709657", "0.6684469", "0.6659372", "0.66385174", "0.661875", "0.66034144", "0.6584257", "0.6555231", "0.65253407", "0.6521609", "0.65139824", "0.65079725", "0.650327", "0.6502636", "0.649897", "0.64645207", "0.6450297", "0.6429287", "0.6420365", "0.639582", "0.6364112", "0.6360472", "0.6353596", "0.6343546", "0.6332469", "0.63264644", "0.6319733", "0.6308497", "0.6308227", "0.6291217", "0.6284265", "0.62593174", "0.625076", "0.6244847", "0.62429667", "0.62399656", "0.62376094", "0.62316954", "0.6231566", "0.6229934", "0.62265533", "0.6225929", "0.622199", "0.622199", "0.6217634", "0.6217634", "0.62160397", "0.621156", "0.62079394", "0.620791", "0.62064725", "0.6205042", "0.61988175", "0.6192826", "0.6189907", "0.61844045", "0.6182144", "0.618114", "0.61804074", "0.6178766", "0.61782455", "0.6178124", "0.6167766", "0.61554986", "0.6154542", "0.6152647", "0.61482406", "0.6145615", "0.61440563", "0.61427695", "0.61356175", "0.6120262", "0.6115866", "0.61155283", "0.61097014", "0.610831", "0.6106159", "0.61011404", "0.60959846", "0.60955584" ]
0.0
-1
Creates a button to confirm note changes
function createBtnConfirm() { let btnConfirm = document.createElement("button"); btnConfirm.className = "note-button note-button-bottom"; btnConfirm.addEventListener("click", function () { saveNotesToLocalStorage(); }); btnConfirm.appendChild(createImgConfirm()); return btnConfirm; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleNoteButtonEvent(thisObj) {\n _changed = true;\n if ($(thisObj.getHtmlIds().noteContainer).visible()) {\n if (thisObj.getStandardValue() == thisObj.getMeta().seeNoteCui) {\n thisObj.clearNote();\n }\n else {\n thisObj.hideNote();\n }\n }\n else {\n thisObj.showNote();\n }\n }", "async function confirmClick(removeButton){\n //let noteId = $(removeButton).parent().attr('id');\n if (confirm('Are you sure?')){\n deleteNote (removeButton);\n } else {\n renderNotes ();\n }\n}", "function addButtonClick(){\n\t\tvar note = Note();\n\t\tstorage.push(note);\n\t\tdisplayNotes();\n\n\t}", "function addNoteButton(note) {\n var li = $(\"<div />\", slide.contentDocument);\n li.addClass(\"noteButton\");\n var time = $(\"<div />\", slide.contentDocument);\n time.addClass(\"noteButtonTime\");\n time.text(new Date(note.time).toLocaleString());\n li.append(time);\n var summary = $(\"<div />\", slide.contentDocument);\n summary.addClass(\"noteButtonSummary\");\n summary.text(noteSummary(note));\n li.append(summary);\n li.click(function () showNote(note, li));\n $(\"#noteList\", slide.contentDocument).append(li);\n return li;\n }", "function makeAcceptChangesBtn(targetRow) {\n targetRow.lastElementChild.innerHTML = `<button data-trigger='hover' data-container='button' data-toggle='tooltip' data-placement='top' title='Edit project details' class='icon accept-changes'><i class='ph-check-circle accept-changes ph-lg'></i></button>`;\n}", "function addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}", "setConfirmButtonText(t) {\n this.confirmButtonText = t;\n }", "function onConfirm(buttonIndex) {}", "function initConfirmationWindow(event) {\r\n let contentString = '<div style=\"color:black\" id=\"helperNotification\">'+\r\n '<h2>Thank you for your help!</h2>'+\r\n '<p>Cick \"Undo\" if this was a mistake or click \"Continue\" '+\r\n ' to confirm.</p><button style=\"padding-right:4px\" id=\"undoButton\">Undo</button>' +\r\n '<button id=\"confirmButton\">Continue</button></div>';\r\n infoWindow.setContent(contentString);\r\n}", "onClick(e) {\r\n this.insertNewNote(this);\r\n }", "function makeNote(note) {\n let noteLi = document.createElement(\"li\")\n noteLi.innerText = note.title\n noteLi.className= 'note-li'\n noteLi.dataset.id = note.id\n noteList.append(noteLi)\n\n //How to crete delete button\n let delBtn = document.createElement(\"button\")\n delBtn.innerText = \"delete\"\n delBtn.className = \"del-btn\"\n delBtn.dataset.id = note.id\n noteLi.append(delBtn)\n }", "function createNoteByClick() {\n var newDate = new Date();\n var noteId = newDate.getTime();\n bq.setAttribute(\"id\", \"note-\" + noteId);\n bq.innerText = null;\n localStorage.setItem(noteId, \"\");\n bq.focus();\n}", "function createBtnDelete(obj) {\n let btnDelete = document.createElement(\"button\");\n btnDelete.id = \"delete-button\";\n btnDelete.className = \"note-button\";\n\n btnDelete.addEventListener(\"click\", function () {\n obj.removeNote();\n });\n btnDelete.appendChild(createImgDelete());\n return btnDelete;\n}", "function creatNote(tex,priority) {\n const notesContainer = document.getElementById('notes-container');\n const newP = document.createElement('p');\n newP.className = `note ${priority}`;\n newP.innerText = tex;\n\n const deletBtn = document.createElement('button');\n deletBtn.className = 'remove-btn';\n deletBtn.innerText = 'X'; \n deletBtn.onclick = removeNote;\n newP.appendChild(deletBtn);\n\n\n notesContainer.appendChild(newP);\n}", "function confirmDeleteNote(){\n\twarning({\n\t\ttitle:'Warning',\n\t\tmsg:'Are you sure you want to delete this note?',\n\t\tnoAction:function(){ \n\t\t\treturn false;\n\t\t},\n\t\tyesAction:function(){\n\t\t\tdeleteNote();\n\t\t\tresetform();\n\t\t\tsaveflag=true;\t\n\t\t\t$('#save_note').attr('disabled','disabled');\n\t\t},\n\t\tcancelAction:function(){ return false;}\n\t\t});\n}", "function revealConfirmation () {\n console.log('show text now');\n document.querySelector('.copy-btn-label').innerHTML = 'Copied!';\n}", "function displayNote(noteid, title, note, completed) {\n\tvar idTag, htmlTag;\n\tif (completed == \"0\" || completed == 0){\n\t\tidTag = \"#notCompletedList\";\n\t\thtmlTag = \"<button class='btn btn-info btn-xs' onclick='toggle(\\\"\"+noteid+\"\\\")'>Mark as Complete</button>\";\n\t}else if(completed == \"1\" || completed == 1){\n\t\tidTag = \"#completedList\";\n\t\thtmlTag = \"<button class='btn btn-info btn-xs' onclick='toggle(\\\"\"+noteid+\"\\\")'>Mark as Not Complete</button>\";\n\t}else\n\t\treturn;\n\n\t$(idTag).append(\n\t\t\"<tr id='\"+noteid+\"'>\"+\n\t\t\t\"<td id='title\"+noteid+\"'>\"+title+\"</td>\"+\n\t\t\t\"<td id='note\"+noteid+\"'>\"+note+\"</td>\"+\n\t\t\t\"<td id='completed\"+noteid+\"' value='\"+completed+\"' style='text-align:center;'>\"+\n\t\t\thtmlTag +\n\t\t\t\" <button class='btn btn-default btn-xs' onclick='editNote(\\\"\"+noteid+\"\\\")'><span title='Edit' class='glyphicon glyphicon-pencil' aria-hidden='true'></span></button>\"+\n\t\t\t\" <button class='btn btn-danger btn-xs' onclick='deleteNote(\\\"\"+noteid+\"\\\")'><span title='Remove' class='glyphicon glyphicon-remove' aria-hidden='true'></span></button></td>\"+\n\t\t\"</tr>\");\n}", "function updateNotes (notesList) {\n const notesDisplayArea = document.getElementById('notesDisplayArea')\n notesDisplayArea.innerHTML = notesToHTML(notesList)\n notesDisplayArea.querySelectorAll('delete').forEach(button => {\n button.addEventListener('click', event => {\n const noteId = button.dataset.noteId\n console.log(button.dataset.noteId)\n deleteNote(noteId)\n })\n })\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 toggle(noteId) {\n\tif (confirm('Are you sure?')) {\n\t\t// get all details from the note\n\t\tvar tM = {\n\t\t\ttitle:$(\"#title\"+noteId).text(),\n\t\t\tnote:$(\"#note\"+noteId).text(),\n\t\t\t// switch its status\n\t\t\tcompleted: ((($(\"#completed\"+noteId).attr(\"value\")) == 0)? 1:0)\n\t\t};\n\t\t// add the new one to FirebaseDB\n\t\tnotesdb.push(tM);\n\t\t// remove the old one\n\t\tnotesdb.child(noteId).remove();\n\t}\n\n}", "function acknowledgeButton(){\n var confirm = document.createElement('button');\n confirm.id = 'confirm';\n confirm.textContent = 'Proceed';\n btnContainer.appendChild(confirm);\n btnContainer.addEventListener('click', acceptResults);\n}", "function DeleteClick() {\n notyConfirm('Are you sure to delete?', 'DeleteSupplierPayment()');\n}", "toggleButton() {\n if (this.noteMessageInput.value) {\n this.addNoteButton.removeAttribute(\"disabled\");\n } else {\n this.addNoteButton.setAttribute(\"disabled\", \"true\");\n }\n }", "static createConfirmEditDialog() {\n\t const bx = calendar_util.Util.getBX();\n\t return new bx.Calendar.Controls.ConfirmEditDialog();\n\t }", "function showNote(event) {\n const note = findNote(event);\n if (!note) {\n return;\n }\n\n if (fretboardDiv.lastChild !== image) {\n if (fretboardDiv.lastChild.innerHTML === note.note) {\n return;\n }\n\n removeChildren();\n }\n\n fretboardDiv.appendChild(createButton(note));\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 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 addNote(e) {\n e.preventDefault();\n let newNote = document.createElement(\"div\");\n newNote.className = \"parent-note\";\n newNote.innerHTML = `<div class=\"my-note\" onclick=swapNotes(this)>\n <div class=\"x-btn-container\">\n <button type=\"button\" class=\"x-button\" onclick=deleteNote(this.parentNode.parentNode)>X</button>\n </div>\n <p> ${input.value} </p>\n <button type=\"button\" onclick=editNote(this.parentNode.parentNode)>Edit</button>\n </div>\n `;\n myNotes.appendChild(newNote);\n input.value = \"\";\n}", "function confirmDeletion(){\n vex.dialog.open({\n message: \"Comment Has Been Deleted\",\n buttons:[\n $.extend({},vex.dialog.buttons.Yes,{text: \"OK\"})\n ],\n callback: function (data) {\n $(location).attr(\"href\", \"/\"); \n }\n });\n }", "function 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}", "function newNote() {\n document.getElementById('note_area').value = '';\n document.getElementById('note_area').readOnly = false;\n document.getElementById('btnDelNote').disabled = true;\n document.getElementById('btnEditNote').disabled = true;\n\n oSelectedNote = null;\n}", "function editCommandButton() {\n if (commandHasChanges()) {\n //changes -> öffne modal\n $('#resetButtonChanges').attr(\"onclick\", \"$('#uncommitedChangesModal').modal('hide');\");\n $('#discardChangesButton').attr(\"onclick\", \"editCommand()\");\n $('#uncommitedChangesModal').modal('show');\n } else {\n editCommand();\n }\n}", "function editInput(clickedId){\n var inputId = clickedId.replace('-button', '');\n $('#' + inputId).prop('readonly', false);\n $('<button/>', {\n type: 'button',\n \"class\": 'button primary save',\n id: 'confirm-' + inputId,\n css: {\n 'margin-left': '5px'\n },\n onclick: 'confirmEdit(this.id)',\n text: 'confirm'\n }).insertAfter('#' + clickedId);\n}", "function showNotesEditor(noteId, noteTitle = '', noteContent = '') {\n\n newNoteBtn.addClass('d-none');\n let label = noteId ? 'Editar Nota' : 'Nueva Nota';\n let buttonText = noteId ? 'Actualizar Nota' : 'Guardar Nota';\n\n notesContainer.html(`\n <div style='text-align: center;'>\n <h4>${label}</h4>\n </div>\n <div class='form' style='margin: 15px'>\n <input id='note-title' type='text' class='form-control' placeholder='Título' maxlength='500' value='${noteTitle}'>\n <textarea id='note-content' class='form-control mt-3' placeholder='Contenido' id='floatingTextarea' style='height: 350px'>${noteContent}</textarea>\n </div>\n <div style='text-align: right; margin: 15px'>\n <button id='upsert-note' class='btn btn-success ms-auto'>${buttonText}</button>\n <button id='edit-note-cancel' class='btn btn-warning ms-auto'>Cancelar</button>\n </div>\n `);\n\n $('#edit-note-cancel').on('click', function () {\n loadNotes();\n });\n\n $('#upsert-note').on('click', function () {\n\n const title = $('#note-title').val().trim();\n const content = $('#note-content').val().trim();\n\n if (title === '') {\n iziToast.warning({\n message: 'Ingresa el título de la nota',\n close: true,\n timeout: 2000,\n });\n return;\n }\n\n if (content === '') {\n iziToast.warning({\n message: 'Ingresa el contenido de la nota',\n close: true,\n timeout: 2000,\n });\n return;\n }\n\n if (!noteId) {\n // Nueva Nota\n executeRequest('POST', 'notes/create', { title: title, content: content }).then(r => {\n\n iziToast.success({\n message: 'La nota se ha guardado correctamente',\n close: true,\n timeout: 1500,\n });\n\n loadNotes();\n\n }).catch(() => {\n // Se maneja en la petición\n });\n } else {\n // Actualizar Nota\n executeRequest('PATCH', 'notes/update', { id: noteId, title: title, content: content }).then(r => {\n\n iziToast.success({\n message: 'La nota se ha actualizado correctamente',\n close: true,\n timeout: 1500,\n });\n\n loadNotes();\n\n }).catch(() => {\n // Se maneja en la petición\n });\n }\n });\n\n}", "function noButton(){\n const new_question = ('How many passages would you like to read to determine your reading speed?\\n\\n' +\n 'Each passage should take between 10 and 45 seconds to read.\\n\\n' +\n 'The more passages you read, the more accurate your measured WPM will be.')\n\n let q = $$('question')\n q.innerText = new_question;\n\n //Remove yes and no buttons\n $$('yes').remove();\n $$('no').remove();\n\n //Create input box\n let text_num = makeSelectionRange('1', global_number_of_possible_passages, '1');\n\n //Create confirm button\n let confirm = makeConfirmButton();\n\n q.after(text_num);\n text_num.after(confirm);\n}", "function enableShowNotesButton() {\n var needed = false;\n for (let i = 0; i < activeQuestion.clues.length; i++) {\n note = activeQuestion.clues[i].r;\n if (note !== \"\") {\n needed = true;\n }\n }\n if (needed) {\n document.getElementById(\"notes-button\").classList.add(\"control-button-active\");\n }\n}", "function quitConfirm() {\n\tshowOverlay();\n\tgetId('quitText').innerHTML = \"Are you sure you<br>want to QUIT?\";\n\tgetId('buttonLeftText').innerHTML = \"Yes\";\n\tgetId('buttonRightText').innerHTML = \"No\";\n}", "function newPartConfirm() {\n swal({\n title: \"Are you sure?\",\n text: \"This will delete the current part\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes, start a new part\",\n closeOnConfirm: true\n },\n function(){\n paper.project.clear();\n newProject();\n });\n}", "function updateNotice(e){\n\tdbId = e.parentElement.parentElement.children[1].getAttribute('pk')\n\tdocument.querySelector('input[name=notice]').value = e.parentElement.parentElement.children[1].innerText\n\tdocument.querySelector('#submit').innerHTML = `<input class=\"btn btn-outline-info mr-2\" type=\"submit\" name=\"update_notice\" value=\"Update\">\n\t\t\t\t\t\t\t\t<input class=\"btn btn-outline-danger\" type=\"button\" onclick=\"cancelUpdate()\" value=\"Cancel\">`\n}", "function user_create_send_notification_button() {\n this.submit( null, null, function(data){\n data.resetpw = true;\n })\n}", "function commitNewCommandButton() {\n var commandName = $('#newCommandName').val();\n\n if (commandName === \"\") {\n $(\"#commandNameFeedback\").text(\"Der command muss einen Namen haben!\");\n return;\n }\n\n if (commandHasChanges()) {\n //changes -> öffne modal\n $('#resetButtonChanges').attr(\"onclick\", \"closeUCAndNCModals()\");\n $('#discardChangesButton').attr(\"onclick\", \"commitNewCommand()\");\n $('#uncommitedChangesModal').modal('show');\n } else {\n commitNewCommand();\n }\n}", "function addLittleButtonsAnswer() {\n \n //console.log(INSIDE addLittleButtonsAnswer, thisTopicID: \" + thisTopicId);\n //console.log(also inside addLittlebuttonsAnswer, thisTopicText: \" + thisTopicText);\n //console.log(also inside addLittlebuttonsAnswer, thisTopicAnswer: \" + thisTopicAnswer);\n // append the delete and edit buttons, with the id of the current topic as data\n thisBox.append(\n \"<button type='button' class='btn btn-default btn-xs littleXAnswer' data_idtopic=\" +\n thisTopicId + \">\" +\n \"<span class='glyphicon glyphicon-remove' aria-hidden='true'></span></button>\");\n var newEditButton = $(\"<span>\");\n newEditButton.attr(\"type\", \"button\");\n newEditButton.addClass(\"btn\");\n newEditButton.addClass(\"btn-default\");\n newEditButton.addClass(\"btn-xs\");\n newEditButton.addClass(\"littleEAnswer\");\n newEditButton.addClass(\"glyphicon\");\n newEditButton.addClass(\"glyphicon-pencil\");\n newEditButton.attr(\"aria-hidden\", \"true\");\n newEditButton.attr(\"data-idtopic\", thisTopicId);\n newEditButton.attr(\"data-texttopic\", thisTopicText);\n newEditButton.attr(\"data-textanswer\", thisTopicAnswer);\n thisBox.append(newEditButton);\n }", "function updateothernote()\n{\n var logopener=\"----entering updateothernote----\";\n console.log(logopener);\n\n //lets get the id. \n console.log(\"UniqueGuid is \" + event.target.id);\n\n //we have the id. now, we need to do a post call to update it. \n var tempbutton = event.target;\n\n apiworkothernoteupdate(tempbutton);\n \n var logcloser=\"----leaving updateothernote----\";\n console.log(logcloser);\n}", "function sendTodoButton(sender_psid){\n response = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\": \"TODO\",\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"url\":\"https://marvin-assistant.herokuapp.com/todo\",\n \"title\":\"TODO\",\n \"webview_height_ratio\": \"tall\",\n \"messenger_extensions\": true,\n \"fallback_url\": \"https://www.google.com\"\n }\n ]\n }\n }\n };\n sendMessage(sender_psid, response);\n}", "function setupNoteCreateDialog(commentDialog, observer) {\n observer.disconnect();\n\n let commentDialogRenderer = makeHTML(commentDialogRenderer_raw);\n commentDialog.appendChild(commentDialogRenderer);\n let injectedCommentDialogRenderer = commentDialog.querySelector(\"ytd-comment-dialog-renderer\");\n\n var commentDialogObserver = new MutationObserver(function(mutations, observer) {\n let defaultText = commentDialog.querySelector(\"#placeholder\");\n defaultText.textContent = \"Add a private note...\";\n\n let avatar = commentDialog.querySelector(\"#author-thumbnail\");\n avatar.remove();\n\n let btnWrapper = commentDialog.querySelector(\"#buttons\");\n // Move to next fn if possible\n let btns = btnWrapper.querySelectorAll(\"ytd-button-renderer\");\n for (let btn of btns) {\n btn.setAttribute(\"is-paper-button\", \"\");\n }\n setupCreateNoteButtons(btnWrapper, observer);\n });\n commentDialogObserver.observe(injectedCommentDialogRenderer, {childList: true});\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=\"thema-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Thema</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"One Piece\";\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(\"Thema der Geschichte 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}", "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 yesButtonClick() {\n\n pdfs(\"wfFrame\" + pdf(\"CurrentDesk\")).Submit_Click();\n psc().gsUIMode = \"Confirm\";\n if (pdfs(\"wfFrame\" + pdf(\"CurrentDesk\")).HasNoError) {\n psc().confirmresult = true;\n eval(psc().clickmethod);\n confirmresult = false;\n //psc().confirmresult = false;\n // psc().hideConfirmMessagePane('YES');\n\n }\n}", "async _clickOnJSConfirmButton(){\n\t\tawait t\n\t\t.setNativeDialogHandler(() => true)\n\t\t.click(JSConfirmButton);\n\t}", "function createNewNoteButton() {\n noteButton = document.createElement(\"div\");\n noteButton.className = \"menuIcon\";\n document.body.appendChild(noteButton);\n let span = document.createElement(\"span\");\n noteButton.appendChild(span);\n let icon = document.createElement(\"img\");\n icon.src = \"/media/plus-circle.svg\";\n icon.width = \"50\";\n icon.height = \"50\";\n span.appendChild(icon);\n noteButton.addEventListener(\"click\", function () {\n let menu = document.querySelector(\".menuIcon\");\n menu.classList.toggle(\"active\");\n });\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 cancelUpdate(){\n\tdocument.querySelector('input[name=notice]').value = ''\n\tdocument.querySelector('#submit').innerHTML = `<input class=\"btn btn-outline-white\" type=\"submit\" name=\"add_notice\" value=\"Add\"></input>`\n}", "function msg_SuccessfulSave(){\n new PNotify({\n title: 'Saved',\n text: 'New Record Added.',\n type: 'success'\n });\n }", "renderFormButtons() {\n //if the note.id exists, then we can either delete or edit that note\n if (this.props.note.id !== undefined) {\n return (<div>\n { /* Show the save button to edit note */}\n <button type=\"submit\" className=\"btn btn-success float-right\">Add Note</button>\n { /* Show the delete button to delete note */}\n <button onClick={this.deleteNote} className=\"btn btn-danger\">Delete Note</button>\n </div>);\n }\n return (\n /* Show the add button to save a new note */\n <button type=\"submit\" className=\"btn btn-success float-right\">Add Note</button>\n );\n }", "function generate_button(href, type, text) {\n var button = '<a class=\"btn btn-' + type + '\" ';\n button += 'href=\"' + href + '\" ';\n button += 'data-remote=\"true\" data-method=\"patch\">';\n button += text + '</a>';\n return button;\n }", "function confirm_actions(e) {\n e.preventDefault();\n\n var $confirm = '<ul>'+M.util.get_string('plugins_will_be_added', 'local_rlsiteadmin'),\n $bodycontent,\n plugin,\n $status,\n $report = '',\n $dependency = {},\n button;\n\n for (plugin in M.local_rlsiteadmin.data_actions.add) {\n $confirm += '<li>'+plugin+'</li>';\n }\n $confirm += '</ul>';\n\n $confirm += '<ul>'+M.util.get_string('plugins_will_be_updated', 'local_rlsiteadmin');\n for (plugin in M.local_rlsiteadmin.data_actions.update) {\n $confirm += '<li>'+plugin+'</li>';\n }\n $confirm += '</ul>';\n\n $confirm += '<ul>'+M.util.get_string('plugins_will_be_removed', 'local_rlsiteadmin');\n for (plugin in M.local_rlsiteadmin.data_actions.remove) {\n $confirm += '<li>'+plugin+'</li>';\n }\n $confirm += '</ul>';\n\n Y.log($confirm);\n\n // Rebuild the modal each time, since the content of the modal is\n // so unique, and enabling and disabling the button would have to be\n // redone anyway.\n $bodycontent = '<div id=\"modal-content\">';\n $bodycontent += '<h4>'+M.util.get_string('preparing_actions', 'local_rlsiteadmin')+'</h4>';\n $bodycontent += '<p>' + $confirm + '</p>';\n $bodycontent += '<div id=\"action-results\"><i class=\"fa fa-spinner fa-spin fa-4\"></i></div>';\n $bodycontent += '</div>';\n\n YUI().use(\"panel\", function (Y) {\n M.local_rlsiteadmin.plugin_modal = new Y.Panel({\n srcNode: '<div></div>',\n id: 'manage-actions-modal',\n headerContent: M.util.get_string('actions_in_progress', 'local_rlsiteadmin'),\n bodyContent: $bodycontent,\n buttons: [\n {\n id: 'modal-confirm-button',\n label: M.util.get_string('confirm', 'local_rlsiteadmin'),\n section: 'footer',\n action: function(e) {\n e.preventDefault();\n e.target.hide();\n Y.one('#manage-actions-modal .modal-cancel-button').set('label', M.util.get_string('close', 'local_rlsiteadmin'));\n do_actions(e);\n },\n classNames: 'modal-confirm-button',\n disabled: true\n },\n {\n id: 'modal-cancel-button',\n label: M.util.get_string('cancel', 'local_rlsiteadmin'),\n section: 'footer',\n action: function(e) {\n e.preventDefault();\n M.local_rlsiteadmin.plugin_modal.hide();\n M.local_rlsiteadmin.plugin_modal.destroy();\n },\n classNames: 'modal-cancel-button',\n disabled: true\n },\n ],\n classNames: 'manage-actions-modal',\n width: '60%',\n height: 500,\n zIndex: 10000,\n centered: true,\n modal: true,\n visible: true,\n render: true\n });\n });\n\n // Check dependencies for each add action, and add that action and each dependency not yet installed.\n Y.Object.each(M.local_rlsiteadmin.data_actions.add, function($value, $key) {\n Y.log('Loop through add actions.');\n\n // For each dependency, if it's not installed in the addons object, add the dependency.\n if ((typeof M.local_rlsiteadmin.data_addons[$key].cache === 'object') && ('dependencies' in M.local_rlsiteadmin.data_addons[$key].cache)) {\n Y.Object.each(M.local_rlsiteadmin.data_addons[$key].cache.dependencies, function($dvalue, $dkey) {\n if (($dkey in M.local_rlsiteadmin.data_addons) && !(M.local_rlsiteadmin.data_addons[$dkey].installed || ($dkey in M.local_rlsiteadmin.data_actions.add))) {\n M.local_rlsiteadmin.data_actions.add[$dkey] = $dkey;\n $dependency = {'source': $key, 'target': $dkey};\n $report += '<li>'+M.util.get_string('dependency_will_be_added', 'local_rlsiteadmin', $dependency)+'</li>';\n }\n });\n }\n });\n\n // Check dependencies for each update action, and add that action and each dependency not yet installed.\n Y.Object.each(M.local_rlsiteadmin.data_actions.update, function($value, $key) {\n Y.log('Loop through update actions.');\n\n // For each dependency, if it's not installed in the addons object, add.\n if ((typeof M.local_rlsiteadmin.data_addons[$key].cache === 'object') && ('dependencies' in M.local_rlsiteadmin.data_addons[$key].cache)) {\n Y.Object.each(M.local_rlsiteadmin.data_addons[$key].cache.dependencies, function($dvalue, $dkey) {\n if (($dkey in M.local_rlsiteadmin.data_addons) && !(M.local_rlsiteadmin.data_addons[$dkey].installed || ($dkey in M.local_rlsiteadmin.data_actions.add))) {\n M.local_rlsiteadmin.data_actions.update[$dkey] = $dkey;\n $dependency = {'source': $key, 'target': $dkey};\n $report += '<li>'+M.util.get_string('dependency_will_be_added', 'local_rlsiteadmin', $dependency)+'</li>';\n }\n });\n }\n });\n\n // Loop through all remove actions.\n // Check for plugins that depend on the plugins being removed.\n Y.Object.each(M.local_rlsiteadmin.data_actions.remove, function($value, $key) {\n Y.log('Loop through remove actions.');\n\n // For every installed plugin, if it depends on the removed plugin also remove it.\n Y.Object.each(M.local_rlsiteadmin.data_addons, function($rvalue, $rkey) {\n if ((typeof $rvalue.dependencies !== 'undefined') && ($rvalue.dependencies[$key])) {\n // Only alert if we're not already uninstalling the plugin.\n if (!($rkey in M.local_rlsiteadmin.data_actions.remove)) {\n M.local_rlsiteadmin.data_actions.remove[$rkey] = $rkey;\n $dependency = {'source': $key, 'target': $rkey};\n $report += '<li>'+M.util.get_string('dependency_will_be_removed', 'local_rlsiteadmin', $dependency)+'</li>';\n }\n }\n });\n });\n\n if ($report.length <= 0) {\n $report = '<li>'+M.util.get_string('no_dependencies', 'local_rlsiteadmin')+'</li>';\n }\n Y.log($report);\n $report = '<h4>'+M.util.get_string('dependencies', 'local_rlsiteadmin')+'</h4>\\n<ul>'+$report+'</ul>';\n Y.one('#action-results').insert($report, 'before');\n\n M.local_rlsiteadmin.action_dropdown_update();\n\n Y.one('#modal-content .fa-spinner').hide();\n\n button = Y.one('#manage-actions-modal .modal-confirm-button');\n button.set('disabled', false);\n // Don't know why this isn't done automatically. YUI bug?\n button.removeClass('yui3-button-disabled');\n\n button = Y.one('#manage-actions-modal .modal-cancel-button');\n button.set('disabled', false);\n // Don't know why this isn't done automatically. YUI bug?\n button.removeClass('yui3-button-disabled');\n\n // Create status placeholder\n $status = '<h4 id=\"status-header\"></h4>\\n';\n $status += '<div id=\"status-bar\" class=\"progress\"><div class=\"bar\" style=\"width: 0%;\"></div></div>\\n';\n Y.one('#action-results').insert($status, 'before');\n Y.one('#status-bar').hide();\n }", "function confirm() {\n\n showElement(mainContent);\n hideElement(formConfirm);\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=\"tw-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">TW</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"http://twitter.com/MeerUndMehrWiki\";\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(\"Twitter-Link 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}", "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 showConfirm() {\n confirm({\n title: 'Do you Want to delete these items?',\n icon: <ExclamationCircleOutlined />,\n content: 'Some descriptions',\n onOk() {\n const id = selectedRowKeys[0];\n fetchData('DELETE', { id }).then((res) => {\n if (res.ok) {\n setStateSelect({\n selectedRowKeys: []\n })\n onReset();\n setSelectedAudioBook({ isAdded: true, selected: null });\n }\n });\n },\n onCancel() {\n console.log('Cancel');\n },\n });\n }", "function updateConfirmation () {\n team_form.setConfirmationMessage(confirmation)\n }", "function setNotifyBtn() {\r\n notifyBtn.addEventListener(\"click\", (e) => {\r\n handleNotify(e, false);\r\n });\r\n}", "function showCandidatureConfirmed(){\n $(\".welcomed\").html(\"Your candidature has been confirmed. Wait for the elections to end.\");\n $(\"button\").remove();\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=\"gbl-kg-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Kurzgeschichte</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"<!-- INFORMATIONEN ZUR ANPASSUNG IST UNTEN\\n-->{{Geschichten-Info 2013/Kurzgeschichte\\n<!-- unter dieser Linie nichts verändern -->\\n|LastUpdateHack={{{LastUpdateHack|{{REVISIONDAY2}}.{{REVISIONMONTH}}.{{REVISIONYEAR}}}}}\\n|Portal={{{Portal|}}}\\n|Name=\"+ wgPageNameRegexedSplit +\"\\n}}<noinclude>{{Geschichten-Info/Autoren-Werkzeugkasten}}[[Kategorie:Angepasste Geschichtenbalken]]</noinclude>\";\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(\"Sollte alles mit 'OK' funktionieren. ###### ACHTUNG ##### geht nur in Geschichtenübersicht.\", 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 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 add_note_button(q_id){\n $(\".alert-notice\").hide();\n $('.view_comment_class').hide();\n $('.edit_comment_class').hide();\n $('.archive_comment_class').hide();\n //$('#add_comment_button_bottom_div_'+ q_id).hide();\n $('#add_comment_button_top_div_'+ q_id).hide();\n //$('#{questionid}new_note_text').text(\"\");\n $('#add_comment_block_div_'+ q_id).show();\n}", "function saveNoteInPopUp() {\n var currentNote = document.querySelector(\".note-list__item[data-item-number='\" + currentNoteId + \"']\");\n notes.forEach(function(element, index) { \n if (element.noteId === currentNoteId) {\n element.noteText = editText.value;\n currentNote.style.background = element.colorBg;\n if (!editHead) {\n element.noteHead = \"\";\n } else {\n element.noteHead = editHead.value;\n }\n }\n });\n currentNote.querySelector(\".note-list__text\").innerHTML = editText.value;\n currentNote.querySelector(\".note-list__head\").innerHTML = editHead.value;\n if (!currentNote.querySelector(\".note-list__head\").innerHTML) {\n currentNote.querySelector(\".note-list__head\").style.marginBottom = \"0px\";\n } else {\n currentNote.querySelector(\".note-list__head\").style.marginBottom = \"10px\";\n }\n notePopUp.style.display = 'none';\n document.querySelector(\".overlay\").style.display = 'none';\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=\"gbl-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Geschichtenbalken: normal</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"<!-- INFORMATIONEN ZUR ANPASSUNG IST UNTEN\\n-->{{Geschichten-Info 2013\\n<!-- unter dieser Linie nichts verändern -->\\n|LastUpdateHack={{{LastUpdateHack|{{REVISIONDAY2}}.{{REVISIONMONTH}}.{{REVISIONYEAR}}}}}\\n|Portal={{{Portal|}}}\\n|Name=\"+ wgPageNameRegexedSplit +\"\\n}}<noinclude>{{Geschichten-Info/Autoren-Werkzeugkasten}}[[Kategorie:Angepasste Geschichtenbalken]]</noinclude>\";\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(\"Sollte alles mit 'OK' funktionieren. ###### ACHTUNG ##### geht nur in Geschichtenübersicht.\", 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 showRestRoom(container, title) {\n title.innerText = \"DO YOU WANT TO JOIN THE LOBBY ?\"\n let template = `\n <button class=\"button\" id=\"buttonYes\" type=\"button\">YES !</button>\n <button class=\"button\" id=\"buttonNo\" type=\"button\">NO !</button>\n `;\n container.innerHTML = template;\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=\"autor1-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Autor1</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Ersten Autor der Geschichte 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}", "function doneremove(e) {\r\n const item = e.target;\r\n\r\n if (item.classList[0] === \"remove\") {\r\n const note = item.parentElement.parentElement;\r\n remove(note);\r\n note.remove();\r\n // reload for update the notes session\r\n window.location.reload(1);\r\n }\r\n if (item.classList[0] === \"done\") {\r\n const note = item;\r\n note.innerText = \"completed\";\r\n note.classList.remove(\"btn-primary\");\r\n note.parentElement.parentElement.classList.add(\"bg-success\", \"completed\");\r\n }\r\n}", "function buttonClick() {\n timestamp = duration[duration.length-1];\n console.log(timestamp + \"docReady: \" + docReady);\n if (docReady && timestamp !== undefined) {\n firepad.makeHeaderDialog_(timestamp);\n\n //Create buttons that take you to different parts of the video\n var button = document.createElement(\"input\");\n button.type = \"button\";\n button.value = timestamp.toFixed(2)+\"s\";\n button.onclick = function() {\n playerInstance.seek(timestamp);\n };\n document.querySelector(\"#annotatedNotes\").appendChild(button);\n }\n}", "function llenarBotonEvaluacion(){\n var retorno='<button type=\"button\" class=\"btn btn-xs btn-default btn-block\"><span class=\"glyphicon glyphicon-pencil\"></span> Evaluación</button>'\n return retorno\n }", "function renderNoteInfo(aNote) {\n while(noteTitle.firstChild){\n noteTitle.removeChild(noteTitle.firstChild)\n }\n noteTitle.innerHTML = `<h2>${aNote.title}</h2>`\n let n = document.createElement('p')\n n.innerHTML = `<a>${aNote.content}</a>\n <br>\n <br>\n <button data-id=${aNote.id} id=\"editNoteBtn\">Edit this note</button>\n <button data-id=${aNote.id} id=\"deleteNoteBtn\">Delete this note</button>\n `\n noteTitle.appendChild(n)\n}", "function editNotes(ele){\n\t\t\tvar formContainer = document.createElement(\"div\"),\n\t\t\t\tformContent = '',\n\t\t\t\theader = '<h3>Edit Notes</h3>',\n\t\t\t\tinputArea = '<textarea placeholder=\"Jot down some notes\" autofocus></textarea>',\n\t\t\t\tsubmitButton = '<input type=\"button\" class=\"btn\" value=\"Update\" onclick=\"BNB.calendar.Notes.submitEditNotes(this)\">',\n\t\t\t\tcloseButton = '<span class=\"close\" onclick=\"BNB.calendar.Notes.removeEditNotes(this.parentNode);\">X</span>';\n\n\t\t\t// If a dialog is already open, close it\n\t\t\tif(document.getElementsByClassName(\"edit-notes-form\")[0]){\n\t\t\t\tremoveEditNotes(document.getElementsByClassName(\"edit-notes-form\")[0]);\n\t\t\t}\n\n\t\t\t// Track the clicked element\n\t\t\tcurrentStepNode = ele.parentNode;\n\n\t\t\t// Add notes to the textarea if notes exist\n\t\t\tif(currentStepNode.getAttribute(\"data-notes\") != \"There are no notes for this event.\"){\n\t\t\t\tinputArea = '<textarea autofocus>' + \n\t\t\t\tcurrentStepNode.getAttribute(\"data-notes\") + \n\t\t\t\t'</textarea>';\n\t\t\t}\n\n\t\t\t// Assemble Notes dialog box\n\t\t\tformContent = header + inputArea + submitButton + closeButton;\n\n\t\t\t// Add a new \"Edit Notes\" dialog box to the page\n\t\t\tformContainer.className = \"edit-notes-form\";\n\t\t\tformContainer.innerHTML = formContent;\n\t\t\taddEditNotes(ele, formContainer);\n\t\t}", "function pushNote(thisNote) {\n //console.log('push has been called');\n myNotes.push(thisNote);\n Cookies.set('storedNotes', myNotes);\n //myNotes = Cookies.getJSON('storedNotes');\n //console.log('New Note Saved');\n confirmation.placeholder = 'New note saved';\n note.value = '';\n}", "removeResource(evt) {\n evt.preventDefault();\n let button = $(evt.target);\n this.view.attr(\"hidden\", \"\"); // do not show the block\n this.destroyed = true\n this.registry.showSaveNote();\n }", "function createNotify()\n{\n\n\t\tif( get[ 'msg' ] == 'insert' )\n\t\t{\n\n\t\t\t\tnotifySuccess( 'El menú <b>' + get[ 'element' ] + '</b> ha sido creado correctamente.' );\n\n\t\t}\n\n}", "function editBtn(url, btnNAme) {\n\t$('#edit-btn').empty().html(\n\t\t'<a href=\"'+url+'\">\\\n\t\t\t<button class=\"btn btn-block btn-sm btn-info pull-right\">\\\n\t\t\t\t<i class=\"fa fa-edit\"></i> '+btnNAme+'\\\n\t\t\t</button>\\\n\t\t</a>'\n\t);\n}", "function addLittleButtonsTopic() {\n \n //console.log(INSIDE addLittleButtonsTopic, thisTopicID: \" + thisTopicId);\n //console.log(also inside addLittleButtonsTopic, thisTopicText: \" + thisTopicText);\n //console.log(also inside addLittlebuttonsTopic, thisTopicAnswer: \" + thisTopicAnswer);\n // append the delete and edit buttons, with the id of the current topic as data\n thisBox.append(\n \"<button type='button' class='btn btn-default btn-xs littleXTopic' data_idtopic=\" +\n thisTopicId + \">\" +\n \"<span class='glyphicon glyphicon-remove' aria-hidden='true'></span></button>\");\n var newEditButton = $(\"<span>\");\n newEditButton.attr(\"type\", \"button\");\n newEditButton.addClass(\"btn\");\n newEditButton.addClass(\"btn-default\");\n newEditButton.addClass(\"btn-xs\");\n newEditButton.addClass(\"littleETopic\");\n newEditButton.addClass(\"glyphicon\");\n newEditButton.addClass(\"glyphicon-pencil\");\n newEditButton.attr(\"aria-hidden\", \"true\");\n newEditButton.attr(\"data-idtopic\", thisTopicId);\n newEditButton.attr(\"data-texttopic\", thisTopicText);\n newEditButton.attr(\"data-textanswer\", thisTopicAnswer);\n thisBox.append(newEditButton);\n }", "function llenarBotonCulminado(){\n var retorno='<button type=\"button\" class=\"btn btn-xs btn-default btn-block\"><span class=\"glyphicon glyphicon-pencil\"></span> Culminado</button>'\n return retorno\n }", "function showTextArea() {\n\t/*var x = document.createElement(\"INPUT\");\n x.setAttribute(\"type\", \"text\");\n x.setAttribute(\"id\", \"userGuess\");\n document.getElementById(\"answer\").appendChild(x);\n var elem = document.getElementById('guess');\n elem.parentNode.removeChild(elem);\n\n var btn = document.createElement(\"BUTTON\");\n btn.setAttribute(\"type\", \"button\");\n btn.setAttribute(\"id\", \"check\");\n document.getElementById(\"answer\").appendChild(btn);\n btn.innerHTML=\"Check\"; \n document.getElementById(\"check\").onclick=function() {check()};*/\n\tdocument.getElementById(\"answer\").innerHTML = \"<button onclick= \\\"checkSubmition()\\\">Check</button>\"+\" \"+\n\t \"<input type=\\\"text\\\" name=\\\"guess\\\"></input>\";\n\t \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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Autor3</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Dritten Autor der Geschichte 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}", "function PatchActionsComponent_button_5_Template(rf, ctx) { if (rf & 1) {\n const _r2 = ɵɵgetCurrentView();\n ɵɵelementStart(0, \"button\", 1);\n ɵɵlistener(\"click\", function PatchActionsComponent_button_5_Template_button_click_0_listener() { ɵɵrestoreView(_r2); const ctx_r1 = ɵɵnextContext(); return ctx_r1.onAddNewClick(); });\n ɵɵelement(1, \"i\", 5);\n ɵɵelementEnd();\n} }", "function submitEditNotes(ele){\n\t\t\tvar popup = document.getElementsByClassName(\"edit-notes-form\")[0],\n\t\t\t\tupdatedNotes = ele.parentNode.getElementsByTagName(\"textarea\")[0].value;\n\n\t\t\tif(!updatedNotes) updatedNotes = \"There are no notes for this event.\"\n\n\t\t\t// Update notes\n\t\t\tcurrentStepNode.setAttribute(\"data-notes\", updatedNotes);\n\n\t\t\t// Save notes to database\n\t\t\tsaveAction.enqueue( makeJsonFromNode(currentStepNode));\n\n\t\t\t// Remove popup\n\t\t\tremoveEditNotes(popup);\n\t\t}", "function addNewNote(raphaelName) {\n var color = \"white\";\n var text = \" \";\n\n //find color selected\n $(\".dropdown-menu li\").click(function() {\n color = $(this).text();\n $(\"#dropdownbtn\").text(color);\n if(color == \"Pink\") $(\"#dropdownbtn\").css({\"background-color\": \"#ffc0cb\"});\n if(color == \"Blue\") $(\"#dropdownbtn\").css({\"background-color\": \"#8deeee\"});\n if(color == \"Green\") $(\"#dropdownbtn\").css({\"background-color\": \"#98fb98\"});\n });\n\n //add note to the canvas and send message to all pages\n $(\".addnotebutton\").click(function() {\n text = $(\"#newnoteinput\").val();\n var note = controlNote(raphaelName, 400, 300, color, text);\n pushNote(note);\n\n if(TogetherJS.running) {\n TogetherJS.send({\n type: \"controlNote\",\n xPos: 400,\n yPos: 300,\n noteColor: color,\n text: text,\n ID: note.id\n });\n }\n\n $(\"#dropdownbtn\").text(\"Note Color\");\n $(\"#dropdownbtn\").css({\"background-color\": \"rgb(249, 211, 140)\"});\n $(\"#newnoteinput\").val(\"\");\n text = \" \";\n color = \"white\";\n });\n}", "function changeNote(event){\n let el = event.target;\n let id=el.parentNode.id;\n let elInData=data.find(function(element){return element.id==id;});\n\n if(el.classList.contains(\"markBut\")) { \n elInData.isMark=!elInData.isMark;\n }\n else if(el.classList.contains(\"delBut\")) {\n position =data.indexOf(elInData);\n if ( ~position ) data.splice(position, 1);\n }\n else if(el.classList.contains(\"textChangeNote\")){\n return;\n }\n else if(el.classList.contains(\"penBut\")) {\n \n if( noteChanging==null)\n { \n let noteTextEl=el.parentNode.querySelector('.noteText');\n let textarea=document.createElement('textarea');\n textarea.className=\"form-control textChangeNote\";\n textarea.value=noteTextEl.innerHTML;\n noteTextEl.innerHTML=null;\n noteTextEl.appendChild(textarea);\n noteChanging=noteTextEl;\n \n el.classList.remove('btn-danger');\n el.classList.add('btn-success'); \n return;\n }\n else{\n \n elInData.text=noteChanging.querySelector('.textChangeNote').value;\n el.classList.remove('btn-success');\n el.classList.add('btn-danger');\n noteChanging=null;\n }\n\n }\n\n localStorage.setItem('arrNotes',JSON.stringify(data));\n refresh();\n}", "function llenarBotonDiferido(){\n var retorno='<button type=\"button\" class=\"btn btn-xs btn-default btn-block\"><span class=\"glyphicon glyphicon-refresh\"></span> Diferido</button>'\n return retorno\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=\"fsk-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Autor2</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"FSK\";\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(\"Zweiten Autor der Geschichte 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}", "function addNote() {\r\n const newNote = document.createElement('div')\r\n newNote.classList.add('note--new')\r\n\r\n const noteText = document.createElement('li')\r\n noteText.innerText = inputText.value\r\n noteText.classList.add('note--text')\r\n newNote.appendChild(noteText)\r\n\r\n const noteView = document.createElement('button')\r\n noteView.innerHTML = '<i class=\"far fa-eye\"></i>'\r\n noteView.classList.add('note--view-btn')\r\n newNote.appendChild(noteView)\r\n\r\n const noteDelete = document.createElement('button')\r\n noteDelete.innerHTML = '<i class=\"fas fa-trash\"></i>'\r\n noteDelete.classList.add('note--delete-btn')\r\n newNote.appendChild(noteDelete)\r\n\r\n noteContainer.appendChild(newNote)\r\n\r\n console.log(noteText.innerText)\r\n\r\n inputText.value = ''\r\n}", "function signalrAnnounceComment(postID, op, commentWriterId ) {\n\n let targetbuttonId = 'txtBox_' + postID;\n\n let commentContent = document.getElementById(targetbuttonId).value;\n\n $.connection.linkedInHub.server.announceComment({ PostId: postID, PostUserId: op, CommentWriterId: commentWriterId, CommentContent: commentContent });\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}", "get saveButton() {\n return {\n command: \"save\",\n icon: \"save\",\n label: \"Save\",\n type: \"rich-text-editor-button\",\n };\n }", "function onConfirm(buttonIndex) {\n alert('You selected button ' + buttonIndex);\n}", "function getReadEditButton(pk, state, small=false) {\n\n let bReadText = '';\n let bReadIcon = '';\n let bReadTarget = '';\n\n if (state) {\n bReadText = '{% trans \"Mark as unread\" %}';\n bReadIcon = 'fas fa-bookmark icon-red';\n bReadTarget = 'unread';\n } else {\n bReadText = '{% trans \"Mark as read\" %}';\n bReadIcon = 'far fa-bookmark icon-green';\n bReadTarget = 'read';\n }\n\n let style = (small) ? 'btn-sm ' : '';\n\n return `<button title='${bReadText}' class='notification-read btn ${style}btn-outline-secondary float-right' type='button' pk='${pk}' target='${bReadTarget}'><span class='${bReadIcon}'></span></button>`;\n}", "clickYes() {\n return this\n .waitForElementVisible('@topicFormYesBtn')\n .click('@topicFormYesBtn');\n }", "function makeActionBtns(targetRow, projectId) {\n targetRow.lastElementChild.innerHTML = `<a href='/{{user.username}}/project/${projectId}/track' class='btn btn-primary track'><i class=\"ph-timer ph-lg\"></i> Track</a>\n <button data-trigger='hover' data-container='button' data-toggle=\"tooltip\" data-placement='top' title=\"Edit project details\" class='btn icon edit'><i class=\"ph-pencil-simple ph-lg edit\"></i></button>\n <button data-trigger='hover' data-container='button' data-toggle=\"tooltip\" data-placement='top' title=\"Delete\" class='btn icon delete'><i class=\"ph-trash-simple delete ph-lg\"></i></button>`;\n handleTooltips();\n}", "function createButtons(){\n\n if(currentEvent.type === 'no-action'){\n var confirm = document.createElement('button');\n confirm.id = 'confirm';\n confirm.textContent = 'Proceed';\n btnContainer.appendChild(confirm);\n\n } else {\n var acceptRisk = document.createElement('button');\n acceptRisk.id = 'accept';\n acceptRisk.textContent = 'Risk it!';\n var rejectRisk = document.createElement('button');\n rejectRisk.id = 'reject';\n rejectRisk.textContent = 'No Way!';\n btnContainer.appendChild(acceptRisk);\n btnContainer.appendChild(rejectRisk);\n }\n\n btnContainer.addEventListener('click', choiceClick);\n}", "function newNote() {\n var csrftoken = $.cookie('csrftoken'),\n folder_id = $('.folder-list>.active>a').attr(\"data-folderid\"),\n data = {\n title: \"Untitled note\",\n body: \"<br>\",\n folder_id: folder_id,\n csrfmiddlewaretoken: csrftoken\n };\n $.post(\"/notes/addnote/\", data, function (data) {\n $('#notelist').children().prepend(data).children().first().trigger('click');\n $('#title').empty();\n });\n }", "function addRemediationItemComment(id, btnName, btnText, title) {\n var params = {\n remediationItemId : id\n };\n \n // prevent the okay button from being clicked multiple times.\n var clicked = false;\n\n var windowUrl = CONTEXT_PATH + \"/workitem/remediationItemCommentPanel.jsf?\" + Ext.Object.toQueryString(params);\n\n SailPoint.confirm( {\n url : windowUrl,\n options : {\n method : 'get'\n }\n }, {\n windowParameters : {\n className : 'sailpoint',\n title : title\n },\n okLabel : btnText,\n cancelLabel : \"#{msgs.button_cancel}\",\n ok : function(win) {\n // Make sure the user can't double click the ok button.\n if (!clicked) {\n clicked = true;\n Ext.getDom(btnName).click();\n return false;\n }\n },\n cancel : function(win) {\n SailPoint.NavigationHistory.back();\n Ext.getDom('editForm:id').value = workItemId;\n return true;\n },\n callback : function() {\n Ext.getDom('editForm:id').value = id;\n },\n buttonAlign : 'center'\n } );\n}" ]
[ "0.6704172", "0.6655943", "0.65650445", "0.63859004", "0.6303029", "0.62033916", "0.6119666", "0.6116401", "0.60906357", "0.6060411", "0.6059917", "0.6045325", "0.5977627", "0.5947365", "0.5937937", "0.59128815", "0.58957195", "0.5885357", "0.5877614", "0.58743775", "0.58650184", "0.58572835", "0.5844212", "0.58342135", "0.5818137", "0.5816145", "0.58121616", "0.57990354", "0.57706505", "0.5757615", "0.57469636", "0.5732612", "0.571522", "0.5712187", "0.56973904", "0.56946385", "0.56930614", "0.5674124", "0.56732816", "0.5672948", "0.56715876", "0.56590134", "0.5655621", "0.5653424", "0.5650341", "0.56469405", "0.56452453", "0.5644157", "0.56303185", "0.5626822", "0.56222576", "0.5613841", "0.5600984", "0.5597961", "0.5592784", "0.55800676", "0.5578892", "0.5566321", "0.55574965", "0.5557134", "0.5553794", "0.55502737", "0.55394685", "0.5535926", "0.5533645", "0.55253613", "0.55231017", "0.5519663", "0.5510593", "0.5508833", "0.5506841", "0.54977095", "0.54958504", "0.54932857", "0.5492695", "0.5490367", "0.54866767", "0.5485693", "0.5482794", "0.5479785", "0.5477966", "0.5468626", "0.54684883", "0.5466109", "0.5464407", "0.5463734", "0.5460315", "0.5456046", "0.54527265", "0.54517484", "0.5449207", "0.5449168", "0.5449112", "0.54441726", "0.5437488", "0.54374707", "0.5437236", "0.5426235", "0.5423939", "0.5419731" ]
0.7303158
0
Image for createBtnConfirm function
function createImgConfirm() { let imgConfirm = document.createElement("img"); imgConfirm.src = "media/check.svg"; imgConfirm.alt = "confirm button"; imgConfirm.width = "32"; imgConfirm.height = "32"; imgConfirm.title = "Confirm"; return imgConfirm; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBtnConfirm() {\n let btnConfirm = document.createElement(\"button\");\n btnConfirm.className = \"note-button note-button-bottom\";\n btnConfirm.addEventListener(\"click\", function () {\n saveNotesToLocalStorage();\n });\n btnConfirm.appendChild(createImgConfirm());\n return btnConfirm;\n}", "function createAcceptButton() {\n\n let notAccept = document.createElement('a');\n notAccept.classList.add('col', 'px-0', 'col-sm-1');\n\n let notAcceptImg = document.createElement('img');\n notAcceptImg.src = \"/icons/check.svg\";\n notAcceptImg.classList.add('img-fluid', 'notify-action-button', 'check');\n notAcceptImg.alt = \"Accept Notification\";\n notAccept.appendChild(notAcceptImg);\n\n return notAccept;\n}", "function onConfirm(buttonIndex) {}", "function add_delBttn (obj, text)\r\n {\r\n bttn = obj.add(\"button\", undefined, \"X\");\r\n //bttn = obj.add(\"image {helpTip:\\\"Remove asset\\\", image: \\\"\"+(icons_folder+\"delete_asset.png\")+\"\\\"}\");\r\n bttn.preferredSize = [20,20];\r\n bttn.helpTip = text;\r\n // give onClick\r\n bttn.onClick = function () { delete_BG_asset (this); };\r\n return bttn;\r\n }", "function setupCardChoices() { \r\n /*Setup Two choices*/\r\n backgroundImg.createNewButton(\"yesButton\", \"Yes\", 300, 360,\"bold 30px Arial\", \"black\", \"blue\");\r\n backgroundImg.createNewButton(\"noButton\", \"No\", 400, 360,\"bold 30px Arial\", \"black\", \"blue\");\r\n}", "function makeButton(backgroundImage, title, type) {\n var button = L.DomUtil.create(\"a\", \"leaflet-control-view-\" + type);\n button.title = title;\n button.href = \"#\";\n button.setAttribute(\"role\", \"button\");\n button.setAttribute(\"aria-label\", title);\n button.style.backgroundImage = \"url(\" + backgroundImage + \")\";\n button.style.backgroundSize = \"contain\";\n\n return button;\n }", "function createdeletepicprompt(yescb, nocb, dontpromptcb) {\n\n // Containing div\n var promptdiv = $(dc('div'))\n .css('display', 'none');\n\n // Paragraph\n var questionp = $(dc('p'))\n .css('border', 'none');\n //.css('padding', rmargin + 'px');\n\n // Text label\n var label = $(dc('label'))\n .html('Delete this picture?');\n\n // Build label paragraph\n label.appendTo(questionp);\n\n // Button paragraph\n var buttonp = $(dc('p'))\n .css('border', 'none')\n .css('padding', '0px');\n\n // Yes button\n var yesbutton = $(dc('input'))\n .attr('type', 'button')\n .css('width', popupbuttonwidth + 'px')\n .css('margin-right', buttonmargin + 'px')\n .css('margin-left', buttonmargin + 'px')\n .attr('value', 'Confirm');\n\n // No button\n var nobutton = $(dc('input'))\n .attr('type', 'button')\n .css('width', popupbuttonwidth + 'px')\n .css('margin-right', buttonmargin + 'px')\n .css('margin-left', buttonmargin + 'px')\n .attr('value', 'Cancel');\n\n // Don't prompt button\n var dontprompt = $(dc('input'))\n .attr('type', 'button')\n .css('margin-right', buttonmargin + 'px')\n .css('margin-left', buttonmargin + 'px')\n .css('width', popupbuttonwidth + 'px')\n .attr('value', 'Don\\'t show this prompt');\n\n // Create yes button if callback was passed\n if(yescb) {\n yesbutton.click(function(){yescb();});\n }\n\n // Create no button if callback was passed\n if(nocb) {\n nobutton.click(function(){nocb();});\n }\n\n // Create dont prompt button if callback was passed\n if(dontpromptcb) {\n dontprompt.click(function(){dontpromptcb();});\n }\n\n // Append to modal\n yesbutton.appendTo(buttonp);\n nobutton.appendTo(buttonp);\n\n // Show this only if it's enabled\n if(showdontprompt)\n dontprompt.appendTo(buttonp);\n\n // Build div\n questionp.appendTo(promptdiv);\n buttonp.appendTo(promptdiv);\n\n // Return completed prompt\n return promptdiv;\n }", "function createButton(value) {\n value.accept = value.accept !== false;\n const defaultLabel = value.accept ? 'OK' : 'Cancel';\n return {\n label: value.label || defaultLabel,\n iconClass: value.iconClass || '',\n iconLabel: value.iconLabel || '',\n caption: value.caption || '',\n className: value.className || '',\n accept: value.accept,\n actions: value.actions || [],\n displayType: value.displayType || 'default'\n };\n }", "function createButton(icon) {\n const image = document.createElement('img')\n image.src = icon.src\n image.classList.add(CLASSES.ICON_IMG)\n if (icon.spinning) {\n image.classList.add(CLASSES.ICON_IMG_SPINNING)\n }\n const container = document.createElement('div')\n container.title = icon.title\n container.classList.add(CLASSES.ICON_CONTAINER)\n container.classList.add(CLASSES.ICON_CONTAINER_BUTTON)\n container.appendChild(image)\n return container\n}", "function createDeleteButton() {\n const deleteButtonElement = document.createElement('button');\n deleteButtonElement.className = \"btn bg-transparent delete-button\";\n\n const trashImgElement = document.createElement(\"img\");\n trashImgElement.src = \"images/recycle.png\";\n\n deleteButtonElement.appendChild(trashImgElement);\n return deleteButtonElement;\n}", "GetTemplateActionImagesButton(){\n // Bouton Logout sous forme d'image\n const LogoutSvg = \"PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAwMCAxMDAwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8bWV0YWRhdGE+IFN2ZyBWZWN0b3IgSWNvbnMgOiBodHRwOi8vd3d3Lm9ubGluZXdlYmZvbnRzLmNvbS9pY29uIDwvbWV0YWRhdGE+CjxnPjxwYXRoIGQ9Ik03NTcuNSwxNTIuMWMzMC4xLDIyLDU2LjksNDYuOCw4MC4zLDc0LjZjMjMuNCwyNy44LDQzLjUsNTcuOCw2MC4yLDkwLjFjMTYuNywzMi4zLDI5LjQsNjYuNCwzOC4xLDEwMi40YzguNywzNiwxMy4xLDcyLjYsMTMuMSwxMDkuNmMwLDYzLjgtMTEuOSwxMjMuNy0zNS42LDE3OS42Yy0yMy43LDU1LjktNTUuOSwxMDQuNy05Ni40LDE0Ni4yYy00MC41LDQxLjUtODgsNzQuNS0xNDIuNSw5OC44QzYyMC4xLDk3Ny44LDU2MS43LDk5MCw0OTkuNSw5OTBjLTYxLjYsMC0xMTkuNi0xMi4yLTE3NC4xLTM2LjVjLTU0LjUtMjQuNC0xMDIuMi01Ny4zLTE0My05OC44Yy00MC44LTQxLjUtNzIuOS05MC4zLTk2LjQtMTQ2LjJjLTIzLjQtNTUuOS0zNS4xLTExNS44LTM1LjEtMTc5LjZjMC0zNi40LDQuMi03Mi4xLDEyLjYtMTA3LjFjOC40LTM1LDIwLjItNjguMywzNS42LTk5LjhjMTUuNC0zMS42LDM0LjUtNjEuMSw1Ny4yLTg4LjVjMjIuOC0yNy41LDQ4LjItNTIuMiw3Ni4zLTc0LjFjMTQuNy0xMSwzMC42LTE1LjEsNDcuNy0xMi40YzE3LjEsMi43LDMwLjksMTEuMyw0MS43LDI1LjdjMTAuNywxNC40LDE0LjcsMzAuNSwxMiw0OC40Yy0yLjcsMTcuOC0xMSwzMi4zLTI1LjEsNDMuMmMtNDIuMiwzMS42LTc0LjQsNzAuMy05Ni45LDExNi4zYy0yMi40LDQ2LTMzLjYsOTUuNC0zMy42LDE0OC4yYzAsNDUuMyw4LjQsODgsMjUuMSwxMjguMmMxNi43LDQwLjEsMzkuNiw3NS4xLDY4LjgsMTA1YzI5LjEsMjkuOSw2My4yLDUzLjUsMTAyLjQsNzFjMzkuMSwxNy41LDgwLjgsMjYuMywxMjUsMjYuM2M0NC4yLDAsODUuOC04LjgsMTI1LTI2LjNjMzkuMS0xNy41LDczLjMtNDEuMiwxMDIuNC03MWMyOS4xLTI5LjksNTIuMi02NC45LDY5LjMtMTA1YzE3LjEtNDAuMiwyNS42LTgyLjksMjUuNi0xMjguMmMwLTUzLjUtMTItMTA0LjEtMzYuMS0xNTEuOGMtMjQuMS00Ny43LTU3LjktODctMTAxLjQtMTE3LjljLTE0LjctMTAuMy0yMy42LTI0LjQtMjYuNi00Mi4yYy0zLTE3LjksMC41LTM0LjMsMTAuNS00OS40YzEwLTE0LjQsMjMuOC0yMy4yLDQxLjItMjYuMkM3MjYuNywxMzguMiw3NDIuNywxNDEuOCw3NTcuNSwxNTIuMUw3NTcuNSwxNTIuMXogTTQ5OS41LDUzMS45Yy0xNy40LDAtMzIuMy02LjMtNDQuNy0xOWMtMTIuNC0xMi43LTE4LjYtMjgtMTguNi00NS44Vjc1LjljMC0xNy44LDYuMi0zMy4zLDE4LjYtNDYuM2MxMi40LTEzLDI3LjMtMTkuNiw0NC43LTE5LjZjMTguMSwwLDMzLjMsNi41LDQ1LjcsMTkuNmMxMi40LDEzLDE4LjYsMjguNSwxOC42LDQ2LjN2MzkxLjJjMCwxNy44LTYuMiwzMy4xLTE4LjYsNDUuOEM1MzIuOCw1MjUuNiw1MTcuNiw1MzEuOSw0OTkuNSw1MzEuOUw0OTkuNSw1MzEuOXoiLz48L2c+Cjwvc3ZnPg==\"\n const UserConfigSvg = \"PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaWQ9IkxheWVyXzEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyOCAxMjg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAxMjggMTI4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM0RjRGNEY7fQoJLnN0MXtmaWxsOiNGRkZGRkY7fQo8L3N0eWxlPjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjY0IiBjeT0iNjQiIHI9IjY0Ii8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTc3LjQsNzUuM2MtMi0wLjMtMy40LTEuOS0zLjQtMy45di01LjhjMi4xLTIuMywzLjUtNS4zLDMuOC04LjdsMC4yLTMuMmMxLjEtMC42LDIuMi0yLDIuNy0zLjggIGMwLjctMi41LDAuMS00LjctMS41LTQuOWMtMC4yLDAtMC40LDAtMC43LDBsMC40LTUuOUM3OS42LDMwLjksNzMuMywyNCw2NS4zLDI0aC0yLjVjLTgsMC0xNC4zLDYuOS0xMy44LDE1LjFsMC40LDYgIEM0OS4yLDQ1LDQ5LDQ1LDQ4LjgsNDVjLTEuNiwwLjItMi4yLDIuNC0xLjUsNC45YzAuNSwxLjksMS43LDMuMywyLjgsMy45bDAuMiwzLjFjMC4yLDMuNCwxLjYsNi40LDMuNyw4Ljd2NS44YzAsMi0xLjQsMy42LTMuNCwzLjkgIEM0MS44LDc2LjgsMjcsODMuMiwyNyw5MHYxNGg3NFY5MEMxMDEsODMuMiw4Ni4yLDc2LjgsNzcuNCw3NS4zeiIvPjwvc3ZnPg==\"\n const GoToAppAdminSvg = \"PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMTIwMC4wMDAwMDBwdCIgaGVpZ2h0PSIxMjgwLjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMTIwMC4wMDAwMDAgMTI4MC4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KPG1ldGFkYXRhPgpDcmVhdGVkIGJ5IHBvdHJhY2UgMS4xNSwgd3JpdHRlbiBieSBQZXRlciBTZWxpbmdlciAyMDAxLTIwMTcKPC9tZXRhZGF0YT4KPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsMTI4MC4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiCmZpbGw9IiMwMDAwMDAiIHN0cm9rZT0ibm9uZSI+CjxwYXRoIGQ9Ik04NTAwIDEyNzkzIGMtMjAzIC0xOSAtMjUyIC0yNCAtMjY0IC0yOSAtMjEgLTggLTY3IC00MDEgLTg0IC03MTgKbC03IC0xMjkgLTExMCAtMjcgYy02MCAtMTUgLTE0NCAtNDEgLTE4NSAtNTggLTEwNSAtNDMgLTMzNyAtMTU0IC0zOTcgLTE5MQotMjggLTE3IC01MyAtMzEgLTU1IC0zMSAtMyAwIC0xNTEgMTIwIC0zMjkgMjY2IC0xNzggMTQ2IC0zMzAgMjY4IC0zMzYgMjcxCi0yNCAxMCAtMjI5IC0xNjQgLTM4MiAtMzIzIC0xNDcgLTE1MiAtMzE1IC0zNjIgLTMwMyAtMzc3IDQzIC01NyAyMDcgLTI1OQozNDcgLTQyNyA5NCAtMTEzIDE3NSAtMjExIDE3OSAtMjE4IDQgLTggLTkgLTM4IC0zNCAtNzggLTY3IC0xMDYgLTE0NSAtMjcxCi0xODAgLTM3OSAtMTggLTU1IC00MyAtMTMyIC01NiAtMTcyIC0xMyAtMzkgLTI0IC03OCAtMjQgLTg2IDAgLTExIC0xOSAtMTYKLTcyIC0yMSAtMzkwIC0zNiAtNzY1IC03OSAtNzc1IC05MCAtMzEgLTMwIC01MSAtNDMyIC0zNCAtNjQ5IDEyIC0xNTEgMzUKLTMxNSA0NiAtMzI1IDQgLTUgMjk5IC0zNCA3NTcgLTc3IGw3NyAtNyA2IC00MSBjNCAtMjMgMTUgLTYyIDI1IC04NyAxMCAtMjUKMzQgLTk3IDU0IC0xNjEgMzkgLTEyMSAxMjAgLTI5MyAxODcgLTM5MyAyMiAtMzMgMzggLTY1IDM1IC03MyAtMyAtNyAtODMKLTEwNiAtMTc5IC0yMjAgLTI2NCAtMzE2IC0zNDggLTQyMyAtMzQwIC00MzYgMzQgLTYwIDE5NSAtMjQ5IDMwOCAtMzYzIDE0OQotMTUwIDM4MiAtMzQ0IDM5MyAtMzI4IDQgNiA5OSA4NiAyMTIgMTc5IDExMyA5MyAyNTAgMjA3IDMwNSAyNTQgNTUgNDggMTA3CjkyIDExNyA5OSAxNCAxMSAzMyA0IDEzMCAtNTEgMTM0IC03NiAyOTkgLTE0NCA0NTkgLTE4NyA2MyAtMTcgMTIxIC0zNSAxMjcKLTM5IDggLTUgMjMgLTEwOSA0MiAtMzAyIDMwIC0yOTMgNTcgLTUyNCA2NCAtNTQ1IDggLTIxIDMxMCAtMzcgNTY5IC0zMSAyMDYKNSA0MDcgMjQgNDIzIDM5IDIgMyAyMCAxODAgMzkgMzk0IDIwIDIxNCAzOCA0MDQgNDEgNDIyIDYgMzggNCAzNyAxNzcgODggMTQ1CjQzIDMzOCAxMjggNDU1IDIwMSA0NyAzMCA5MCA1MiA5NiA0OSA2IC0yIDY3IC01MiAxMzYgLTExMSAyMzIgLTIwMCA1MjIgLTQyNgo1MzcgLTQyMSAyNyAxMSAxMzggOTYgMjAwIDE1MyAxMjkgMTIwIDQ4MyA1MjEgNDgzIDU0NyAwIDMgLTExNCAxNDEgLTI1MiAzMDcKLTEzOSAxNjUgLTI2MyAzMTMgLTI3NSAzMjggbC0yMiAyNyA1OSAxMTQgYzc5IDE1MSAxNTYgMzQ0IDE4OSA0NzEgbDI2IDEwNAoxODUgMTcgYzEwMiA5IDI5NCAyNyA0MjcgMzkgbDI0MiAyMyA2IDI2IGMxMyA2MyAyNiAyMTkgMzEgMzgwIDkgMjM3IC0xNyA1ODIKLTQ0IDU5OSAtNyA0IC0xOTcgMjQgLTQyNCA0NSAtMjI3IDIxIC00MTYgNDAgLTQyMCA0MiAtNCAyIC0xMiAzMCAtMTggNjIgLTI3CjEzNyAtMTE1IDM2NCAtMjA2IDUzMyBsLTY1IDEyMSAzOCA0NiBjMjEgMjYgMTM5IDE3MSAyNjQgMzIzIDEyNCAxNTIgMjI5IDI4MQoyMzMgMjg4IDggMTIgLTcxIDExMyAtMjAzIDI2MCAtMTQ2IDE2MiAtNDgxIDQ1MSAtNTA0IDQzNCAtODMgLTYzIC0zODIgLTMwNQotNDg3IC0zOTQgLTc1IC02MiAtMTQyIC0xMTkgLTE1MSAtMTI2IC0xMiAtMTAgLTU0IDcgLTIyOSA5NiAtMTUzIDc2IC0yNDcKMTE2IC0zMjUgMTM5IC02MCAxOCAtMTIwIDMyIC0xMzIgMzIgLTI1IDAgLTI1IC0zIC00OSAyNTUgLTE3IDE5MSAtNjQgNjA4Ci02OCA2MTIgLTggOCAtMTI2IDIzIC0yNTIgMzIgLTEzMCAxMCAtMzcyIDEyIC00NTQgNHogbTQ1NSAtMjA5NCBjMjE3IC0zNgo0MjcgLTE1MSA2MTAgLTMzMyAxNzkgLTE3OCAyODkgLTM3NCAzMzUgLTYwMSAxMDQgLTUwMSAtOTkgLTk5OCAtNTIwIC0xMjc2Ci0xOTIgLTEyNyAtMzc4IC0xODYgLTYxNiAtMTk2IC0yMjIgLTEwIC0zODggMjQgLTU3OSAxMTcgLTIzOSAxMTcgLTQxOSAyOTMKLTU0NiA1MzQgLTk2IDE4MyAtMTM0IDM0MyAtMTMzIDU3MSAxIDI4MSA3NyA1MDcgMjQ0IDcyMyAyMTIgMjc1IDUwMCA0NDYgNzk1CjQ3MSAxMTEgOSAzMjkgNCA0MTAgLTEweiIvPgo8cGF0aCBkPSJNODUwMCAxMDUyMSBjLTM2NSAtODAgLTY2MyAtMzU5IC03NzcgLTcyNyAtMjUgLTgzIC0yNyAtMTAxIC0yNwotMjc5IC0xIC0yMDcgNCAtMjM4IDY1IC0zOTYgNjUgLTE2OSAyMzUgLTM3OCAzOTggLTQ4OCA5MCAtNjEgMjE0IC0xMTcgMzE3Ci0xNDMgMTI4IC0zMiAzNzIgLTMyIDQ5MCAwIDE0MCAzOCAyNDEgODYgMzU0IDE3MCAzMjAgMjM4IDQ3MyA1ODMgNDMwIDk3MAotMjcgMjUwIC0xMjQgNDQ4IC0zMDEgNjE3IC0xMzQgMTI4IC0yNzQgMjEwIC00NDggMjYyIC0xMTkgMzUgLTM3MSA0MyAtNTAxCjE0eiBtMzgyIC0yNTYgYzIyOCAtNDggNDQwIC0yMDkgNTM3IC00MDcgMTcgLTM1IDQxIC0xMDEgNTIgLTE0NyAxOCAtNzMgMjEKLTEwNSAxNyAtMjM1IC00IC0xMzIgLTggLTE2MSAtMzQgLTIzNiAtNzYgLTIyNyAtMjk4IC00MjkgLTU0NiAtNDk2IC03NiAtMjEKLTI5MCAtMjQgLTM1OCAtNSAtMTQ3IDQwIC0yNjcgMTEwIC0zNzQgMjE3IC00NSA0NCAtOTYgMTA2IC0xMTUgMTM3IC0yMjIgMzczCi0xMDUgODYyIDI1OSAxMDc4IDc0IDQzIDE4NiA4NyAyNjAgOTkgNzUgMTMgMjMxIDEwIDMwMiAtNXoiLz4KPHBhdGggZD0iTTQ3MTYgODQ0OCBjLTc1IC0xOTEgLTE2MiAtNDI4IC0yNTEgLTY4MCBsLTk4IC0yNzggLTEyMiAwIGMtMjMxIDAKLTU4MyAtNDcgLTc4OCAtMTA2IC03MCAtMjAgLTEyOSAtMzUgLTEzMSAtMzMgLTEgMiAtMzYgNTEgLTc3IDEwOSAtMTQwIDIwMAotNTcwIDc5MCAtNTc1IDc5MCAtMTAgMCAtMTgxIC02OCAtMjE5IC04OCAtMjIgLTExIC03NCAtMzYgLTExNSAtNTYgLTQxIC0xOQotMTIwIC02MSAtMTc1IC05NCAtNTUgLTMyIC0xNDggLTg3IC0yMDcgLTEyMiAtMTA1IC02MiAtMjUwIC0xNjYgLTM0MiAtMjQ1CmwtNDYgLTQxIDEyMCAtMjU5IGM2NyAtMTQzIDE3MSAtMzY3IDIzMiAtNDk4IGwxMTEgLTIzOCAtNzYgLTc3IGMtMTk2IC0yMDAKLTQzMyAtNTExIC01MTMgLTY3NSAtMTYgLTMyIC0zMiAtNTcgLTM3IC01NyAtNCAwIC0xNDYgMjQgLTMxNSA1NCAtMzI5IDU4Ci03NzMgMTI5IC03NzcgMTI0IC04IC04IC0xMDMgLTI0OCAtMTQwIC0zNTMgLTUxIC0xNDYgLTEzNSAtNTU4IC0xNzAgLTg0MApsLTYgLTUwIDUwOCAtMTk1IDUwOCAtMTk1IDIgLTk1IGM0IC0xNzEgMjMgLTM4MSA0NCAtNDg5IDExIC01OCAyNyAtMTQxIDM1Ci0xODMgOCAtNDMgMjYgLTExNiAzOSAtMTYzIDE0IC00NyAyNSAtOTIgMjUgLTEwMCAwIC03IC05MyAtODAgLTIwNyAtMTYxCi0xMTUgLTgxIC0zMTMgLTIyNCAtNDQxIC0zMTggLTIwOCAtMTUyIC0yMzIgLTE3MyAtMjI3IC0xOTMgMjIgLTg4IDIxNiAtNDY0CjM0NiAtNjcyIDc0IC0xMTYgMjIzIC0zMzAgMjY0IC0zNzggbDMwIC0zNCAxNzUgODEgYzE3MiA4MSA3MzYgMzM5IDc5NiAzNjUKbDMwIDE0IDEzNSAtMTI1IGMxNjkgLTE1OCAyNTMgLTIyMSA0ODIgLTM2MSAxMzggLTg0IDE4MiAtMTE2IDE4MCAtMTMwIC0xCi0xMCAtMjIgLTE0MiAtNDcgLTI5MyAtNDQgLTI2NiAtMTE2IC03NDggLTExNiAtNzczIDAgLTcgMTUgLTE4IDMzIC0yNiAyMjUKLTkwIDQyNiAtMTUyIDcxNSAtMjIwIDE5MyAtNDYgNDczIC05NCA0ODMgLTgzIDE4IDIwIDI2MSA2NTkgMzU1IDkyOSBsMzggMTEzCjE1MiAwIGMyNjIgMCA0NDcgMjYgNzEyIDEwMiAxMjIgMzQgMTQ2IDM4IDE1NyAyNyA3IC04IDE1MyAtMjEyIDMyNSAtNDU0IDE3MgotMjQyIDMxNCAtNDQyIDMxNiAtNDQzIDMgLTQgOTEgMzcgMzYxIDE3MCAxMTIgNTUgMjQzIDEzMCAzNDUgMTk3IDE0NSA5NiAzMzEKMjMzIDM4MSAyODEgMTggMTYgMTUgMjUgLTgxIDI0MSAtNTUgMTIzIC0xNTkgMzUwIC0yMzAgNTA0IGwtMTMwIDI3OSAxMTcgMTI2CmMxNjAgMTcwIDMwNSAzNjggNDA1IDU1MiAyNSA0OCA1MCA4OSA1NCA5MSA0IDIgOTUgLTExIDIwMiAtMjkgNTU5IC05NCA4ODMKLTE0NSA4OTQgLTE0MSAyMiA5IDE3OCA0NTMgMjIxIDYyNyA4IDM2IDIwIDc1IDI1IDg3IDkgMjEgNzMgMzgyIDg0IDQ3NSBsNgo0NyAtNDggMjEgYy02MiAyOCAtNDgwIDE4NiAtNzY0IDI5MCBsLTIyOCA4MyAwIDE1NiBjMCAxNzkgLTEwIDI4MSAtNDEgNDQ4Ci0xOCA5OSAtNjcgMzE0IC04NSAzNzUgLTQgMTIgNDQgNTEgMTg4IDE1NCAyMTcgMTU1IDY5NSA1MTEgNzAzIDUyNSA3IDExIC02MQoxNzEgLTE0MyAzMzQgLTExNiAyMzMgLTI2NiA0NjggLTQyNCA2NjcgbC03NyA5NyAtMTMzIC01OCBjLTE4NCAtODEgLTQ4MAotMjE3IC02ODcgLTMxNyBsLTE3MyAtODQgLTEzNCAxMjcgYy0xNDIgMTM0IC0zMTQgMjY4IC00MjkgMzM2IC02MCAzNSAtMTgzCjExNiAtMjA4IDEzNyAtNCA0IDExIDEyMyAzMyAyNjYgMTEyIDcxNCAxMzEgODM2IDEyOCA4MzkgLTIgMSAtNzMgMjkgLTE1OCA2MgotMTgwIDcwIC0zOTkgMTQzIC00MzEgMTQzIC0xMiAwIC00NyA5IC03OCAxOSAtODAgMjggLTQ4OCAxMTAgLTU0NiAxMTEgLTE2IDAKLTI2IC0xNiAtNDkgLTcyeiBtLTE4MSAtMjYyMyBjMjc2IC00OSA1NjQgLTE4NCA3NzIgLTM2MyAyNDYgLTIxMiA0NjAgLTU5OQo1MTggLTkzNiAyMiAtMTI3IDIwIC0zNDcgLTQgLTQ4OCAtNDQgLTI1NSAtMTU0IC01MjUgLTI4NSAtNjk4IC0yMzEgLTMwNwotNjMxIC01NDggLTEwMjAgLTYxNSAtMTE0IC0xOSAtMzM0IC0xOSAtNDU0IDAgLTIyOCAzNyAtNDg2IDEzMCAtNjQ2IDIzMwotMzU2IDIzMCAtNjIwIDYyNSAtNzAyIDEwNTIgLTI0IDEyNyAtMjQgMzU4IDAgNDk1IDkwIDUwOSAzMjkgODYyIDc2MSAxMTI2CjExNCA3MCAyOTMgMTQyIDQzMCAxNzUgMTkzIDQ2IDQzOSA1MyA2MzAgMTl6Ii8+CjxwYXRoIGQ9Ik00MTc1IDU2MjMgYy0yMTUgLTI1IC0zMzcgLTYyIC01MTUgLTE1NCAtMzUwIC0xODEgLTU1OSAtNDQ0IC02NjUKLTgzOCAtNTAgLTE4NCAtNTggLTI0MSAtNTkgLTM5MSAwIC0xNDIgMTYgLTI1MiA1NSAtMzcxIDI0IC03NCAxMDkgLTI1OSAxMTkKLTI1OSAzIDAgMzQgLTQyIDY3IC05MiAxNDggLTIyMyAzNTUgLTM4OSA2MDkgLTQ4OCA1MDYgLTE5OCAxMDM3IC05NCAxNDM3CjI4MCAxODAgMTY4IDMyOCA0MzYgMzc4IDY4MiA2OSAzNDMgMTIgNjY0IC0xNzMgOTc0IC0xOTkgMzM1IC00NTkgNTI0IC04NTgKNjIzIC0xMzQgMzMgLTI5MiA0NyAtMzk1IDM0eiBtMzQ1IC0zNzQgYzMxMiAtNzggNTMyIC0yNjEgNjgxIC01NjUgNjggLTE0MQo4MyAtMjE0IDgzIC00MDkgMCAtMTk5IC0xNSAtMjcwIC05MCAtNDI0IC01NSAtMTE1IC0xMTIgLTE5NiAtMTk1IC0yNzkgLTI5MAotMjg1IC02MjcgLTM2OCAtMTAyNCAtMjUyIC0yNTggNzUgLTQ2MiAyNTMgLTU5NSA1MTkgLTEyNyAyNTQgLTEzOSA1NzMgLTMzCjgxNiAxMDUgMjM2IDI4OSA0MjQgNTI1IDUzNSAyMTcgMTAyIDQwOCAxMTkgNjQ4IDU5eiIvPgo8L2c+Cjwvc3ZnPgo=\"\n const GoToHomeSvg = \"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE4LjEuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMjcuMDIgMjcuMDIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI3LjAyIDI3LjAyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBzdHlsZT0iZmlsbDojMDMwMTA0OyIgZD0iTTMuNjc0LDI0Ljg3NmMwLDAtMC4wMjQsMC42MDQsMC41NjYsMC42MDRjMC43MzQsMCw2LjgxMS0wLjAwOCw2LjgxMS0wLjAwOGwwLjAxLTUuNTgxDQoJCWMwLDAtMC4wOTYtMC45MiwwLjc5Ny0wLjkyaDIuODI2YzEuMDU2LDAsMC45OTEsMC45MiwwLjk5MSwwLjkybC0wLjAxMiw1LjU2M2MwLDAsNS43NjIsMCw2LjY2NywwDQoJCWMwLjc0OSwwLDAuNzE1LTAuNzUyLDAuNzE1LTAuNzUyVjE0LjQxM2wtOS4zOTYtOC4zNThsLTkuOTc1LDguMzU4QzMuNjc0LDE0LjQxMywzLjY3NCwyNC44NzYsMy42NzQsMjQuODc2eiIvPg0KCTxwYXRoIHN0eWxlPSJmaWxsOiMwMzAxMDQ7IiBkPSJNMCwxMy42MzVjMCwwLDAuODQ3LDEuNTYxLDIuNjk0LDBsMTEuMDM4LTkuMzM4bDEwLjM0OSw5LjI4YzIuMTM4LDEuNTQyLDIuOTM5LDAsMi45MzksMA0KCQlMMTMuNzMyLDEuNTRMMCwxMy42MzV6Ii8+DQoJPHBvbHlnb24gc3R5bGU9ImZpbGw6IzAzMDEwNDsiIHBvaW50cz0iMjMuODMsNC4yNzUgMjEuMTY4LDQuMjc1IDIxLjE3OSw3LjUwMyAyMy44Myw5Ljc1MiAJIi8+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8L3N2Zz4NCg==\"\n const GoToAppSvg =\"PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCAxNzIgMTcyIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0iYnV0dCIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2UtZGFzaGFycmF5PSIiIHN0cm9rZS1kYXNob2Zmc2V0PSIwIiBmb250LWZhbWlseT0ibm9uZSIgZm9udC13ZWlnaHQ9Im5vbmUiIGZvbnQtc2l6ZT0ibm9uZSIgdGV4dC1hbmNob3I9Im5vbmUiIHN0eWxlPSJtaXgtYmxlbmQtbW9kZTogbm9ybWFsIj48cGF0aCBkPSJNMCwxNzJ2LTE3MmgxNzJ2MTcyeiIgZmlsbD0ibm9uZSI+PC9wYXRoPjxnIGZpbGw9IiMwMDAwMDAiPjxwYXRoIGQ9Ik04NiwxNC4zMzMzM2MtMzkuNDk1NTIsMCAtNzEuNjY2NjcsMzIuMTcxMTUgLTcxLjY2NjY3LDcxLjY2NjY3YzAsMzkuNDk1NTIgMzIuMTcxMTUsNzEuNjY2NjcgNzEuNjY2NjcsNzEuNjY2NjdjMzkuNDk1NTIsMCA3MS42NjY2NywtMzIuMTcxMTUgNzEuNjY2NjcsLTcxLjY2NjY3YzAsLTM5LjQ5NTUyIC0zMi4xNzExNSwtNzEuNjY2NjcgLTcxLjY2NjY3LC03MS42NjY2N3pNODYsMjguNjY2NjdjMzEuNzQ5MjEsMCA1Ny4zMzMzMywyNS41ODQxMiA1Ny4zMzMzMyw1Ny4zMzMzM2MwLDMxLjc0OTIxIC0yNS41ODQxMiw1Ny4zMzMzMyAtNTcuMzMzMzMsNTcuMzMzMzNjLTMxLjc0OTIxLDAgLTU3LjMzMzMzLC0yNS41ODQxMiAtNTcuMzMzMzMsLTU3LjMzMzMzYzAsLTMxLjc0OTIxIDI1LjU4NDEyLC01Ny4zMzMzMyA1Ny4zMzMzMywtNTcuMzMzMzN6TTcxLjY2NjY3LDYxLjE2ODYydjQ5LjY2Mjc2bDQzLC0yNC44MzEzOHoiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==\"\n \n var Div = document.createElement(\"div\")\n Div.setAttribute(\"style\",\"display: flex; flex-direction: row; align-items: center; justify-content: space-around; align-content: center;\")\n var ButtonLogout = document.createElement(\"button\")\n ButtonLogout.setAttribute(\"title\", \"Logout\")\n ButtonLogout.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n ButtonLogout.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); GlobalLogout()})\n ButtonLogout.innerHTML = '<img src=\"data:image/svg+xml;base64,' + LogoutSvg + '\" height=\"100%\" width=\"100%\">'\n Div.appendChild(ButtonLogout)\n\n var ButtonUserConfig = document.createElement(\"button\")\n ButtonUserConfig.setAttribute(\"title\", \"User\")\n ButtonUserConfig.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n ButtonUserConfig.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); CoreXWindowUserConfig.BuildWindow()})\n ButtonUserConfig.innerHTML = '<img src=\"data:image/svg+xml;base64,' + UserConfigSvg + '\" height=\"100%\" width=\"100%\">'\n Div.appendChild(ButtonUserConfig)\n\n var ButtonHome = document.createElement(\"button\")\n ButtonHome.setAttribute(\"title\", \"Home\")\n ButtonHome.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n ButtonHome.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); this._ClickOnHomeFct()})\n ButtonHome.innerHTML = '<img src=\"data:image/svg+xml;base64,' + GoToHomeSvg + '\" height=\"100%\" width=\"100%\">'\n Div.appendChild(ButtonHome)\n\n if(GlobalIsAdminUser()){\n var ButtonGoToApp = document.createElement(\"button\")\n ButtonGoToApp.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n let LocalStorageApp = localStorage.getItem(\"CoreXApp\")\n if(LocalStorageApp == \"App\"){\n ButtonGoToApp.setAttribute(\"title\", \"Go to Admin App\")\n ButtonGoToApp.addEventListener(\"click\", ()=>{this.GoToApp.bind(this, false)()})\n ButtonGoToApp.innerHTML = '<img src=\"data:image/svg+xml;base64,' + GoToAppAdminSvg + '\" height=\"100%\" width=\"100%\">'\n } else {\n ButtonGoToApp.setAttribute(\"title\", \"Go to App\")\n ButtonGoToApp.addEventListener(\"click\", ()=>{this.GoToApp.bind(this, true)()})\n ButtonGoToApp.innerHTML = '<img src=\"data:image/svg+xml;base64,' + GoToAppSvg + '\" height=\"100%\" width=\"100%\">'\n }\n Div.appendChild(ButtonGoToApp)\n }\n return Div\n }", "function llenarBotonCancelado(){\n var retorno='<button type=\"button\" class=\"btn btn-xs btn-default btn-block\"><span class=\"glyphicon glyphicon-hand-down\"></span> Cancelado</button>'\n return retorno\n }", "function createConfirmMsg(){\n\n\tvar confirm = document.createElement(\"div\");\n\tconfirm.className = \"confirm\";\n\tdocument.body.appendChild(confirm);\n\n\tvar confirm_text = document.createElement(\"div\");\n\tconfirm_text.className = \"confirm_text\";\n\tconfirm_text.innerHTML = \"Are you sure?\";\n\tconfirm.appendChild(confirm_text)\n\n\tvar confirm_removal_button = document.createElement(\"button\");\n\tconfirm_removal_button.className = \"confirm_removal\";\n\tconfirm_removal_button.innerHTML = \"Confirm\";\n\tconfirm_removal_button.addEventListener('click', function(){\n\t\talert(\"Send remove request to database\");\n\t\tremoveElement(confirm);\n\t\tvar background = document.getElementsByClassName('background')[0];\n\t\tremoveElement(background);\n\t})\n\n\tconfirm.appendChild(confirm_removal_button);\n\n\tvar cancel_removal_button = document.createElement(\"button\");\n\tcancel_removal_button.className = \"cancel_removal\";\n\tcancel_removal_button.innerHTML = \"Cancel\";\n\tcancel_removal_button.addEventListener('click', function(){\n\t\tremoveElement(confirm);\n\t\tvar background = document.getElementsByClassName('background')[0];\n\t\tremoveElement(background);\n\t})\n\tconfirm.appendChild(cancel_removal_button);\n}", "function createDenyButton() {\n\n let notDeny = document.createElement('a');\n notDeny.classList.add('col', 'px-0', 'col-sm-1');\n\n let notDenyImg = document.createElement('img');\n notDenyImg.src = \"/icons/deny.svg\";\n notDenyImg.classList.add('img-fluid', 'notify-action-button', 'deny');\n notDenyImg.alt = \"Deny Notification\";\n notDeny.appendChild(notDenyImg);\n\n return notDeny;\n}", "function button(refObject) {\n\trefObject.parentNode.style.background=\"url(/img/welcome/button3.gif) no-repeat 0 0 \";\n}", "function createAnimalButton(animal) {\n var button = document.createElement(\"button\");\n var image = document.createElement(\"img\");\n button.className = \"animal-button\";\n button.addEventListener(\"click\", function (event) { return clickStyle(event, animal); });\n image.src = imageURL(animal);\n button.appendChild(image);\n answer.innerHTML = '';\n return button;\n }", "function showConfirm() {\n\t\tnavigator.notification.confirm(\n\t\t\t'Choose source:', // message\n\t\t\tonConfirm, // callback to invoke with index of button pressed\n\t\t\t'Add Photo', // title\n\t\t\t'Camera Roll,Camera' // buttonLabels\n\t\t);\n\t}", "function showConfirm() {\n\t\tnavigator.notification.confirm(\n\t\t\t'Choose source:', // message\n\t\t\tonConfirm, // callback to invoke with index of button pressed\n\t\t\t'Add Photo', // title\n\t\t\t'Camera Roll,Camera' // buttonLabels\n\t\t);\n\t}", "function showConfirm() {\n\t\tnavigator.notification.confirm(\n\t\t\t'Choose source:', // message\n\t\t\tonConfirm, // callback to invoke with index of button pressed\n\t\t\t'Add Photo', // title\n\t\t\t'Camera Roll,Camera' // buttonLabels\n\t\t);\n\t}", "function showConfirm() {\n\t\tnavigator.notification.confirm(\n\t\t\t'Choose source:', // message\n\t\t\tonConfirm, // callback to invoke with index of button pressed\n\t\t\t'Add Photo', // title\n\t\t\t'Camera Roll,Camera' // buttonLabels\n\t\t);\n\t}", "function showConfirm() {\n\t\tnavigator.notification.confirm(\n\t\t\t'Choose source:', // message\n\t\t\tonConfirm, // callback to invoke with index of button pressed\n\t\t\t'Add Photo', // title\n\t\t\t'Camera Roll,Camera' // buttonLabels\n\t\t);\n\t}", "function showConfirm() {\n\t\tnavigator.notification.confirm(\n\t\t\t'Choose source:', // message\n\t\t\tonConfirm, // callback to invoke with index of button pressed\n\t\t\t'Add Photo', // title\n\t\t\t'Camera Roll,Camera' // buttonLabels\n\t\t);\n\t}", "function onConfirm(button)\n\t\t\t{\n\t\n\t\t\t\tif (button == 2){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic6, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.CAMERA, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t\tif (button == 1 ){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic6, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.PHOTOLIBRARY, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "function VButton(columnName, mandatory, isReadOnly, isUpdateable, text, description, help, AD_Process_ID, isLink, isRightLink, AD_Form_ID, isBGProcess, isAskUserBGProcess) {\n\n this.actionListner;\n this.AD_Process_ID = AD_Process_ID;\n this.AD_Form_ID = AD_Form_ID;\n this.description = description;\n this.help = help;\n this.text = text;\n this.isLink = isLink;\n this.isRightLink = isRightLink;\n this.actionLink = null;\n this.isCsv = false;\n this.isPdf = false;\n this.askUserBGProcess = isAskUserBGProcess;\n this.isBackgroundProcess = isBGProcess;\n\n this.values = null;\n\n var $img = $(\"<i title='\" + text + \"'>\");\n\n var $txt = $(\"<span>\").text(text);\n var rootPath = VIS.Application.contextUrl + \"Areas/VIS/Images/base/\";\n\n var $ctrl = null;\n //Init Control\n if (!isLink) {\n $ctrl = $('<button>', { type: 'button', name: columnName });\n $img.css(\"margin-right\", \"8px\");\n $ctrl.append($img).append($txt);\n }\n else {\n $ctrl = $('<li>');\n $ctrl.append($txt).append($img);\n }\n\n //\tSpecial Buttons\n if (columnName.equals(\"PaymentRule\")) {\n this.readReference(195);\n $ctrl.css(\"color\", \"blue\"); //\n setIcon(\"vis vis-payment\"); // 29*14\n }\n else if (columnName.equals(\"DocAction\")) {\n this.readReference(135);\n $ctrl.css(\"color\", \"blue\"); //\n setIcon(\"vis vis-cog\"); // 16*16\n }\n else if (columnName.equals(\"CreateFrom\")) {\n setIcon(\"vis vis-copy\"); // 16*16\n }\n else if (columnName.equals(\"Record_ID\")) {\n setIcon(\"vis vis-find\"); // 16*16\n $ctrl.text(VIS.Msg.getMsg(\"ZoomDocument\"));\n }\n else if (columnName.equals(\"Posted\")) {\n this.readReference(234);\n $ctrl.css(\"color\", \"magenta\"); //\n setIcon(\"fa fa-line-chart\"); // 16*16\n }\n else if (isLink) {\n setIcon(\"vis vis-action\");\n }\n\n function setIcon(img) {\n $img.addClass(img);\n };\n\n IControl.call(this, $ctrl, VIS.DisplayType.Button, isReadOnly, columnName, mandatory);\n\n if (isReadOnly || !isUpdateable) {\n this.setReadOnly(true);\n //this.Enabled = false;\n }\n else {\n this.setReadOnly(false);\n }\n\n var self = this; //self pointer\n var $ulPopup = null;\n\n $ulPopup = getPopupList();\n function getPopupList() {\n var ullst = $(\"<ul class='vis-apanel-rb-ul'>\");\n //ullst.append($(\"<li data-action='D'>\").text(VIS.Msg.getMsg(\"Default\")));\n ullst.append($(\"<li data-action='C'>\").text(VIS.Msg.getMsg(\"OpenCSV\")));\n ullst.append($(\"<li data-action='P'>\").text(VIS.Msg.getMsg(\"OpenPDF\")));\n return ullst;\n };\n\n\n $ctrl.on(VIS.Events.onClick, function (evt) { //click handler\n evt.stopPropagation();\n\n var isReport = null;\n // self.invokeActionPerformed({ source: self });\n if (!self.isReadOnly) {\n var sqlQry = \"VIS_81\";\n var param = [];\n param[0] = new VIS.DB.SqlParam(\"@AD_Process_ID\", AD_Process_ID);\n isReport = executeScalar(sqlQry, param);\n\n\n sqlQry = \"VIS_149\";\n param = [];\n param[0] = new VIS.DB.SqlParam(\"@AD_Process_ID\", AD_Process_ID);\n var isCrystalReport = executeScalar(sqlQry, param);\n\n if (isCrystalReport == \"Y\" && VIS.context.getIsUseCrystalReportViewer()) {\n self.invokeActionPerformed({ source: self });\n }\n else {\n if (isReport == 'Y') {\n $img.w2overlay($ulPopup.clone(true));\n }\n else {\n self.invokeActionPerformed({ source: self });\n }\n }\n }\n });\n\n if ($ulPopup) {\n $ulPopup.on(\"click\", \"LI\", function (e) {\n var target = $(e.target);\n\n if (target.data(\"action\") == \"P\") {\n self.isPdf = true;\n self.isCsv = false;\n }\n else if (target.data(\"action\") == \"C\") {\n self.isCsv = true;\n self.isPdf = false;\n }\n self.invokeActionPerformed({ source: self });\n });\n }\n\n\n this.setText = function (text) {\n if (text == null) {\n $txt.text(\"\");\n return;\n }\n var pos = text.indexOf('&');\n if (pos != -1)\t\t\t\t\t//\tWe have a nemonic - creates ALT-_\n {\n var mnemonic = text.toUpperCase().charAt(pos + 1);\n if (mnemonic != ' ') {\n //setMnemonic(mnemonic);\n text = text.substring(0, pos) + text.substring(pos + 1);\n }\n }\n $txt.text(text);\n\n };\n\n this.disposeComponent = function () {\n $ctrl.off(VIS.Events.onClick);\n $ctrl = null;\n self = null;\n //this.actionListner = null;\n this.AD_Process_ID = null;\n this.description = null;\n this.help = null;\n this.setText = null;\n };\n }", "function confirmation(){\n\t $( \"#confirmation\" ).dialog({\n\t resizable: false,\n\t height:170,\n\t width:375,\n\t autoOpen: false,\n\t modal: true,\n\t buttons: {\n\t \"Oui\": function() {\n\t $( this ).dialog( \"close\" );\n\n\t $('#image').children().remove(); \n\t $('<input type=\"file\" />').appendTo($('#image')); \n\t \t$(\".supprimer_photo\").toggle(false);\n\t \tRecupererimage(); \t \n\t \t \n\t },\n\t \"Annuler\": function() {\n\t $( this ).dialog( \"close\" );\n\t }\n\t }\n\t });\n\t}", "function llenarBotonNegado(){\n var retorno='<button type=\"button\" class=\"btn btn-xs btn-default btn-block\"><span class=\"glyphicon glyphicon-remove-circle\"></span> Negado</button>'\n return retorno\n }", "function okButton(options = {}) {\n options.accept = true;\n return createButton(options);\n }", "function confirmMessageWindowOpen (title,content,NextLink,iconVal = 'far fa-meh-rolling-eyes')\n{\n $.confirm({\n icon: iconVal,\n title: title,\n content: content,\n theme: 'supervan',\n buttons: {\n Next: {\n btnClass: 'btn-blue',\n action:function(){\n window.open(NextLink,'_self','toolbar=yes,scrollbars=yes,resizable=yes');\n }\n }\n }\n });\n}", "function onConfirm(button)\n\t\t\t{\n\t\n\t\t\t\tif (button == 2){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic3, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.CAMERA, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t\tif (button == 1 ){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic3, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.PHOTOLIBRARY, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "function showImageOnButton(uri) {\n //me.getAddImageButtonRef().setHtml('<div class=\"addPhotoButtonHolder\"><img src=\"' + uri + '\" class=\"addPhotoButtonImage\"/></div>');\n\t\t me.getAddImageButtonRef().setHtml('<div class=\"addPhotoButtonHolder\" style=\"background:url(' + uri + '); background-size:cover; background-repeat:no-repeat; background-position:center;\">&nbsp;</div>');\n\t\t}", "buy_tower_btns() {\n var tt = this;\n var ph = loadImage(\"img/ph.jpg\");\n\t//create 3 btns\n tt.normal_tower = tt.add_btn(0, -30, 10, 10, ph);\n tt.ice_tower = tt.add_btn(0, 0, 10, 10, ph);\n tt.poison_tower = tt.add_btn(0, 30, 10, 10, ph);\n //hide the tooltip\n\ttt.hide();\n }", "function onConfirm(button)\n\t\t\t{\n\t\n\t\t\t\tif (button == 2){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic5, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.CAMERA, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t\tif (button == 1 ){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic5, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.PHOTOLIBRARY, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "function do_btn( )\n{ \n\n g_button2 = createButton( \"Save Image\" );\n g_button2.position( 150, 900 );\n g_button2.mousePressed( save_image ); // the callback // will call mousePressed( ) function below\n}", "function onConfirm(button)\n\t\t\t{\n\t\n\t\t\t\tif (button == 2){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic4, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.CAMERA, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t\tif (button == 1 ){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic4, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.PHOTOLIBRARY, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "function llenarBotonCulminado(){\n var retorno='<button type=\"button\" class=\"btn btn-xs btn-default btn-block\"><span class=\"glyphicon glyphicon-pencil\"></span> Culminado</button>'\n return retorno\n }", "function onConfirm(button)\n\t\t\t{\n\t\n\t\t\t\tif (button == 2){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic2, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.CAMERA, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t\tif (button == 1 ){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic2, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.PHOTOLIBRARY, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "function quitConfirm() {\n\tshowOverlay();\n\tgetId('quitText').innerHTML = \"Are you sure you<br>want to QUIT?\";\n\tgetId('buttonLeftText').innerHTML = \"Yes\";\n\tgetId('buttonRightText').innerHTML = \"No\";\n}", "function createButton(left, bottom, icon)\n {\n var b = document.createElement( 'div' );\n b.classList.add(\"whiteboard\");\n b.style.position = \"absolute\";\n b.style.zIndex = 40;\n b.style.left = left + \"px\";\n b.style.bottom = bottom + \"px\";\n b.style.top = \"auto\";\n b.style.right = \"auto\";\n b.style.fontSize = \"16px\";\n b.style.padding = \"3px\";\n b.style.borderRadius = \"3px\";\n b.style.color = \"lightgrey\";\n if (icon)\n {\n b.classList.add(\"fas\");\n b.classList.add(icon);\n }\n reveal.appendChild(b);\n return b;\n }", "function alertUserToImageChanges() {\n\t\t//$('#image-scripts2').html('<span class=\"info\">Do you want to save your changes</span>');\t\n\t\t$(\"#edit-image\").text('Save Changes');\n\t\t$(\"#edit-image\").removeClass('btn btn-success');\n\t\t$(\"#edit-image\").removeClass('btn btn-info');\n\t\t$(\"#edit-image\").addClass('btn btn-warning');\n\t\t$(\"#edit-image\").fadeIn();\n\t\t}", "function onConfirm(button)\n\t\t\t{\n\t\n\t\t\t\tif (button == 2){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic1, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.CAMERA, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t\tif (button == 1 ){\n\t\t\t\t\t{\n\t\t\t\t navigator.camera.getPicture(dump_pic1, photofail,\n\t\t\t\t\t\t { \n\t\t\t\t\t\t\t\t\tquality : 50, \n\t\t\t\t\t\t\t\t\tdestinationType : Camera.DestinationType.DATA_URL, \n\t\t\t\t\t\t\t\t\tsourceType : Camera.PictureSourceType.PHOTOLIBRARY, \n\t\t\t\t\t\t\t\t\tallowEdit : true, \n\t\t\t\t\t\t\t\t\ttargetWidth: 640, \n\t\t\t\t\t\t\t\t\ttargetHeight: 480\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}\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "function buttons() {\n fill(74, 77, 81);\n noStroke();\n rect(butX, butY, 220, 50, 10);\n rect(butX + 250, butY, 220, 50, 10);\n fill(255);\n textSize(20);\n textStyle(NORMAL);\n textAlign(LEFT);\n text(\"Yes, definitely!\", butX + 40, butY + 30);\n text(\"No, not feeling it\", butX + 285, butY + 30);\n}", "function buttonhtml(cellValue, options, rowObject) {\n var btnhtml = \"<button type='button' class='btn btn-primary' id='btn-foto' data-toggle='modal' data-target='#Mod_foto'>Subir Foto</button>\";\n return btnhtml; \n }", "function makeBtn() {\n // Deleting the gifs prior to adding new gifs\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#btnDump\").empty();\n // Looping through the array of movies\n for (var i = 0; i < topics.length; i++) {\n var b = $(\"<button>\");\n b.addClass(\"gifButton\");\n // Adding a data-attribute\n b.attr(\"data-subject\", topics[i]);\n // Providing the initial button text\n b.text(topics[i]);\n // Adding the button to the HTML\n $(\"#btnDump\").append(b);\n }\n }", "function createBtnDelete(obj) {\n let btnDelete = document.createElement(\"button\");\n btnDelete.id = \"delete-button\";\n btnDelete.className = \"note-button\";\n\n btnDelete.addEventListener(\"click\", function () {\n obj.removeNote();\n });\n btnDelete.appendChild(createImgDelete());\n return btnDelete;\n}", "function createButtons(dialog, actionName, confirm) {\n if (confirm == undefined || confirm == '') {\n //No default buttons\n }\n\n //alert(actionName);\n\n //For views that have their own buttons, reset buttonArray = {};\n var buttonArray = {};\n if (actionName == \"CreateAccount\") {\n var autoClose = gDialogEntry.attr(\"autoClose\");\n if (autoClose === \"False\") {\n buttonArray.Save = function () { $('form[name=\"CreateAccountForm\"]').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n\n //replace Create text with Create and Continue;\n var createAndContinue = $(\"span.ui-button-text\");\n createAndContinue.text(\"Create and Continue\");\n }\n else {\n buttonArray.Create = function () { $('form[name=\"CreateAccountForm\"]').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider('yes'); };\n dialog.dialog({ buttons: buttonArray });\n }\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n\n } else if (actionName == \"Wizard\") {\n buttonArray.Back = function () { submitWizardForm('Back'); };\n buttonArray.Continue = function () { submitWizardForm('Continue'); };\n buttonArray.Save = function () { submitWizardForm('Save'); };\n buttonArray.Cancel = function () { confirmDialogDecider('yes'); };\n buttonArray.AddDependent = function () { submitWizardForm('AddDependent'); };\n buttonArray.Finish = function () { submitWizardForm('Finish'); };\n dialog.dialog({ buttons: buttonArray });\n\n\n } else if (actionName == \"ResetPasswordForm\" || actionName == \"ResetPassword\") {\n buttonArray.Create = function () { $('form[name=\"ResetPasswordForm\"]').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider('yes'); };\n dialog.dialog({ buttons: buttonArray });\n var createAndContinue = $(\"span.ui-button-text\");\n createAndContinue.text(\"Create and Continue\");\n\n } else if (actionName == \"ForgotPassword\") {\n\n var autoClose = gDialogEntry.attr(\"autoClose\");\n if (autoClose === \"False\") {\n buttonArray.Save = function () { $('form[name=\"ForgotPasswordForm\"]').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n\n //replace Create text with Create and Continue;\n var createAndContinue = $(\"span.ui-button-text\");\n createAndContinue.text(\"Create and Continue\");\n }\n else {\n buttonArray.Create = function () { $('form[name=\"ForgotPasswordForm\"]').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider('yes'); };\n dialog.dialog({ buttons: buttonArray });\n }\n\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n\n } else if (actionName === \"Create\") {\n var autoClose = gDialogEntry.attr(\"autoClose\");\n if (autoClose === \"False\") {\n buttonArray.Save = function () { $('form').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n\n //replace Create text with Create and Continue;\n var createAndContinue = $(\"span.ui-button-text\");\n createAndContinue.text(\"Create and Continue\");\n }\n else {\n buttonArray.Create = function () { $('form').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n }\n\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"Edit\") {\n buttonArray.Save = function () { $('form').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({\n buttons: buttonArray\n\t\t\t, open: function (event) {\n\t\t\t setButtonStyle($(this).parent().find('.ui-dialog-buttonpane button:contains(\"Delete\")'), 'ui-icon-trash');\n\t\t\t setButtonStyle($(this).parent().find(' button:contains(\"Cancel\")'), 'ui-icon-cancel');\n\t\t\t}\n });\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"Upload\" ||\n actionName === \"EditUpload\" ||\n actionName === \"Contest\") {\n buttonArray.Save = function () { $('form').submit(); };\n buttonArray.Close = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n $(\".ui-dialog-titlebar-close\").hide();\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"View\") {\n buttonArray.Close = function () { dialog.dialog('close'); };\n dialog.dialog({ buttons: buttonArray });\n //$(\".ui-dialog-titlebar-close\").hide();\n } else if (actionName === \"Rearrange\") {\n //TODO check document for rearrange with confirm\n buttonArray.Save = function () { $('form').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"Approval\") {\n buttonArray.Save = function () { $('form').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"AddExisting\") {\n buttonArray.Save = function () { $('form').submit(); };\n buttonArray.Cancel = function () { closeModalDialog(); };\n dialog.dialog({ buttons: buttonArray });\n } else if (actionName === \"AssignAPEHospital\" ||\n actionName === \"AssignProposalAPEHospital\") {\n buttonArray.Save = function () {\n $('form').submit();\n RefreshHospitalsDualListBox();\n };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"Assign\") {\n buttonArray.Save = function () { $('form').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"AssignExclusion\") {\n buttonArray.Save = function () {\n $('#SelectedExclusionId option').attr('selected', 'selected');\n $('form').submit();\n var targetGrid = gDialogEntry.attr(\"targetgrid\");\n _grid_refreshChildWindowGrid(targetGrid);\n dialog.dialog('close');\n };\n buttonArray.Cancel = function () { closeModalDialogConfirm(dialog); };\n dialog.dialog({ buttons: buttonArray });\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"Copy\") {\n buttonArray.Save = function () { $('form').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"WizardCreate\" ||\n actionName === \"WizardEdit\" ||\n actionName === \"WizEdit\") {\n dialog.dialog({ buttons: {} });\n } else if (actionName === \"AccountTransfer\") {\n buttonArray.Save = function () { $('form').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n confirm == 'yes' && _attachConfirmOnCloseButtonDialog(dialog);\n } else if (actionName === \"UploadEmployee\") {\n buttonArray.Save = function () { $('form[name=\"UploadEmployee\"]').submit(); };\n buttonArray.Cancel = function () { confirmDialogDecider(confirm); };\n dialog.dialog({ buttons: buttonArray });\n\n //replace Create text with Create and Continue;\n var createAndContinue = $(\"span.ui-button-text\");\n createAndContinue.text(\"Submit\");\n }\n\n //assign the style of all buttons after creating them!\n //CSS: all elements with ui-button class which are children of ui-dialog class\n //setButtonStyle(\".ui-dialog .ui-button\", null, 'popup-createButtons');\n setButtonStyle(\".ui-dialog-buttonset button\");\n}", "showDeleteBtn() {\n if (this.state.allowDelete) {\n return (\n <Image source={require('../img/deleteText.png')}></Image>\n );\n } else {\n return null;\n }\n }", "function confirm() {\n\n showElement(mainContent);\n hideElement(formConfirm);\n}", "function createButtons(){\n\n if(currentEvent.type === 'no-action'){\n var confirm = document.createElement('button');\n confirm.id = 'confirm';\n confirm.textContent = 'Proceed';\n btnContainer.appendChild(confirm);\n\n } else {\n var acceptRisk = document.createElement('button');\n acceptRisk.id = 'accept';\n acceptRisk.textContent = 'Risk it!';\n var rejectRisk = document.createElement('button');\n rejectRisk.id = 'reject';\n rejectRisk.textContent = 'No Way!';\n btnContainer.appendChild(acceptRisk);\n btnContainer.appendChild(rejectRisk);\n }\n\n btnContainer.addEventListener('click', choiceClick);\n}", "_createButtonIcon(type, parent, onClick) {\n var button = this._createElementUnder('button', parent);\n var span = this._createElementUnder('span', button);\n span.classList.add('material-icons-round');\n span.classList.add('md-24');\n span.innerText = type;\n button.addEventListener(\"click\", onClick);\n return button;\n }", "function CheckImage(btn,sValue) {\n // Check if Image:\n \n if (sValue.substring(0, 4)=='img:') {\n //console.log(btn.id+' is image')\n let ButtonImage = document.createElement('img');\n ButtonImage.src = '/static/EcoLabels/'+sValue.substring(4);\n ButtonImage.className = 'button-img'\n btn.appendChild(ButtonImage);\n return \n } else {\n //console.log(btn.id+' is other')\n btn.innerHTML = sValue;\n }\n \n}", "GetTemplateActionBoutton(Titre, Fct){\n var Button = document.createElement(\"button\")\n Button.setAttribute(\"style\", \"background-color:white;\")\n Button.setAttribute(\"class\", \"CoreXActionButtonButton\")\n Button.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); Fct()})\n\n var Div1 = document.createElement(\"div\")\n Div1.setAttribute(\"style\", \"display: flex; flex-direction: row; align-items: center; justify-content: center; align-content: center;\")\n Button.appendChild(Div1)\n\n var Div2 = document.createElement(\"div\")\n Div2.innerHTML = Titre\n Div1.appendChild(Div2)\n\n return Button\n }", "function createCalibrationBtn(row, col) {\n var btn = document.createElement(\"button\");\n btn.textContent = \"😭\";\n btn.setAttribute(\"class\", `emoji-btn calibration-btn row-${row} col-${col}`);\n btn.setAttribute(\"id\", `calibrate-${row}-${col}`);\n btn.addEventListener(\"click\", function() {\n clickCounter += 1\n progressCalibration(row, col)\n });\n btn.style.setProperty(\"grid-row\", row);\n btn.style.setProperty(\"grid-column\", col);\n dom.popupContent.appendChild(btn);\n }", "function DeleteClick() {\n notyConfirm('Are you sure to delete?', 'DeleteSupplierPayment()');\n}", "static createConfirmEditDialog() {\n\t const bx = calendar_util.Util.getBX();\n\t return new bx.Calendar.Controls.ConfirmEditDialog();\n\t }", "function addExtraButtons () {\n\tmw.toolbar.addButtons(\n\t{\n\t\t'imageId': 'button-redirect',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_redirect.png', \n\t\t'speedTip': 'Redirect',\n\t\t'tagOpen': '#REDIRECT[[',\n\t\t'tagClose': ']]',\n\t\t'sampleText': 'Target page name'\n\t},\n\t{\n\t\t'imageId': 'button-strike',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_strike.png', \n\t\t'speedTip': 'Strike',\n\t\t'tagOpen': '<s>',\n\t\t'tagClose': '</s>',\n\t\t'sampleText': 'Strike-through text'\n\t},\n\t{\n\t\t'imageId': 'button-enter',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_enter.png', \n\t\t'speedTip': 'Line break',\n\t\t'tagOpen': '<br/>',\n\t\t'tagClose': '',\n\t\t'sampleText': ''\n\t}, \n\t\t'imageId': 'button-hide-comment',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_hide_comment.png', \n\t\t'speedTip': 'Insert hidden Comment',\n\t\t'tagOpen': '<!-- ',\n\t\t'tagClose': ' -->',\n\t\t'sampleText': 'Comment'\n\t}, \n\t{\n\t\t'imageId': 'button-blockquote',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_blockquote.png',\n\t\t'speedTip': 'Insert block of quoted text',\n\t\t'tagOpen': '<blockquote>\\n',\n\t\t'tagClose': '\\n</blockquote>',\n\t\t'sampleText': 'Block quote'\n\t},\n\t{\n\t\t'imageId': 'button-insert-table',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_insert_table.png',\n\t\t'speedTip': 'Insert a table',\n\t\t'tagOpen': '{| class=\"wikitable\"\\n|',\n\t\t'tagClose': '\\n|}',\n\t\t'sampleText': '-\\n! header 1\\n! header 2\\n! header 3\\n|-\\n| row 1, cell 1\\n| row 1, cell 2\\n| row 1, cell 3\\n|-\\n| row 2, cell 1\\n| row 2, cell 2\\n| row 2, cell 3'\n\t},\n\t{\n\t\t'imageId': 'button-insert-reflink',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_reflink.png',\n\t\t'speedTip': 'Insert a reference',\n\t\t'tagOpen': '<ref>',\n\t\t'tagClose': '</ref>',\n\t\t'sampleText': 'Insert footnote text here'\n\t}\n\t);\n}", "function captionButton(btnAdd, btnDelete)\n\t{\n\t\tcaption = \"\";\n\n\t\tif (btnAdd == true && permissionsMember[currentModule['control_name']][2] == 1) {\n\t\t\tcaption += '<a id=\"btnAdd\" href=\"'+bUrl+currentModule['url']+'/add\" class=\"btnTop btn btn-success\"><i class=\"fa fa-plus\"></i> Add</a>';\n\t\t}\n\t\tif (btnDelete == true && permissionsMember[currentModule['control_name']][4] == 1) {\n\t\t\tcaption += '<a id=\"btnMultiDelete\" href=\"#\" class=\"btnTop btn btn-danger\"><i class=\"fa fa-trash-o\"></i> Delete</a>';\n\t\t}\n\n\t\treturn caption;\n\t}", "function new_toogle_button(classButton, textButton){\n\nreturn \"<span class=\\\"padding\\\" style=\\\"cursor:pointer;\\\" onclick=\\\"\"+classButton+\"()\\\" >&nbsp;&nbsp;&nbsp;&nbsp;\"+textButton+\"&nbsp;<img src=\\\"/pics/sort_btn_gray_on.gif\\\" class=\\\"\"+classButton+\"\\\"/></span>\";\n}", "function createIconButton(iconClass, isRound, text, data, callback) {\n var button = newElement('button');\n button.classList.add('btn');\n\n if (isRound) {\n button.classList.add('btn-round');\n }\n\n button.innerHTML = '<i class=\"fas fa-' + iconClass + '\"></i>'\n\n if (text) {\n button.innerHTML += text;\n }\n\n if (callback) {\n button.addEventListener('click', () => callback.apply(data));\n }\n\n return button;\n}", "function getButtonTemplate(btnText){var buttonTemplate='';if(!btnText)btnText=buttonText;// get from global buttonText option\nif(_theme==='cosmo-theme'){buttonTemplate+='<sfanspan class=\"icon-element-wrapper\">'+iconCosmo+'</sfanspan>';buttonTemplate+='<sfanspan class=\"sarafan-button-text\">'+btnText+'</sfanspan>';return buttonTemplate;}if(_theme==='topnews-theme'){buttonTemplate+='<sfanspan class=\"icon-element-wrapper\">'+iconTopnews+'</sfanspan>';buttonTemplate+='<sfanspan class=\"sarafan-button-text topnews-button-text\">'+btnText+'</sfanspan>';return buttonTemplate;}switch(_btnType){case'btn-only-icon':if(_buttonSize==='small'){svgEye=svgEyeSmall;}buttonTemplate+='<sfanspan class=\"icon-element-wrapper\">'+svgEye+'</sfanspan>';break;case'btn-only-text':buttonTemplate+='<sfanspan class=\"sarafan-button-text\">'+btnText+'</sfanspan>';break;case'sfn-btn__type1'||'sfn-btn__type2':buttonTemplate+='<sfanspan class=\"sfn-btn__label\">'+btnText+'</sfanspan>';break;default:if(_buttonSize==='small'){svgEye=svgEyeSmall;}buttonTemplate+='<sfanspan class=\"icon-element-wrapper\">'+svgEye+'</sfanspan>';buttonTemplate+='<sfanspan class=\"sarafan-button-text\">'+btnText+'</sfanspan>';}if(optionsFromApiData.buttonTemplate){buttonTemplate=optionsFromApiData.buttonTemplate;var btn=document.createElement('div');btn.innerHTML=buttonTemplate;var btnTextNode=btn.querySelector('.sarafan-button-text');if(btnTextNode){btnTextNode.innerHTML=btnText;buttonTemplate=btn.innerHTML;}}return buttonTemplate;}", "function buildButton(code) {\n\n var btn = document.createElement(\"button\");\n btn.className = \"tb-btn\";\n btn.type = \"button\";\n btn.style.fontFamily = \"FontAwesome\";\n btn.style.fontStyle = \"normal\";\n btn.style.fontWeight = \"normal\";\n btn.style.fontVariant = \"normal\";\n btn.style.lineHeight = 1;\n btn.innerHTML = '&#xf1c5';\n\n var existing = document.querySelector(\"button.tb-btn.img-btn\");\n existing.parentElement.insertBefore(btn, existing.nextSibling);\n\n return btn;\n }", "function makeCheckButton() {\n var buttonCheck = $(\"<button>\")\n buttonCheck.addClass(\"btn btn-info\");\n buttonCheck.text(\"Check my answers!\");\n $(\"#check-button\").append(buttonCheck);\n }", "function boton1() {\n var x = document.createElement(\"BUTTON\");\n var t = document.createTextNode(\"Nothing\");\n x.appendChild(t);\n EJERCICIO2.appendChild(x);\n}", "function newDeleteButton() {\n const deleteImage = document.createElement('button');\n deleteImage.type = 'button';\n deleteImage.className = 'delete';\n deleteImage.title = 'Delete';\n return deleteImage;\n}", "function createButtons() {\n\t\tvar buttonHTML = '<input id=\"CustomNextButton\" class=\"FakeButton Button\" title=\"→\" ' \n\t\t+ 'type=\"button\" name=\"CustomNextButton\" value=\"→\" aria-label=\"Next\">'\n\t\t+ '<input id=\"ShowAnswerButton\" style = \"display:none\" class=\"FakeButton Button\" title=\"Show Answer\" ' \n\t\t+ 'type=\"button\" name=\"ShowAnswerButton\" value=\"Show Answer\" aria-label=\"Show Answer\">'\n\t\t+ '<style>.Total {display: none !important;}</style>';\n\t\tjQuery('#showbuttons').append(buttonHTML);\n\t}", "function llenarBotonEvaluacion(){\n var retorno='<button type=\"button\" class=\"btn btn-xs btn-default btn-block\"><span class=\"glyphicon glyphicon-pencil\"></span> Evaluación</button>'\n return retorno\n }", "function createButtonHTML(button) {\n return '<li class=\"'+ button.styleClassDisabled +'\" id=\"' + button.id + '\" ' +'onclick=\"toggleAction(\\'' + button.id + '\\');\"'+\n '\">'+\n //'<a href=\"#\">' +\n '<img ' +\n 'alt=\"' + button.alt + '\" ' +\n 'title=\"' + button.alt + '\" ' +\n 'id=\"' + button.id + '-img\" ' +\n 'src=\"' + button.imageSrcDisabled + '\" ' +\n '/>' +\n //(button.label ? ('<div class=\"toolbar-button-label\">'+ button.label+'</div>') :'')+\n //'</a>'+\n '</li>';\n}//createButtonHTMLbutton()", "function newPartConfirm() {\n swal({\n title: \"Are you sure?\",\n text: \"This will delete the current part\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes, start a new part\",\n closeOnConfirm: true\n },\n function(){\n paper.project.clear();\n newProject();\n });\n}", "function cb( )\n{ var button = document.createElement( \"div\" );\n\tbutton.id = \"button\";\n\tbutton.className = \"button blue_background hidden\";\n\tbutton.innerHTML = \"Begin\";\n\tdocument.body.appendChild( button );\n\t\n}", "function ConfirmDialog(){\r\n\r\n \r\n \r\n }", "function ToolBar_CreateCloneButton(theHTML, theObject, szImage, extraContent, imageList)\n{\n\t//helpers\n\tvar buttonDROPDOWN;\n\t//type of the button to use\n\tvar strType;\n\t//by default we do not allow custom dropdowns\n\tvar bCustomDropDown = false;\n\t//we choose the type according to the look\n\tswitch (theObject.InterfaceLook)\n\t{\n\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\tcase __NEMESIS_LOOK_SAP_BELIZE:\n\t\t\t//use div (font bugs on buttons!)\n\t\t\tstrType = \"div\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//use button\n\t\t\t\tstrType = \"button\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//use div (font bugs on buttons!)\n\t\t\t\tstrType = \"div\";\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//use button\n\t\t\tstrType = \"button\";\n\t\t\t//check if we want a custom dropdown\n\t\t\tbCustomDropDown = extraContent && extraContent.CustomDropDown;\n\t\t\tbreak;\n\t}\n\t//create the button itself\n\tvar button = document.createElement(strType);\n\t//set its styles\n\tbutton.style.cssText = \"position:absolute;background-color:transparent;padding:0px;margin:0px;cursor:default;text-overflow:ellipsis;overflow:\" + (__BROWSER_IE8_OR_LESS ? \"visible\" : \"hidden\") + \";color:\" + theObject.FGColours[__STATE_DEFAULT] + \";\";\n\t//make it unselectable\n\tBrowser_SetSelectable(button, false);\n\n\t//create the image\n\tvar buttonIMAGE = button.appendChild(document.createElement(\"img\"));\n\tbuttonIMAGE.src = __NEMESIS_EMPTY_BG;\n\t//set styles\n\tbuttonIMAGE.style.cssText = \"position:absolute;display:none;\";\n\tbuttonIMAGE.style.width = szImage.w + \"px\";\n\tbuttonIMAGE.style.height = szImage.h + \"px\";\n\n\t//if we have a custom drop down\n\tif (bCustomDropDown)\n\t{\n\t\t//this using a caption?\n\t\tvar bHasCaption = extraContent.CustomDropDown.Caption;\n\t\t//create dropdown button\n\t\tbuttonDROPDOWN = button.appendChild(document.createElement(bHasCaption ? \"div\" : \"img\"));\n\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;background-repeat:no-repeat;background-position:center center;\" + Basic_GetFontStyle(Get_String(extraContent.CustomDropDown.Font, theObject.Properties[__NEMESIS_PROPERTY_FONT]));\n\t\tbuttonDROPDOWN.style.borderTop = extraContent.CustomDropDown.BorderTop;\n\t\tbuttonDROPDOWN.style.borderLeft = extraContent.CustomDropDown.BorderLeft;\n\t\tbuttonDROPDOWN.style.borderBottom = extraContent.CustomDropDown.BorderBottom;\n\t\tbuttonDROPDOWN.style.borderRight = extraContent.CustomDropDown.BorderRight;\n\t\tbuttonDROPDOWN.style.width = Get_Number(extraContent.CustomDropDown.Width, 6) + \"px\";\n\t\tbuttonDROPDOWN.style.height = Get_Number(extraContent.CustomDropDown.Height, 4) + \"px\";\n\t\t//has it got an image?\n\t\tif (extraContent.CustomDropDown.Image)\n\t\t{\n\t\t\t//image is a number?\n\t\t\tvar imageIndex = Get_Number(extraContent.CustomDropDown.Image, null);\n\t\t\t//valid?\n\t\t\tif (imageIndex != null && imageList)\n\t\t\t{\n\t\t\t\t//set it\n\t\t\t\timageList.SetImage(buttonDROPDOWN, imageIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//has caption?\n\t\t\t\tif (bHasCaption)\n\t\t\t\t{\n\t\t\t\t\t//set it as a background image\n\t\t\t\t\tbuttonDROPDOWN.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + extraContent.CustomDropDown.Image + \"')\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//set it as full image\n\t\t\t\t\tbuttonDROPDOWN.src = __HOST_LESSON_RESOURCES + extraContent.CustomDropDown.Image;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//has it got a caption?\n\t\tif (bHasCaption)\n\t\t{\n\t\t\t//set it\n\t\t\tbuttonDROPDOWN.innerHTML = extraContent.CustomDropDown.Caption.ToPlainText(theObject.DataObject.Id); // SAFE BY ENCODING\n\t\t}\n\t}\n\telse\n\t{\n\t\t//create dropdown button\n\t\tbuttonDROPDOWN = button.appendChild(document.createElement(\"img\"));\n\t\tbuttonDROPDOWN.src = __NEMESIS_EMPTY_BG;\n\t}\n\n\t//create text node\n\tvar buttonCAPTION = button.appendChild(document.createElement(\"div\"));\n\tbuttonCAPTION.style.cssText = \"position:absolute;padding:2px;padding-bottom:4px;display:none;text-overflow:ellipsis;word-wrap:normal;white-space:nowrap;\" + Basic_GetFontStyle(theObject.Properties[__NEMESIS_PROPERTY_FONT]);\n\n\t//finaly, switch on interface style\n\tswitch (theObject.InterfaceLook)\n\t{\n\t\tdefault:\n\t\t\t//if its not custom?\n\t\t\tif (!bCustomDropDown)\n\t\t\t{\n\t\t\t\t//update dropdown\n\t\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:7px;height:5px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_classic_sprite.png');background-repeat:no-repeat;background-position:-170px -54px;\";\n\t\t\t}\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t\tbutton.style.background = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_sapenjoy_buttonbg.png')\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"2px outset #d3d1cb\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:11px;height:13px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_sapenjoy_stream.png');background-repeat:no-repeat;background-position:-105px -136px;border-left:1px solid #808080;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.background = \"#f2e1af\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"2px solid #D9D9D9\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:11px;height:13px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_tradeshow_stream.png');background-repeat:no-repeat;background-position:-105px -136px;border-left:1px solid #808080;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t\tbutton.style.background = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_signature_buttonbg.png')\";\n\t\t\t\tbutton.style.borderRadius = \"2px\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:8px;height:12px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_signature_stream.png');background-repeat:no-repeat;background-position:-99px -640px;margin-top:5px;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.border = \"1px solid #A3A3A3\";\n\t\t\t\tbutton.style.backgroundColor = Get_Color(\"<SAPCLR:61>\", null, theObject.InterfaceLook);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:11px;height:13px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_corbus_stream.png');background-repeat:no-repeat;background-position:-105px -138px;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.borderRadius = \"1px\";\n\t\t\t\tbutton.style.border = \"1px solid #BFBFBF\";\n\t\t\t\tbutton.style.backgroundColor = \"Transparent\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;bottom:1px;right:1px;display:none;width:7px;height:7px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_bluecrystal_stream.png');background-repeat:no-repeat;background-position:-117px -369px;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_BELIZE:\n\t\t\t//update button itself\n\t\t\tbutton.style.borderRadius = \"2px\";\n\t\t\tbutton.style.border = \"1px solid #ABABAB\";\n\t\t\tbutton.style.backgroundColor = \"transparent\";\n\t\t\t//set dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;left:23px;top:0px;width:24px;height:26px;display:none;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_belize_sprite.png');background-repeat:no-repeat;background-position:-62px 0px;\";\n\t\t\t//correct image position\n\t\t\tbuttonIMAGE.style.left = \"3px\";\n\t\t\tbuttonIMAGE.style.top = \"5px\";\n\t\t\tbreak;\n\t}\n\t//return the button\n\treturn button;\n}", "function addSubmitButton (icon, style, text, check, datai18n) {\n const button = $(\n '<button class=\"btn ' + style + ' btn-xs btn-tutorial-run\"></button>'\n )\n button.append($('<i class=\"fa ' + icon + '\"></i>'))\n button.append(\n ' ' + '<span data-i18n=\"button.' + datai18n + '\">' + text + '</span>'\n )\n const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0\n let title = text\n const kbdText = (isMac ? 'Cmd' : 'Ctrl') + '+Shift+Enter'\n if (!check) {\n title = title + ' (' + kbdText + ')'\n button.attr('data-i18n-opts', '{\"kbd\": \"' + kbdText + '\"}')\n }\n button.attr('title', title)\n button.attr('data-i18n', '')\n button.attr('data-i18n-attr-title', 'button.' + datai18n + 'title')\n if (check) {\n button.attr('data-check', '1')\n }\n button.attr('data-icon', icon)\n button.on('click', function () {\n thiz.$removeSolution(exercise)\n thiz.$showExerciseProgress(label, button, true)\n })\n panelHeadingRight.append(button)\n return button\n }", "function addHelperButton (icon, caption, classBtn, datai18n) {\n const button = $(\n '<button class=\"btn btn-light btn-xs btn-tutorial-solution\"></button>'\n )\n button.attr('title', caption)\n button.attr('data-i18n', '')\n button.addClass(classBtn)\n button.append($('<i class=\"fa ' + icon + '\"></i>'))\n if (datai18n) {\n if (typeof datai18n === 'string') {\n datai18n = { key: datai18n }\n }\n button.attr('data-i18n-attr-title', datai18n.key + 'title')\n const buttonText = $(\n `<span class=\"d-none d-sm-inline-block d-md-none d-lg-inline-block\">${caption}</span>`\n )\n buttonText.attr('data-i18n', datai18n.key)\n if (datai18n.opts) {\n buttonText.attr('data-i18n-opts', JSON.stringify(datai18n.opts))\n }\n button.append(document.createTextNode(' '))\n button.append(buttonText)\n if (datai18n.opts) {\n button.attr('data-i18n-opts', JSON.stringify(datai18n.opts))\n }\n } else {\n button.append(' ' + caption)\n }\n panelHeading.append(button)\n return button\n }", "function createToolBtn(obj) {\n var btn = $('<button/>', {\n title: obj.title,\n name: obj.name,\n text: obj.text\n }).addClass(obj.classes);\n return btn;\n }", "function deleteConfirm() {\n swal({\n title: \"Are you sure?\",\n text: \"You will not be able to recover this layer!\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes, delete it!\",\n closeOnConfirm: true\n },\n function(){\n\t\t\tremoveLayer();\n });\n}", "function mkToolBtnTop(iconLoc, label) {\t//make tool button top part, always visiable\r\n\tvar btn = Util.div(\"math-button\")\r\n\t\t\t\t\t.attr(\"tabindex\",\"0\")\r\n\t\t\t\t\t.append(Util.div(\"math-button-icon\")\r\n\t\t\t\t\t\t\t\t .styles(\"background\", \"url(assets/img/toolbar/\" + iconLoc + \")\"))\r\n\t\t\t\t\t.append(Util.div(\"math-button-label\")\r\n\t\t\t\t\t\t\t\t .append(document.createTextNode(label))\r\n\t\t\t\t\t \t\t\t .append(Util.br())\r\n\t\t\t\t\t \t\t\t .append(Util.div(\"math-button-sign\")));\r\n\tbtn.addEventListener('click', btn1);\r\n\tbtn.addEventListener('blur', btn2);\r\n\treturn btn;\r\n}", "function buttonModal(title, description, button_url, button_text, cancel_text)\n{\n\tdocument.body.insertAdjacentHTML('afterbegin', '<div id=\"uni-modal-back\" class=\"modal-bg\" onclick=\"closeModal();\"></div><div id=\"uni-modal\" class=\"modal-box\"><div class=\"modal-title\">' + title + '</div><div class=\"modal-desc\">' + description + '</div><div class=\"modal-button-bar\"><div class=\"modal-button-wrap\"><a class=\"modal-button\" href=\"' + button_url + '\">' + button_text + '</a></div> <div class=\"modal-button-wrap\"><a class=\"modal-button\" href=\"javascript:closeModal()\">' + cancel_text + '</a></div></div></div>');\n}", "confirmImg(){\n var canvas = document.getElementsByTagName(\"canvas\");\n var image = canvas[0].toDataURL(\"image/jpeg\", 1.0);\n window.open(image);\n }", "function addConfirmationBox() {\n\n var predicationDate = $(this).closest('tr.predictionTable').find('.predictionDate').text();\n var predictionValue = $(this).closest('tr.predictionTable').find('.predictionValue').text();\n var predictionRegion = $(this).data(\"region\");\n var $button = $(this);\n\n var message = \"Do you really want to delete this prediction?\" + \"<br>\" +\n \"Date = \" + predicationDate +\"<br>Value = \" + predictionValue +\n \"<br>Region = \" + predictionRegion;\n\n\n bootbox.confirm(message, function(result) {\n\n if (result == true) {\n /* User choose yes.\n Create a post request.\n */\n doFormAction($button);\n }\n\n });\n}", "function MenuInstructionsClick() {\n\n if ((flagMenuInstructions == 'default') && (flagChangeCharacter == 'default')) {\n flagMenuInstructions = 'active';\n var menu_image = document.getElementById('placeholder');\n menu_image.style.display = \"none\";\n var messageDiv = document.getElementById('char_image');\n messageDiv.style.borderLeft = \"thin solid #260321\";\n var instructions = document.createElement(\"p\");\n instructions.innerHTML = \"Collect all items to get points.<br> Avoid the water.<br> Avoid bugs at all costs.<br>(They are evil bastards!)\"\n instructions.style.textAlign = \"left\";\n instructions.style.color = \"rgb(89, 1, 15)\";\n instructions.style.fontFamily = \"Comic Sans MS\";\n instructions.style.fontSize = \"14px\";\n messageDiv.appendChild(instructions);\n instructions.style.verticalAlign = \"text-top\";\n var ok_button = document.createElement(\"BUTTON\");\n ok_button.innerHTML = 'okidoki';\n messageDiv.appendChild(ok_button);\n\n ok_button.onclick = function() {\n messageDiv.removeChild(instructions);\n messageDiv.removeChild(ok_button);\n messageDiv.style.borderLeft = \"thin solid #FFFFFF\";\n menu_image.style.display = \"initial\";\n flagMenuInstructions = 'default';\n };\n };\n}", "function onConfirm(buttonIndex) {\n alert('You selected button ' + buttonIndex);\n}", "function addBtn (element, text, margin){\n var textCode = text.replace(/'/g, \"%27\");\n var url=chrome.runtime.getURL(\"images/saveicon.png\");\n element.insertAdjacentHTML(\"afterend\", \"<div style='text-align:right; margin-bottom:\"+margin+\";'><span style='background:#455a64; padding: 5px; border-radius: 0 0 5px 5px; display: inline-block;'><a href='http://www.thiscodeworks.com/new?code=\" + encodeURIComponent(textCode) + \"&url=\" + window.location.href + \"&pagetitle=\"+encodeURIComponent(document.title)+\"' target='_blank' style='color: white; text-decoration: none;'><img src='\"+url+\"' style='margin:0; vertical-align: bottom; height: 19px; width: 19px;background: #ffffff00; border: none;'> Save<a></span></div>\");\n}", "function createImgDelete() {\n let imgDelete = document.createElement(\"img\");\n imgDelete.id = \"img-delete\";\n imgDelete.src = \"media/x.svg\";\n imgDelete.alt = \"delete button\";\n imgDelete.width = \"32\";\n imgDelete.height = \"32\";\n imgDelete.title = \"Delete\";\n return imgDelete;\n}", "function choiceButtons() {\n var w = new Window(\"dialog\", 'The word \"' + myWord + '\" already exists…'),\n u,\n editBtn = w.add(\n \"button\",\n u,\n \"Delete the existing image and create a new one\"\n ); //- Choosing to delete the word image and create a new one\n (skipBtn = w.add(\"button\", u, \"Keep the existing image and move on\")),\n (skipBtn.code = 0); //- Choosing to keep the existing word and move on to the next one\n editBtn.code = 1;\n\n w.preferredSize.width = 400;\n w.alignChildren = [\"fill\", \"top\"];\n\n skipBtn.onClick = editBtn.onClick = function () {\n w.close(this.code);\n };\n\n var result = w.show();\n\n if (result == 1) {\n myFoundText[0].parentTextFrames[0].parentPage.remove(); //- Deleting the page on which the word has been found\n myDoc.colors.itemByName(myWord).remove(); //- Deleting the previous word color\n createWord();\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 product_cancel_button() { \n\t\t$('#product_form').trigger(\"reset\");\n\t\t//$('#img-upload').attr('src',\" \");\n\t\tupdate_id=\"\";\n\t\tbutton_create(1);\n\t\tproduct_datatable_function(); \n\t}", "function addButton(btn_type, parentNode) {\n let btn = document.createElement(\"img\");\n btn.setAttribute(\"class\", btn_type);\n btn.setAttribute(\"alt\", btn_type);\n btn.setAttribute(\"src\", \"./assets/images/\" + btn_type + \".svg\");\n\n if (btn_type == \"check\") \n btn.setAttribute(\"checked\", \"unchecked\"); \n\n parentNode.appendChild(btn);\n}", "function createButton1(name, text, onclick, disab, myclass, style) {\n\tvar s = \"<INPUT TYPE='BUTTON'\";\n\ts += \"NAME='\" + name + \"' \";\n\ts += \"VALUE='\" + text + \"' \";\n\ts += \"ID='\" + name + \"' \";\n\tif (style)\n\t\ts += \"style='\" + style + \"'\";\n\ts += \"CLASS='\" + myclass + \"'\";\n\tif (disab) {\n\t\ts += \"DISABLED \"\n\t}\n\ts += \"OnClick='\" + onclick + \"'> \";\n\treturn s;\n}", "function button(label, callback, classes){\n var styles = _.isEmpty(classes) ? ['btn-default'] : classes; \n var $btn = $(\"<button type='button' class='btn'>\"+_.escape(label)+\"</button>\");\n $btn[0].onclick = callback;\n _.each(styles, function(s){$btn.addClass(s);});\n return $btn;\n }", "additionalContent() {\n return (\n <StyledConfirmButtons>\n {this.renderCancelButton()}\n {this.renderConfirmButton()}\n </StyledConfirmButtons>\n );\n }", "function modalConfirm(titulo, body, okButonHref) {\n $('#modal-confirm .modal-body').html(body);\n $('#modal-confirm #myModalLabel').html(titulo);\n $('#modal-confirm #modal-btn-ok').attr('href', okButonHref);\n $('#modal-confirm').modal('toggle');\n}", "function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) {\n mwCustomEditButtons[mwCustomEditButtons.length] =\n {\"imageId\": imageId,\n \"imageFile\": imageFile,\n \"speedTip\": speedTip,\n \"tagOpen\": tagOpen,\n \"tagClose\": tagClose,\n \"sampleText\": sampleText};\n}", "createButtons() {\n this.settingsButton = this._createConnectionButton(TEXTURE_NAME_SETTINGS);\n this.deleteButton = this._createConnectionButton(TEXTURE_NAME_DELETE);\n }", "function mkToolBtnTop(iconLoc, label) {\t//make tool button top part, always visiable\n\tvar btn = insertInto(div(\"math-button\"), [\n\t\t \t\tdiv(\"math-button-icon\", {background: \"url(assets/img/toolbar/\" + iconLoc + \")\"}),\n\t\t\t\tinsertInto(div(\"math-button-label\"), [\n\t\t\t\t\tdocument.createTextNode(label),\n\t\t\t\t\tmake(\"br\"),\n\t\t\t\t\tdiv(\"math-button-sign\")\n\t\t\t\t])\t\t\n \t]);\n\tbtn.setAttribute(\"tabindex\",\"0\");\n\tbtn.addEventListener('click', btn1, false);\n\tbtn.addEventListener('blur', btn2, false);\n\treturn btn;\n}", "function successMessage(msg, callback) {\n $.confirm({\n icon: 'fa fa-check fa-lg',\n title: 'Registro correcto!',\n content: `<b>${msg}</b>`,\n type: 'green',\n scrollToPreviousElement: false,\n scrollToPreviousElementAnimate: false,\n buttons: {\n Aceptar: {\n text: 'Aceptar',\n btnClass: 'btn-green',\n action: function () {\n callback;\n }\n }\n }\n });\n}", "function buttonSave() {\n image(imgSave, 475, 550);\n}", "showConfirmBox(title, content, detail) {\r\n return this.showMessageBox({\r\n buttons: ['Yes', 'No'],\r\n message: content,\r\n title,\r\n detail,\r\n defaultId: 1,\r\n cancelId: 1,\r\n type: 'warning',\r\n noLink: true,\r\n }).then((answer) => {\r\n return (answer == 0);\r\n });\r\n }", "function createButton () {\n animal = animal.toUpperCase ();\n $(\"#animalButtons\").append(\"<button type='button' class='btn btn-primary starterGif' id='\" + animal.toLowerCase() +\"'>\" + \"See \" + animal + \" gifs</button>\");\n animals.push(animal);\n }", "function addButton(text, onclick, cssObj, id) {\n cssObj = cssObj || {bottom: '7%', left: '4%', 'z-index': 3}\n let button = document.createElement('button'), btnStyle = button.style\n button.id = id\n button.setAttribute(\"data-toggle\", \"modal\")\n button.setAttribute(\"data-target\", \"#exampleModal\")\n button.setAttribute(\"class\", \"btn btn-outline-info\")\n if (document.getElementById(id)) {\n return\n }\n document.body.appendChild(button)\n button.innerHTML = text\n button.onclick = onclick\n Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key])\n $(button).after(`<div class='loader'></div>`)\n $(button).next().hide()\n return button\n }", "function initConfirmationWindow(event) {\r\n let contentString = '<div style=\"color:black\" id=\"helperNotification\">'+\r\n '<h2>Thank you for your help!</h2>'+\r\n '<p>Cick \"Undo\" if this was a mistake or click \"Continue\" '+\r\n ' to confirm.</p><button style=\"padding-right:4px\" id=\"undoButton\">Undo</button>' +\r\n '<button id=\"confirmButton\">Continue</button></div>';\r\n infoWindow.setContent(contentString);\r\n}", "function showConfirm(message, title) {\n navigator.notification.confirm(\n message, // message\n onConfirm, // callback to invoke with index of button pressed\n title, // title\n 'Aceptar,Cancelar' // buttonLabels\n );\n}" ]
[ "0.7381665", "0.65416354", "0.63602394", "0.62371385", "0.6204981", "0.6187084", "0.61553764", "0.61195225", "0.609529", "0.6037567", "0.60281134", "0.60163194", "0.6009989", "0.6000285", "0.59944713", "0.59719354", "0.59646595", "0.59646595", "0.59646595", "0.59646595", "0.59646595", "0.59646595", "0.5963432", "0.5949238", "0.5945811", "0.5945076", "0.59374446", "0.5925012", "0.591055", "0.58986807", "0.5896128", "0.588888", "0.5882523", "0.5874868", "0.58729583", "0.5862403", "0.5854664", "0.58508736", "0.58502215", "0.58435863", "0.5841867", "0.5834688", "0.58314854", "0.58070385", "0.5803094", "0.57997495", "0.5771267", "0.5764261", "0.57625544", "0.5758174", "0.5749145", "0.57388055", "0.57309943", "0.57233536", "0.5715608", "0.57150924", "0.57069266", "0.5697978", "0.5689427", "0.56886756", "0.5686032", "0.56814706", "0.5679678", "0.56714493", "0.566944", "0.5661297", "0.56553304", "0.5644408", "0.5643179", "0.5643154", "0.5642161", "0.564099", "0.56363016", "0.5628462", "0.56234604", "0.56184983", "0.5613529", "0.56061465", "0.5603471", "0.5602108", "0.55973893", "0.55923307", "0.558333", "0.5581951", "0.5581365", "0.55765384", "0.55748373", "0.55691576", "0.5567051", "0.55652475", "0.55631113", "0.55577385", "0.5556265", "0.5555694", "0.5555635", "0.55551636", "0.55515164", "0.5548475", "0.5545974", "0.55407107" ]
0.71519136
1
creates dateobj from current date and binds it to the note obj
function addDate() { const noteDate = new Date(); let month = noteDate.getMonth() + 1; if (month < 10) { month = `0${month}`; } let day = noteDate.getDate(); if (day < 10) { day = `0${day}`; } return `${noteDate.getFullYear()}-${month}-${day}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setInitialDate(initialDate){\n const date = this._stringify(initialDate);\n const objectDate = new Date(date);\n return objectDate;\n }", "function prepDate(model) { return _.isEmpty(model) ? null : moment(model).toDate();}", "function initializeCurrentDate(){\n\tcurrentYear=d.getFullYear();\n\tcurrentMonth=d.getMonth();\t\n\ttodaysYear=d.getFullYear();\n\ttodaysMonth=d.getMonth();\n\ttodaysDate=d.getDate();\t\n}", "function DateObj(d) {\n\tvar date = d || new Date();\n\treturn {\n\t\t\tday : date.getDate()\n\t\t, month : date.getMonth()\n\t\t,\tyear : date.getFullYear()\n\t\t,\tnow: Date.now()\n\t};\n}", "function createDateObj(name) {\r\n\treturn {\r\n\t\tid : name,\r\n\t\tdate : null\r\n\t};\r\n}", "makeDateObject (val) {\n // handle support for eu date format\n let dateAndTime = val.split(' ')\n let arr = []\n if (this.format.indexOf('-') !== -1) {\n arr = dateAndTime[0].split('-')\n } else {\n arr = dateAndTime[0].split('/')\n }\n let year = 0\n let month = 0\n let day = 0\n if (this.format.indexOf('DD/MM/YYYY') === 0 || this.format.indexOf('DD-MM-YYYY') === 0) {\n year = arr[2]\n month = arr[1]\n day = arr[0]\n } else if (this.format.indexOf('YYYY/MM/DD') === 0 || this.format.indexOf('YYYY-MM-DD') === 0) {\n year = arr[0]\n month = arr[1]\n day = arr[2]\n } else {\n year = arr[2]\n month = arr[0]\n day = arr[1]\n }\n\n let date = new Date();\n if(this.hideDate){\n // time only\n let splitTime = dateAndTime[0].split(':')\n // handle date format without seconds\n let secs = splitTime.length > 2 ? parseInt(splitTime[2]) : 0\n date.setHours(parseInt(splitTime[0]), parseInt(splitTime[1]), secs, 0)\n } else if (this.hideTime) {\n // date only\n date = new Date(parseInt(year), parseInt(month)-1, parseInt(day))\n } else {\n // we have both date and time\n let splitTime = dateAndTime[1].split(':')\n // handle date format without seconds\n let secs = splitTime.length > 2 ? parseInt(splitTime[2]) : 0\n date = new Date(parseInt(year), parseInt(month)-1, parseInt(day), parseInt(splitTime[0]), parseInt(splitTime[1]), secs)\n }\n\n return date\n }", "function _today() {\n this.dt = new Date();\n }", "constructor() {\n this.currentDate = new Date();\n }", "function ds_setToToday() {\r\r\n\tthis.setDateParts( this.year, this.month, this.date );\r\r\n}", "constructor(date = new Date()) {\n this.date = date;\n }", "constructor(date) {\n this.date = this.str_to_date(date)\n this.updateValue();\n return this\n }", "function get_current_date(){\n var date = new Date();\n var obj_date={\n day : date.getDate(),\n month : date.getMonth()+1,\n year : date.getFullYear(),\n }\n\n return obj_date;\n}", "function initDate(){\n var date = new Date();\n var day = date.getDate();\n var month = date.getMonth() + 1;\n var year = date.getFullYear();\n\n if (month < 10) month = \"0\" + month;\n if (day < 10) day = \"0\" + day;\n\n var today = year + \"-\" + month + \"-\" + day; \n $(\"#story-date\").attr(\"value\", today);\n}", "fromModel(date) {\n return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?\n { year: date.year, month: date.month, day: date.day } :\n null;\n }", "function convertCurrentDate(data) {\n currentDate = data.current.dt\n // from https://www.epochconverter.com/programming/#javascript\n myDate = new Date(currentDate * 1000);\n console.log(\"Current human date: \" + myDate);\n\n}", "function convertDateObj(d) {\n\td.start_date = new Date(d.start_date);\n\tif (d.end_date !== null)\n\t\td.end_date = new Date(d.end_date);\n\treturn d;\n}", "date(e){\n this.appDate = e.detail.value; \n \n }", "function set_date(){\n var query = getQueryParams(document.location.search),\n date_num = query.date,\n today,\n year, day, month, divided, divided_2;\n\n if(date_num == '' || date_num == undefined){\n var today = new Date().toDateString();\n }else{\n divided = date_num.match(/.{1,4}/g);\n year = divided[1];\n divided_2 = divided[0].match(/.{1,2}/g);\n month = divided_2[0];\n day = divided_2[1];\n today = new Date(year, month, day).toDateString();\n }\n $('#date').html(today);\n }", "function convertDate(caregiver) {\n caregiver.created = new Date(caregiver.created).getTime();\n caregiver.DOB = new Date(caregiver.DOB).getTime();\n return caregiver;\n }", "function createVjsdateObject(vjsInput) {\r\n /* Config for the format of the date. Has to be in english (already set) for javascript to read it back. */\r\n var dateFormat;\r\n if (vjsInput.getAttribute('data-vjsdateFormat') !== \"\") { dateFormat = JSON.parse(vjsInput.getAttribute('data-vjsdateFormat')) } else {\r\n dateFormat = {\r\n \"weekday\": \"long\",\r\n \"year\": \"numeric\",\r\n \"month\": \"long\",\r\n \"day\": \"numeric\",\r\n \"hour\": \"numeric\",\r\n \"minute\": \"numeric\"\r\n };\r\n }\r\n vjsInput.value = new Date(vjsInput.value).toLocaleDateString(\"en-US\", dateFormat);\r\n vjsInput.dateFormat = dateFormat;\r\n vjsInput.addEventListener(\"focus\", function () {\r\n vjsdate(this);\r\n this.blur();\r\n });\r\n}", "constructor() {\n super();\n var today = new Date(),\n date =\n today.getFullYear() +\n '-' +\n (today.getMonth() + 1) +\n '-' +\n today.getDate();\n this.state = {\n date: date,\n due_date: date,\n };\n }", "function DateUpdater() { }", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "function formatDate(obj) {\n const date = new Date(obj.date).toLocaleString(\"default\", {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n });\n obj.date = date;\n return obj;\n}", "function createDateObject (topPosition, leftPosition, divId, objectStyle, objectTime, objectWidth, objectHeight, objectFont) {\n var today = new Date();\n /*\n Create arrays for both swedish and english months and days so that depending on the chosen language display different names.\n */\n var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n var sweMonths = ['Januari', 'Februari', 'Mars', 'April', 'Maj', 'Juni', 'Juli', 'Augusti', 'September', 'Oktober', 'November', 'December'];\n var sweDays = ['Sön', 'Mån', 'Tis', 'Ons', 'Tor', 'Fre', 'Lör', 'Sön'];\n var curDay = today.getDate();\n var curYear = today.getFullYear();\n\n\n if(lang == \"se\") {\n var curWeekDay = sweDays[today.getDay()];\n var curMonth = sweMonths[today.getMonth()];\n }\n else {\n var curWeekDay = days[today.getDay()];\n var curMonth = months[today.getMonth()];\n }\n\n //do not create the whole object again if it is already created.\n if(document.getElementsByClassName('date')[0]) {\n var dateDiv = document.getElementsByClassName('date')[0];\n dateDiv.innerHTML = curWeekDay+\", \"+curDay+\" \"+curMonth+\" \"+curYear;\n // console.log(\"updated\");\n\n }\n else {\n var dateDiv = document.createElement('div');\n dateDiv.style.color = 'white';\n dateDiv.setAttribute('id', divId);\n dateDiv.setAttribute('class', 'icon-middle sunny resize-drag date');\n\n var date = curWeekDay + \", \" + curDay + \" \" + curMonth + \" \" + curYear;\n dateDiv.innerHTML = date;\n\n var style = window.getComputedStyle(dateDiv);\n dateDiv.style.top = topPosition;\n dateDiv.style.left = leftPosition;\n dateDiv.setAttribute('top', topPosition);\n dateDiv.setAttribute('left', leftPosition);\n\n dateDiv.setAttribute('object-style', objectStyle);\n\n if (objectFont !== \"noFont\") {\n fontFamilies2.push(objectFont); //add the font if there is a selected font\n\n dateDiv.setAttribute('object-font', objectFont);\n\n dateDiv.style.fontFamily = objectFont;\n }\n else {\n dateDiv.style.fontFamily = 'Julius Sans One';\n dateDiv.setAttribute('object-font', \"Julius Sans One\");\n }\n\n if (objectWidth == \"startWidth\" && objectHeight == \"startHeight\") {\n // console.log(\"startWidthHeight: \" + style.getPropertyValue('width') + \" \" + style.getPropertyValue('height'));\n dateDiv.style.width = \"100px\";\n dateDiv.style.height = \"50px\";\n dateDiv.setAttribute('object-width', '100px');\n dateDiv.setAttribute('object-height', '50px');\n }\n else {\n dateDiv.style.width = objectWidth;\n dateDiv.style.height = objectHeight;\n // console.log(\"objectWidthHeight \" + objectWidth + \" \" + objectHeight);\n dateDiv.setAttribute('object-width', objectWidth);\n dateDiv.setAttribute('object-height', objectHeight);\n }\n\n var font = parseFloat(dateDiv.getAttribute('object-height'));\n dateDiv.style.fontSize = font / 3 + 'px';\n\n document.getElementsByClassName('middle-side')[0].appendChild(dateDiv);\n\n var functionCaller = arguments.callee.caller.name;\n\n //Add the action to the undo array if it was added from the left side\n if (functionCaller == \"drop\") {\n addToUndoArray(dateDiv.id, \"addObject\", topPosition, leftPosition, dateDiv.getAttribute('object-style'), objectTime, dateDiv.getAttribute('object-width'), dateDiv.getAttribute('object-height'),dateDiv.getAttribute('object-font'), \"noMessage\");\n }\n\n }\n\n //create a timer that updates the date every minute.\n dateTimer = setTimeout(function() {createDateObject(dateDiv.getAttribute('top'),dateDiv.getAttribute('left'),dateDiv.id,dateDiv.getAttribute('object-style'),\"no-time\",dateDiv.getAttribute('object-width'),dateDiv.getAttribute('object-height'),dateDiv.getAttribute('object-font')) }, 60000);\n\n}", "function currentDate() {\nvar today = new Date();\nvar dd = today.getDate();\nvar mm = today.getMonth()+1; //January is 0!\n\nvar yyyy = today.getFullYear();\nif(dd<10){\n dd='0'+dd;\n} \nif(mm<10){\n mm='0'+mm;\n} \nvar today = dd+'/'+mm+'/'+yyyy;\ndocument.getElementById(\"createDate\").value = today;\n}", "function makeDateObjects(data){\r\n\t\tconsole.log(\"makeDateObjects\");\r\n\t\tfor (i = 0; i < data.length; i++){\r\n\t\t\tvar datestring = data[i][selectedOptions.dateField];\r\n\t\t\tvar thisYear = parseInt(datestring.substring(0,4));\r\n\t\t\tvar thisMonth = parseInt(datestring.substring(5,7));\r\n\t\t\tvar thisDay = parseInt(datestring.substring(8,10));\r\n\t\t\tvar thisDateComplete = new Date(thisYear, thisMonth-1, thisDay); // JS-Date Month begins at 0\r\n\t\t\tzaehlstellen_data[i][selectedOptions.dateField] = thisDateComplete;\r\n\t\t}\r\n\t}", "function newNote(body) {\n return { body: body, time: new Date() };\n}", "function makeDate() {\n\t var today = new Date();\n\t var dd = today.getDate();\n\t var mm = today.getMonth() + 1;\n\t var yyyy = today.getFullYear();\n\n\t if (dd < 10) {\n\t dd = '0' + dd;\n\t }\n\t if (mm < 10) {\n\t mm = '0' + mm;\n\t }\n\t today = mm + '/' + dd + '/' + yyyy;\n\t $('.date-format').html(today);\n\t}", "function myDate() \n\t\t{\n\t\t\tvar d = new Date();\n\t\t\t//The current date is saved to the date string\n\t\t\tdocument.getElementById(\"date\").innerHTML = d.toDateString();\n\t\t}", "function formatObjectDate(ibd){\n\n\tvar ibdObj = JSON.parse(JSON.stringify(ibd));\n\tibdObj.createdTime = moment(ibd.createdTime).format(\"YYYY/MM/DD HH:mm Z\").toString();\n\tibdObj.updatedTime = moment(ibd.updatedTime).format(\"YYYY/MM/DD HH:mm Z\").toString();\t\t\n\treturn ibdObj;\n\t\n}", "get date() {\n\t\treturn this.__date;\n\t}", "get date() {\n\t\treturn this.__date;\n\t}", "get date() {\n\t\treturn this.__date;\n\t}", "get date() {\n\t\treturn this.__date;\n\t}", "get date() {\n\t\treturn this.__date;\n\t}", "get date() {\n\t\treturn this.__date;\n\t}", "updateToDate(date) {\n var dateStringTo = date._d;\n var dateObjTo = new Date(dateStringTo);\n var momentObjTo = Moment(dateObjTo);\n var momentStringTo = momentObjTo.format('YYYY-MM-DD');\n this.setState({ selectedToDate: momentStringTo });\n }", "function createToday(){\n statsinfo.today = new Date();\n}", "updateTodaysDate() {\n const currentView = this.currentView;\n let view;\n if (currentView === 'month') {\n view = this.monthView;\n }\n else if (currentView === 'year') {\n view = this.yearView;\n }\n else {\n view = this.multiYearView;\n }\n view._init();\n }", "updateTodaysDate() {\n const currentView = this.currentView;\n let view;\n if (currentView === 'month') {\n view = this.monthView;\n }\n else if (currentView === 'year') {\n view = this.yearView;\n }\n else {\n view = this.multiYearView;\n }\n view._init();\n }", "function Reminder(rmDate, rmDesc, rmId, rmNotes, rmPeriod, rmEnabled){\r\nthis.rmDate = rmDate;\r\nthis.rmDesc = rmDesc;\r\nthis.rmPeriod = rmPeriod;\r\nthis.rmId = rmId;\r\nthis.rmNotes = rmNotes;\r\nthis.rmEnabled = rmEnabled;\r\nthis.getRmDate = function(){\r\n\t\t\t\t\t\t\t\tvar myDate = new Date;\r\n\t\t\t\t\t\t\t\tvar tmpDate = this.rmDate.split(\"-\");\r\n\t\t\t\t\t\t\t\tmyDate.setDate(1);\r\n\t\t\t\t\t\t\t\tmyDate.setMonth((tmpDate[1]));\r\n\t\t\t\t\t\t\t\tmyDate.setYear(tmpDate[0]);\r\n\t\t\t\t\t\t\t\tmyDate.setDate(tmpDate[2]);\r\n\t\t\t\t\t\t\t\t//alert(myDate);\r\n\t\t\t\t\t\t\t\treturn myDate;\n\t}\r\n}", "function DateHelper() {}", "function currentDate(document, update) {\r\n var currentDate = new Date();\r\n var fields, i;\r\n\r\n if (update.$currentDate) {\r\n fields = Object.keys(update.$currentDate);\r\n for (i = 0; i < fields.length; i++) {\r\n // ECMAScript's Date.getTime() returns milliseconds, where as POSIX epoch are in seconds.\r\n document[fields[i]] = Math.round(currentDate.getTime() / 1000);\r\n }\r\n }\r\n }", "_pushDate(gen, obj) {\n\t switch (gen.dateType) {\n\t case 'string':\n\t return gen._pushTag(TAG.DATE_STRING) &&\n\t gen._pushString(obj.toISOString())\n\t case 'int':\n\t case 'integer':\n\t return gen._pushTag(TAG.DATE_EPOCH) &&\n\t gen._pushIntNum(Math.round(obj / 1000))\n\t case 'float':\n\t // force float\n\t return gen._pushTag(TAG.DATE_EPOCH) &&\n\t gen._pushFloat(obj / 1000)\n\t case 'number':\n\t default:\n\t // if we happen to have an integral number of seconds,\n\t // use integer. Otherwise, use float.\n\t return gen._pushTag(TAG.DATE_EPOCH) &&\n\t gen.pushAny(obj / 1000)\n\t }\n\t }", "function register_actual_date()\n{\n RMPApplication.debug (\"begin register_actual_date\");\n var my_date = new Date(); \n var currentTime = Math.round(my_date.getTime()/1000); \n c_debug(debug.prepare_data, \"=> register_actual_date: currentTime = \", currentTime);\n RMPApplication.setVariable(\"date_intervention\", currentTime);\n // other_var.date_intervention = RMPApplication.get(\"date_intervention\");\n RMPApplication.debug (\"end register_actual_date\");\n}", "function setDate() {\n vmCurves.dateFrom = new Date( new Date().getTime() - (24*7 * 60*60 * 1000) ); //Sieben Tage vor heute\n vmCurves.dateTo = new Date();\n }", "function createNew(intDate){\r\n\tvar dateObj = new Date;\r\n\tdocument.getElementById(\"reminderEdit\").style.display = 'block';\r\n\tclearForm();\r\n\tdocument.getElementById(\"reminderDate\").value = intDate;\r\n\tdocument.getElementById(\"reminderMonth\").value = myShortMonths[dateObj.getMonth()];\r\n\tdocument.getElementById(\"reminderYear\").value = dateObj.getFullYear();\r\n\tdocument.getElementById(\"reminderMode\").value = \"new\";\r\n}", "function Datepicker(obj) {\n\t\t//用户可配置属性\n\t\tthis.options = {\n\t\t\t$dom: document.body, //放置日历的dom\n\t\t\tstartTime: new Date().getTime(), //开始时间,为毫秒数\n\t\t\tendTime: new Date().getTime(), //结束时间\n\t\t\t//要在日历上展示的其他信息,格式必须为下列格式\n\t\t\totherData: {\n\t\t\t\t// \"2016-02-28\" : {\n\t\t\t\t// \"stockId\": 1, //库存Id,保存更新时使用\n\t\t\t\t// \"selledCount\":0, //已售数\n\t\t\t\t// \"stock\":10 //库存数\n\t\t\t\t// },\n\t\t\t\t// \"2016-02-29\": {\n\t\t\t\t// \"stockId\" : 2,\n\t\t\t\t// \"selledCount\" : 1,\n\t\t\t\t// \"stock\": 10\n\t\t\t\t// }\n\t\t\t},\n\t\t\t//渲染日历组件\n\t\t\trender: function(){\n\t\t\t\tconsole.log(\"数据\":this.renderData);\n\t\t\t}\n\t\t};\n\t\t//配置项,需要包括$dom\n\t\tthis.options = this.extend(true, this.options, obj.options);\n\t\t//初始日历数据\n\t\tthis.initData = [];\n\t\t//渲染页面的数据\n\t\tthis.renderData = [];\n\t\t//是否有跨年\n\t\tthis.isAcross = false;\n\t\t//开始日期的月份信息\n\t\tthis.startMonthArr = [31, 28 + this.isLeapYear(this.options.startTime), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; //每个月的天数\n\t\t//结束日期的月份信息\n\t\tthis.endMonthArr = [31, 28 + this.isLeapYear(this.options.endTime), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\t\t//格式化的开始日期\n\t\tthis.formatStartDay = null;\n\t\t//格式化的结束日期\n\t\tthis.formatEndDay = null;\n\t\t//需要渲染的数据\n\t\tthis.renderData = [];\n\t\tthis.preData = {};\n\t\tthis.init();\n\t}", "function _date(obj) {\n return exports.PREFIX.date + ':' + obj.toISOString();\n}", "function getSelectedDate()\n{\nreturn curr_date;\n}", "function setJobScheduledDate()\n\t{\n\t\tvar rows = auxJobGrid.getSelectionModel().getSelections();\n\t\n\t\tif (rows.length > 0) \n\t\t{\n\t\t\tvar record = rows[0];\n\t\t\t\n\t\t\tif (record.data.days != undefined && record.data.days != \"\") \n\t\t\t{\n\t\t\t\tvar auxDate = new Date(jobDate.getValue().toGMTString());\n\t\t\t\t\n\t\t\t\tif (auxDate != undefined)\n\t\t\t\t{\n\t\t\t\t\tauxDate.setDate(auxDate.getDate() + record.data.days);\n\t\t\t\t\t\n\t\t\t\t\trecord.set('scheduled_date', auxDate); //Add days to the datePlanted object.\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "toModel(date) {\n return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?\n { year: date.year, month: date.month, day: date.day } :\n null;\n }", "function _updateDate($this) {\n\n function _suffix(n) { // returns the appropriate suffix\n return [null, 'st', 'nd', 'rd', 'th'][n] || \"th\";\n }\n\n var data = $this.data(store);\n\n $this.html(months[month].toProperCase() + \" \" + day + _suffix(day) + \", \" + year); // Visible date\n\n var datetime = year + \"/\" + _zeroPad(month + 1, 2) + \"/\" + day;\n $this.attr(\"datetime\", datetime); // Tag's date\n data.$input.val(datetime.replace(/\\//g, \"-\")); // Hidden input's date\n }", "setDate(date) {\n this.date = date;\n }", "function createTodaysDate(){\r var today = new Date();\r var dd = today.getDate();\r var mm = today.getMonth()+1;\r var yyyy = today.getFullYear();\r\r if(dd<10) {\r dd = '0'+dd\r } \r\r if(mm<10) {\r mm = '0'+mm\r } \r\r return mm + '/' + dd + '/' + yyyy;\r}", "function setScreenDate() {\n var scr_date_n = new Date().getTime();\n screenDate = moment(scr_date_n).format('LLLL');\n $(\"#currdate\").empty();\n $(\"#currdate\").text(screenDate);\n screenDatetemp = scr_date_n;\n}", "get date() {\n const _ = this;\n return new DateTime(new Date(_.year, _.month, _.day), _._kind);\n }", "constructor(props) {\n super(props)\n let now = moment()\n this.state = { selected_date: now }\n }", "function dat(){\n var d = new Date();\n document.getElementById(\"date\").innerHTML = d;\n }", "toModel(date) {\n return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) ? this._toNativeDate(date) :\n null;\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 updatePostDate(type,args,obj)\n{\n var month = (args[0][0][1] < 10) ? '0' + args[0][0][1] : args[0][0][1];\n var day = (args[0][0][2] < 10) ? '0' + args[0][0][2] : args[0][0][2];\n var year = args[0][0][0];\n\n document.getElementById('post_date').value = month + '/' + day + '/' + year;\n window.cal1.hide();\n}", "function CHMnetscapeDate(value)\r\n{\r\n dateObj.value=value;\r\n return;\r\n}", "_pushDate(gen, obj) {\n switch(gen.dateType) {\n case 'string':\n return gen._pushTag(TAG.DATE_STRING) &&\n gen._pushString(obj.toISOString());\n case 'int':\n case 'integer':\n return gen._pushTag(TAG.DATE_EPOCH) &&\n gen._pushIntNum(Math.round(obj / 1000));\n case 'float':\n // force float\n return gen._pushTag(TAG.DATE_EPOCH) &&\n gen._pushFloat(obj / 1000);\n case 'number':\n default:\n // if we happen to have an integral number of seconds,\n // use integer. Otherwise, use float.\n return gen._pushTag(TAG.DATE_EPOCH) &&\n gen.pushAny(obj / 1000);\n }\n }", "function getJavaDate( dt:NotesDateTime) :Date {\r\n\tvar date:Date = null;\r\n\r\n\tif (dt != null) {\r\n\t\ttry {\r\n\t\t\tdate = dt.toJavaDate();\r\n\t\t} catch (e) {\r\n\t\t\t//do nothing\r\n\t\t} finally {\r\n\t\t\trecycleObjects(dt);\r\n\t\t}\r\n\t}\r\n\treturn date;\r\n}", "updateFromDate(date) {\n var dateString = date._d;\n var dateObj = new Date(dateString);\n var momentObj = Moment(dateObj);\n var momentString = momentObj.format('YYYY-MM-DD');\n this.setState({ selectedFromDate: momentString });\n }", "function initialize(){\ncurr_date=opener.selDate;\nsemimonthly=opener.isSemimonthly; \ncurr_date=(curr_date == null)?new Date():curr_date;\nreturn curr_date;\n}", "function init (){\n todayEl.text(today.format(\"DD-MMM-YYYY\"));\n buildBody();\n buildList();\n}", "function setDate() {\n // It will set the departure date to current date\n const departureDate = customDateFormat();\n document.getElementById('departure-date').value = departureDate;\n\n // It will set the return date to 7 days fast from current date\n const returnDate = customDateFormat(7);\n document.getElementById('return-date').value = returnDate;\n}", "function init() {\n initDate();\n }", "function enterCurrentDateToHTML() {\n currentDate = Date.now();\n dateIn.value = date;\n}", "function formatDate(obj) {\n\t\t\n\t\t\t\tfunction addZero(num) {\n\t\t\t\t\tif (num < 10)\n\t\t\t\t\t\treturn \"0\" + num;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn num;\n\t\t\t\t}\n\n\t\t\t\tif (obj.updated) {\n\t\t\t\t\tvar showDate = new Date(obj.updated);\n\t\t\t\t\tvar editStatus = \"Updated on \";\n\t\t\t\t} else\t{\n\t\t\t\t\tvar showDate = new Date(obj.created);\n\t\t\t\t\tvar editStatus = \"Created on \";\n\t\t\t\t}\t\n\n\t\t\t\tvar yy = showDate.getFullYear().toString();\n\t\t\t\tvar mm = addZero(showDate.getMonth()+1);\n\t\t\t\tvar dd = addZero(showDate.getDate());\n\t\t\t\tvar hh = addZero(showDate.getHours());\n\t\t\t\tvar mins = addZero(showDate.getMinutes());\t\n\t\t\t\tvar ss = addZero(showDate.getSeconds());\n\n\t\t\t\t// change to 12-hour clock and add am/pm\n\t\t\t\tvar ampm = \"am\";\n\t\t\t\tif (hh == \"00\")\n\t\t\t\t\thh = 12;\n\t\t\t\tif (hh == 12)\n\t\t\t\t\tampm = \"pm\";\n\t\t\t\tif (hh > 12) {\n\t\t\t\t\tampm = \"pm\";\n\t\t\t\t\thh -= 12;\n\t\t\t\t}\n\n\t\t\t\tshowDate = yy + \"/\" + mm + \"/\" + dd + \" at \" + hh + \":\" + mins + ampm;\n\t\t\t\t//console.log(yy, mm, dd, hh, min);\n\n\t\t\t\tshowDate = editStatus + showDate;\n\t\t\t\t\n\t\t\t\treturn showDate;\n\t\t\t}", "function createDateFromString(obj) {\n let date = obj.day + obj.fullDate + \" \" + obj.time;\n return new Date(date).toLocaleString();\n}", "function setDate(date){\n\t z=$(date).attr('value');\n\n\t var today = new Date();\n\t var dd = today.getDate();\n\t var mm = today.getMonth()+1; //January is 0!\n\n\t var yyyy = today.getFullYear();\n\t if(dd<10){dd='0'+dd} \n\t if(mm<10){mm='0'+mm} \n\t today = yyyy+'-'+mm+'-'+dd; \n\n\t $(date).attr('value',today);\n\t}", "_setToDate(date) {\n let dates = get(this, '_dates');\n let [dateFrom] = dates;\n let vals;\n\n let oneDay = 1000 * 60 * 60 * 24;\n\n if (date) {\n let tmp = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0);\n date = new Date(tmp.getTime() + (oneDay - 1));\n }\n\n if (date && (dateFrom && date.getTime() < dateFrom.getTime())) {\n vals = Ember.A([date, dateFrom]);\n } else {\n vals = Ember.A([dateFrom, date]);\n }\n\n set(this, '_dates', vals);\n }", "function write() {\n if (ngModelCtrl.$viewValue) {\n scope.setInitialDate(ngModelCtrl.$viewValue);\n } else {\n var date = new Date();\n scope.setInitialDate(date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate());\n }\n scope.resetDate();\n }", "fromModel(date) {\n return (date instanceof Date && !isNaN(date.getTime())) ? this._fromNativeDate(date) : null;\n }", "function date()\n\t{\n\t\tvar currentdate = new Date(); \n\t\tif (currentdate.getMonth()+1 >9) {\n\t\t\tvar datetime = currentdate.getFullYear() + \"-\"\n + (currentdate.getMonth()+1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar datetime = currentdate.getFullYear() + \"-0\"\n + (currentdate.getMonth()+1);\n\t\t}\n\t\tif (currentdate.getDate() >9) {\n\t\t\tvar datetime = datetime + \"-\" + (currentdate.getDate());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar datetime = datetime + \"-0\" + (currentdate.getDate());\n\t\t}\n\t\tif (currentdate.getHours() >9) {\n\t\t\tvar datetime = datetime + \"T\" + (currentdate.getHours());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar datetime = datetime + \"T0\" + (currentdate.getHours());\n\t\t}\n\t\tif (currentdate.getMinutes() >9) {\n\t\t\tvar datetime = datetime + \":\" + (currentdate.getMinutes());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar datetime = datetime + \":0\" + (currentdate.getMinutes());\n\t\t}\n\t\t$(\"#date\").val(datetime);\n\t}", "function date_yyyymmdd (date_obj) {\n let now = date_obj || new Date();\n\n let month = now.getMonth() + 1;\n let day = now.getDate();\n\n month = (month < 10) ? ('-' + 0 + month) : ('-' + month);\n day = (day < 10) ? ('-' + 0 + day) : ('-' + day);\n\n return now.getFullYear() + month + day;\n}", "function dateObjects()\n{\n\n}", "makeLocalFromDateObject(date) {\n var ret = this.dateStrings(date)\n return ret.day + \".\" + ret.month + \".\" + ret.year\n }", "function newDate(){\n let today = new Date();\n console.log(today);\n}", "function setDate(number){\n if((number < 0) && (curr.month === 0)){\n curr.month = 11;\n curr.year--;\n }else if((number > 0) && (curr.month === 11)){\n curr.month = 0;\n curr.year++;\n }else if(number > 0){\n curr.month++;\n }else if(number < 0){\n curr.month--;\n }\n date = new Date(curr.year, curr.month, 1);\n setCal = {\n date: date.getDate(),\n month: date.getMonth(),\n year: date.getFullYear(),\n day: date.getDay()\n }\n }", "constructor() {\n return new RealDate(date) //Vamos fixar a data usanod mockDate\n }", "function newDate(x) {\n return new Date(x);\n }", "function initDate() {\n\t function fixup(value, min, max) {\n\t return (typeof value !== 'number' || isNaN(value)) ? min : (value>=min ? (value<=max ? value: max): min);\n\t } return {\n\t year: fixup(HEAP32[(((tm)+(20))>>2)] + 1900 , 1970, 9999),\n\t month: fixup(HEAP32[(((tm)+(16))>>2)], 0, 11),\n\t day: fixup(HEAP32[(((tm)+(12))>>2)], 1, 31),\n\t hour: fixup(HEAP32[(((tm)+(8))>>2)], 0, 23),\n\t min: fixup(HEAP32[(((tm)+(4))>>2)], 0, 59),\n\t sec: fixup(HEAP32[((tm)>>2)], 0, 59)\n\t };\n\t }", "function fx_Date(data)\n{\n\t//has format?\n\tif (String_IsNullOrWhiteSpace(data))\n\t{\n\t\t//use default\n\t\tdata = \"D/M/Y\";\n\t}\n\t//get current date\n\tvar theDate = new Date();\n\t//Format it\n\treturn VarManager_FormatDate(data, theDate);\n}", "get currentDate(){\r\n return new Date().toDateString();\r\n }", "setCurrentDate(current) {\n self.datePicker.current = new Date(current);\n }", "setDate(date, revers = false) {\n let dateTemplate = this.renderTemplate(this.dateTemplate, {\n date: moment(date).format('D MMM YYYY')\n })\n\n if(revers)\n this.container.prepend(dateTemplate)\n else\n this.container.append(dateTemplate)\n }", "function displayDate() {\n // variable for date formatted day, month, day, year\n var date = now.format(\"dddd, MMMM Do YYYY\");\n // update text to show date\n currentDayEl.text(date);\n}", "getValidDate(obj) {\r\n return this.dateTimeAdapter.isDateInstance(obj) && this.dateTimeAdapter.isValid(obj)\r\n ? obj\r\n : null;\r\n }", "getValidDate(obj) {\r\n return this.dateTimeAdapter.isDateInstance(obj) && this.dateTimeAdapter.isValid(obj)\r\n ? obj\r\n : null;\r\n }", "didReceiveAttrs() {\n if (isPresent(this.date) && typeOf(this.date) === 'date') {\n trySet(this, 'value', moment(this.date).tz(this.timezone).format(this.displayFormat));\n }\n }" ]
[ "0.63527185", "0.6269293", "0.6180642", "0.60575897", "0.60421413", "0.6031795", "0.60178787", "0.59838736", "0.59559596", "0.594456", "0.59158146", "0.58970475", "0.58958", "0.58240855", "0.5808925", "0.57719463", "0.5757563", "0.5752189", "0.5751734", "0.5748681", "0.5730593", "0.5720143", "0.57193804", "0.57193804", "0.57193804", "0.57193804", "0.57193804", "0.57193804", "0.571364", "0.5712333", "0.5710842", "0.5699908", "0.5688964", "0.56776965", "0.56740904", "0.5671333", "0.5662324", "0.5662324", "0.5662324", "0.5662324", "0.5662324", "0.5662324", "0.5661346", "0.5659197", "0.56589395", "0.56589395", "0.56535494", "0.565007", "0.56462276", "0.5643963", "0.5638996", "0.5638548", "0.56344235", "0.56330055", "0.5618376", "0.5603598", "0.56034446", "0.5577888", "0.55747473", "0.5571018", "0.55651575", "0.5561145", "0.55609363", "0.5547379", "0.5536141", "0.55276656", "0.5527607", "0.55234975", "0.55211836", "0.55044234", "0.54992497", "0.54840773", "0.54832816", "0.5483146", "0.5481734", "0.54779655", "0.5476562", "0.5476091", "0.5474136", "0.5471067", "0.54681915", "0.5466744", "0.546264", "0.54590994", "0.54536265", "0.54534847", "0.5450169", "0.5446609", "0.54366606", "0.5427591", "0.5424678", "0.54208785", "0.5419115", "0.5410509", "0.5405157", "0.53952444", "0.5388918", "0.538804", "0.538804", "0.5377068" ]
0.53984296
95
Creates a dropdown menu for the note
function addBooksToNote(obj) { let noteDropDown = document.createElement("div"); let button = document.createElement("button"); let btnIcon = document.createElement("img"); let dropDownContent = document.createElement("div"); let dropDownList = document.createElement("ul"); noteDropDown.className = "dropdown"; noteDropDown.appendChild(button); noteDropDown.appendChild(dropDownContent); button.className = "note-button"; button.addEventListener("click", () => { clearNoteDropDown(); addBooksToDropDown(obj, dropDownContent); dropDownContent.style.display = "block"; }); button.appendChild(btnIcon); btnIcon.src = "media/journal-plus.svg"; btnIcon.width = "24"; btnIcon.height = "24"; btnIcon.title = "Move to notebook"; dropDownContent.className = "dropdown-content shadow-sm"; dropDownContent.appendChild(dropDownList); return noteDropDown; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateDropdownMenu() {\n\tvar dropdownContent = document.getElementById(\"dropdown-content\");\n\tvar oldDropdownList = document.getElementById(\"dropdownList\");\n\tif (dropdownContent) {\n\t\tvar newDropdownList = document.createElement(\"ul\");\n\t\tnewDropdownList.id = \"dropdownList\";\n\t\tfor (var i = 0; i < tracks.length; i++) {\n\t\t\tvar track = tracks[i];\n\t\t\tvar trackEntry = document.createElement(\"li\");\n\t\t\ttrackEntry.id = \"trackEntry\" + i;\n\t\t\ttrackEntry.classList.add(\"dropdown-content\");\n\t\t\ttrackEntry.addEventListener(\"click\", function() {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tcurrentTrack = track;\n\t\t\t\t\tresetTime();\n\t\t\t\t\tshowFutureStrokes(currentTrack);\n\t\t\t\t}, visualDelay);\n\t\t\t});\n\t\t\tvar text = document.createTextNode(track.name);\n\t\t\ttrackEntry.appendChild(text);\n\t\t\tnewDropdownList.appendChild(trackEntry);\n\t\t}\n\t\tdropdownContent.replaceChild(newDropdownList, oldDropdownList);\n\t}\n}", "function createDropdownMenu() {\n return $(\"<ul>\").addClass(\"dropdown-menu\");\n }", "get dropdown_menu() {return browser.element('#user_info_dropdown')}", "function McDropdownPanel() { }", "function createDropdownMenu(title, pos, menuItems, selectedItemIdx) {\n\n var labelId = guid();\n\n var menuId = guid();\n\n var listId = guid();\n\n var html = [\n '<div id =\"' + menuId + '\" class=\"dropdown chart-dropdown\">',\n '<button class=\"btn btn-default dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">',\n '<label id=\"' + labelId + '\" style=\"font: normal 14px Times New Roman\">' + title + '</label>',\n '<span class=\"caret\"></span>',\n '</button>',\n '<ul id=\"' + listId + '\"class=\"dropdown-menu scrollable-menu\" >',\n '</ul>',\n '</div>'\n ].join('\\n');\n\n $(viewer.container).append(html);\n\n $('#' + menuId).css({\n\n 'top': pos.top + 'px',\n 'left': pos.left + 'px'\n });\n\n $('#' + labelId).text(title + ': ' + menuItems[selectedItemIdx || 0].label);\n\n menuItems.forEach(function (menuItem) {\n\n var itemId = guid();\n\n var itemHtml = '<li id=\"' + itemId + '\"><a href=\"\">' + menuItem.label + '</a></li>';\n\n $('#' + listId).append(itemHtml);\n\n $('#' + itemId).click(function (event) {\n\n event.preventDefault();\n\n menuItem.handler();\n\n $('#' + labelId).text(title + ': ' + menuItem.label);\n });\n });\n\n return menuId;\n }", "function miscNotes() {\n\t// Set element ID.\n\tvar id = \"misc-notes\";\n\n\tvar buttonName = \"Notes\";\n\n\t// Create an array-like object for titles.\n\tvar links = {\n\t\t\"Html within Html\": \"https://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file\",\n\t\t\"Angular Modules and Controllers in Files\": \"https://www.w3schools.com/angular/angular_modules.asp\",\n\t\t\"Multiple Modules in AngularJS\": \"https://stackoverflow.com/questions/18512434/multiple-module-in-angularjs\", \n\t\t\"C++ if else shorthand\": \"https://stackoverflow.com/questions/24793916/shorthand-c-if-else-statement\" \n\t};\n\n\t// Call dropdownList with titles.\n\tdropdownList(id, buttonName, links);\n}", "function OCM_dropdownMarkup() {\r\n\t\t\t\t\tvar $nectar_ocm_dropdown_func = ($('#slide-out-widget-area[data-dropdown-func]').length > 0) ? $offCanvasEl.attr('data-dropdown-func') : 'default';\r\n\t\t\t\t\tif ($nectar_ocm_dropdown_func == 'separate-dropdown-parent-link') {\r\n\t\t\t\t\t\t$('#slide-out-widget-area .off-canvas-menu-container li.menu-item-has-children').append('<span class=\"ocm-dropdown-arrow\"><i class=\"fa fa-angle-down\"></i></span>');\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function create_dropdown_menu() {\n // Define dropdown menu\n var dropdown = document.createElement('div')\n dropdown.setAttribute('id', 'class-dropdown-' + original_or_target)\n dropdown.setAttribute('class', 'class-dropdown')\n \n // Define icon\n var dropdown_icon = document.createElement('div')\n dropdown_icon.setAttribute('id', 'class-dropdown-icon-' + original_or_target)\n dropdown_icon.setAttribute('class', 'class-dropdown-icon')\n dropdown_icon.innerHTML = '<i class=\"fas fa-sort-down\"></i>'\n dropdown_icon.style.transform = 'translate(0px, -4px)'\n\n // Define display value, and show default value\n var display_val = document.createElement('div')\n display_val.setAttribute('id', 'class-dropdown-text-' + original_or_target)\n display_val.setAttribute('class', 'class-dropdown-text')\n display_val.innerText = get_default_class_name()\n\n // Append the element to the document\n var parent = document.getElementById(parent_id)\n parent.appendChild(dropdown)\n parent.appendChild(dropdown_icon)\n dropdown.appendChild(display_val)\n \n }", "function loadDropdownMenusForCreateNodeModal() {\n addDropdownMenuOptions(\"inputLicense\", \"license\");\n addDropdownMenuOptions(\"inputVersion\", \"version\");\n addDropdownMenuOptions(\"inputProfessionalOwner\", \"profOwner\");\n addDropdownMenuOptions(\"inputTechnicalOwner\", \"techOwner\");\n addDropdownMenuOptions(setListAttributeForInput(\"inputDepartments\"), \"departments\");\n addDropdownMenuOptions(setListAttributeForInput(\"inputTags\"), \"tags\");\n}", "function buildSequenceMenu() {\n // build a string holding the html for the select menu\n var dropdown = \"<select>\\n\";\n dropdown+=\"<option id='-1' value='-1'>Select a sequence</option>\\n\";\n for (var i=0; i < jsonData[0].sequences.length; i++) {\n dropdown += \"<option id='\"+jsonData[0].sequences[i].id+\"' value='\"+i+\"'>\"+jsonData[0].sequences[i].name+\"</option>\\n\";\n }\n dropdown += \"</select>\\n\";\n\n // modify the dom to display the values and menus that have been read\n $(\"#headerTitle\").html(jsonData[0].name);\n $(\"#dropdown\").html(dropdown);\n\n // use a callback to rebuild the task menu whenever the sequence is selected\n $(\"#dropdown\").change(buildTaskMenu);\n }", "function createCurrentBacklogList() {\n var note = $(\".note[data-type='1']\");\n var backloglist = document.getElementById(\"ddlTaskBacklog\");\n backloglist.innerHTML = \"\";\n for (var i = 0; i < note.length; i++) {\n var id = note[i].getAttribute(\"data-id\");\n var content = note[i].getElementsByClassName(\"item-id\")[0].innerHTML + \" - \"\n + note[i].getElementsByClassName(\"note-content\")[0].innerHTML;\n backloglist.innerHTML += \"<option value='\" + id + \"'>\" + content + \"</option>\";\n }\n}", "function menuOptions() {}", "function createModelDropdownMenu() {\r\n\tvar input = \"\";\r\n\tinput += '<select id=\"select_model\" onchange=\"loadModelShape()\"><option value=\"select model\">select model...</option>';\r\n\tfor (var i = 0; i < curModels.length; i++) {\r\n\t\tinput += '<option value=\"' + curModels[i].name + '\">' + curModels[i].name + '</option>';\r\n\t}\r\n\tinput += '</select>';\r\n\treturn input;\r\n}", "function kolab_notes_options_menu()\n{\n var content = $('#options-menu'),\n width = content.width() + 25,\n dialog = content.clone(true);\n\n // set form values\n $('select[name=\"sort_col\"]', dialog).val(kolabnotes.settings.sort_col || '');\n $('select[name=\"sort_ord\"]', dialog).val(kolabnotes.settings.sort_order || 'ASC');\n\n // Fix id/for attributes\n $('select', dialog).each(function() { this.id = this.id + '-clone'; });\n $('label', dialog).each(function() { $(this).attr('for', $(this).attr('for') + '-clone'); });\n\n var save_func = function(e) {\n if (rcube_event.is_keyboard(e.originalEvent)) {\n $('#listmenulink').focus();\n }\n\n var col = $('select[name=\"sort_col\"]', dialog).val(),\n ord = $('select[name=\"sort_ord\"]', dialog).val();\n\n kolabnotes.list_set_sort(col, ord);\n return true;\n };\n\n dialog = rcmail.simple_dialog(dialog, rcmail.gettext('listoptionstitle'), save_func, {\n closeOnEscape: true,\n open: function(e) {\n setTimeout(function() { dialog.find('select').first().focus(); }, 100);\n },\n minWidth: 400,\n width: width\n });\n}", "function Dropdown(parent_id, item = {}) {\n item.type = \"select\";\n item.id = item.id || \"{0}_{1}\".format(item.type, __SELECT++);\n item.label = item.label || item.id;\n item.needQuestion = (item.needQuestion == false) ? false : true;\n Tag.call(this, parent_id, item);\n\n this.options = item.options || [\"option1\", \"option2\", \"option3\"];\n this.option_ids = [];\n this.option_values = [];\n for (var i in this.options) {\n this.option_ids.push(\"option_{0}\".format(__OPTION++));\n this.option_values.push(this.options[i]);\n }\n\n this.value = item.value || \"\";\n this.label_id = \"label_{0}\".format(this.id);\n this.button_id = \"button_{0}\".format(this.id);\n this.dropRight = item.dropRight || false;\n this.choose_prompt = item.choose_prompt || \"Choose\";\n this._style = \"mdl-menu mdl-js-menu mdl-js-ripple-effect\" + ((this.dropRight) ? \"mdl-menu--bottom-right\" : \"mdl-menu--bottom-left\");\n\n this.html = '<div class=\"mdl-textfield mdl-js-textfield\">\\\n <input id=\"{4}\" form=\"{8}\" class=\"mdl-textfield__input\" readonly {5} {6} value=\"{7}\"><button id=\"{0}\" form=\"{8}\" style=\"right: 0;\"\\\n class=\"mdl-button mdl-js-button mdl-button--icon\">\\\n <i class=\"material-icons\">expand_more</i></button>\\\n <ul id=\"{1}\" class=\"{2}\" for=\"{0}\" form=\"{8}\">{3}</ui></div>'.format(\n this.button_id, this.id, this._style, this._option_factory(),\n this.label_id, this.required, this.disabled, this.value, this.parent_id\n );\n\n this.render();\n var option_values = this.option_values;\n var label_id = this.label_id;\n for (let i in this.option_ids) {\n document.getElementById(this.option_ids[i]).onclick = function() {\n document.getElementById(label_id).value = option_values[i];\n };\n /*$(\"#\"+this.option_ids[i]).click(function() {\n $(\"#\"+label_id).val(option_values[i]);\n })*/\n }\n}", "function addMenu() {\n $('.heading-column:first-child').append(\n '<a class=\"menu-button pull-left\" data-toggle=\"dropdown\" id=\"menu-dropdown\">' +\n '<i class=\"fa fa-bars fa-sm\"></i>' +\n '</a>' +\n '<ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"menu-dropdown\">' +\n '<li role=\"presentation\" class=\"dropdown-header\">'+ repositoryName +'</li>' +\n '<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"/repos\">Repository search</a></li>' +\n '<li role=\"presentation\"><a id=\"close-issues\" role=\"menuitem\" tabindex=\"-1\" href=\"#\">Close done issues</a></li>' +\n '<li role=\"presentation\"><a class=\"toggle-done\" role=\"menuitem\" tabindex=\"-1\" href=\"#\">Toggle done items</a></li>' +\n '<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"/logout\">Logout</a></li>' +\n '</ul>'\n );\n}", "function createOptionsList() {\n if (!this.soundSelected) select.textContent = audios['defaultStatus'];\n else select.textContent = this.soundSelected;\n \n for (let key in audios){\n if (key == 'defaultStatus') continue;\n let option = document.createElement('div');\n option.classList.add('sound_option');\n option.textContent = audios[key].name;\n options.append(option);\n }\n }", "function createDropDown(){\r\r\n\t\tvar $form = $(\"div#country-select form\");\r\r\n\t\t$form.hide();\r\r\n\t\tvar source = $(\"#country-options\");\r\r\n\t\tsource.removeAttr(\"autocomplete\");\r\r\n\t\tvar selected = source.find(\"option:selected\");\r\r\n\t\tvar options = $(\"option\", source);\r\r\n\t\t$(\"#country-select\").append('<dl id=\"target\" class=\"dropdown\"></dl>')\r\r\n\t\t$(\"#target\").append('<dt class=\"' + selected.val() + '\"><a href=\"#\"><span class=\"flag\"></span><em>' + selected.text() + '</em></a></dt>')\r\r\n\t\t$(\"#target\").append('<dd><ul></ul></dd>')\r\r\n\t\toptions.each(function(){\r\r\n\t\t\t$(\"#target dd ul\").append('<li class=\"' + $(this).val() + '\"><a href=\"' + $(this).attr(\"title\") + '\"><span class=\"flag\"></span><em>' + $(this).text() + '</em></a></li>');\r\r\n\t\t\t});\r\r\n\t}", "function createAboutMenu() { // create menu with all cipher catergories\r\n\tvar o = document.getElementById(\"calcOptionsPanel\").innerHTML\r\n\r\n\to += '<div class=\"dropdown\">'\r\n\to += '<button class=\"dropbtn\">About</button>'\r\n\to += '<div class=\"dropdown-content\">'\r\n\r\n\to += '<center>'\r\n\to += '<div style=\"display: flex; justify-content: center;\"><img src=\"res/logo.svg\" style=\"height: 10px\"></div>'\r\n\to += '<div style=\"display: flex; justify-content: center;\"><span style=\"font-size: 70%; color: rgb(186,186,186);\">by Saun Virroco</span></div>'\r\n\to += '</center>'\r\n\to += '<div style=\"margin: 0.5em;\"></div>'\r\n\to += '<input class=\"intBtn\" type=\"button\" value=\"GitHub Repository\" onclick=\"gotoGitHubRepo()\">'\r\n\to += '<div style=\"margin: 0.5em;\"></div>'\r\n\to += '<input class=\"intBtn\" type=\"button\" value=\"Quickstart Guide\" onclick=\"displayQuickstartGuide()\">'\r\n\r\n\to += '</div></div>'\r\n\r\n\tdocument.getElementById(\"calcOptionsPanel\").innerHTML = o\r\n}", "function createDropdown(parentDiv, text, dropdownId, behavior)\n{\n parentDiv.appendChild(document.createElement(\"br\"));\n \n label = document.createElement(\"strong\");\n label.textContent = text;\n parentDiv.appendChild(label);\n \n var dropdown = document.createElement(\"select\");\n dropdown.id = dropdownId;\n dropdown.onchange = behavior;\n parentDiv.appendChild(dropdown);\n}", "function userMenu() {\n const dropdown = document.querySelector(\"#user-control-list.dropdown-menu\");\n if (dropdown) {\n const options = document.createElement(\"li\");\n options.classList.add(\"optionsLink\");\n options.style = \"cursor: pointer\";\n options.innerHTML = `<a><i class=\"fa fa-fw fa-dot-circle-o\"></i><span> ${chrome.i18n.getMessage(\n \"optionsLink\"\n )} </span></a>`;\n dropdown.insertBefore(options, dropdown.childNodes[20]);\n document.querySelector(\".optionsLink\").addEventListener(\"click\", () => {\n chrome.runtime.sendMessage({ message: \"options pls\" });\n });\n }\n}", "function setUpDropdownMenu() {\n\tvar dropdown = document.getElementById(\"dictionary-title\");\n\n\tfor (var columnKey in Object.keys(dictionaries_in_dropdown_data)) {\n\t\t// Get column data from large column object\n\t\tvar column_data = dictionaries_in_dropdown_data[columnKey];\n\n\t\t// Create the option element for the dropdown\n\t\tvar option = document.createElement('option');\n\t\toption.text = column_data[\"title\"]; // set the text to be the title\n\t\toption.value = columnKey; \t\t\t// set the value to be the index\n\t\tdropdown.appendChild(option);\n\t}\n}", "function Dropdown(){\n this.createDropdown = function(dict, name, id, selected){\n this.item = document.createElement(\"select\")\n\t\tthis.name = name\n\n\t\tvar ttmp = document.createElement(\"label\")\n\t\tttmp.setAttribute(\"name\", name)\t\t\t\n\t\tttmp.innerHTML = this.name\n\t\tthis.item.appendChild(ttmp)\n\n \t\tfor(var x in dict){\n \t\tvar tmp =document.createElement(\"option\")\n \t\ttmp.setAttribute('value',dict[x])\n \t\ttmp.innerHTML= x + '<br>' \n \n \t\tthis.item.appendChild(tmp)\n \t}\n\n },\n \n this.getSelected = function(){\n this.item=document.getElementById()\n },\n\n this.addToDocument = function(){\n document.body.appendChild(this.item);\n\n }\n}", "function addDropDown() {\n var select = document.createElement(\"select\");\n select.setAttribute(\"id\", \"dropdown\");\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", 0);\n option.innerText = \"Today\";\n select.appendChild(option);\n for (var i = 1; i <= 24; i++) {\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", i);\n option.innerText = \"Wk\" + i;\n if (i != 17) {\n option.innerText = \"Wk\" + i;\n } else {\n option.innerText = \"Wk\" + i + \"/18\";\n i++;\n }\n select.appendChild(option);\n }\n //console.log(select);\n var div = document.createElement(\"div\");\n div.innerText = \"wk\";\n div.setAttribute(\"class\", \"navtarget\");\n select.style.cssFloat = \"right\";\n select.style.letterSpacing = \"initial\";\n document\n .getElementsByClassName(\"Nav-h Py-med No-brdbot Tst-pos-nav\")[0]\n .appendChild(select);\n}", "function buildTaskMenu() {\n // figure out which sequence is selected\n var item = $(\"#dropdown option:selected\").attr(\"value\");\n\n // now build the submenu\n var submenu = \"\";\n if (item != -1) {\n // extract each task from the json data\n for (var i = 0; i < jsonData[0].sequences[item].tasks.length; i++) {\n seqData=jsonData[0].sequences[item].tasks[i];\n submenu += \"<div><a class='task' href='#' seq='\"+item+\"' task='\"+i+\"' type='\"+seqData.options.type+\"'>\"+seqData.name+\"</a></div>\\n\";\n }\n }\n $(\"#submenu\").html(submenu);\n\n // define a callback to handle when a task is selected\n $(\".task\").click(loadTask);\n }", "function generateMenu() {\n var menu = document.createElement(\"div\");\n menu.id = \"menu\";\n document.body.appendChild(menu);\n generatePalette();\n generateDropdown(canvassize);\n generateDropdown(brushsize);\n generateDropdown(bordertype);\n generateDropdown(fillClear);\n generateTextInput();\n generateDisplay();\n generateSaveLoad();\n\n}", "function generateDropdown(object) {\n var values = object.value;\n var names = object.name;\n var dropdown = document.createElement(\"select\");\n dropdown.id = object.title;\n dropdown.classList.add(\"dropdown\");\n dropdown.addEventListener(\"change\", switchOption);\n document.getElementById(\"menu\").appendChild(dropdown);\n for (var i = 0; i < object.value.length; i++) {\n var option = document.createElement(\"option\");\n option.value = object.value[i];\n option.text = object.name[i];\n if (object.name[i] === object.default) {\n option.selected = \"selected\";\n }\n dropdown.appendChild(option);\n }\n\n}", "function createDropDown() {\n var $source = $(\"#radiusSelect\");\n var $selected = $source.find(\"option[selected]\");\n var $options = $(\"option\", $source);\n \n\n $(\"#addy_in_radius\").append('<dl id=\"target\" class=\"dropdown\"></dl>');\n var $target = $(\"#target\");\n\n $target.append('<dt><a href=\"#\">' + $selected.text() + '<span class=\"value\">' +\n $selected.val() + '</span><i class=\"icon-angle-down\"></i></a></dt>');\n\n $target.append('<dd><ul></ul></dd>');\n\n $options.each(function(){\n $(\"#target dd ul\").append('<li><a href=\"#\">' + $(this).text()\n + '<span class=\"value\">' + $(this).val() + '</span></a></li>');\n });\n\n }", "get unorderedListButton() {\n return {\n command: \"insertUnorderedList\",\n icon: \"editor:format-list-bulleted\",\n label: \"Unordered List\",\n radio: true,\n type: \"rich-text-editor-button\",\n };\n }", "static dropDownMenuForInteraction() {\n // add variables list\n\n d3.selectAll('.variable1').remove();\n d3.selectAll('.variable2').remove();\n d3.selectAll('.time').remove();\n\n netSP.variableInfo.forEach(d=>{\n d3.select('#variable1').append('option').attr('class','variable1').attr('value',d[1]).text(d[1]);\n d3.select('#variable2').append('option').attr('class','variable2').attr('value',d[1]).text(d[1]);\n });\n netSP.timeInfo.forEach((d,i)=>{\n if (i) d3.select('#time').append('option').attr('class','time').attr('value',d).text(d);\n });\n // if (visualizingOption === 'LMH') {\n // d3.select('#dataInstances').attr('disabled','');\n // d3.select('#variable').attr('disabled','');\n // }\n // if (visualizingOption === 'tSNE'||visualizingOption === 'PCA'||visualizingOption === 'UMAP') {\n // d3.select('#dataInstances').attr('disabled',null);\n // d3.select('#variable').attr('disabled',null);\n // }\n }", "DropDown() {}", "function newNote() {\n const note = prompt('Name of note?');\n window.localStorage.setItem(note, '');\n\n const noteElem = document.createElement('option');\n noteElem.innerText = note;\n notes.insertBefore(noteElem, notes.firstChild);\n\n // Focus this note\n notes.value = note;\n changeNote();\n}", "function appendDropDown(preSec, component, epFav, contentPath){\r\n if (preSec != \"doc\") {\r\n return;\r\n }\r\n pre = component.getStyles().getId();\r\n if ((_g(pre + \"Drop\") != null) && _g(pre + \"Menu\") != null) {\r\n return; //already defined\r\n }\r\n var img = Util.cep(\"img\", {\r\n 'src': contentPath + '\\\\images\\\\3943_16.gif'\r\n });\r\n var link = Util.cep(\"a\", {\r\n 'className': 'drop-Down',\r\n 'id': pre + 'Drop'\r\n });\r\n var menu = Util.cep(\"div\", {\r\n 'id': pre + 'Menu',\r\n 'className': 'form-menu menu-hide'\r\n })\r\n Util.ac(img, link);\r\n var sec = _g(component.getStyles().getId());\r\n \r\n var secCL = Util.Style.g(\"sec-title\", sec, \"span\");\r\n var secSpan = secCL[0]; //Util.gc(secCL[0]);\r\n Util.ac(link, secSpan);\r\n Util.ac(menu, secSpan);\r\n epathLoad(epFav, component);\r\n }", "function createMenu($this){\n if(isList($this)){\n \n //generate select element as a string to append via jQuery\n var selectString = '<select id=\"mobileMenu-'+$this.attr('id')+'\" class=\"mobileMenu\">';\n \n //create first option (no value)\n selectString += '<option value=\"\">'+settings.topOptionText+'</option>';\n \n //loop through list items\n $this.find('li').each(function(){\n \n //when sub-item, indent\n var levelStr = '';\n var len = $(this).parents('ul, ol').length;\n for(i=1;i<len;i++){levelStr += settings.indentString;}\n \n //get url and text for option\n var link = $(this).find('a:first-child').attr('href');\n var text = levelStr + $(this).clone().children('ul, ol').remove().end().text();\n \n //add option\n selectString += '<option value=\"'+link+'\">'+text+'</option>';\n });\n \n selectString += '</select>';\n \n //append select element to ul/ol's container\n $this.parent().append(selectString);\n \n //add change event handler for mobile menu\n $('#mobileMenu-'+$this.attr('id')).change(function(){\n goToPage($(this));\n });\n \n //hide current menu, show mobile menu\n showMenu($this);\n } else {\n alert('mobileMenu will only work with UL or OL elements!');\n }\n }", "function createNoteOption(select, key) {\n var option = document.createElement('option');\n option.innerHTML = key;\n option.value = notes[key];\n select.appendChild(option);\n}", "function createMenu(dataList, elementID) {\n let dropDownMenu = document.getElementById(elementID);\n for (let i=0; i < dataList.length; i++) {\n let optn = dataList[i];\n let newEl = document.createElement('option');\n newEl.textContent = optn;\n dropDownMenu.appendChild(newEl);\n }\n}", "function dropdownAdd(name) {\n\n // Create elements\n var li = document.createElement(\"li\")\n var center = document.createElement(\"center\")\n var text = document.createTextNode(name)\n\n // Nest center inside li\n center.appendChild(text)\n li.appendChild(center)\n\n // Grab list\n var list = document.getElementById(\"dropList\")\n\n // Append li to list\n list.appendChild(li)\n }", "function selection() {\n const select = document.createElement('select');\n const topic = ['Select Topic', 'Rails', 'HTML', 'CSS', 'JS'];\n topic.forEach(topic => {\n const option = document.createElement('option');\n option.value = topic;\n option.textContent = topic;\n select.appendChild(option)\n });\n return select;\n}", "function browserMenusCreate( parentId, options )\n{\n // Only add parent if it's set\n if (parentId !== \"\")\n options.parentId = parentId;\n\n // Do it\n browser.menus.create( options );\n}", "function generateDropdown(parentID,label,dropID,title,array) {\n //add select options\n var dropHtml = \"\";\n if (label != \"\") {\n dropHtml += '<label>' + label + '</label>'\n }\n dropHtml += '<select class=\"selectpicker show-tick\" id=\"'+ dropID +'\" title=\"'+title+'\" data-style=\"btn-default\" data-width=\"100%\" data-size=\"10\">'\n //build list, apply BREAKS or LABELS if words present in array\n for (i = 0; i < array.length; i++) {\n if (array[i] == 'BREAK'){\n dropHtml += '<option data-divider=\"true\"></option>';\n } else if (array[i].includes('LABEL=')) {\n dropHtml += '<optgroup label=\"' + array[i].replace('LABEL=','') + '\">';\n } else if (array[i].includes('ENDLABEL')) {\n dropHtml += '</optgroup>';\n }\n else {\n dropHtml += '<option>' + array[i] + '</option>';\n }\n }\n dropHtml += '</select>';\n //add to parent div\n document.getElementById(parentID).innerHTML = dropHtml;\n //initialise dropdown\n $('#'+dropID).selectpicker();\n //bind dropdown click handler\n $('#'+dropID).on('changed.bs.select', dropClickHandler);\n}", "function addStudyAreaToDropdown(name,toolTip){\n\tvar id = name.replaceAll(' ','-');\n\t$('#study-area-list').append(`<a id = '${id}' name = '${name}' class=\"dropdown-item \" data-toggle=\"tooltip\" title=\"${toolTip}\">${name}</a>`)\n \t$('#'+id).on('click',function(){\n \t\t// $('#summary-spinner').show();\n \t\t$('#study-area-list').hide();\n longStudyAreaName = this.name;\n \tdropdownUpdateStudyArea(this.name);\n }) \n }", "function addoption(text)\n{\n\t// create new option in drop download list\n\tvar len=document.getElementById('note_category').length;\n\tgroupid = parseInt(nextid.replace(/\"/g,''));\n\tvar opt = document.createElement('option');\n\topt.setAttribute('value',groupid);\n\topt.setAttribute('id','select'+groupid);\n\topt.innerHTML = text;\n\tdocument.getElementById('note_category').appendChild(opt);\n\tdocument.getElementById('note_category').selectedIndex=len;\n\tvar str = $('ul.noteUL').html();\n\tvar newline=\"<li class='category'><div><span>Category: </span>\"+text+\"</div><ul id='group\"+groupid+\"'></ul></li>\";\n\tvar newstr = newline + str;\n\t// update slidebar window\n\t$('ul.noteUL').html(newstr);\n\tlen = groupStore.length;\n\tgroupStore[len] = new Object();\n\tgroupStore[len]._title = text;\n\tgroupStore[len]._groupid = groupid;\n\t\t\n}", "function showAddComponent() {\n document.getElementById('add-component-dropdown').innerHTML = `\n <select id=\"addposition\" class=\"postion-dropdown\"></select>\n <button class=\"button\" type=\"button\" onclick=\"addComponent()\">+</button>`;\n}", "function createMenu($this){\n if(isList($this)){\n\n //generate select element as a string to append via jQuery\n var selectString = '<select id=\"mobileMenu_'+$this.attr('id')+'\" class=\"mobileMenu\">';\n\n //create first option (no value)\n selectString += '<option value=\"\">'+settings.topOptionText+'</option>';\n\n //loop through list items\n $this.find('li').each(function(){\n\n //when sub-item, indent\n var levelStr = '';\n var len = $(this).parents('ul, ol').length;\n for(i=1;i<len;i++){levelStr += settings.indentString;}\n\n //get url and text for option\n var link = $(this).find('a:first-child').attr('href');\n var text = levelStr + $(this).clone().children('ul, ol').remove().end().text();\n\n //add option\n selectString += '<option value=\"'+link+'\">'+text+'</option>';\n });\n\n selectString += '</select>';\n\n //append select element to ul/ol's container\n $this.parent().append(selectString);\n\n //add change event handler for mobile menu\n $('#mobileMenu_'+$this.attr('id')).change(function(){\n goToPage($(this));\n });\n\n //hide current menu, show mobile menu\n showMenu($this);\n } else {\n alert('mobileMenu will only work with UL or OL elements!');\n }\n }", "function creaSelect(list)\n{\n\t//crea un menu per la resta de resultats\n\tvar select=document.createElement('select');\n\tselect.style.display='block';\n\tlist.items.forEach(function(item)\n\t{\n\t\tvar id = item.id.videoId;\n\t\tvar canal = item.snippet.channelTitle;\n\t\tvar titol = item.snippet.title;\n\t\t//new option\n\t\tvar option=document.createElement('option');\n\t\tselect.appendChild(option)\n\t\toption.value=id;\n\t\tvar text=canal+\": \"+titol;\n\t\tif(text.length>=47) text=text.substring(0,44)+\"...\";\n\t\toption.innerHTML=text;\n\t});\n\treturn select;\n}", "function addBooksToDropDown(obj, dropDownContent) {\n let closeButton = document.createElement(\"button\");\n let closeButtonIcon = document.createElement(\"img\");\n\n dropDownContent.appendChild(closeButton);\n closeButton.className = \"note-button close-btn-dropdown\";\n closeButton.addEventListener(\"click\", () => {\n dropDownContent.style.display = \"none\";\n });\n\n closeButton.appendChild(closeButtonIcon);\n closeButtonIcon.src = \"media/x.svg\";\n closeButtonIcon.height = \"18\";\n closeButtonIcon.width = \"18\";\n closeButtonIcon.alt = \"Close dropdown\";\n closeButtonIcon.title = \"close\";\n closeButtonIcon.className = \"close-btn-dropdown-img\";\n\n for (let i = 0; i < existingNoteBooks.length; i++) {\n let li = document.createElement(\"li\");\n li.className = \"dropdown-li\";\n let option = document.createElement(\"a\");\n\n option.href = \"#\";\n option.className = \"dropdown-option dropdown-a\";\n option.textContent = existingNoteBooks[i].getTitle();\n\n option.addEventListener(\"click\", (element) => {\n if (obj.checked == true || obj.checkBox.style.display == \"none\") {\n obj.setTitleOfNoteBook(element.target.innerText);\n saveNotesToLocalStorage();\n globalUpdate();\n }\n\n allNotes.forEach((element) => {\n if (element.checkBox.checked == true) {\n element.titleOfNoteBook = existingNoteBooks[i].getTitle();\n element.checkBox.checked = false;\n saveNotesToLocalStorage();\n globalUpdate();\n }\n });\n\n dropDownContent.style.display = \"none\";\n });\n\n li.appendChild(option);\n\n dropDownContent.appendChild(li);\n }\n\n let selectToMove = document.createElement(\"button\");\n selectToMove.textContent = \"SELECT MORE\";\n selectToMove.className =\n \"btn btn-outline-secondary btn-sm btn-block dropdown-btn\";\n selectToMove.addEventListener(\"click\", () => {\n moveSelected(true);\n });\n\n dropDownContent.appendChild(selectToMove);\n closeOnClickOutside(obj, dropDownContent);\n}", "function makeArtistsMenu () {\n fetchMyArtists((error, artists) => {\n if (error) { // Got an error\n console.error(error);\n } else {\n const menu = document.getElementById('artistMenu');\n artists.forEach(artist => {\n console.log(artist);\n const option = document.createElement('option');\n option.innerHTML = artist.artistName;\n option.value = artist.artistID;\n select.append(option);\n /*\n\n option.setAttribute('role','option');\n \n */\n });\n }\n });\n}", "function dropdown(e) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<select onChange={handleSelectChange} value={displayTag}>\n\t\t\t\t\t<option value=\"Select a Category\"> -- Select a category -- </option>\n\t\t\t\t\t<option value=\"all\">All</option>\n\n\t\t\t\t\t{categories.map((item) => <option value={item}>{item}</option>)}\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t)\n\t}", "function createDropdownMenu() {\n \n var dropdownMenuItems = document.getElementsByClassName(\"gen-tree\");\n\n for (var i = 0; i < dropdownMenuItems.length; i++) {\n dropdownMenuItems[i].onclick = function() {\n\n updateProgramTitle(this.innerHTML);\n\n var tableId = 'course-table'; \n var program = this.innerHTML;\n var numOfYears = 4;\n\n createTable(tableId, program, numOfYears);\n }\n }\n}", "showStandardMenu() {\n const menu = this._Menu.buildFromTemplate([\n {role: 'cut'},\n {role: 'copy'},\n {role: 'paste'},\n {type: 'separator'},\n {role: 'selectAll'},\n ]);\n menu.popup();\n }", "function addPriorityBox(newTaskForm){\n //add drop down box\n var priorityBtn = document.createElement(\"select\");\n priorityBtn.setAttribute(\"id\", \"priorityBtn\");\n priorityBtn.innerText += \"Priority\";\n\n //add drop down items\n var div = document.createElement(\"div\");\n div.setAttribute(\"class\", \"newTaskInput\");\n div.setAttribute(\"aria-labelledby\", \"dropdownMenuButton\");\n newTaskForm.appendChild(div);\n\n var high = document.createElement(\"option\");\n high.setAttribute(\"class\", \"dropdown-item\");\n high.setAttribute(\"value\", \"high\");\n high.innerHTML += \"High Priority\";\n priorityBtn.appendChild(high);\n\n var medium = document.createElement(\"option\");\n medium.setAttribute(\"value\", \"medium\");\n medium.setAttribute(\"class\", \"dropdown-item\");\n medium.innerHTML += \"Medium Priority\";\n priorityBtn.appendChild(medium);\n\n var low = document.createElement(\"option\");\n low.setAttribute(\"value\", \"low\");\n low.setAttribute(\"class\", \"dropdown-item\");\n low.innerHTML += \"Low Priority\";\n priorityBtn.appendChild(low); \n\n newTaskForm.appendChild(priorityBtn);\n newTaskForm.innerHTML += \"<br>\";\n\n return newTaskForm;\n}", "function initializeSlideDropdown() {\n var html = \"\";\n\n for (var i = 0; i < storyLength; i++) {\n html += \"<option>\" + (i+1) + \": \" + titleList[i] + \"</option>\\n\";\n }\n\n $slideDropdown.append(html);\n}", "function onOpen() {\n // Add a menu with some items, some separators, and a sub-menu.\n DocumentApp.getUi().createMenu('Utilities')\n .addItem('Insert Date', 'insertDateAtCursor')\n .addItem('Insert Time', 'insertTimeAtCursor')\n .addToUi();\n}", "add_item(tag, text) {\r\n $(tag).prepend('\\\r\n <a class=\"dropdown-item\">'+text+'</a>\\\r\n <div class=\"dropdown-divider\"></div>\\\r\n ')\r\n }", "function addHelpToolsMenu() {\n var edittools = document.getElementById('editpage-helpmenu');\n\n if (edittools) {\n var menu = \"<select id=\\\"helpControl\\\" style=\\\"display:inline\\\" onChange=\\\"chooseHelpTools(selectedIndex)\\\">\";\n menu += \"<option>Help Topics</option>\";\n menu += \"<option>Naming Conventions</option>\";\n menu += \"<option>Template Help</option>\";\n menu += \"<option>Image Help</option>\";\n menu += \"<option>Miscellaneous</option>\";\n menu += \"<option>Asking Questions</option>\";\n menu += \"</select>\";\n edittools.innerHTML = menu + edittools.innerHTML;\n\n /* default subset from cookie */\n var s = parseInt( getCookie('edittoolshelpmenu') );\n if ( isNaN(s) ) s = 0;\n\n /* update dropdown control to value of cookie */\n document.getElementById('helpControl').selectedIndex = s; \n\n /* display the subset indicated by the cookie */\n chooseHelpTools( s );\n }\n}", "function mkDrop(options, callback){\n var drop = $(\"<ul class='dropdown-menu'></ul>\");\n _.each(options, function(opt){\n drop.append(mkOption(opt, callback)); \n });\n return drop;\n }", "function showToChildList(data){\n\tvar toID = parseInt(document.getElementById(\"to_level_id\").value) + 1;\n\t\t//var toID = parseInt(document.getElementById(\"to_level_id\").value);\n\tvar anOption = document.createElement(\"OPTION\") ;\n\tdocument.getElementById(\"to_level_\"+toID).options.add(anOption) ;\n\tanOption.text = \"Select\";\n\tanOption.value = \"\"; \n\tfor(var key in data){\n\t\tvar anOption = document.createElement(\"OPTION\") ;\n\t\tdocument.getElementById(\"to_level_\"+toID).options.add(anOption) ;\n\t\tanOption.text = data[key].localBodyNameInEnglish;\n\t\tanOption.value = data[key].localBodyCode; \t\t\n\t}\n\tdocument.getElementById(\"to_level_id\").value = toID;\n}", "function showStatesInDropDown() {\n\tlet html = states.map(curr => \"<option value=\" + curr.code + \">\" + curr.name + \"</option>\")\n\tlet inputState = document.querySelector('#inputStateForm');\n\tinputState.insertAdjacentHTML(\"afterbegin\", html);\n}", "function questionCreator() {\n\n\tvar container = $(\"<div class='form-group'></div>\");\n\n\tfor (var i = 0; i <= questions.length; i++) {\n\t\tvar dropMenuCont = $(\"<select id='question\" + (i + 1)+ \"'></select>\");\n\t\tvar title = $(\"<h3>\" + questions[i].title + \"</h3>\");\n\t\tvar question = $(\"<p>\" + questions[i].question + \"</p>\");\n\t\tdropMenu(dropMenuCont);\n\t\tcontainer.append(title);\n\t\tcontainer.append(question);\n\t\tcontainer.append(dropMenuCont)\n\t\t$(\"#questions\").append(container);\n\n\t}\n}", "function createNoteOptions() {\n var selects = $('[id^=note]');\n for (var i = 0; i < selects.length; i++) {\n for(var key in notes) {\n createNoteOption(selects[i], key);\n }\n }\n}", "buildSelect() {\n // Build html select\n this.select = document.createElement('select')\n this.select.classList.add(this.selectClass)\n // Create all options from li\n const items = this.element.querySelectorAll('li')\n ;[].forEach.call(items, item => {\n const option = document.createElement('option')\n option.innerText = item.innerText\n option.value = item.querySelector('a').href\n if (item.classList.contains('active')) {\n option.selected = true\n }\n this.select.appendChild(option)\n })\n // Clean parent and append select\n this.parent.innerHTML = ''\n this.parent.appendChild(this.select)\n this.select.addEventListener('change', this.handleSelectAsLink)\n }", "function addFriendS() {\n var ul = document.getElementById(\"dropdown\");\n var li = document.createElement(\"li\");\n\n li.appendChild(document.createTextNode(\"Shaun Chung\"));\n ul.appendChild(li);\n}", "function generateSelectionMenu() {\n // Iterate through the river info to determine the dropdow groupings\n var selectionGroups = [];\n for(var i=0; i < riverInfo.length; i++) {\n if(i == 0) {\n selectionGroups.push(riverInfo[i].state);\n } else {\n if(selectionGroups.includes(riverInfo[i].state) == false) {\n selectionGroups.push(riverInfo[i].state);\n }\n }\n }\n\n // Iterate over each selection group, placing the group in the item-list\n for(var i=0; i < selectionGroups.length; i++) {\n var currentGroup = '<div id=\"' + abbrState(selectionGroups[i], 'abbr') + '-group\" class=\"item-group\" data-state=\"' + selectionGroups[i] + '\"></div>';\n $('.item-list').append(currentGroup);\n }\n\n // Iterate over each item in the river info list, placing each one in its appropriate dropdown group\n riverInfo.forEach((riverData, i) => {\n var selectionIDText = riverData.river.toLowerCase().split(\" \").join(\"-\") + \"-selection\";\n var currentItem = document.createElement('div');\n currentItem.id = riverData.river.toLowerCase().split(\" \").join(\"-\") + '-selection';\n currentItem.classList.add('item');\n currentItem.dataset.index = i;\n currentItem.addEventListener('click', () => selectItem(selectionIDText));\n currentItem.innerHTML = riverData.river;\n var itemGroup = '#' + abbrState(riverData.state, 'abbr') + '-group';\n $(itemGroup).append(currentItem);\n })\n}", "function createDoctype() {\n const selectedOption = getSelectedOption();\n createListItem(selectedOption.textContent);\n hide(doctypeSelector);\n createAddButton();\n createCancelButton();\n createAgeSelector(selectedOption);\n createTitleInput();\n}", "function criarItensDropdown(dados) {\n \n categoriasIds.set(dados.nome, dados.id)\n categoriasNomes.set(dados.id, dados.nome)\n\n const dropdownAdicionar = document.getElementById(\"adicionarDropdown\")\n const dropdownAlterar = document.getElementById(\"alterarDropdown\")\n\n const optionAdicionar = document.createElement(\"OPTION\")\n optionAdicionar.innerHTML = dados.nome\n\n const optionAlterar = document.createElement(\"OPTION\")\n optionAlterar.innerHTML = dados.nome\n \n\n dropdownAdicionar.options.add(optionAdicionar)\n dropdownAlterar.options.add(optionAlterar)\n}", "function addHelpToolsMenu() {\n var edittools = document.getElementById('editpage-helpmenu');\n\n if (edittools) {\n var menu = \"<select id=\\\"helpControl\\\" style=\\\"display:inline\\\" onChange=\\\"chooseHelpTools(selectedIndex)\\\">\";\n menu += \"<option>Tópicos de Ajuda</option>\";\n menu += \"<option>Convenções de Nomenclatura</option>\";\n menu += \"<option>Ajuda da Predefinição</option>\";\n menu += \"<option>Ajuda da Imagem</option>\";\n menu += \"<option>Diversos</option>\";\n menu += \"<option>Fazendo Perguntas</option>\";\n menu += \"</select>\";\n edittools.innerHTML = menu + edittools.innerHTML;\n\n /* default subset from cookie */\n var s = parseInt( getCookie('edittoolshelpmenu') );\n if ( isNaN(s) ) s = 0;\n\n /* update dropdown control to value of cookie */\n document.getElementById('helpControl').selectedIndex = s; \n\n /* display the subset indicated by the cookie */\n chooseHelpTools( s );\n }\n}", "function init_dash() {\n dropDown();\n}", "function PancakeDropdown(promptText) {\n /**CONSTANTS***/\n //Keys\n //Style\n var BG_COLOR = \"#FFFFFF\";\n var BORDER_COLOR = \"#c9cbcd\";\n var BG_COLOR_SELECTED = \"#f2f5f8\";\n var BORDER_COLOR_SELECTED = \"#B4B6B8\";\n var FONT_COLOR = \"#B1A9AE\";\n var FONT_COLOR_SELECTED = \"#68696b\";\n //Layout\n var DEFAULT_HEIGHT = 20;\n //Class\n var DROPDOWN_SELECT_TEXT_CLASS = \"DROPDOWN_SELECT_TEXT_CLASS\";\n\n /**Externally Set***/\n //Structure\n var externalDiv;\n //Util\n var papaIndicatorSelection;\n var optionWindowComponent;\n //Layout\n var windowWidth;\n var width;\n var height = DEFAULT_HEIGHT;\n var isAlignLeft;\n //Functions\n var externalOnOptionSelected;\n\n /**Internally Set***/\n //Structure\n var selectedP;\n var dropButton;\n var closeButton;\n var optionsWindowDiv;\n //State\n var selectedText;\n var selectedTextColor;\n //Utils\n var shapeUtil = ShapesUtil.getInstance();\n //State\n var selectedOptionData;\n var isShowFullList;\n\n /**Public Function**/\n this.setExternalDiv = function (divD3) {\n externalDiv = divD3;\n };\n\n this.setSelectedTextColor = function(color){\n selectedTextColor = color;\n };\n\n this.drawComponent = function () {\n performConstruct();\n };\n\n this.setOuterComponents = function (optionWindowComponentInput) {\n optionWindowComponent = optionWindowComponentInput;\n };\n\n this.setLayout = function (widthInput, heightInput, windowWidthInput, isAlignLeftInput) {\n width = widthInput;\n height = heightInput;\n windowWidth = windowWidthInput;\n isAlignLeft = isAlignLeftInput;\n if (!windowWidth){\n windowWidth = width;\n }\n };\n\n this.setSelectedOption = function(optionData){\n selectedOptionData = optionData;\n markAsSelected();\n };\n\n this.setFunctions = function(onOptionSelectedInput){\n externalOnOptionSelected = onOptionSelectedInput;\n };\n\n this.clearSelection = function () {\n clearSelection();\n };\n\n /***Construct***/\n function performConstruct() {\n clearSlate(externalDiv);\n\n selectedP = externalDiv.append(\"p\")\n .style({\n position: \"absolute\",\n margin: 0,\n \"font-size\": 13 + \"px\",\n top: 0 + \"px\",\n right: 0 + \"px\",\n width: width + \"px\",\n height: height + \"px\",\n border: \"1px solid\",\n \"line-height\": height + \"px\",\n \"padding-left\": 5 + \"px\",\n \"padding-right\": 20 + \"px\",\n \"border-radius\": 2 + \"px\",\n \"box-sizing\": \"border-box\",\n cursor: \"pointer\"\n })\n .classed(DROPDOWN_SELECT_TEXT_CLASS, true)\n .on(\"click\", onDropClick)\n .on(\"mousedown\", onDropMouseDown);\n\n dropButton = externalDiv.append(\"div\")\n .style({\n position: \"absolute\",\n top: 0 + \"px\",\n right: 0 + \"px\",\n width: 20 + \"px\",\n height: 20 + \"px\",\n cursor: \"pointer\",\n \"pointer-events\": \"none\"\n });\n\n var dropIcon = dropButton.append(\"div\")\n .style({\n position: \"absolute\",\n top: 6 + \"px\",\n right: 6 + \"px\",\n width: 8 + \"px\",\n height: 8 + \"px\"\n });\n shapeUtil.createTriangle(dropIcon, 8, 8, shapeUtil.DIRECTION.BOTTOM, \"#555555\");\n\n closeButton = externalDiv.append(\"div\")\n .style({\n position: \"absolute\",\n top: 0 + \"px\",\n right: 0 + \"px\",\n width: 20 + \"px\",\n height: 20 + \"px\",\n display: \"none\",\n cursor: \"pointer\",\n background: BORDER_COLOR_SELECTED\n })\n .on(\"click\", onCancelClick)\n .on(\"mousedown\", onCancelMouseDown);\n\n var closeP = closeButton.append(\"p\")\n .style({\n margin: 0,\n \"font-family\": \"sans-serif\",\n \"font-size\": 14 + \"px\",\n \"text-align\": \"center\",\n height: 20 + \"px\",\n \"line-height\": 20 + \"px\"\n })\n .text(\"X\");\n\n optionsWindowDiv = externalDiv.append(\"div\")\n .style({\n position: \"absolute\",\n top: height + 5 + \"px\",\n width: windowWidth + \"px\",\n border: \"1px solid #999999\",\n background: \"white\",\n display: \"none\",\n \"z-index\": 2\n });\n\n if (!isAlignLeft){\n optionsWindowDiv.style(\"left\", 0);\n }else{\n optionsWindowDiv.style(\"right\", 0);\n }\n\n optionWindowComponent.setFunctions(onOptionSelected);\n optionWindowComponent.setExternalDiv(optionsWindowDiv);\n optionWindowComponent.drawComponent();\n\n optionWindowComponent.hideList();\n unmarkAsSelected();\n }\n\n\n function switchToCloseButton() {\n closeButton.style(\"display\", \"\");\n dropButton.style(\"display\", \"none\");\n }\n\n function switchToDropButton() {\n closeButton.style(\"display\", \"none\");\n dropButton.style(\"display\", \"\");\n }\n\n /**Actions!**/\n function showList() {\n optionWindowComponent.showList();\n }\n\n function clearSelection() {\n selectedOptionData = undefined;\n unmarkAsSelected();\n optionWindowComponent.clearSelection();\n }\n\n function unmarkAsSelected() {\n if (!promptText){\n promptText = \"Select\";\n }\n\n selectedP.style({\n color: FONT_COLOR,\n \"border-color\": BORDER_COLOR,\n background: BG_COLOR,\n \"font-weight\": \"normal\"\n }).text(promptText);\n\n switchToDropButton();\n }\n\n function markAsSelected() {\n selectedP.style({\n color: FONT_COLOR_SELECTED,\n \"border-color\": BORDER_COLOR_SELECTED,\n background: BG_COLOR_SELECTED,\n \"font-weight\": 700\n }).text(selectedOptionData.selectedText);\n\n if (selectedTextColor){\n selectedP.style(\"color\", selectedTextColor);\n }\n\n switchToCloseButton();\n }\n\n /**Event Listener***/\n function onOptionSelected(optionData) {\n selectedOptionData = optionData;\n markAsSelected();\n if (externalOnOptionSelected) {\n externalOnOptionSelected(selectedOptionData);\n }\n }\n\n function onDropMouseDown(){\n optionWindowComponent.isOptionClicked = true;\n }\n\n function onDropClick() {\n isShowFullList = true;\n if (optionsWindowDiv.style(\"display\") == \"none\") {\n showList();\n } else {\n optionWindowComponent.hideList();\n }\n }\n\n function onCancelClick() {\n clearSelection();\n if (externalOnOptionSelected) {\n externalOnOptionSelected(undefined);\n }\n optionWindowComponent.hideList();\n }\n\n function onCancelMouseDown(){\n optionWindowComponent.isOptionClicked = true;\n }\n\n}", "function showLanguageOption(item) {\n document.getElementById(\"dropdownLanguageOption\").innerHTML = item.innerHTML;\n}", "function itemMenu(e) {\n\te.preventDefault();\n\tItemSelection = e.target;\n\tconst[idx, isSource] = findNode(ItemSelection);\n\tconst elemName = (isSource) ? \"sourceDropdown\" : \"deviceDropdown\";\n\tconst menu = document.getElementById(elemName);\n\tmenu.style.top = `${e.pageY}px`;\n\tmenu.style.left = `2rem`;\n\tmenu.classList.toggle(\"show\");\n}", "get selector() {\n if(!this.exists)\n if(this.publication.pmetadata.title)\n return m(\"span#br-chapter\", this.publication.pmetadata.title);\n else\n return null;\n\n return m(\"select#br-chapter\", {\n title: __(\"Chapter selection\"),\n onchange: (e) => {\n const st = e.target;\n m.route.set(\"/:id\", { id: st[st.selectedIndex].value, }, { replace: false });\n }\n }, this.volumes.map(volume => {\n const chapters = [];\n volume.chapters.forEach(chapter => {\n chapters.push(m(\"option\", {\n value: chapter.uuid,\n selected: this.isSelected(chapter)\n }, chapter.title));\n });\n if(volume.title)\n return m(\"optgroup\", {\n label: volume.title\n }, chapters);\n else\n return chapters;\n \n }));\n }", "function createMenu(app) {\n const { commands } = app;\n let menu = new widgets_1.Menu({ commands });\n menu.title.label = 'BookMark';\n exports.BookMarks.forEach(item => menu.addItem({ command: `BookMark-${item.name}:show` }));\n return menu;\n }", "dropdownContent() {\n return Demo.getSamplePrograms().map(program => {\n return (\n <a tabindex=\"0\" class=\"dropdown-item\" onclick={e=>this.handleDropdownClick(program)}>\n {program.name}\n </a>\n );\n })\n }", "function dropDown(itemNames, id, locationHash){\n\t\titemNames.forEach((item)=>{\n\n\t\t\t//creating li and a tags for dropdown-content\n\t\t\tvar a = document.createElement(\"a\");\n\t\t\tvar li = document.createElement(\"li\");\n\n\t\t\t//setting links of dropdown element's\n\t\t\ta.setAttribute(\"href\", locationHash+item.toLowerCase());\n\n\t\t\t//adding item to 'a' tag as inner element\t\n\t\t\ta.innerHTML = item;\n\n\t\t\t//adding 'a' tag to 'li' tag as a child element\n\t\t\tli.appendChild(a);\n\n\t\t\t//adding 'li' tag to 'id' parameter as a child element\n\t\t\tid.appendChild(li);\t\n\t\t});\n\t}", "function clearNoteDropDown() {\n document.querySelectorAll(\".close-btn-dropdown\").forEach((e) => e.remove());\n document.querySelectorAll(\".dropdown-li\").forEach((e) => e.remove());\n document.querySelectorAll(\".dropdown-btn\").forEach((e) => e.remove());\n}", "function lcDisplayTypeMenu(itemArray) {\n actualArray = new Array();\n //the list does not include the first two items.\n for (i = 2; i < itemArray.length; i++) {\n actualArray[i-2] = itemArray[i];\n }\n new PopupMenu(\"Learning Curve Types\", \"LearningCurveTypes\", actualArray, mouse_x, mouse_y,\n parseSelectedType, itemArray[1]);\n}", "function fnMenuContextPastas() {\n var vjsHtml = \"\";\n vjsHtml = vjsHtml + \"<li>\";\n vjsHtml = vjsHtml + \" <div style='margin: 3px;border:1px none #4cff00;'>\";\n vjsHtml = vjsHtml + \" <span style='display:block; font-size: 11px; margin:0 0 0 20px; min-width:200px; width:200px; color: #bbb;'>Ações para a pasta:</span>\";\n vjsHtml = vjsHtml + \" <span id='menuContextPastas_pasta' style='display:block; margin: 0 20px; font-size: 15px; max-width:200px;font-size: 13px; overflow:hidden; white-space: nowrap; text-overflow: ellipsis;' title=''></span>\";\n vjsHtml = vjsHtml + \" </div>\";\n vjsHtml = vjsHtml + \"</li>\";\n vjsHtml = vjsHtml + \"<li class='divider'></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' id='menuContextPastas_abrir' data-caminho=''><i class='fa fa-folder-open-o'>&nbsp;&nbsp;</i>Abrir</a></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' id='menuContextPastas_renomear' data-toggle='modal' data-target='#modalBootstrap' data-whatever='' data-estadopasta='fechada' data-tipo='D' data-caminho=''><i class='fa fa-pencil'>&nbsp;&nbsp;</i>Renomear</a></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' id='menuContextPastas_moverpara' data-toggle='modal' data-target='#modalBootstrap' data-nome='' data-estadopasta='fechada' data-tipo='D' data-caminho=''><i class='fa fa-arrows'>&nbsp;&nbsp;</i>Mover Para</a></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' class='btn disabled' style='text-align: left;'><i class='fa fa-files-o'>&nbsp;&nbsp;</i>Copiar Para</a></li>\";\n vjsHtml = vjsHtml + \"<li role='separator' class='divider'></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' id='menuContextPastas_excluir' data-caminho='' data-caminhopastapai= '' data-whatever='' data-tipo='D' data-estadopasta='fechada' class='btn' style='text-align: left;'><i class='fa fa-trash'>&nbsp;&nbsp;</i>Excluir</a></li>\";\n $(\".folders, .folders_lista, .directory\").contextMenu({\n menuSelector: \"#contextMenu\",\n menuSelected: function (invokedOn, selectedMenu) {\n },\n beforeShow: function (invokedOn) {\n $(\"#contextMenu ul\").empty().append(vjsHtml);\n if (invokedOn.closest('#container_principallista').length) {\n $(\"#menuContextPastas_pasta\").attr('title', $.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_pasta\").text($.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_abrir\").data('caminho', invokedOn.find('a').data('caminho'));\n $(\"#menuContextPastas_renomear\").data('whatever', $.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_renomear\").data('caminho', invokedOn.find('a').data('caminho'));\n $(\"#menuContextPastas_moverpara\").data('nome', $.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_moverpara\").data('caminho', invokedOn.find('a').data('caminho'));\n $(\"#menuContextPastas_excluir\").data('caminho', invokedOn.find('a').data('caminho'));\n $(\"#menuContextPastas_excluir\").data('whatever', $.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_excluir\").data('caminhopastapai', $.trim(invokedOn.closest('#container_principallista').data('caminhopasta')));\n }\n else if (invokedOn.closest('.jqueryFileTree').length) {\n $(\"#menuContextPastas_pasta\").attr('title', $.trim(invokedOn.closest('.directory').find('a:first').text()));\n $(\"#menuContextPastas_pasta\").text($.trim(invokedOn.closest('.directory').find('a:first').text()));\n if (invokedOn.closest('.directory').hasClass('collapsed')) {\n $(\"#menuContextPastas_abrir\").text(\"Abrir\").prepend(\"<i class='fa fa-folder-open-o'>&nbsp;&nbsp;</i>\");\n $(\"#menuContextPastas_renomear\").data(\"estadopasta\", \"fechada\");\n $(\"#menuContextPastas_excluir\").data(\"estadopasta\", \"fechada\");\n $(\"#menuContextPastas_moverpara\").data(\"estadopasta\", \"fechada\");\n }\n else if (invokedOn.closest('.directory').hasClass('expanded')) {\n $(\"#menuContextPastas_abrir\").text(\"Recarregar\").prepend(\"<i class='fa fa-refresh'>&nbsp;&nbsp;</i>\");\n $(\"#menuContextPastas_renomear\").data(\"estadopasta\", \"aberta\");\n $(\"#menuContextPastas_excluir\").data(\"estadopasta\", \"aberta\");\n $(\"#menuContextPastas_moverpara\").data(\"estadopasta\", \"aberta\");\n }\n $(\"#menuContextPastas_abrir\").data('caminho', invokedOn.find('a:first').data('caminho'));\n $(\"#menuContextPastas_renomear\").data('whatever', $.trim(invokedOn.closest('.directory').find('a:first').text()));\n $(\"#menuContextPastas_renomear\").data('caminho', invokedOn.find('a:first').data('caminho'));\n $(\"#menuContextPastas_moverpara\").data('nome', $.trim(invokedOn.closest('.directory').find('a:first').text()));\n $(\"#menuContextPastas_moverpara\").data('caminho', invokedOn.find('a:first').data('caminho'));\n $(\"#menuContextPastas_excluir\").data('caminho', invokedOn.find('a:first').data('caminho'));\n $(\"#menuContextPastas_excluir\").data('whatever', $.trim(invokedOn.closest('.directory').find('a:first').text()));\n if (invokedOn.closest('.jqueryFileTree').closest('.expanded').length) {\n $(\"#menuContextPastas_excluir\").data('caminhopastapai', invokedOn.closest('.jqueryFileTree').closest('.expanded').find('a:first').data('caminho'));\n }\n else{\n $(\"#menuContextPastas_excluir\").data('caminhopastapai', '/');\n }\n if (invokedOn.data('origemacesso') == '1') {\n $(\"#menuContextPastas_moverpara\").data('origemacesso', invokedOn.data('origemacesso'));\n }\n }\n }\n });\n }", "function renderMenu(){\n $.get(\"/api/masterPlants/\", function(mData){\n for (var i=0; i<mData.length; i++){\n var newOption = $(\"<option>\").text(mData[i].common_name).addClass(\"drop-down\");\n newOption.attr({\"value\":mData[i].id});\n $(\"#drop-down\").append(newOption);\n } \n })\n }", "function dropdownList() {\n $dropdownItem.click(function() {\n if (widthFlg) {\n $(this).toggleClass('active');\n if ($(this).hasClass('active')) {\n $(this).next(\"ul\").stop().slideDown({duration: 300, easing: \"easeOutBack\"});\n $(this).find('.material-icons').text('keyboard_arrow_down');\n\n } else {\n $(this).next(\"ul\").stop().slideUp({duration: 300, easing: \"easeOutBack\"});\n $(this).find('.material-icons').text('keyboard_arrow_right');\n\n }\n }\n });\n }", "function displayListMenu() {\n $.get('js/templates/listChooserMenu.html', function (source) {\n var template = Handlebars.compile(source);\n var templateData = {\n items: arrayObj,\n save: false,\n remove: true\n };\n $(savedList).append(template(templateData));\n }, 'html')\n}", "function dropMenus(markupSet) {\n\t\t\t\tvar ul = $('<ul></ul>'), i = 0;\n\t\t\t\t$('li:hover > ul', ul).css('display', 'block');\n $('<li class=\"bbcode_button_left\"></li>').appendTo(ul);\n\t\t\t\t$.each(markupSet, function(index) {\n\t\t\t\t\tvar button = this, t = '', text = '', custom = '', title, li, j;\n title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');\n switch (button.name) {\n case 'H1':\n title = 'Заголовок 1-го уровня';\n break;\n\n case 'H2':\n title = 'Заголовок 2-го уровня';\n break;\n\n case 'H3':\n title = 'Заголовок 3-го уровня';\n break;\n\n case 'b':\n title = 'Жирный текст';\n break;\n\n case 'i':\n title = 'Наклонный текст';\n break;\n\n case 'U':\n title = 'Подчёркнутый текст';\n break;\n\n case 'align':\n title = 'Сдвиг текста';\n break;\n\n case 'picture':\n title = 'Вставка картинки';\n break;\n\n case 'list_num':\n title = 'Элемент числового списка';\n break;\n\n case 'list_num_sub':\n title = 'Подэлемент числового списка';\n break;\n\n case 'list':\n title = 'Элемент маркированного списка';\n break;\n\n case 'list_sub':\n title = 'Подэлемент маркированного списка';\n break;\n\n case 'link':\n title = 'Ссылка';\n break;\n\n case 'smile':\n title = 'Смайлы';\n custom = 'custom_a';\n text = 'Смайлы';\n onclick = 'onclick = \"attachObject.controller(\\'getAttachForm\\', \\'smile\\')\"';\n break;\n }\n if (button.preview) {\n title = button.preview;\n text = button.preview;\n button.name = 'custom_a';\n custom = 'custom_a';\n }\n if (button.nextline) {\n $('<li class=\"bbcode_button_right\"></li>').appendTo(ul);\n $('<br/><br/>').appendTo(ul);\n $('<li class=\"bbcode_button_left\"></li>').appendTo(ul);\n }\n \n if (button.name) {\n var onclick;\n switch (button.name) {\n\n case 'box':\n case 'file':\n title = 'Загрузка архивов';\n text = '';\n button.name = 'box';\n custom = 'box';\n onclick = 'onclick = \"attachObject.controller(\\'getAttachForm\\', \\'file\\')\"';\n break;\n\n case 'dynamic':\n case 'sample':\n title = 'Загрузка семпла';\n text = '';\n button.name = 'dynamic';\n custom = 'dynamic';\n onclick = 'onclick = \"attachObject.controller(\\'getAttachForm\\', \\'sample\\')\"';\n break;\n\n case 'image':\n title = 'Загрузка картинки';\n text = '';\n onclick = 'onclick = \"attachObject.controller(\\'getAttachForm\\', \\'image\\')\"';\n break;\n\n case 'music':\n title = 'Прикрепить трек';\n text = '';\n onclick = 'onclick = \"attachObject.controller(\\'getAttachForm\\', \\'track\\')\"';\n break;\n\n case 'video':\n title = 'Прикрепить видео';\n onclick = 'onclick = \"attachObject.controller(\\'getAttachForm\\', \\'video\\')\"';\n break;\n\n case 'link':\n title = 'Вставить ссылку';\n onclick = 'onclick = \"attachObject.controller(\\'getAttachForm\\', \\'link\\')\"';\n break;\n }\n }\n\t\t\t\t\tkey = (button.key) ? 'accesskey=\"'+button.key+'\"' : '';\n key = (button.key) ? 'accesskey=\"'+button.key+'\"' : '';\n if (button.separator) {\n $('<li class=\"bbcode_button_right\"></li>').appendTo(ul);\n $('<li class=\"bbcode_button_left\"></li>').appendTo(ul);\n } else {\n i++;\n for (j = levels.length -1; j >= 0; j--) {\n t += levels[j]+\"-\";\n }\n li = $('<li class=\" bbcode_button_center markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'\"><a href=\"javascript:void(0)\" '+key+' title=\"'+title+'\" class=\"bbcode_' + button.name + ' '+custom+'\" '+(onclick||'')+' style=\"text-decoration: none;\">'+text+'</a></li>')\n .bind(\"contextmenu\", function() { // prevent contextmenu on mac and allow ctrl+click\n return false;\n }).click(function() {\n return false;\n }).bind(\"focusin\", function(){\n $$.focus();\n }).mouseup(function() {\n if (button.call) {\n eval(button.call)();\n }\n setTimeout(function() { markup(button) },1);\n return false;\n }).hover(function() {\n $('> ul', this).show();\n $(document).one('click', function() { // close dropmenu if click outside\n $('ul ul', header).hide();\n }\n );\n }, function() {\n $('> ul', this).hide();\n }\n ).appendTo(ul);\n\n if (typeof markupSet[Number(index) + Number(1)] != 'undefined')\n if (typeof markupSet[Number(index) + Number(1)].separator == 'undefined' && !button.seperator)\n $('<li class=\"bbcode_button_seperator\"></li>').appendTo(ul);\n if (button.dropMenu) {\n levels.push(i);\n $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));\n }\n }\n });\n text = '';\n custom = '';\n $('<li class=\"bbcode_button_right\"></li>').appendTo(ul);\n\t\t\t\tlevels.pop();\n\t\t\t\treturn ul;\n\t\t\t}", "function create_form_drop_down(name,elements)\n{\n let drops = [];\n name += \"<m style='color: red; display: inline-block;'> * </m>\";\n for(let i = 0;i < elements.length ; i++)\n {\n drops.push(`<option value=\"${elements[i]}\">${elements[i]}</option>`)\n };\n return `<div class=\"input_container\">\n <label for=\"${name.toLowerCase()}\">\n <b>${name} : </b>\n </label>\n <br>\n <select type=\"text\" class=\"data\" name=\"${name.toLowerCase()}\">\n ${drops.join('')}\n </select>\n </div>`;\n}", "function _dos_template_start() {\n // ALL plugin elements definition\n const dos_wrapper = document.querySelector(\"#dos_wrapper\"),\n dos_openButton = document.querySelector(\"#dos_open_button\"),\n dos_list_wrapper = document.querySelector(\"#dos_list_wrapper\"),\n dos_templates_options = document.querySelector(\"#dos_templates_options\"),\n dos_paste_button = document.querySelector(\"#dos_paste_button\"),\n dos_reset_button = document.querySelector(\"#dos_reset_button\"),\n dos_preview_block = document.querySelector(\"#dos_preview_block\"),\n dos_preview_area_ru = document.querySelector(\"#dos_preview_area_ru\"),\n dos_preview_area_ua = document.querySelector(\"#dos_preview_area_ua\"),\n dos_add_new_option = document.querySelector(\"#dos_add_new_option\"),\n\n\n textareas = dos_preview_block.querySelectorAll(\"textarea\");\n\n // options creating model (class) for drop-down\n class Template {\n constructor(label, textRU, textUA) {\n this.ru = String(textRU);\n this.ua = String(textUA);\n this.option = document.createElement(\"option\");\n this.option.label = label;\n this.option.value = label;\n arr.push(this);\n return dos_templates_options.append(this.option);\n };\n }\n\n // Creating new templates and adding it options into drop-down\n const buzzer = new Template(`Buzzer`, \"ru\", \"ua\");\n const speaker = new Template(`Speaker`, `<div href=\"\">RURU</div>`, `<div href=\"\">UAUA</div>`);\n\n const sim_holder = new Template(`Держатели SIM-карт`, `\n <p><strong>{$prefix}&nbsp;{$brand_name}&nbsp;{$name}&nbsp;{$mod}.</strong></p><p style=\"margin-bottom: 24px;\"><u><strong>Держатель SIM-карты (лоток) смартфона</strong></u>&nbsp;&mdash; это маленькая и довольно хрупкая деталь. Держатели к разным смартфонам изготовлены из разных материалов, в зависимости от бренда и модели: пластик, метал, а также композитные. Наиболее осторожными нужно быть с пластиковым держателем, так как он является самым хрупким, металлические, в свою очередь - чаще теряются. Ломаются держатели от того, что их вставляют небрежно или не той стороной, также при неосторожной установке сим-карты. В худшем случае, вы можете повредить контактные усики внутри разъема (коннектора) или вовсе отломать разъем от контактов платы. Ломают держатели реже, так как владельцами устройств используется совсем не часто. Самой распостраненной причиной замены нового держателя является потеря старого.</p><hr/><div>Когда нужно купить новый держатель сим карты:</div><div>&nbsp;</div><div>держатель был утерян;</div><div>сим-лоток деформирован;</div><div>на поверхность лотка попадала вода или любая другая жидкость;</div><div>появление ржавчины на лотке (в случае металлических держателей);</div><div>отсутствует часть или половина сим держателя;</div><div>если слот симкарты застрял в неподвижном положении - следует обратится в сервисный центр.<br/>​</div><hr/><p style=\"margin-bottom: 24px;\"><br/>Если же у вас недостаточно опыта в обращении с техникой или составляющими мелкими деталями - не стоит самостоятельно пытаться склеить или почистить лоток. Также категорически не рекомендуем использовать держатель с другой модели смартфона.&nbsp;</p><p style=\"margin-bottom: 24px;\">Обратитесь в сервисный центр нашего магазина, где наши сотрудники проведут диагностику устройства, сообщат вам о поломке, помогут выбрать нужный товар и проконсультируют вас.</p><style type=\"text/css\">.gost:hover{color: green; /* Цвет ссылки */}</style>`, `\n <div><div><strong>{$prefix}{$brand_name}{$name}{$mod}.</strong></div><div>&nbsp;</div><div><u><strong>Тримач SIM-карти (лоток) смартфона</strong></u>&nbsp;- це маленька і досить тендітна деталь. Тримачі до різних смартфонів виготовлені з різних матеріалів, залежно від бренду та моделі: пластик, метал, а також композитні. Найбільш обережними потрібно бути з пластиковим тримачем, так як він є найтендітнішим, металеві, в свою чергу - частіше губляться. Ламаються тримачі від того, що їх вставляють недбало або не тією стороною, а також при необережній установці сім-карти. У гіршому випадку, ви можете пошкодити контактні вусики всередині роз&#39;єму (коннектора) або зовсім відламати роз&#39;єм від контактів плати. Ламають тримачі рідше, так як власниками пристроїв використовується зовсім не часто. Найбільш поширеною причиною заміни тримача є втрата старого.</div><div>&nbsp;</div><div><hr/><div>Коли варто купувати новий тримач сім:</div></div><ul><li>&nbsp;</li><li><div>тримач був загублений;</div><div>сім-лоток деформований;</div><div>відсутня частина або половина лотка;</div><div>на поверхню лотка потрапляла вода або будь-яка інша рідина;</div><div>поява іржі на лотку (в разі металевих утримувачів);</div><div>якщо слот сім карти застряг в нерухомому положенні - варто звернутися до сервісного центру.</div><div>&nbsp;</div></li></ul><div><hr/><p><br/>Якщо ж у вас недостатньо досвіду в поводженні з технікою або складовими дрібними деталями - не варто самостійно намагатися склеїти або очистити лоток. Також категорично не рекомендуємо використовувати тримач з іншої моделі смартфона.</p></div><div>&nbsp;</div><div>Зверніться в сервісний центр нашого магазину, де наші співробітники проведуть діагностику пристрої, повідомлять вам про поломку, допоможуть вибрати потрібний товар і проконсультують вас.</div><div>&nbsp;</div></div><style type=\"text/css\">.gost:hover{color: green; /* Цвет ссылки */}</style>\n `);\n const micro = new Template(`Микрофоны`, `\n <div><span style=\"font-family:tahoma,geneva,sans-serif;\"><u><strong>Микрофон</strong></u> - одна из важнейших деталей смартфона, так как именно с помощью его мы можем общаться с другими людьми и сложно было бы себе представить телефон без микрофона. Основной задачей микрофона является преобразование звуковых волн в электромагнитные. Зачастую, производители устанавливают в свои мобильные устройства микрофоны 2-х типов: микрофон шумоподавления и цифровой (основной).&nbsp; Данные компоненты часто распаяны на нижней плате телефона. А наружу видны только крохотные круглые отверстия в нижней части корпуса. В случае с основным микрофоном, именно через такое отверстие звук и поступает в микрофон.</span></div><div>&nbsp;</div><div><span style=\"font-family:tahoma,geneva,sans-serif;\">Основные <strong>признаки</strong> неисправности микрофона:</span><br/>&nbsp;</div><ul><li><span style=\"font-family:tahoma,geneva,sans-serif;\">ваш собеседник плохо вас слышит или не слышит вовсе;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">вы или ваш собеседник слышите шум во время звонка;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">микрофон перестает работать в отдельном приложении.</span></li></ul><div>&nbsp;</div><div><span style=\"font-family:tahoma,geneva,sans-serif;\"><strong>Причины</strong> неисправности:</span><br/>&nbsp;</div><ul><li><span style=\"font-family:tahoma,geneva,sans-serif;\">повреждение шлейфа;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">в микрофон попадала влага или пыль;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">микрофон физически поврежден;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">программные неполадки устройства.</span></li></ul><div>&nbsp;</div><div><span style=\"font-family:tahoma,geneva,sans-serif;\">В таком случае, не стоит пытаться самостоятельно чистить или чинить микрофон, не имея опыта такой работы, подобные действия могут привести к повреждению корпуса, самого микрофона или платы, на которой тот расположен.</span></div><div><span style=\"font-family:tahoma,geneva,sans-serif;\">Обратитесь в сервисный центр нашего магазина, где наши сотрудники проведут диагностику устройства, сообщат вам о поломке и проконсультируют вас.</span></div>`, `\n <div><span style=\"font-family:tahoma,geneva,sans-serif;\"><u><strong>Мікрофон</strong></u> - одна з найважливіших деталей смартфона, так як саме за допомогою нього ми можемо спілкуватися з іншими людьми і важко було б собі уявити телефон без мікрофона. Головною завданням мікрофону є перетворення звукових хвиль на електромагнітні. Часто, виробники встановлюють в свої мобільні пристрої мікрофони 2-х типів: мікрофон шумозаглушення та цифровий(основний). Дані компоненти часто розпаяні на нижній платі телефону. А назовні видно тільки крихітні круглі отвори в нижній частині корпусу. У випадку з основним мікрофоном, саме через такий отвір звук і потрапляє до мікрофону.&nbsp;</span><br/>&nbsp;</div><div><span style=\"font-family:tahoma,geneva,sans-serif;\">Основні <strong>ознаки </strong>несправності мікрофона:</span></div><div>&nbsp;</div><ul><li><span style=\"font-family:tahoma,geneva,sans-serif;\">ваш співрозмовник погано вас чує або не чує зовсім;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">ви або ваш співрозмовник чуєте шум під час дзвінка;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">мікрофон перестає працювати в окремому додатку.</span></li></ul><div><br/><span style=\"font-family:tahoma,geneva,sans-serif;\"><strong>Причини </strong>несправності:</span></div><div>&nbsp;</div><ul><li><span style=\"font-family:tahoma,geneva,sans-serif;\">пошкодження шлейфу;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">в мікрофон потрапляла волога або пил;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">мікрофон фізично пошкоджений;</span></li><li><span style=\"font-family:tahoma,geneva,sans-serif;\">програмні збої.</span></li></ul><div>&nbsp;</div><div><span style=\"font-family:tahoma,geneva,sans-serif;\">В такому випадку, не варто намагатися самостійно чистити або лагодити мікрофон, не маючи досвіду такої роботи, подібні дії можуть привести до пошкодження корпусу, самого мікрофона або плати зарядки, на якій той розміщений.</span></div><div><span style=\"font-family:tahoma,geneva,sans-serif;\">Зверніться в сервісний центр нашого магазину, де наші співробітники проведуть діагностику пристрої, повідомлять вам про поломку і проконсультують вас.</span></div>\n `);\n const camera_lens = new Template(`Стекла камеры`, `\n <p><strong>{$prefix}&nbsp;{$brand_name}&nbsp;{$name}&nbsp;{$mod}.</strong></p><p><u><strong>Стекло камеры</strong></u>&nbsp;- наружная часть камеры устройства, которая не является составной модуля камеры, а крепится поверх модуля, также может быть частью задней крышки корпуса смартфона и выступать наружу. Основной функцией стекла камеры является защита. Оно защищает камеру от пыли, влаги и мусора, которые могут негативно повлиять на качество съемки или, в худшем случае, повредить модуль камеры.&nbsp;</p><hr/><p>Основные&nbsp;<strong>причины</strong>&nbsp;замены:</p><ul><li>царапины или трещины на стекле камеры;</li><li>нарушение герметичности (люфты и зазоры);</li><li>попадание влаги под стекло;</li><li>деформация или повреждения рамки стекла;</li><li>потеря стекла камеры.</li></ul><hr/><p><br/>В таком случае, не стоит пытаться самостоятельно чистить или доставать стекло, не имея опыта такой работы, подобные действия могут привести к повреждению корпуса, рамки камеры, или неработоспособности модуля камеры.</p><p>Обратитесь в сервисный центр нашего магазина, где наши сотрудники проведут диагностику устройства, сообщат вам о поломке и проконсультируют вас.</p>`, `\n <p><strong>{$prefix}&nbsp;{$brand_name}&nbsp;{$name}&nbsp;{$mod}.</strong></p><p><u><strong>Скло камери</strong></u>&nbsp;- зовнішня частина камери пристрою, яка не є складовою модуля камери, а кріпиться поверх модуля, також може бути частиною задньої кришки корпусу смартфона і виступати назовні. Основною функцією скла камери є захист. Воно перешкоджує потраплянню пилу, вологи і сміття, що може негативно вплинути на якість зйомки або, в гіршому випадку, пошкодити модуль камери.</p><hr/><div>Основні&nbsp;<strong>причини&nbsp;</strong>заміни:</div><div>&nbsp;</div><ul><li>подряпини або тріщини на склі камери;</li><li>порушення герметичності (люфти і зазори);</li><li>потрапляння вологи під скло;</li><li>деформація або пошкодження рамки скла;</li><li>втрата скла камери.</li></ul><hr/><p><br/>У такому випадку, не варто намагатися самостійно чистити або діставати скло, не маючи досвіду такої роботи, подібні дії можуть привести до пошкодження корпусу, рамки камери, або непрацездатності модуля камери.</p><p>Зверніться в сервісний центр нашого магазину, де наші співробітники проведуть діагностику пристрої, повідомлять вам про поломку і проконсультують вас.</p>\n `);\n const button_hover = new Template(`Кнопка (Home)`,\n `<div> {$prefix} {$brand_name} {$name} {$mod} - одна из основных и наиболее часто взаимодействующих с владельцем деталей смартфона, что ускоряет появление царапин, потертостей и других неприятных визуальных или функциональных повреждений. У пользователей бывают случаи, когда накладка отваливалась и терялась, а также кнопка может западать или болтаться в отсутствии фиксации. Подобные признаки могут стать причиной замены. </div> <div> </div> <div> Если вы решили обратиться за помощью в наш магазин или сервисный центр, то вы получите помощь от опытных профессионалов, которые смогут определить точную причину поломки и проконсультировать при покупке нужной детали. Если вы имеете опыт в разборке уcтройств и починке мелких комплектующих, тогда можете провести замену самостоятельно.</div> `,\n `<div> {$prefix} {$brand_name} {$name} {$mod} - одна з основних і найбільш часто взаємодіючих з власником деталей смартфона, що прискорює появу подряпин, потертостей та інших неприємних візуальних або функціональних пошкоджень. У користувачів бувають випадки, коли накладка відвалювалася і губилася, а також кнопка може западати або рухатися при відсутності фіксації. Подібні ознаки можуть стати причиною заміни.</div><div> &nbsp;</div><div> Якщо ви вирішили звернутися за допомогою в наш магазин або сервісний центр, то ви отримаєте допомогу від досвідчених професіоналів, які зможуть визначити точну причину поломки і проконсультувати при покупці потрібної деталі. Якщо ви маєте досвід в розбиранні пристроїв і лагодження дрібних комплектуючих, тоді можете провести заміну самостійно.</div>`);\n const vibro = new Template(`Вибромоторы`,\n `<div><span style=font-family:tahoma,geneva,sans-serif><u><strong>Вибромоторы</strong></u> - это внутренние компоненты смартфонов, которые передают свои колебания целиком всему телефону и в итоге мы получаем \"вибрацию\". Вибромоторы играют важную роль для пользователя устройства, так как при отсутствии звука они помагают буквально \"почувствовать\" важный звонок. Компоненты такого типа по своей сути являются маленькими двигателями, где одна из подвижных частей - вал, который имеет несбалансированный центр тяжести, что при циклическом движении и создает данное явление (вибрацию). Но высокая интенсивность такого циклического движения может постепенно вредить вибромотору или же всему устройству целиком.</span><br> </div><div><hr><p><br><span style=font-family:tahoma,geneva,sans-serif>Когда нужна <strong>замена </strong>или <strong>ремонт</strong> вибромотора:</span></div><ul><li><span style=font-family:tahoma,geneva,sans-serif>полное прекращение работы виброзвонка;</span><li><span style=font-family:tahoma,geneva,sans-serif>виброзвонок работает очень слабо;</span><li><span style=font-family:tahoma,geneva,sans-serif>телефон при звонках вибрирует не всегда;</span><li><span style=font-family:tahoma,geneva,sans-serif>зависание: вибрация не выключается и не прекращается при определенных условиях вплоть до полного выключения устройства.</span></ul><div> </div><div><span style=font-family:tahoma,geneva,sans-serif><strong>Причины </strong>неисправности компонента:</span></div><div> </div><ul><li><span style=font-family:tahoma,geneva,sans-serif>выход из строя элементов, которые питают вибромотор;</span><li><span style=font-family:tahoma,geneva,sans-serif>накопление мусора и пыли внутри устройства (вследствие - перегорание);</span><li><span style=font-family:tahoma,geneva,sans-serif>физические повреждения устройства или виброзвонка;</span><li><span style=font-family:tahoma,geneva,sans-serif>попадание жидкости;</span><li><span style=font-family:tahoma,geneva,sans-serif>программный сбой устройства.</span><br> </ul><div><hr><p><br><span style=font-family:tahoma,geneva,sans-serif>В таком случае, не стоит пытаться самостоятельно чинить данный компонент, не имея опыта такой работы, подобные действия могут привести к повреждению корпуса, самого компонента или платы, на которой тот распаян.</span></div><div><span style=font-family:tahoma,geneva,sans-serif>Обратитесь в наш магазин или сервис, где наши сотрудники проведут диагностику устройства, сообщат вам о поломке и помогут выбрать в магазине нужную деталь, а также проконсультируют вас.</span></div>\n `,\n `<div><u><strong>Вібромотори</strong></u> - це внутрішні компоненти смартфонів, які передають свої коливання цілком всьому телефону і в підсумку ми отримуємо \"вібрацію\". Вібромотор грають важливу роль для користувача пристроїв, так як при відсутності звуку вони допомагають буквально \"відчути\" важливий дзвінок. Компоненти такого типу за принципом роботи є маленькими двигунами, де одна з рухомих частин - вал, який має незбалансований центр ваги, що при циклічному русі і створює дане явище (вібрацію). Але висока інтенсивність такого циклічного руху може поступово шкодити вібромотору або ж всьому пристрою цілком.<br><br><hr><p><br>Коли потрібна <strong>заміна </strong>або <strong>ремонт </strong>вібромотора:</div><ul><li>повне припинення роботи вібродзвінка;<li>вібро працює дуже слабо;<li>телефон при дзвінках вібрує не завжди;<li>зависання: вібрація не вимикається і не припиняється при певних умовах аж до повного виключення пристрою.</ul><div> </div><div><strong>Причини </strong>несправності компонента:<br> </div><ul><li>вихід з ладу елементів, які живлять вібромотор;<li>накопичення сміття і пилу всередині пристрою (внаслідок - перегорання);<li>фізичні ушкодження пристрою або вібродзвінка;<li>потрапляння рідини;<li>програмний збій пристрою.<br><br><hr><p><br>В такому випадку, не варто намагатися самостійно лагодити даний компонент, не маючи досвіду такої роботи, подібні дії можуть привести до пошкодження корпусу, самого компонента або плати, на якій той розпаяний.</ul><div>Зверніться в сервісний центр нашого магазину, де наші співробітники проведуть діагностику пристрої, повідомлять вам про поломку і проконсультують вас.</div>\n `);\n const vinty = new Template(`Винты`, `<div style=\"text-align:justify;font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;color:#363636\"><p><span style=font-family:tahoma,geneva,sans-serif><strong>{$prefix} </strong><strong>{$brand_name} </strong><strong>{$name} </strong><strong>{$mod}.</strong></span><p><span style=font-family:tahoma,geneva,sans-serif><u><strong>Винты</strong></u><strong> </strong>для смартфонов - это мельчайшие крепежные составляющие вашего корпуса и внутренних копмлектующих.<br>Подобные детали очень просто потерять или повредить. Каждый винт может отличаться диаметром и размерами, а также материалом и разновидностью <i>шлица</i>.<br>Шлиц — это форма углубления в головке винта, например: крест, прямой, шестигранный, плоский и т.д.</span></p><img alt=\"\"src=https://home.aks.ua/userfiles/images/shlits(2).png style=font-family:tahoma,geneva,sans-serif;width:600px;height:126px><hr color=#CACACA noshade size=1px width=100%><br><p><span style=font-family:tahoma,geneva,sans-serif><strong>Признаки</strong>, которые могут стать причиной замены винтов:</span><ul style=list-style-position:inside;margin-left:1em;margin-right:1em type=circle><li><span style=font-family:tahoma,geneva,sans-serif>потеря винтов при разборке / сборке устройства;</span><li><span style=font-family:tahoma,geneva,sans-serif>повреждения резьбы винта;</span><li><span style=font-family:tahoma,geneva,sans-serif>сорванная шляпка винта;</span><li><span style=font-family:tahoma,geneva,sans-serif>стертое углубление на шляпке винта;</span><li><span style=font-family:tahoma,geneva,sans-serif>негерметичность корпуса устройства (люфты, зазоры, поскрипывания);</span><li><span style=font-family:tahoma,geneva,sans-serif>плохо закрепленные внутренние копмлектующие устройства.</span></ul><br><hr color=#CACACA noshade size=1px width=100%><p><span style=font-family:tahoma,geneva,sans-serif>Все выше перечисленные пункты вызывают не только раздражение пользователя устройства, но и могут стать причиной попадания большого количества пыли и влаги под корпус и на внутренние комплектующие устройства, что в свою очередь, приводит к быстрому выведению из строя внутренних компонентов, повреждению корпуса и порче внешнего вида смартфона.</span><p><span style=font-family:tahoma,geneva,sans-serif>Чтобы избежать подобных проблем, вы можете обратиться в наш сервис, где получите необходимые рекомендации. Также, при наличии опыта и спец. инструментов, вы можете заменить винты или другие детали самостоятельно, прежде заказав товар в нашем магазине</span></div><p> \n `, `\n <div style=\"text-align:justify;font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;color:#363636\"><p><span style=font-family:tahoma,geneva,sans-serif><strong>{$prefix} </strong><strong>{$brand_name} </strong><strong>{$name} </strong><strong>{$mod}.</strong></span><p><span style=font-family:tahoma,geneva,sans-serif><u><strong>Гвинти</strong></u><strong> </strong>для смартфонів – це наймілкіші кріпильні складові вашого корпусу та внутрішніх комплектуючих.<br>Подібні деталі дуже просто загубити або пошкодити. Кожен гвинтик може відрізнятися діаметром і розмірами, а також матеріалом і різновидом <i>шліца</i>.<br>Шліц — це форма заглиблення в голівці болта, наприклад: хрест, прямий, шестигранний, плоский і т.д.</span><p><span style=font-family:tahoma,geneva,sans-serif><img alt=\"\"src=/userfiles/images/shlits(2).png style=width:600px;height:126px></span><hr color=#CACACA noshade size=1px width=100%><p><span style=font-family:tahoma,geneva,sans-serif>  <strong>Ознаки</strong>, які можуть стати причиною заміни гвинтів:</span><ul style=list-style-position:inside;margin-left:1em;margin-right:1em type=circle><li><span style=font-family:tahoma,geneva,sans-serif>втрата або потрапляння в важкодоступні місця гвинтів при розбиранні / збиранні пристрою;</span><li><span style=font-family:tahoma,geneva,sans-serif>пошкодження різьби гвинта;</span><li><span style=font-family:tahoma,geneva,sans-serif>зірвана голівка гвинта;</span><li><span style=font-family:tahoma,geneva,sans-serif>стерте заглиблення на голівці гвинтика;</span><li><span style=font-family:tahoma,geneva,sans-serif>негерметичність корпусу пристрою (люфти, зазори, поскрипування);</span><li><span style=font-family:tahoma,geneva,sans-serif>погано закріплені внутрішні комплектуючі пристрої.</span></ul><br><hr color=#CACACA noshade size=1px width=100%><p><span style=font-family:tahoma,geneva,sans-serif>Всі вище перераховані пункти викликають не тільки роздратування власника пристрою, але і можуть стати причиною потрапляння великої кількості пилу і вологи під корпус і на внутрішні комплектуючі пристрої, що в свою чергу, призводить до швидкого виведення з ладу внутрішніх компонентів, пошкодження корпусу і псування зовнішнього вигляду смартфона.</span><p><span style=font-family:tahoma,geneva,sans-serif>Щоб уникнути подібних проблем, ви можете звернутися в наш сервіс, де отримаєте необхідні рекомендації. Також, при наявності досвіду і спеціальних інструментів, ви можете замінити болти або інші деталі самостійно, попередньо замовивши товар у нашому магазині.</span></div><p> \n `);\n const test = new Template(`TEST`, `{123|213|321}`, `{123|213|321}`);\n\n\n // expand/close plugin on button click\n dos_openButton.onclick = function () {\n\n if (!(dos_list_wrapper.classList.contains('dos_list_wrapper'))) {\n this.value = \"Спрятать\";\n dos_list_wrapper.classList.toggle('dos_list_wrapper')\n dos_wrapper.style.height = \"100%\";\n } else {\n this.value = \"Показать\";\n dos_wrapper.style.height = \"49px\";\n dos_list_wrapper.classList.toggle('dos_list_wrapper');\n }\n };\n\n\n // insert template in preview fields\n dos_templates_options.onchange = function () {\n textareas.forEach(el => {\n el.readOnly = true;\n });\n dos_preview_area_ru.textContent = arr[this.selectedIndex - 1].ru;\n dos_preview_area_ua.textContent = arr[this.selectedIndex - 1].ua;\n };\n\n\n // for clearing teasers on button click and paste in into 2 main fields\n dos_paste_button.onclick = function () {\n\n\n teasers_ru.value = '';\n teasers_uk.value = '';\n\n dos_target_area_ru = document.querySelectorAll(\"iframe\")[0].contentDocument.body;\n dos_target_area_ua = document.querySelectorAll(\"iframe\")[1].contentDocument.body;\n dos_target_area_ru.innerHTML = dos_preview_area_ru.textContent;\n dos_target_area_ua.innerHTML = dos_preview_area_ua.textContent;\n\n };\n\n // for adding new template via interface\n dos_add_new_option.onclick = function () {\n let labelOfTemplate = prompt(\"Введите название категории/подкатегории: \");\n localStorage.setItem(\"test1\", \"test1\");\n\n }\n\n\n // for automatic pop-up\n setTimeout(() => {\n dos_openButton.click();\n }, 2200);\n\n // for reverting field values\n dos_reset_button.onclick = setStateToAreas;\n }", "function makeNote(note) {\n let noteLi = document.createElement(\"li\")\n noteLi.innerText = note.title\n noteLi.className= 'note-li'\n noteLi.dataset.id = note.id\n noteList.append(noteLi)\n\n //How to crete delete button\n let delBtn = document.createElement(\"button\")\n delBtn.innerText = \"delete\"\n delBtn.className = \"del-btn\"\n delBtn.dataset.id = note.id\n noteLi.append(delBtn)\n }", "populate_dropdown() {\n let dropdown = $(\"#vertex-shader\");\n this.shader_lib.vertex_info.map((x, i) => {\n $('<option>')\n .val(i)\n .html(x.title)\n .appendTo(dropdown);\n });\n }", "function menuTendina()\n{\n\t$(\".dropdown-menu li a\").click(function(){\n \n $(\"#tendina:first-child\").html($(this).text()+ ' <span class=\"caret\"></span>');\n $(\"#tendina:first-child\").val($(this).text());\n });\n}", "function display_menu_infos() {\n var menu_item_html = \"\";\n if (data.menu_info != undefined) {\n for (var i = 0; i < data.menu_info.length; i++) {\n menu_item_html += '<ul id=\"menuItem' + i;\n menu_item_html += '\" onclick=\"selectMenu(' + i + ')\">';\n menu_item_html += data.menu_info[i]['name'] + '</ul>';\n }\n }\n $('#horizontal_menu_bar').html(menu_item_html);\n}", "function editNotes(notesID) {\n\n\t//get the notes id\n\tvar notesHoverID = \"hover_\" + notesID;\n\t\n\tvar selectNotes = document.createElement(\"select\");\n\t\n\tselectNotes.id = \"select_\" + notesID;\t\n\tvar opt = document.createElement(\"Option\");\n\topt.value = \"Option 1 for notes\";\n\topt.textContent = \"Option 1 for notes\";\n\tselectNotes.appendChild(opt);\n\tvar opt2 = document.createElement(\"Option\");\n\topt2.value = \"Option 2 for notes\";\n\topt2.textContent = \"Option 2 for notes\";\n\tselectNotes.appendChild(opt2);\n\t\n\t// Get the modal\n\tvar modal = document.getElementById(\"notesModal\");\n\tmodal.appendChild(selectNotes);\n\t// Get the button that opens the modal\n\t//var btn = document.getElementById(\"myBtn\");\n\n\t// Get the <span> element that closes the modal\n\tvar span = document.getElementsByClassName(\"close\")[0];\n\n\t//position the modal box\n\t//new method\n\tvar el, x, y;\n\n\tel = document.getElementById(notesHoverID);\n\tif (window.event) {\n\t\tx = window.event.clientX + document.documentElement.scrollLeft\n\t\t+ document.body.scrollLeft;\n\t\ty = window.event.clientY + document.documentElement.scrollTop +\n\t\t+ document.body.scrollTop;\n\t}\n\telse {\n\t\tx = event.clientX + window.scrollX;\n\t\ty = event.clientY + window.scrollY;\n\t}\n\tx -= 2; y -= 2;\n\ty = y+15\n\tel.style.left = x + \"px\";\n\tel.style.top = y + \"px\";\n\tel.style.display = \"block\";\n\n\t// When the user clicks the button, open the modal \n\tmodal.style.display = \"block\";\n\n\n\t// When the user clicks on <span> (x), close the modal\n\tspan.onclick = function() {\n\t\tmodal.style.display = \"none\";\n\t}\n\n\t// When the user clicks anywhere outside of the modal, close it\n\twindow.onclick = function(event) {\n \t\tif (event.target == modal) {\n \t\tmodal.style.display = \"none\";\n\t\t}\n\t}\n}", "function createDropdown (json) {\n\tlet d = document.createDocumentFragment();\n\n\tjson.sort(function(a,b){\n\t\tif(a.firstName < b.firstName) return -1;\n\t\telse if(a.firstName > b.firstName) return 1;\n\t\treturn 0;\n\t})\n\tfor (var i = 0; i < json.length; i++) {\n\t\tif(json[i].firstName == \"Bart\") continue;\n\t\tlet option = document.createElement('option');\n\t\t// when users store both username and name, access the user's name and username fields\n\t\toption.innerHTML = json[i].firstName;\n\t\toption.setAttribute(\"value\", json[i].firstName);\n\t\toption.setAttribute(\"id\", json[i].firstName + \"Option\");\n\t\td.appendChild(option);\n\t}\n\t$('#taskWell > span > .assignedTo').append(d);\n\t\n\t\n}", "function addSelCtgs() {\n // reset these properties couse after delete it is displayed 1st list\n optID = 0;\n slevel = 1;\n\n // if items in Root, shows 1st <select>, else, resets properties to initial value\n if(optHierarchy[0].length > 0) document.getElementById('n_sl'+slevel).innerHTML = getSelect(optHierarchy[0]);\n else {\n optHierarchy = {'0':[]};\n optData = {'0':{'value':'Root', 'content':'', 'parent':-1}};\n document.getElementById('n_sl'+slevel).innerHTML = '';\n }\n }", "function 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}", "function dropBox() {\n\tconst drop_btn = document.querySelector(\".drop-btn\");\n\tconst menu_wrapper = document.querySelector(\".combo-box\");\n\tconst icon = document.querySelector(\"#settings-icon\");\n\n\tdrop_btn.onclick = () => {\n\t\tmenu_wrapper.classList.toggle(\"show\");\n\t\ticon.classList.toggle(\"show\");\n\t};\n}", "formatEditMenu() {\n // If the activity is not editable, don't show a menu.\n if (!this.isEditable()) {\n return nothing;\n }\n // Show delete option if not deleted, else show undelete.\n let menuItem = html`\n <sl-menu-item @click=\"${() => this.handleDeleteToggle(false)}\"\n >Delete Comment</sl-menu-item>`;\n if (this.activity.deleted_by) {\n menuItem = html`\n <sl-menu-item @click=\"${() => this.handleDeleteToggle(true)}\"\n >Undelete Comment</sl-menu-item>`;\n }\n\n return html`\n <iron-icon class=\"comment-menu-icon\"\n icon=\"chromestatus:more-vert\"\n @click=${() => this.toggleMenu()}></iron-icon>\n <div class=\"edit-menu\">\n <div id=\"comment-menu\" style=\"display: none;\">\n <sl-menu>${menuItem}</sl-menu>\n </div>\n </div>`;\n }", "function populateDropdownMenu(num, ddMenu, ddCB, ddItems, tags, identifier, term) {\n for (var i = 0; i < num ; i++) {\n ddCB[i] = createCheckBox();\n ddItems[i] = createItem(ddCB[i], tags[i], i, identifier, term);\n ddMenu.append(ddItems[i]);\n }\n }", "getMenuOptions() {\n return ['NewRecipe', 'View', 'Home','Search']\n }", "function getDropDown(availableOptionArray, id) {\n let result = '';\n let word_length = $(\"#word\"+ id).outerWidth();\n result += ' <div class=\"dropdown-content\" style=\"width:' + word_length + 'px\">';\n availableOptionArray.forEach(function (p) {\n result += '<button onclick=\"tag_click(this)\" class= \"dropdown-content-block drop_down_button_'+ id+'\" style=\"background-color:' + p.color + '\">' + p.tag + '</button>';\n });\n result += '</div>';\n return result;\n}", "function createPriorityDropdown(){\n function createDropdown(){\n const dropdown = document.createElement('select')\n dropdown.classList = \"priorities\"\n const selectPriority = document.createElement('option')\n selectPriority.value = \"select\"\n selectPriority.innerText = \"Select Priority\"\n const high = document.createElement('option')\n high.value = \"1\"\n high.innerText = \"High Priority\"\n const medium = document.createElement('option')\n medium.value = \"2\"\n medium.innerText = \"Medium Priority\"\n const low = document.createElement('option')\n low.value = \"3\"\n low.innerText = \"Low Priority\"\n dropdown.add(selectPriority)\n dropdown.add(high)\n dropdown.add(medium)\n dropdown.add(low)\n return dropdown\n }\n let priorities = createDropdown()\n priorities.addEventListener('change', function(e){\n selected = e.target.value\n })\n return priorities\n}", "function creationSelect(liste_option_lentille){\n liste_deroulante_option = '<select class=\"description_option\"><option>Selectionner une lentille</option>' ;\n //Récupération de toutes les valeurs pour les mettre dans une balise option de la liste deroulante\n for (let valeur_option of liste_option_lentille) {\n liste_deroulante_option += \"<option value='\" + valeur_option + \"'>\" + valeur_option + \"</option>\";\n }\n //Fermeture de la balise select\n liste_deroulante_option += '</select>';\n return liste_deroulante_option\n}", "constructor(){\n\t\tthis.newTask = makeElem('li'); //This creates a new list element for the tasks\n\t\tthis.dropdown = addDropdown();\n\t\tthis.deleter = this.dropdown.lastElementChild.lastElementChild;\n\t\tthis.editor = this.dropdown.lastElementChild.firstElementChild;\n\t}", "function addDropdownItem(dropdownID,label,value,tooltip){\n if(tooltip === undefined || tooltip === null){tooltip = ''};\n\t$('#'+dropdownID).append(`<option title = '${tooltip}' value = \"${value}\">${label}</option>`)\n}" ]
[ "0.66719514", "0.66393393", "0.662687", "0.65324175", "0.6475894", "0.6362708", "0.6341031", "0.6317304", "0.63116854", "0.626956", "0.62344635", "0.62289363", "0.62193483", "0.62162197", "0.6201725", "0.61597914", "0.6149038", "0.6147206", "0.6103805", "0.6051121", "0.6044457", "0.60252976", "0.60202634", "0.6020244", "0.6012983", "0.60094553", "0.59982324", "0.5989526", "0.59877604", "0.59530526", "0.5947281", "0.5930519", "0.59273845", "0.5922488", "0.5919838", "0.5907528", "0.5901126", "0.58779985", "0.58746505", "0.5863262", "0.5860208", "0.58561987", "0.5841649", "0.5825511", "0.5823676", "0.58198375", "0.58174807", "0.58001953", "0.579797", "0.57882595", "0.5788217", "0.57738996", "0.5768166", "0.576228", "0.5756944", "0.5756377", "0.5734436", "0.57229066", "0.57162625", "0.5715848", "0.57101166", "0.57080615", "0.57045555", "0.569983", "0.5693414", "0.5687523", "0.56873107", "0.56809235", "0.5679594", "0.56736654", "0.5673043", "0.5668849", "0.5646458", "0.56444365", "0.56434935", "0.5641749", "0.5627143", "0.56261384", "0.56243455", "0.5620773", "0.56186163", "0.56181896", "0.56115717", "0.5610637", "0.5601652", "0.5600788", "0.5597171", "0.55918664", "0.5590654", "0.55811644", "0.55801773", "0.55796504", "0.55760014", "0.5575299", "0.55694646", "0.5564828", "0.5563504", "0.5561589", "0.5554866", "0.5553594" ]
0.6532493
3
Adds a list of note books to dropdown of addBooksToNote and a checkbox to move multiple notes.
function addBooksToDropDown(obj, dropDownContent) { let closeButton = document.createElement("button"); let closeButtonIcon = document.createElement("img"); dropDownContent.appendChild(closeButton); closeButton.className = "note-button close-btn-dropdown"; closeButton.addEventListener("click", () => { dropDownContent.style.display = "none"; }); closeButton.appendChild(closeButtonIcon); closeButtonIcon.src = "media/x.svg"; closeButtonIcon.height = "18"; closeButtonIcon.width = "18"; closeButtonIcon.alt = "Close dropdown"; closeButtonIcon.title = "close"; closeButtonIcon.className = "close-btn-dropdown-img"; for (let i = 0; i < existingNoteBooks.length; i++) { let li = document.createElement("li"); li.className = "dropdown-li"; let option = document.createElement("a"); option.href = "#"; option.className = "dropdown-option dropdown-a"; option.textContent = existingNoteBooks[i].getTitle(); option.addEventListener("click", (element) => { if (obj.checked == true || obj.checkBox.style.display == "none") { obj.setTitleOfNoteBook(element.target.innerText); saveNotesToLocalStorage(); globalUpdate(); } allNotes.forEach((element) => { if (element.checkBox.checked == true) { element.titleOfNoteBook = existingNoteBooks[i].getTitle(); element.checkBox.checked = false; saveNotesToLocalStorage(); globalUpdate(); } }); dropDownContent.style.display = "none"; }); li.appendChild(option); dropDownContent.appendChild(li); } let selectToMove = document.createElement("button"); selectToMove.textContent = "SELECT MORE"; selectToMove.className = "btn btn-outline-secondary btn-sm btn-block dropdown-btn"; selectToMove.addEventListener("click", () => { moveSelected(true); }); dropDownContent.appendChild(selectToMove); closeOnClickOutside(obj, dropDownContent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addBooksToNote(obj) {\n let noteDropDown = document.createElement(\"div\");\n let button = document.createElement(\"button\");\n let btnIcon = document.createElement(\"img\");\n let dropDownContent = document.createElement(\"div\");\n let dropDownList = document.createElement(\"ul\");\n\n noteDropDown.className = \"dropdown\";\n noteDropDown.appendChild(button);\n noteDropDown.appendChild(dropDownContent);\n\n button.className = \"note-button\";\n button.addEventListener(\"click\", () => {\n clearNoteDropDown();\n addBooksToDropDown(obj, dropDownContent);\n dropDownContent.style.display = \"block\";\n });\n button.appendChild(btnIcon);\n\n btnIcon.src = \"media/journal-plus.svg\";\n btnIcon.width = \"24\";\n btnIcon.height = \"24\";\n btnIcon.title = \"Move to notebook\";\n\n dropDownContent.className = \"dropdown-content shadow-sm\";\n dropDownContent.appendChild(dropDownList);\n\n return noteDropDown;\n}", "function clickAdd() {\n $(\"#addCopy\").click(function (event) {\n event.preventDefault();\n $(\"input:checkbox:checked\").each(function () {\n addCopy($(this).val());\n renderBooks();\n });\n });\n}", "function addBookToLibrary() {\n const title = document.querySelector('#title-input').value;\n const author = document.querySelector('#author-input').value;\n const pages = document.querySelector('#pages-input').value;\n let read = document.querySelector('#read-input').checked;\n if (read == true) {\n read = \"read\";\n } else {\n read = \"unread\";\n } ;\n addForm.reset();\n addForm.hidden = true;\n addBtn.hidden = false;\n submitBtn.hidden = true;\n myLibrary.push(new Book(title, author, pages, read));\n clearTable();\n displayBooks();\n}", "function addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function addNewItem() {\n \n const item = window.prompt('What is your new task?','');\n const count = document.getElementById('selectedListOl').\n getElementsByTagName('LI').length;\n \n // let newItem;\n \n if (item) {\n notesItems += `\n <LI><label id=\"label${(count+1)}\"><input type=\"checkbox\" \n id=\"item${(count+1)}\">${item}</label></LI>`;\n \n reRenderDashboard();\n\n // list updated\n edited = true;\n document.getElementById('saveList').disabled = false;\n }\n \n }", "function addBookToLibrary(event){\n const title = document.getElementById(\"title\").value\n const author = document.getElementById(\"author\").value\n const pages = document.getElementById(\"pages\").value\n const read = document.getElementById(\"read\").checked\n\n const book = Book(title, author, pages, read)\n myLibrary.push(book)\n\n displayBooks()\n\n document.getElementById(\"title\").value = ''\n document.getElementById(\"author\").value = ''\n document.getElementById(\"pages\").value = ''\n document.getElementById(\"read\").checked = false\n\n\n}", "function addBookToLibrary(event) {\n event.preventDefault();\n const title = document.getElementById(\"title\").value;\n const author = document.getElementById(\"author\").value;\n const pages = document.getElementById(\"pages\").value;\n //const read = document.querySelector(\"#read\").checked;\n let newBook = new book(title, author, pages);\n myLibrary.push(newBook);\n displayLibrary();\n}", "function addBookToLibrary(e) {\n\te.preventDefault();\n\n\tif($title.value == '' || $author.value =='' || $pages.value == '' ){\n\t\talert('please input');\n\n\t}else{\n\t\tconst newTitle = $title.value;\n\t\tconst newAuthor = $author.value;\n\t\tconst newPages = $pages.value;\n\t\tconst newRead = getReadStatus();\n\t\tconst newBook = new Book(newTitle,newAuthor,newPages,newRead);\n\t\tmyLibrary.push(newBook)\n\t\tupdateLocalStorage(myLibrary);\n\t\tclearForm();\n\t\tdisplayLibrary();\n\t\ttoggleForm();\n\t}\n\n\t\n}", "function addBookToLibrary() {\n\n\n const title = document.getElementById('booktitle').value\n const author = document.getElementById('author').value\n const pages = document.getElementById('pages').value\n const alreadyRead = document.getElementById('alreadyread').checked\n const book = new Book(title, author, pages, alreadyRead)\n myLibrary.push(book)\n updateTable()\n\n\n\n\n\n}", "function addNote(note) {\n setNotesList(prevList => { return [...prevList, note] });\n }", "function addNewBook() {\n\n title = document.getElementById(\"inputTitle\").value;\n document.getElementById(\"inputTitle\").value = \"\";\n author = document.getElementById(\"inputAuthor\").value;\n document.getElementById(\"inputAuthor\").value = \"\";\n publisher = document.getElementById(\"inputPublisher\").value;\n document.getElementById(\"inputPublisher\").value = \"\";\n isRead = document.getElementById(\"inputRead\").checked;\n document.getElementById(\"inputRead\").checked = false;\n\n myLibrary.push({title,author,publisher,isRead});\n\n document.getElementById(\"formContainer\").style.visibility = \"hidden\";\n \n organize();\n total();\n store();\n\n\n}", "function addBookBtn() {\n if (formAuthor.value && formTitle.value && formPages.value) {\n let newBook = new Book();\n newBook.author = formAuthor.value;\n newBook.title = formTitle.value;\n newBook.pages = formPages.value;\n newBook.read = returnReadOption();\n myLibrary.push(newBook);\n formTitle.value = \"\";\n formAuthor.value = \"\";\n formPages.value = \"\";\n notRead.checked = true;\n toggleModal();\n loadLibrary();\n } else {\n alert(\"Please fill out the form\")\n }\n}", "function addItemTodoList() {\r\n\taddItem.addEventListener(\"click\", function () {\r\n\t\tlet text = prompt(\"add a new to-do item\");\r\n\r\n\t\t// tried cloning existing node, had some issues\r\n\r\n\t\t// let clonedNode = checkboxList.firstElementChild.cloneNode(true);\r\n\t\t// checkboxItem[0].innerHTML = text;\r\n\t\t// checkboxList.prepend(clonedNode);\r\n\t\t// checkboxItems[0].insertAdjacentElement(\"beforebegin\", clonedNode);\r\n\r\n\t\t// got rid of already existing todo items, have one with display: none\r\n\t\t// need to show it and add the text to the text area in it\r\n\t\tlet clone = checkboxItems.cloneNode(true);\r\n\t\tlet textNode = clone.childNodes[3];\r\n\t\tlet removeButton = clone.childNodes[5];\r\n\r\n\t\t// add elements to coresponding arrays\r\n\r\n\t\tcheckboxItemsArr.push(clone);\r\n\t\tremoveButtonsArr.push(removeButton);\r\n\t\tclone.classList.remove(\"hidden\");\r\n\t\ttextNode.textContent = text;\r\n\t\tcheckboxList.prepend(clone);\r\n\t});\r\n}", "function addtoLibrary(id, book, authorName, pages, read, list) {\n list.push(new Book(id, book, authorName, pages, read));\n}", "function addToLibrary(name, person, num, check) {\n // Create new book object\n let newBook = new Book(name, person, num, check);\n // Add to library array\n library.push(newBook);\n form.reset();\n showBooks();\n updateLocalStorage();\n}", "function updateCurrentNoteBooks() {\n document.querySelectorAll(\".dropdown-item\").forEach((e) => e.remove()); //cleares window\n document.querySelectorAll(\".noteBookFlex\").forEach((e) => e.remove()); //cleares window\n\n let getDropdownMenu = document.getElementsByClassName(\"dropdown-menu\")[0];\n\n existingNoteBooks.forEach((element) => {\n let flexBox = document.createElement(\"div\");\n let removeNoteBookButton = document.createElement(\"button\");\n let buttonImage = document.createElement(\"img\");\n let notebook = document.createElement(\"button\"); // makes the entie title a button\n\n flexBox.className = \"noteBookFlex\";\n notebook.className = \"dropdown-item\";\n removeNoteBookButton.className = \"removeNoteBookButton\";\n buttonImage.src = \"media/x.svg\";\n notebook.textContent = element.getTitle(); //gets the title variable in noteBookObject\n notebook.style.fontFamily = \"Cursive\";\n\n getDropdownMenu.appendChild(flexBox);\n removeNoteBookButton.appendChild(buttonImage);\n\n if (element.titleOfObject != \"Dashboard\") {\n //checks if element is Dashboard so it wont get removed\n\n flexBox.appendChild(removeNoteBookButton);\n } else {\n notebook.classList.add(\"Dashboard\");\n }\n\n flexBox.appendChild(notebook);\n\n notebook.addEventListener(\"click\", function () {\n // used to call a certain book to display its notes\n\n openNotebook = element.titleOfObject;\n lastVisitedNoteBook(element.titleOfObject);\n displayCurrentNoteBook();\n globalUpdate();\n });\n\n removeNoteBookButton.addEventListener(\"click\", function () {\n moveToDashboard(element);\n if (element.titleOfObject == openNotebook) {\n openNotebook = \"Dashboard\";\n localStorage.setItem(\"lastVisitedNoteBook\", \"Dashboard\");\n }\n removeNoteBooks(element);\n displayCurrentNoteBook();\n globalUpdate();\n });\n });\n}", "function addNote(lectureID, slideID, note) {\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n objectStore.add({\n slideID: slideID,\n lectureID: lectureID,\n note: note\n }).onsuccess = function(e) {\n // Add a radio button for the note.\n addNoteButton(\n \"Note \" + e.target.result\n + \": Lecture \" + lectureID\n + \" - Slide \"+ slideID,\n e.target.result, note\n );\n };\n}", "function addBookToLibrary() {\r\n //Dynamically generated UI for adding books to Library\r\n let compassingForm = document.getElementById(\"addform\");\r\n let divForm = document.createElement(\"div\");\r\n compassingForm.appendChild(divForm);\r\n divForm.style.position = \"relative\";\r\n divForm.style.width = \"1500px\";\r\n let formBackground = document.createElement(\"img\");\r\n formBackground.src = \"addform.png\"\r\n divForm.appendChild(formBackground)\r\n\r\n let bookForm = document.createElement(\"form\");\r\n\r\n let titleForm = document.createElement(\"input\");\r\n let titleText = document.createElement(\"h3\");\r\n titleText.innerHTML = \"Title\";\r\n titleText.style.left = \"20px\";\r\n titleForm.style.left = \"20px\";\r\n titleForm.style.width = \"550px\";\r\n\r\n let authorForm = document.createElement(\"input\");\r\n let authorText = document.createElement(\"h3\");\r\n authorText.innerHTML = \"Author\";\r\n authorText.style.left = \"600px\"\r\n authorForm.style.left = \"600px\"\r\n authorForm.style.width = \"260px\";\r\n\r\n let genreForm = document.createElement(\"input\");\r\n let genreText = document.createElement(\"h3\");\r\n genreText.innerHTML = \"Genre\";\r\n genreText.style.left = \"885px\"\r\n genreForm.style.left = \"885px\"\r\n genreForm.style.width = \"200px\";\r\n\r\n let yearForm = document.createElement(\"input\");\r\n let yearText = document.createElement(\"h3\");\r\n yearText.innerHTML = \"Year\";\r\n yearText.style.left = \"1115px\"\r\n yearForm.style.left = \"1115px\"\r\n yearForm.style.width = \"70px\"\r\n\r\n let readForm = document.createElement(\"input\");\r\n readForm.setAttribute(\"type\", \"checkbox\")\r\n let checkText = document.createElement(\"h3\");\r\n checkText.innerHTML = \"Read?\"\r\n checkText.style.left = \"1230px\";\r\n readForm.style.left = \"1230px\";\r\n\r\n let labels = [titleText, authorText, genreText, yearText, checkText]\r\n let forms = [titleForm, authorForm, genreForm, yearForm, readForm]\r\n for (let i = 0; i < forms.length; i++) {\r\n bookForm.appendChild(forms[i])\r\n bookForm.appendChild(labels[i])\r\n labels[i].style.color = \"white\";\r\n labels[i].style.position = \"absolute\";\r\n forms[i].style.position =\"absolute\";\r\n labels[i].style.bottom = \"50px\";\r\n forms[i].style.bottom = \"30px\";\r\n }\r\n divForm.appendChild(bookForm);\r\n\r\n let buttonAdd = document.createElement(\"img\");\r\n buttonAdd.src = \"add_button_static.png\";\r\n buttonAdd.style.bottom = \"30px\";\r\n buttonAdd.style.position = \"absolute\";\r\n buttonAdd.style.left = \"1370px\";\r\n buttonAdd.style.width = \"100px\";\r\n buttonAdd.style.height = \"50px\";\r\n divForm.appendChild(buttonAdd)\r\n buttonAdd.addEventListener(\"click\", () => {\r\n \r\n book = new Book(titleForm.value, authorForm.value, genreForm.value, yearForm.value, readForm.checked)\r\n library.push(book)\r\n loopBooks(book);\r\n compassingForm.removeChild(divForm);\r\n })\r\n buttonAdd.addEventListener(\"mouseover\", function(event) {\r\n event.target.src = \"add_button_animation.gif\";\r\n })\r\n buttonAdd.addEventListener(\"mouseout\", function(event) {\r\n event.target.src = \"add_button_static.png\";\r\n })\r\n}", "function AddNoteToFolder() {\n var selects = document.querySelectorAll('li.selected');\n var idFolder = document.querySelector('.folder-section__title h2').innerHTML;\n\n // GET FOLDER ARRAY\n var foldersArray = getFoldersArray();\n\n // FIND SELECTED FOLDER \n var folder = foldersArray.find(obj => obj.title == idFolder);\n \n \n for (let i = 0; i < selects.length; i++) {\n const select = selects[i];\n\n // ID OF NOTE \n var idNote = select.getAttribute('id');\n\n // PUSH NOTE ID INTO FOLDER LIST \n folder.list.push(idNote);\n\n }\n \n // SAVE FOLDERS ARRAY BACK INTO LOCALSTORAGE\n localStorage.setItem('foldersArray', JSON.stringify(foldersArray));\n location.reload();\n\n }", "function addBookToLibrary(inputs){\n const title = inputs[0];\n const author = inputs[1];\n const pages = inputs[2];\n const read = inputs[3];\n myLibrary.push(new Book(title.value,author.value,pages.value,read.value));\n console.log(myLibrary)\n render();\n}", "function addBookToLibrary() {\n let Num = myLibrary.length;\n const name = document.getElementById('name').value;\n const author = document.getElementById('author').value;\n const pages = document.getElementById('pages').value;\n const read = \"Have Not Read\"\n const bookNum = \"book\" + Num;\n\n myLibrary.push(new Book(name, author, pages, read, bookNum))\n\n let myLibraryEnd = myLibrary.length - 1;\n addBookHTML(myLibraryEnd);\n}", "function addBookToLibrary(){\n let bookTitle = document.getElementById(\"book-title\").value;\n let bookAuthor = document.getElementById(\"book-author\").value;\n let bookPages = document.getElementById(\"book-pages\").value;\n let booksLibrary = document.getElementById(\"library\");\n let error;\n let readOrNot;\n let inputText = document.querySelectorAll(\".book-info\");\n let readCheck = document.getElementById(\"have-read-check\").checked;\n if(readCheck === true){\n readOrNot = \"Read\";\n }else{\n readOrNot = \"Not Read\";\n }\n //checks to make sure all fields are filled\n if(bookPages < 1 || bookTitle === \"\" || bookAuthor === \"\" || bookPages === \"\"){\n error = document.querySelector(\"#error\"); \n error.textContent =\"Please fill in all fields!\";\n setInterval(function(){\n error.textContent = \" \";\n }, 2800)\n\n }else{\n aNewBook = new Book(inputText[0].value,inputText[1].value,inputText[2].value,inputText[3].value,readOrNot);\n myLibrary.push(aNewBook);\n let eachBookDiv = document.createElement(\"div\");\n let currentBook = myLibrary[myLibrary.length - 1];\n let deleteButton = document.createElement(\"button\");\n deleteButton.textContent = \"Delete\";\n deleteButton.setAttribute(\"data-index\", myLibrary.length - 1);\n deleteButton.classList.add(\"delete-button\");\n deleteButton.addEventListener(\"click\",function(){\n let index = deleteButton.getAttribute(\"data-index\");\n let divToRemove = document.querySelector(`[data-index = \"${index}\"]`);\n divToRemove.remove();\n });\n\n eachBookDiv.classList.add(\"book-div\");\n console.log(currentBook);\n//adds book to display\n inputText.forEach(function(el){\n let para = document.createElement(\"p\");\n para.textContent = el.value;\n para.classList.add(\"book\");\n eachBookDiv.setAttribute(\"data-index\", myLibrary.length - 1);\n eachBookDiv.appendChild(para);\n booksLibrary.appendChild(eachBookDiv);\n eachBookDiv.appendChild(deleteButton);\n })\n form.reset();\n }\n \n }", "function addNote(note) {\r\n setListNote((prevNote) => {\r\n return [...prevNote, note];\r\n });\r\n }", "function addBookToLibrary(book) {\n let bookList = document.querySelector('.bookList');\n \n const newBook = new Book();\n myLibrary.push(newBook);\n }", "function addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}", "function addBookToLibrary() {\n let addTitle = document.getElementById(\"new-title\").value;\n let addAuthor = document.getElementById(\"new-author\").value;\n let addPages = document.getElementById(\"new-pages\").value;\n let radios = document.getElementsByName(\"new-read\");\n\n radios.forEach(function (radio) {\n if (radio.checked) addStatus = radio.value;\n });\n\n let newBook = new Book(addTitle, addAuthor, addPages, addStatus);\n myLibrary.push(newBook);\n saveLocalAndRender();\n}", "function addNewBookToBookList(e) {\n\te.preventDefault();\n\n\t// Add book book to global array\n let newBookForm = e.target.children;\n let bookName = newBookForm[0].value;\n let bookAuthor = newBookForm[1].value;\n let bookGenre = newBookForm[2].value;\n let newBook = new Book(bookName, bookAuthor, bookGenre);\n\n // -- this also works --\n // let newBookName = document.querySelector('#newBookName').value;\n // let newBookAuthor = document.querySelector('#newBookAuthor').value;\n // let newBookGenre = document.querySelector('#newBookGenre').value;\n // let newBook = new Book(newBookName, newBookAuthor, newBookGenre);\n\n // add book to library\n libraryBooks.push(newBook);\n\n\t// Call addBookToLibraryTable properly to add book to the DOM\n addBookToLibraryTable(newBook);\n\n}", "function addBookToLibrary() {\n library.push(new Book(form.elements[0].value, //title\n form.elements[1].value, //author\n parseInt(form.elements[2].value), //pages\n form.elements[3].checked)) //read \n clearLibrary()\n sortLibrary()\n createStoredCards()\n saveLocal()\n}", "function appendNotes(notes, append=true){\r\n $.each(notes, function(){\r\n var li = $(\"#note-item-templete\").clone().attr(\"id\",\"li-\"+this._id).show();\r\n append ? li.appendTo(\"#notelist\") : li.prependTo(\"#notelist\");\r\n var content = this.noteContent;\r\n if (this.growth){\r\n if (this.growth.height)\r\n content += \"</br>\" + \"Hight: \" + this.growth.height;\r\n if (this.growth.weight)\r\n content += \", \" + \"Weight: \" + this.growth.weight;\r\n if (this.growth.growthDate)\r\n content += \", \" + \"Date: \" + this.growth.growthDate;\r\n }\r\n li.find(\"p\").html(content);\r\n if(this.img){\r\n li.find(\".note-img\").attr(\"src\", \"/note/\"+this._id+\"/img\").attr(\"height\", \"300\").attr(\"width\",\"400\");\r\n }\r\n li.find(\".time span\").html(this.insertAt);\r\n li.find(\"a.js-action-del\").attr(\"rel\", this._id).attr(\"href\", \"#\");\r\n\r\n noteCount += 1;\r\n $(\"span#noteCount\").html(noteCount);\r\n });\r\n}", "function Note(type) {\n this.noteType = type;\n this.date = addDate();\n this.titleOfNoteBook = openNotebook;\n this.addingFromLocalStorage = function (\n date,\n savedNoteBookPlacment,\n savedTextarea\n ) {\n if (date != null) {\n this.date = date;\n }\n if (savedNoteBookPlacment != null) {\n this.titleOfNoteBook = savedNoteBookPlacment;\n } else {\n this.titleOfNoteBook = openNotebook;\n }\n if (savedTextarea != \"\" && type == 1) {\n this.noteElement.getElementsByClassName(\n \"textArea\"\n )[0].textContent = savedTextarea;\n }\n };\n\n this.noteElement = createNote(this, type);\n main.prepend(this.noteElement);\n\n this.checkBox = document.createElement(\"input\");\n this.checkBox.type = \"checkbox\";\n this.checkBox.style.display = \"none\";\n this.checkBox.className = \"checkbox\";\n this.noteElement.appendChild(this.checkBox);\n this.delete = false;\n\n this.getNoteLi = function () {\n if (this.noteType == 2) {\n let arrayOfInnerText = [];\n let listItemsArray = this.noteElement.getElementsByClassName(\n \"itemOfList\"\n );\n\n for (let index = 0; index < listItemsArray.length; index++) {\n arrayOfInnerText.push(listItemsArray[index].innerText);\n }\n arrayOfInnerText.toString();\n return arrayOfInnerText;\n }\n };\n\n //om du kan mata varje string som newNext från local sätter denna dit dom en i taget\n this.setNewLi = function (newText) {\n if (this.noteType == 2) {\n let node = this.noteElement.getElementsByClassName(\"list\");\n let listItemContainer = document.createElement(\"div\");\n listItemContainer.className = \"list-item-container\";\n let node_li = document.createElement(\"li\");\n node_li.contentEditable = \"true\";\n node_li.className = \"itemOfList\";\n let textnode = document.createTextNode(newText);\n let span = document.createElement(\"SPAN\");\n let txt = document.createTextNode(\"\\u00D7\");\n span.className = \"remove-list-item\";\n span.addEventListener(\"click\", () => {\n listItemContainer.remove();\n saveNotesToLocalStorage();\n });\n span.appendChild(txt);\n node_li.appendChild(textnode);\n listItemContainer.appendChild(node_li);\n listItemContainer.appendChild(span);\n node[0].appendChild(listItemContainer);\n return node;\n }\n };\n this.getNoteText = function () {\n if (this.noteType == 1) {\n return this.noteElement.getElementsByClassName(\"textArea\")[0].textContent;\n }\n };\n this.setTitleOfNoteBook = (title) => {\n this.titleOfNoteBook = title;\n };\n\n this.checkBoxVisible = function (choise) {\n if (choise == true) {\n return (this.checkBox.style.display = \"block\");\n } else if (choise == false) {\n return (this.checkBox.style.display = \"none\");\n }\n };\n\n this.removeNote = function () {\n this.noteElement.remove();\n this.delete = true;\n clearDeleted();\n saveNotesToLocalStorage();\n };\n}", "function AddNote(noteText_ = \"\") {\n if (noteText_ == null || noteText_ == \"\") {\n return;\n }\n\n var newNoteArray = [];\n if (stateVars.itemArray != null) {\n newNoteArray = stateVars.itemArray;\n }\n\n newNoteArray.push(noteText_);\n\n setStateVars((prevState) => {\n return ({\n ...prevState,\n noteArray: newNoteArray,\n promptNewNote: false,\n newNoteText: \"\",\n requireUpdate: true\n });\n });\n }", "static addBookToList(book) {\n // get the all the books from local-storage\n let storedBooks = JSON.parse(localStorage.getItem('Books'))\n // check if the stored-books is not null\n storedBooks = storedBooks ? storedBooks : []\n // then push a new book to the list\n storedBooks.push(book)\n // finally rewrite the Books in local-storage with a new added book\n localStorage.setItem('Books', JSON.stringify(storedBooks))\n // and clear the form input fields\n document.getElementById('book-form').reset()\n }", "static displayBooksToList() {\n const books = Store.getBooks();\n\n books.forEach((book) => {\n UI.addBookToList(book)\n });\n }", "function addNote() {\n if (noteText.value === \"\") {\n return;\n } else {\n notesCounter++; // increamenting notes count\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 notes.unshift(note);\n noteDiv.style.background = \"#ffffff\";\n renderNote(note);\n updateDB();\n clearInputs();\n noteHead.style.display = \"none\";\n noteBot.style.display = \"none\";\n }\n}", "function addBookToLibrary() { \r\n myLibrary.push(new Book(formImg.value, formTitle.value, formAuthor.value, formPages.value, formRead.value));\r\n}", "function addBookToLibrary() {\n // Stays on the same page for the form after submitting\n const myForm = document.getElementById(\"form\");\n myForm.addEventListener(\"submit\", (e) => {\n e.preventDefault();\n });\n const author = document.getElementById(\"author\");\n const title = document.getElementById(\"title\");\n const pages = document.getElementById(\"pages\");\n const getSelectedValue = document.querySelector( \n 'input[name=\"read\"]:checked');\n const read = getSelectedValue.value;\n const newBook = new Book(title.value, author.value, pages.value, read);\n myLibrary.push(newBook);\n}", "function addBookToLibrary()\n{\n \n}", "function add (bookList, bookName) {\n const bookListCopy = [...bookList];\n bookListCopy.push(bookName);\n return bookListCopy;\n // Add your code above this line\n}", "addBookLibrary() {\n const bookStatus = readBtn.innerText;\n const bookItem = new Book(bookId, authorForm.value, titleForm.value, pagesForm.value, bookStatus);\n bookId++;\n myLibrary.push(bookItem);\n this.storage.saveData();\n\n this.renderElem.clearForm();\n this.renderElem.render();\n }", "function addBookToLibrary() {\n let title = document.querySelector('#titleinput').value\n let author = document.querySelector('#authorinput').value\n let pages = document.querySelector('#pagesinput').value\n let read = document.querySelector('#modal-check').checked\n let newBook = new Book(title, author, pages, read)\n myLibrary.push(newBook)\n document.querySelector('#modal').classList.remove('active') \n document.querySelector('#overlay').classList.remove('active')\n document.querySelectorAll(\"input\").forEach(input => {\n input.value = \"\"\n }) \n clear()\n refresh() \n}", "function addBooksToLibrary(title, author, pages) {\r\n let newItem = new book(title, author, pages); \r\n myLibrary.push(newItem);\r\n }", "function addBookToLibrary(){\n const title = document.querySelector('#input-title').value || 'Empty book';\n const author = document.querySelector('#input-author').value || 'empty author';\n const pages = document.querySelector('#input-pages').value || 'empty pages';\n const read = document.querySelector('#input-read').value;\n\n const newBook = new Book(title, author, pages, read);\n\n library.push(newBook);\n displayLibrary();\n}", "function addBookToLibrary(bookToAdd) {\n myLibrary.push(bookToAdd);\n updateLocalStorage();\n}", "function addButtonClick(){\n\t\tvar note = Note();\n\t\tstorage.push(note);\n\t\tdisplayNotes();\n\n\t}", "function addControls(controlType) {\n\t\t\t\t\t\tlet info = JSON.parse(polljone[\"json_string\"]);\n\t\t\t\t\t\tlet single = [];\n\t\t\t\t\t\tif (info.hasOwnProperty(\"id\")) {\n\t\t\t\t\t\t\tsingle.push(info.id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet addLink;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (single.length > 0) {\n\t\t\t\t\t\t\taddLink = ('/my-books?volume=' + single[0]);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}//identifier true\t\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\taddLink = ('/my-books?volume=' + polljone.id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// console.log(addLink); // testing\n\t\t\t\t\t\tlet addButton = document.createElement(\"div\");\n\t\t\t\t\t\taddButton.className = \"btn\";\n\t\t\t\t\t\tif (controlType == \"add\") {\n\t\t\t\t\t\t\taddButton.innerHTML = \"Add to Your Collection?\";\n\t\t\t\t\t\t\taddButton.addEventListener(\"click\", addAction.bind(addButton), { once: true });\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (controlType == \"delete\") {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\taddButton.innerHTML = \"Remove from your Collection?\";\n\t\t\t\t\t\t\taddButton.addEventListener(\"click\", delAction.bind(addButton), { once: true });\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//append to DOM\n\t\t\t\t\t\tnewDiv.appendChild(addButton);\n\t\t\t\t\t\t//add function, query node\n\t\t\t\t\t\tfunction addAction() {\n\t\t\t\t\t\t\t// if (window.confirm(\"Add this book to your collection?\")) {\n\t\t\t\t\t\t\t\tlet bound = this;\n\t\t\t\t\t\t\t\tbound.innerHTML = \"Please Wait...\";\n\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:grey;\");\n\t\t\t\t\t\t\t\tajaxFunctions.ready(ajaxFunctions.ajaxRequest('POST', addLink, 8000, function (err, data, status) {\n\t\t\t\t\t\t\t\t\tif (err) { console.log(err); bound.innerHTML = \"Error\"; }\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t//handle the server response\n\t\t\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:green;\");\n\t\t\t\t\t\t\t\t\t\tbound.innerHTML = \"Added\";\n\t\t\t\t\t\t\t\t\t\t// console.log(data);\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// }//alert box\n\t\t\t\t\t\t}//addAction\t\n\t\t\t\t\t\tfunction delAction() {\n\t\t\t\t\t\t\tif (window.confirm(\"This will cancel any pending trades. Confirm book removal?\")) {\n\t\t\t\t\t\t\t\tlet bound = this;\n\t\t\t\t\t\t\t\tbound.innerHTML = \"Please Wait...\";\n\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:grey;\");\n\t\t\t\t\t\t\t\tajaxFunctions.ready(ajaxFunctions.ajaxRequest('DELETE', addLink, 8000, function (err, data, status) {\n\t\t\t\t\t\t\t\t\tif (err) { console.log(err); bound.innerHTML = \"Error\"; }\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t//handle the server response\n\t\t\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color: grey;\");\n\t\t\t\t\t\t\t\t\t\tbound.innerHTML = \"Removed\";\n\t\t\t\t\t\t\t\t\t\t// console.log(data);\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}//alert box \n\t\t\t\t\t\t}//delAction\n\t\t\t\t\t}", "function attachBookElements(books) {\n const bookshelf = getBookshelfElement();\n for (let i = 0; i < books.length; i++) {\n bookshelf.appendChild(books[i]);\n }\n}", "function addnotes() {\n const check = document.querySelector(\".addnotes\")\n if (check == null){\n const main = document.getElementById(\"main\");\n const txtarea = document.createElement('textarea' );\n txtarea.className = \"addnotes\";\n const bintxt =document.createTextNode(\"your text goes here\");\n\n txtarea.appendChild(bintxt);\n main.appendChild(txtarea);\n\n const save = document.createElement('button' );\n save.className= \"txtbtn1\"\n const btntxt = document.createTextNode(\"save\");\n\n save.appendChild(btntxt);\n main.appendChild(save);\n\n const dltbtn = document.createElement('button' );\n dltbtn.className= \"txtbtn2\"\n const dlttxt = document.createTextNode(\"delete\");\n\n dltbtn.appendChild(dlttxt);\n main.appendChild(dltbtn);\n \n //removing text area and buttons\n const removetxt= document.querySelector(\".txtbtn2\")\n removetxt.addEventListener(\"click\",function(e){\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n })\n const savenote = document.querySelector(\".txtbtn1\")\n savenote.addEventListener(\"click\",function(s){\n\n if(txtarea.value!==\"your text goes here\"){\n var length = notesarr.length + 1\n var notenum = \"note\" + length.toString()\n notesarr.push({title:notenum,body: txtarea.value})\n \n //adding notes to navbar\n\n const titlebtn = document.createElement(\"button\")\n titlebtn.className= \"titlebtns\"\n const titlebtntxt = document.createTextNode(notenum)\n titlebtn.appendChild(titlebtntxt);\n sidebar.appendChild(titlebtn)\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n\n const display= document.querySelector(\".titlebtns\")\n\n display.addEventListener(\"click\",function(d){\n var notenum = display.innerHTML[4]\n var displaynum = parseInt(notenum)-1\n\n var displaytext =(notesarr[displaynum].body)\n\n var displaynote = document.createElement('textarea' );\n displaynote.className = \"addnotes\";\n var notetxt =document.createTextNode(displaytext);\n\n displaynote.appendChild(notetxt);\n main.appendChild(displaynote);\n\n var cancelbtn = document.createElement(\"button\");\n var cancelbtntxt = document.createTextNode(\"cancel\");\n cancelbtn.className= \"txtbtn2\";\n \n cancelbtn.appendChild(cancelbtntxt);\n main.appendChild(cancelbtn);\n\n //removing displayed note\n\n var removedisplay = document.querySelector(\".txtbtn2\")\n console.log(removedisplay)\n removedisplay.addEventListener(\"click\",function(remove){\n\n main.removeChild(displaynote)\n main.removeChild(cancelbtn)\n })\n\n })\n\n }\n })\n \n }\n\n\n}", "addBooksToLs(books) {\n let book;\n if (localStorage.getItem('books') === null) {\n book = [];\n } else {\n book = JSON.parse(localStorage.getItem('books'));\n }\n\n book.push(books);\n\n localStorage.setItem('books', JSON.stringify(book));\n }", "function addBookToStore() {\r\n\r\n const readline = require(\"readline\");\r\n const addBookAction = readline.createInterface({\r\n input: process.stdin,\r\n output: process.stdout,\r\n });\r\n\r\n addBookAction.question('\\n Add the Book\\'s Name, Author, ISBN and separate them with comas.', function (answer) {\r\n console.log(\"Closing the interface\");\r\n addBookAction.close();\r\n });\r\n\r\n var newBook =answer.trim();\r\n //to avoid unexpected results, we check if the inputed string has comma to seperate them\r\n if (newBook && newBook.includes(',')) {\r\n //using the split function, we separate all the strings, using the comma as criteria and input them to the bookstore\r\n //using the push function.\r\n newBook = newBook.split(',');\r\n if (!isNaN(newBook[2]) || newBook[2].length == 10 || newBook[2].length == 13){\r\n newBook = ['Index: ' + function(){ return bookStore.length + 1 }(), ' Name: ' + newBook[0],' Author: ' + newBook[1], ' ISBN: ' + newBook[2] + '\\n']\r\n bookStore.push(newBook);\r\n console.log('Operation Successfull')\r\n return true;\r\n }else {\r\n console.log('ISBN is incorrect.');\r\n addBookToStore();\r\n }\r\n }\r\n }", "function createAddNoteBookButton() {\n\n let getDropdownMenu = document.getElementsByClassName(\"dropdown-menu\")[0];\n let flexBoxForContent = document.createElement(\"div\");\n let buttonToAddBooks = document.createElement(\"button\");\n let buttonImage = document.createElement(\"img\");\n let formToInput = document.createElement(\"form\"); \n let noteBookNameInput = document.createElement(\"input\");\n\n flexBoxForContent.className = \" addNoteBookFlexBox\";\n buttonToAddBooks.className = \"addNoteBookButton\";\n noteBookNameInput.className = \"noteBookTitle\";\n buttonImage.src = \"/media/plus-circle.svg\";\n noteBookNameInput.placeholder = \"Title of book\";\n noteBookNameInput.required = true;\n noteBookNameInput.addEventListener(\"keypress\", function (event) {\n let e = event;\n if (e.code === \"Enter\") {\n createNoteBook();\n }\n });\n\n getDropdownMenu.appendChild(flexBoxForContent);\n buttonToAddBooks.appendChild(buttonImage);\n flexBoxForContent.appendChild(buttonToAddBooks);\n flexBoxForContent.appendChild(formToInput);\n formToInput.appendChild(noteBookNameInput);\n\n buttonToAddBooks.addEventListener(\"click\", function () {\n \n\n createNoteBook(); \n });\n}", "function addBook(e){\n //Get form values\n const title = document.getElementById('title'),\n author = document.getElementById('author'),\n isbn = document.getElementById('isbn');\n \n const book = new Book(title.value, author.value, isbn.value);\n\n //Required field validators\n if((title.value && author.value && isbn.value) === ''){\n // Show error message\n ui.showMessage('Please fill in all fields', 'error');\n } else {\n ui.addBookToList(book);\n ui.clearInputs(title , author, isbn);\n \n // Show success message\n ui.showMessage('Book is succefully added to the library', 'success');\n };\n\n e.preventDefault();\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 }", "function addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // create HTML node from note object\n const node = createItem(note);\n // append created node in HTML\n noteList.appendChild(node);\n // put created node in Map to match it with note\n map.set(node, note);\n // push current note to notes object\n notes.push(note);\n // overwrite notes in indexedDB with notes\n idbKeyval.set('notes', notes)\n .catch(err => console.error('submit failed: ', err));\n // reset input values\n noteBody.value = '';\n noteImg.value = '';\n noteAlt.value = '';\n }", "function addToPage(note) {\r\n $('#main').append(note);\r\n $('.d', note).on('click', del);\r\n note.draggable({ containment: \"#main\", scroll: false, stop: drop });\r\n}", "function addBookDetails(book){\n\t\t$newUl = $('<ul>').css('list-style-type', 'circle');\n\t\t$newAuthor = $('<li>').text('Author: '+book.author).css('font-style','italic');\n\t\t$newId = $('<li>').text('Id: '+book.id).css('font-style','italic');\n\t\t$newPublisher = $('<li>').text('Publisher: '+book.publisher).css('font-style','italic');\n\t\t$newType = $('<li>').text('Type: '+book.type).css('font-style','italic');\n\t\t$newIsbn = $('<li>').text('Isbn: '+book.isbn).css('font-style','italic');\n\t\t$newEdit = $('<button>', {class: 'edit btn btn-outline-info'}).text('Edit').attr('data-id', book.id);\n\t\t\n\t\t$editDiv = $('<div>',{class: 'edit'}).css('display', 'none').attr('data-id', book.id).attr('accept-charset','utf-8');\n\t\t$inputTitle = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','title').attr('placeholder','new title');\n\t\t$inputAuthor = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','author').attr('placeholder','new author');\n\t\t$inputPublisher = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','publisher').attr('placeholder','new publisher');\n\t\t$inputType = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','type').attr('placeholder','new type');\n\t\t$inputIsbn = $('<input>',{class: 'alert alert-info'}).attr('type','text').attr('name','isbn').attr('placeholder','new isbn');\n\t\t$saveBtn = $('<button>',{class: 'save btn btn-outline-info'}).text('Save').attr('data-id', book.id);\t\t\n\t\t\n\t\t$editDiv.append($inputTitle);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputAuthor);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputPublisher);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputType);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($inputIsbn);\n\t\t$editDiv.append('<br>');\n\t\t$editDiv.append($saveBtn);\n\t\t\n\t\t$newUl.append($newAuthor);\n\t\t$newUl.append($newId);\n\t\t$newUl.append($newPublisher);\n\t\t$newUl.append($newType);\n\t\t$newUl.append($newIsbn);\n\t\t$newUl.append($newEdit);\n\t\t$newUl.append('<hr>');\n\t\t$newUl.append($editDiv);\n\t\t\n\t\treturn $newUl;\n\t}", "function addBookToLibrary(book){\n\tmyLibrary.push(book);\n\tdisplayBooks();\n}", "function addBookToLibrary(book) {\n myLibrary.push(book);\n}", "function add (bookName) {\n \n return bookList.push(bookName);\n \n // Add your code above this line\n}", "static addBooks(book){\n const books = Store.getBooks();\n books.push(book);\n //update the books in local storage\n localStorage.setItem('books',JSON.stringify(books));\n }", "function addItemToList() {\n var btn = this;\n bodyBtn = btn.parentNode.parentNode;\n let inputNode = bodyBtn.previousElementSibling;\n setBodyItem();\n createDoneBtnForItem();\n bodyList = bodyBtn.nextElementSibling;\n bodyItem.appendChild(bodyDoneBtn)\n bodyList.appendChild(bodyItem);\n inputNode.value = '';\n}", "function moveSelected(bool) {\n allNotes.forEach((element) => {\n element.checkBoxVisible(bool);\n });\n}", "function addNote() {\n let titleEl = document.getElementById(\"title\")\n let detailsEl = document.getElementById(\"details\")\n\n newNote = new Note(titleEl.value, detailsEl.value)\n allNotes.push(newNote)\n\n printNote(newNote)\n resetFields(titleEl, detailsEl)\n checkBadWords(newNote)\n // changeBackground()\n}", "function addNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\tappendNote(tr, defaultNote);\r\n\taddState();\r\n\t\r\n\trefreshNotes();\r\n}", "addTodoNote() {\n this.todoListsBackup = this.todoLists.slice();\n this.todoLists.push([]);\n }", "function addBooksToLibrary(obj) {\n myLibrary.push(obj);\n}", "function addNote(note) {\n setNotes((prevNotes) => {\n return [...prevNotes, note];\n });\n }", "function addBookToLibrary() {\n let title = document.querySelector(\"[data-name=title]\").value;\n let author = document.querySelector(\"[data-name=author]\").value;\n let pages = document.querySelector(\"[data-name=page]\").value;\n let haveRead = document.querySelector(\"[data-name=read]\").checked;\n if (haveRead === true ? (haveRead = \"Already read\") : (haveRead = \"Read\"))\n if ((title === \"\") | (author === \"\") | (pages === \"\")) {\n //provide an error\n console.log(\n \"something went wrong adding to library\",\n title,\n author,\n pages,\n haveRead\n );\n } else {\n let newBook = new Book(title, author, pages, haveRead);\n myLibrary.push(newBook);\n }\n}", "function addBookToLibrary(book) {\n myLibrary.push(book)\n}", "function addNotes(id, con){\n\tvar musicPosition = 0;\n\tvar storeNotes_arr = [];\n\t\n\tif(con){\n\t\tmusicPosition = id.position;\n\t\tstoreNotes_arr = id.notes;\n\t\tid = id.id;\n\t}\n\t\n\tvar notesHTML = '';\n\tvar noteID = 'note'+edtNotesCount;\n\tvar percent = 0;\n\tvar bgColour = '';\n\tvar editAdded = '';\n\t\n\tfor(n=0;n<notes_arr.length;n++){\n\t\tif(id == notes_arr[n].id){\n\t\t\tpercent = 100/(Number(notes_arr[n].amount)+1);\n\t\t\tbgColour = notes_arr[n].colour;\n\t\t\t\n\t\t\tvar totalNote = '';\n\t\t\tfor(p=0;p<notes_arr[n].amount;p++){\n\t\t\t\ttotalNote += '<div class=\"note\"></div>';\n\t\t\t}\n\t\t\t\n\t\t\tif(!con){\n\t\t\t\teditAdded = 'added';\n\t\t\t}\n\t\t\tnotesHTML = '<div id=\"'+noteID+'\" data-array='+id+' data-type='+id+' class=\"notesWrapper '+editAdded+'\">'+totalNote+'</div>';\n\t\t}\n\t}\n\t\n\t$('.playerNotes').append(notesHTML);\n\t$('#'+noteID+', #'+noteID+' .note').css('background', bgColour);\n\t$('#'+noteID+' .note').draggable({ containment: '#'+noteID, scroll: false, start:function(){ curNote=$(this).closest('div.notesWrapper').attr('data-array');highLightNote(false); }, drag:function(){updateNoteValue(false);}});\n\t$('#'+noteID).draggable({ containment:'.editPlayerWrapper', scroll:false, start:function(){ curNote=$(this).attr('data-array');highLightNote(false); }, drag:function(){updateNoteValue(false);}});\n\t\n\t$('#'+noteID).click(function(){\n\t\tcurNote=$(this).attr('data-array');highLightNote(false);\n\t});\n\t\n\t$('#'+noteID+' .note').click(function(){\n\t\tcurNote=$(this).closest('div.notesWrapper').attr('data-array');highLightNote(false);\n\t});\n\t\n\tif(con){\n\t\t$('#'+noteID).css('top', musicPosition * heightScale);\n\t}else{\n\t\t$('#'+noteID).css('top', curMusicPosition);\t\n\t}\n\t\n\tvar curLeft = percent;\n\t$('#'+noteID+' .note').each(function(index, element) {\n\t\tif(con){\n\t\t\t$(this).css('left',storeNotes_arr[index]);\n\t\t}else{\n\t\t\t$(this).css('left',curLeft+'%');\n\t\t\tcurLeft+=percent;\n\t\t}\n });\n\t\n\tedtNotesCount++;\n\tstopGame();\n}", "function addNote(newNote) {\n setNotes(prevNotes => {\n return [...prevNotes, newNote];\n });\n }", "function addNewPendingItem(label) {\n document.querySelector('.pending-items')\n .insertAdjacentHTML('afterbegin', newPendingItemHTML(label));\n \n // Add EventListeners to New Pending Items:\n let trashButton = document.querySelector('.pending-items>li>.btn-delete-item')\n trashButton.addEventListener('click', (event) => {\n event.currentTarget.parentElement.remove()\n });\n let checkBox = document.querySelector('.pending-items>li>.checkbox')\n checkBox.addEventListener('change', (event) => {\n if (checkBox.checked == true) {\n moveToCompleted(event)\n }\n })\n pendingNote();\n completedNote();\n \n}", "function add (list, bookName) {\n let updatedList = [...list]\n\n updatedList.push(bookName);\n \n return updatedList;\n\n // Add your code above this line\n}", "function createNewBook() {\n const book = new Book(\n document.querySelector(\"#name\").value,\n document.querySelector(\"#author\").value,\n document.querySelector(\"#pages\").value,\n document.querySelector(\"#read\").value == \"true\" ? true : false\n );\n addBookToLibrary(book);\n updateLocalStorage(myLibrary);\n displayBook(book);\n toggleForm();\n}", "function addBook2 (title, id) {\n const newBookList = books.filter(book => book.id !== id);\n const chosenBook = books.filter(book => book.id === id);\n setBooks (newBookList);\n setBookcase ([...bookcase, ...chosenBook]);\n }", "function addNote() {\n var form = document.getElementById(\"note-form\");\n var title = document.getElementById(\"title\").value;\n var content = document.getElementById(\"contentbody\").value;\n var pri = document.getElementById(\"priority\").value;\n if (title !== \"\" && content !== \"\") {\n notes.push({\n title: `${title}`,\n content: `${content}`,\n pri: pri,\n id: c,\n state: 1\n });\n sendmsg(\"Note Added\", \"success\");\n } else {\n sendmsg(\"Fill all Fields\", \"danger\");\n }\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"contentbody\").value = \"\";\n c++;\n saveNotes();\n postNotes();\n btn.innerHTML = \"Add\";\n}", "function addTarefa() {\n event.preventDefault();\n if (document.getElementById(\"todoInput\").value == undefined ||\n document.getElementById(\"todoInput\").value.trim() == \"\") {\n alert('Por favor, preencha o campo');\n //reseta o formulario\n todoForm.reset();\n return false;\n };\n //cria li \n const tarefa = document.createElement('li');\n //atribui a caracteristica draggable para todo li criado, para que possa ser arrastado\n tarefa.setAttribute('draggable', true);\n\n\n //evento adicionado ao ul (todoLista). dragstart é o começo, o que vamos agarrar (drag)\n todoLista.addEventListener('dragstart', function(e) {\n dragging = e.target.closest('li')\n })\n //closest pega o elemento mais proximo da caixa principal onde rola o evento\n\n //dragover é pra arrastar o elemento. funciona como uma sobra que segura o elemento que estava no start, pra poder deslocar\n todoLista.addEventListener('dragover', function(e) {\n //prevent default pra permitir arrastar. o padrao de drag é agarrar e soltar\n e.preventDefault()\n //closest pega o elemento mais proximo da caixa principal\n const node = e.target.closest('li')\n this.insertBefore(dragging, node)\n })\n\n //dragend é o lugar onde vamos soltar, ou seja, fazer o drop\n todoLista.addEventListener('dragend', function(e) {\n dragging = null //valor null pra conseguirmos pegar outros elementos pra arrastar\n })\n\n //cria checkbox\n let checkbox = document.createElement(\"input\");\n checkbox.setAttribute(\"type\", \"checkbox\");\n checkbox.setAttribute(\"id\", inputText.value);\n checkbox.setAttribute(\"name\", inputText.value); \n checkbox.addEventListener(\"input\", checarTodosMarcados) // Chama checar todos marcados porque o valor da variavel todosFeitos pode precisar ser atualizado\n tarefa.appendChild(checkbox);\n\n //mudar linha\n function sublinhado(){\n document.getElementById(\"todoInput\").style.fontStyle = \"italic\";\n }\n\n //cria label\n let label = document.createElement('label');\n label.innerHTML = inputText.value;\n label.setAttribute(\"for\", inputText.value);\n tarefa.appendChild(label);\n\n \n //botão de fechamento\n let button = document.createElement('button');\n button.innerText = \"x\";\n tarefa.appendChild(button);\n button.addEventListener('click', () => {\n todoLista.removeChild(tarefa);\n })\n\n // function feita() {\n // if (checkbox.checked == true) {\n // document.getElementById('label').style.color = \"grey\";\n // }\n // }\n // checkbox.addEventListener('click', feita)\n\n //adiciona tarefa na lista\n todoLista.appendChild(tarefa);\n //reseta o formulario\n todoForm.reset();\n }", "function createNoteOptions() {\n var selects = $('[id^=note]');\n for (var i = 0; i < selects.length; i++) {\n for(var key in notes) {\n createNoteOption(selects[i], key);\n }\n }\n}", "function add (bookName) {\n\n bookList.push(bookName);\n return bookList;\n \n // Change code above this line\n}", "function addToDoList(){\n let toDoItem = {};\n const checkBoxValue = document.getElementById(\"doneCheckBox\").checked;\n const textBoxValue = document.getElementById(\"itemDescription\").value;\n \n toDoItem.description = textBoxValue;\n toDoItem.checked = checkBoxValue;\n toDoArray.push(toDoItem);\n console.log(toDoArray);\n saveToLocalStorage();\n \n loadToDoList();\n }", "function addBookToLibrary(){\n //book = {name:\"harry\", author:\"potter\", numPages:50, isRead:true}\n \n bookName = document.getElementById(\"bookNameField\").value;\n bookAuthor = document.getElementById(\"authorNameField\").value;\n bookNumPages = document.getElementById(\"numPagesField\").value;\n bookIsRead = document.getElementById(\"isReadField\").checked;\n\n let book = new Book(bookName, bookAuthor, bookNumPages, bookIsRead);\n myLibrary.push(book);\n addCard(book);\n}", "function addNote(newNote) {\n allNotes.push(newNote);\n updateNotes(allNotes);\n}", "function displayBooks(){\n books.innerHTML = ''\n myLibrary.forEach((book, index) => {\n addBookToDisplay(book.title, book.author, book.pages, book.read, index)\n });\n\n // const removeBtns = [...document.getElementsByClassName('remove')]\n\n // removeBtns.forEach((removeBtn) => {\n // removeBtn.addEventListener('click', removeBook)\n // })\n\n // const changeBtns = [...document.getElementsByClassName('change')]\n\n // changeBtns.forEach((changeBtn) =>{\n // changeBtn.addEventListener('click', changeRead)\n // })\n\n\n}", "function addNote() {\n self.showAdd = !self.showAdd;\n }", "function add(books, bookName) {\n return [...books, bookName];\n // Add your code above this line\n}", "function writeNotes(notes) {\n const notesDiv = document.querySelector('#notes');\n // clear the div\n notesDiv.innerHTML = '';\n // add all items as Ps to the div\n notes.forEach(function(note) {\n const newItem = document.createElement('p');\n const span1 = document.createElement('span');\n const newButton = document.createElement('button');\n span1.textContent = note.body;\n newButton.textContent = \"x\";\n newButton.addEventListener('click', function() {\n removeNote(note.id);\n localStorage.setItem( 'notes', JSON.stringify(notes) );\n writeNotes(notes);\n });\n // construct the p and append it\n newItem.appendChild(newButton);\n newItem.appendChild(span1);\n notesDiv.appendChild(newItem);\n });\n}", "function addBookToLibrary(name, author, pages, readStatus) {\r\n let book = new Book(name, author, pages, readStatus);\r\n myLibrary.push(book);\r\n render();\r\n}", "function addBookToLibrary(book) {\n library.push(book);\n}", "addBook(book) {\n this.books.push(book);\n }", "function add_books_to_search_results_menu(books_list){\n $(\"book_results_select_box\").val(\"\");\n for (var i = 0; i < books_list.length; i++) {\n $(\"#book_results_select_box\").append(\"<option>\" + books_list[i][\"book_title\"] + \"</option>\");\n if (i == 0){\n fill_out_book_info_form(books_list[i]);\n }\n }\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 }", "addToDo(newToDo) {\n this.setState({\n todos: this.state.todos.concat(newToDo),\n });\n }", "function addBookToLibrary(title, author, pages, isRead) {\n let newBook = new Book(title, author, pages, isRead);\n myLibrary.push(newBook);\n}", "function showBooks(bookArray) {\n for (let i = 0; i < bookArray.length; i++) {\n addBook(bookArray[i]);\n }\n}", "function addNotesDatabase(notes, newNote) {\n\tnotes.push(newNote);\n}", "addTodo() {\n const text = prompt(\"TODO text please\");\n this.setState({\n todos: [...this.state.todos, { id: id++, text: text, checked: false }]\n });\n }", "function addBookToLibrary(e) {\n e.preventDefault();\n let title = document.getElementById('title-in').value\n let author = document.getElementById('author-in').value\n let genre = document.getElementById('genre-in').value\n let numPages = document.getElementById('pages-in').value\n let book = new Book(title, author, genre, numPages)\n\n library.push(book) \n console.log(library[library.length - 1].getInfo())\n form.reset()\n form.style.visibility = 'hidden'\n createBookDiv(book)\n}", "static addBookToList(book) {\n const list = document.querySelector('#book-list');\n // create element type row to add the looped books\n const row = document.createElement('tr');\n // create datas that will be inserted into the row //backstick function was used to support text literals\n row.innerHTML = ` \n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><a href=\"#\" class=\"btn btn-danger btn-sm delete\">X</td>\n `;\n // Now we append the datas to the row\n list.appendChild(row);\n\n }", "function addBook(newBook) {\n $.ajax({\n url: 'http://127.0.0.1:8000/book/',\n method: 'POST',\n data: newBook,\n dataType: 'json'\n }).done(function (response) {\n getBooks();\n clearInputs();\n })\n }", "static displayBooks() {\n const books = Store.getBooks();\n books.forEach(function (book) {\n const ui = new UI();\n ui.addBookToList(book);\n })\n\n }", "function addBookToLibrary(title, author, pages, read) {\n let newBook = new Book(title, author, pages, read)\n myLibrary.push(newBook)\n saveLibraryInStorage(myLibrary)\n renderBook(newBook)\n}" ]
[ "0.63081235", "0.61158514", "0.58664095", "0.58441114", "0.58294445", "0.57431066", "0.5701966", "0.5695114", "0.56449246", "0.56367624", "0.56282496", "0.55916095", "0.5513622", "0.54907507", "0.5467154", "0.5459311", "0.5435347", "0.54313064", "0.54181194", "0.539785", "0.53943795", "0.53647006", "0.5351858", "0.534512", "0.534288", "0.5328748", "0.5321276", "0.5318234", "0.5309976", "0.5303733", "0.53033483", "0.53018713", "0.5299453", "0.528685", "0.5285029", "0.5281039", "0.527174", "0.5246309", "0.5244814", "0.5224412", "0.5221731", "0.5207119", "0.5204632", "0.5200341", "0.51968366", "0.5184925", "0.5182728", "0.51779515", "0.5165153", "0.5150109", "0.51434875", "0.514256", "0.5140542", "0.51349455", "0.51171184", "0.51141536", "0.5102916", "0.5100474", "0.51000106", "0.5090956", "0.5088454", "0.5087301", "0.50857973", "0.50747466", "0.5072173", "0.50718844", "0.5068861", "0.5067564", "0.50670576", "0.5055877", "0.5055636", "0.5054271", "0.50517094", "0.50500286", "0.5043521", "0.5040746", "0.50385576", "0.5037831", "0.50356245", "0.50342155", "0.5029271", "0.5027468", "0.5024596", "0.5023107", "0.5021235", "0.50185704", "0.50096613", "0.5009342", "0.50064105", "0.49991977", "0.4999167", "0.49971488", "0.49965397", "0.4994227", "0.4985659", "0.4973937", "0.49734914", "0.49694365", "0.4968328", "0.49646756" ]
0.6546685
0